diff --git a/.php_cs b/.php_cs index 86d1826adbeb2..56fc26c7e9c80 100644 --- a/.php_cs +++ b/.php_cs @@ -1,4 +1,12 @@ name('*.phtml') ->exclude('dev/tests/functional/generated') diff --git a/.travis.yml b/.travis.yml index f95db1ab3fbb3..3b0108dd1abc7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,30 +10,42 @@ env: - TEST_SUITE=static_annotation matrix: exclude: - - php: 5.5 + - php: 5.4 env: TEST_SUITE=static_phpcs - - php: 5.5 + - php: 5.4 env: TEST_SUITE=static_annotation before_install: - sudo apt-get update -qq - sudo apt-get install -y -qq postfix before_script: - # mock mail + # Mock mail - sudo service postfix stop - smtp-sink -d "%d.%H.%M.%S" localhost:2500 1000 & - echo -e '#!/usr/bin/env bash\nexit 0' | sudo tee /usr/sbin/sendmail - - echo 'sendmail_path = "/usr/sbin/sendmail -t -i "' | sudo tee "/home/travis/.phpenv/versions/`php -i | grep "PHP Version" | head -n 1 | grep -o -P '\d+\.\d+\.\d+.*'`/etc/conf.d/sendmail.ini" + - > + echo 'sendmail_path = "/usr/sbin/sendmail -t -i "' + | sudo tee "/home/travis/.phpenv/versions/`php -i + | grep "PHP Version" + | head -n 1 + | grep -o -P '\d+\.\d+\.\d+.*'`/etc/conf.d/sendmail.ini" # Disable xDebug - echo '' > ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/xdebug.ini - # Create DB for Integration tests - - sh -c "if [ '$TEST_SUITE' = 'integration' ] || [ '$TEST_SUITE' = 'integration_integrity' ]; then mysql -e 'create database magento_integration_tests;'; mv dev/tests/integration/etc/install-config-mysql.travis.php.dist dev/tests/integration/etc/install-config-mysql.php; fi" - # Install tools for static tests - - sh -c "if [ '$TEST_SUITE' = 'static_phpcs' ] || [ '$TEST_SUITE' = 'static_annotation' ]; then pear install pear/PHP_CodeSniffer-1.5.2; fi" - # Change memmory_limit for travis server + # Install MySQL 5.6, create DB for integration tests + - > + sh -c "if [ '$TEST_SUITE' = 'integration' ] || [ '$TEST_SUITE' = 'integration_integrity' ]; then + sudo apt-get remove --purge mysql-common mysql-server-5.5 mysql-server-core-5.5 mysql-client-5.5 mysql-client-core-5.5; + sudo apt-get autoremove; + sudo apt-get autoclean; + sudo apt-add-repository ppa:ondrej/mysql-5.6 -y; + sudo apt-get update; + sudo apt-get install mysql-server-5.6 mysql-client-5.6; + mysql -uroot -e 'SET @@global.sql_mode = NO_ENGINE_SUBSTITUTION; CREATE DATABASE magento_integration_tests;'; + mv dev/tests/integration/etc/install-config-mysql.travis.php.dist dev/tests/integration/etc/install-config-mysql.php; + fi" + # Change memory_limit for travis - echo 'memory_limit = -1' >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini - phpenv rehash; - - composer install --no-interaction --prefer-source --dev - - cd .. + - composer install --no-interaction --dev script: # Unit tests - sh -c "if [ '$TEST_SUITE' = 'unit' ]; then ./vendor/bin/phpunit -c dev/tests/unit/phpunit.xml.dist; fi" diff --git a/CHANGELOG.md b/CHANGELOG.md index 42f7ae6ca9371..cfa1a4ac96cc2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,127 @@ +0.42.0-beta1 +============= +* Fixed bugs: + * Fixed an issue with incorrect price index rounding on bundle product + * Fixed an issue with product price not being updated when clicking the downloadable link on the downloadable product page + * Fixed an issue with exception appearing when clicking the Compare button for selected products + * Added backend UI improvements + * Fixed an issue with the Compare Products block appearing on mobile devices + * Fixed an issue with inability to add conditions to the Catalog Products List widget + * Fixed an issue with a customer redirected to page 404 when trying to unsubscribe from a newsletter + * Fixed an issue with showing a warning when customer tried to change billing address during multiple address checkout + * Fixed an issue with redirecting a customer to the Admin panel when clicking the Reset customer password link + * Fixed an issue with inability of a newly registered customer to select product quantity and shipping addresses during multiple checkout + * Fixed an issue with showing Zend_Date_Exception and Zend_Locale_Exception exceptions after a customer placed an order + * Fixed an issue with inability to rename a subcategory on a store view level + * Fixed an issue with not saving the changed parameters in the Admin section of the backend configuration + * Fixed an issue with fatal error appearing when trying to enter a new address on multi-address checkout + * Fixed an issue with inability to delete a product in the customer’s wishlist in the Admin panel + * Fixed an issue with inability to change product configuration in the customer’s wishlist in the Admin panel + * Fixed an issue with showing errors when customer with no addresses tried to checkout a product via Check out With Multiple Addresses + * Fixed an issue with fatal errors appearing in the Recently Viewed Products frontend widget block + * Fixed an issue with the ability of an authenticated RSS admin user to access all RSS feeds + * Fixed an issue with widgets losing their options and part of their layout references if more than11 layout references are added and saved + * Fixed an issue with the Privacy Policy link missing in the frontend + * Fixed an issue with inability to place an order during multiple checkout + * Fixed an issue with store views switching in the frontend + * Fixed an issue with incorrect work of the CSS minificator + * Fixed an issue with inability to open the edit page for a CMS page after filtering in the grid + * Fixed an issue with inability to expand customer menu if it doesn't contain the categories, if responsive + * Fixed an issue with the absence of JS validation for the Zip/Postal code field + * Fixed an issue with a 1 cent difference in the tax summary and detail on an invoice and a credit memo for a partial invoice when a discount and fixed product tax are applied + * Fixed an issue with throwing validation error for the State field when saving a product with FPT + * Fixed an issue with throwing an error when trying to save a timezone + * Fixed an issue with Exploited Session ID in second browser leading to Error + * Fixed an issue with session loss on page 404 when using the Varnish caching + * Fixed an issue with integration test not resetting static properties to correct default values after each test suite + * Fixed an issue with PDO exception during an installation when MySQL does not meet minimum version requirement + * Removed hardcoded PHP version requirement in the setup module. Validation of PHP version during installation now uses the Composer information + * Fixed an issue with not redirecting to the setup page when Magento is not installed + * Fixed an issue with missing of some languages in the dropdown list on the Customize Your Store page of the Web installation + * Merged and updated data and SQL install scripts to 2.0.0 + * Merged user reported patch to fix fetching headers for APIs when PHP is run as fast CGI + * Removed the @deprecated methods from the code base + * Fixed an issue with the fatal error when enabling Website Restrictions in the frontend + * Fixed an issue with showing incorrect message for view files population tool when the application is not installed + * Fixed certain customer APIs to be accessed anonymously + * Fixed integration tests to avoid sending emails + * Fixed an issue with the Continue button losing its style after returning to the Shipping Information step during one-page checkout in Luma, IE11, FF + * Fixed an issue with incorrect spaces removal + * Fixed an issue with broken responsive design of the Compare Products functionality in the Blank Theme + * Fixed an issue with showing the “No such entity with cartId' message error appearing during creating a new order for a new customer on non-default website + * Fixed an issue with inability to reselect the File Permission on the Readiness Check step during the installation + * Fixed an issue with inability to find by name simple and virtual products in the customer wishlist grid + * Fixed integration test fail after DbStatusValidatorTest modifies schema version of the Core module + * Fixed an issue with inability to install Magento without the ConfigurableProduct module + * Fixed an issue with fatal error appearing on the grouped product page if the GroupedProduct module is disabled + * Fixed an issue with no validation for assigning an attribute to an attribute group (API) + * Fixed an issue with inability to place an order with the registration method and different billing and shipping address + * Fixed an issue with broken footer layout on some Admin panel pages (product creation, order creation, catalog etc.) in IE11 + * Fixed an issue with countries previously selected in the Ship to specific countries field not visible when the parameter is changed to showing all allowed countries and set back again to specific countries in the flat rate shipping method IE11 + * Fixed an issue with not showing admin tax and cache warning notifications in IE11 + * Fixed an issue with product alerts not working + * Fixed an issue with incorrect URL rewrite for category with two stores after renaming category for one store + * Fixed an issue with inability to save a bundle product with a re-created bundle option + * Fixed an issue with inability to add conditions to the Catalog Products List widget + * Fixed an issue with export not available if modules for Products Import/Export are removed + * Fixed an issue with the Use Layered Navigation for custom product attributes leading to an error on an anchor category page in the frontend + * Fixed an issue with the broken export product file on environment SampleData + * Fixed an issue with cache not invalidating after categories are moved in tree + * Fixed an issue with last five orders showing 0 items quantity after invoices are created + * Fixed an issue with an exception appearing on a category page if installing Magento without LayeredNavigation module + * Fixed an issue with tax rate not being saved if all states were chosen for any non-default country + * Fixed an issue with multi-select fail on the Customer add/edit form + * Added exception handling for required fields for REST APIs + * Fixed an issue with success message missing after the signup for price alert + * Fixed an issue with inability to create a return order from the Admin panel + * Fixed an issue with incorrect work of the Default Value for Disable Automatic Group Changes Based on VAT ID setting + * Fixed an issue with fatal error on the I18n tools launch due to incorrect bootstrap/autoload + * Stabilized functional tests for products in the Catalog module + * Stabilized functional tests for product attribute in the Catalog module + * Created installation test + * Updated functional tests for the new customer form + * Updated Magento to follow the new tagging mechanism + * Removed incomplete in functional tests for fixed bugs + * Fixed an issue with missing theme preview images + * Fixed broken SOAP tests + * Fixed an issue with invalid online status on the Edit Product page in the Admin panel + * Fixed an issue with incorrect location of an error message "Incorrect CAPTCHA" in the frontend + * Fixed an issue with showing endless JS loader on the View Configurable Product page in the frontend page, IE, Google Chrome + * Fixed a JavaScript error that occurred on the Create Admin Account step during Magento web installation + * Fixed an issue where a product remained in stock after saving it with the ‘Out of Stock’ inventory value + * Fixed an issue where the JS loader was not disappearing on the View Product page on the frontend if a customer closed the gallery + * Fixed an issue where the JS loader was absent while CAPTCHA was being reloaded + * Fixed an incorrect alignment of fields on the Create Packages popup + * Fixed an issue where Google Content Experiments was not available for CMS pages + * Fixed the broken design of the New Product Attribute popup + * Fixed an issue where product page was not found if an incorrect image URL was inserted through using the WYSISYG editor + * Fixed an issue where the Search Term Report and Search Term list in backend did not work + * Fixed an issue where downloadable links and samples were not saved because of the JavaScript error + * Fixed an issue where Magento Installation Guide was not accessible via the 'Getting Started' link if installing Magento through using web installer with custom locale and custom encryption key + * Fixed an issue with the code style + * Fixed an issue where changes made in tax configuration did not appear in the backend on the Create New Order page + * Fixed an issue where it was impossible to update options of bundle products from the mini shopping cart + * Fixed an issue where layered navigation worked incorrectly with the Automatic (equalize product counts) setting + * Fixed an issue with the incorrect error message appearing when running 'php -f setup/index.php help’ + * Fixed an issue where URLs for subcategories were incorrect after editing URL of a subcategory + * Fixed an issue where attribute labels were loaded from cache after updating product attributes + * Fixed an issue where form data was not preserved when product form did not pass server side validation + * Fixed an issue with static files missing in the Production mode + * Fixed issues with errors appearing after View Files Population Tool was run +* Processed GitHub requests: + * [#683](https://github.com/magento/magento2/pull/683) -- CMS Router not routing correctly + * [#786](https://github.com/magento/magento2/pull/786) -- Fix Travis CI builds +* Various improvements: + * Improved error message when DB schema or data was not up-to-date + * Added nginx configuration to code base + * Removed online payment methods for the Dev Beta release +* Sample Data: + * Implemented Luma Sample Data +* Framework improvements: + * Updated ZF1 dependency to 1.12.9-patch1 +* Documentation update: + * Covered the Sales module with API documentation + 0.1.0-alpha108 ============= * Service Contracts: diff --git a/README.md b/README.md index 5a4d56047c98b..c960876710193 100644 --- a/README.md +++ b/README.md @@ -1,71 +1,22 @@ [![Build Status](https://travis-ci.org/magento/magento2.svg?branch=master)](https://travis-ci.org/magento/magento2) - +

Welcome

Welcome to Magento 2 installation! We're glad you chose to install Magento 2, a cutting edge, feature-rich eCommerce solution that gets results. -#### Contents - -* Magento 2 system requirements -* Composer and Magento -* High-level installation roadmap -* Required server permissions -* Prerequisites -* Installing Composer -* Cloning the Magento 2 GitHub repository -* Installing or reinstalling the Magento software -* Verifying the installation -* Troubleshooting - -

Magento 2 system requirements

- -Before you install Magento 2, make sure your system meets or exceeds the following requirements: - -* Operating systems - - Linux distributions such as RedHat Enterprise Linux (RHEL), CentOS, Ubuntu, Debian, and so on - -* Composer (latest stable version) -* Apache 2.2 or later -* PHP 5.4.11 or 5.5.x -* Required PHP extensions: - - * PDO/MySQL - * mbstring - * mcrypt - * mhash - * simplexml - * curl - * gd2, ImageMagick 6.3.7 (or later) or both - * soap - -* MySQL 5.6.x -* Mail Transfer Agent (MTA) or an SMTP server -* Optional but recommended: - - * php_xdebug2.2.0 or later (development environments only; can have an adverse effect on performance) - * PHPUnit (as a command-line tool) 4.1 or later - -

Composer and Magento

- -We now use Composer to install the Magento 2 software. Composer enables us to manage Magento 2, extensions, and their dependencies. +The installation instructions that used to be here are now published on our GitHub site. Use the information on this page to get started or go directly to the guide. -Composer provides you with the following advantages: +

New to Magento? Need some help?

+If you're not sure about the following, you probably need a little help before you start installing the Magento software: -* Enables you to reuse third-party libraries without bundling them with source code -* Component-based architecture with robust dependency management -* Manages dependencies to reduce extension conflicts and compatibility issues -* Versioned dependencies -* Semantic versioning -* Supports PHP Framework Interoperability standards +* Is the Magento software installed already? +* What's a terminal, command prompt, or Secure Shell (ssh)? +* Where's my Magento server and how do I access it? +* What's PHP? +* What's Apache? +* What's MySQL? -We'll have more information soon on how developers can use Composer to package extensions to distribute to Magento merchants and to other developers. +

Step 1: Verify your prerequisites

-

High-level installation roadmap

- -Following is a brief overview of how to install the Magento 2 software. - -

Step 1: Verify your prerequisites

- -Use the following table to verify you have the correct prerequisites to install the Magento 2 software. +Use the following table to verify you have the correct prerequisites to install the Magento software. @@ -75,772 +26,34 @@ Use the following table to verify you have the correct prerequisites to install - + - + - + - + - +
For more information
Apache 2.2 or laterApache 2.2 or 2.4 Ubuntu: apache -v
CentOS: httpd -v
ApacheApache
PHP 5.4.11 or 5.5.xPHP 5.4.x (where x = 11 or later) or 5.5.x php -vPHPPHP Ubuntu
PHP CentOS
MySQL 5.6.x mysql -u [root user name] -pMySQLMySQL
-

Step 2: Prepare to install

- -After verifying your prerequisites, perform the following tasks in order to prepare to install the Magento 2 software. - -1. Installing Composer -2. Cloning the Magento 2 GitHub repository - -

Step 3: Install and verify

- -1. Installing or reinstalling the Magento software -2. Verifying the installation - -

Required server permissions

- -Unless otherwise noted, all commands in this Readme must be entered as a user with `root` privileges and permission to write to the web server docroot. Depending on your system, that might mean you must use different user accounts or add users to the web server user group—provided that group has sufficient privileges. - -Installing software on Linux typically requires `root` privileges. You should generally not install the Magento 2 software in the web server docroot using `root` privileges; however, that is up to you. - -

Prerequisites

- -This section discusses how to install software required to install Magento 2. - -See one of the following sections: - -* Before you begin -* Apache -* PHP -* MySQL - - -

Before you begin

- -Before you install Magento, you must do all of the following: - -* Set up one or more hosts that meet the Magento 2 system requirements. -* Make sure you can back up your entire system at various points during the installation so you can roll back in the event of issues. - -

Apache

- -

Installing Apache on Ubuntu

- -
  1. Install Apache using the guidelines on the Ubuntu site.
  2. -
  3. Enable server rewrites: - -
  4. -
  5. Specify the type of directives that can be used in .htaccess. Magento uses .htaccess for redirects. For guidelines, see: - -
  6. -
  7. Restart Apache: service apache2 restart
- -

Installing Apache on CentOS

- -1. Install Apache: - - `yum -y install httpd` - - For additional information, see the Apache site. - -2. Enable server rewrites. - - **Note**: You must change the value of Allow Override in the directive for the directory to which you expect to install the Magento software. For example, to install in the web server docroot, edit the directive in <Directory "/var/www/html">. - -2. Set the type of directives that can be used in `.htaccess`. Magento uses `.htaccess` for redirects. Apache documentation. - -3. Restart Apache: `service httpd restart` - -

MySQL

- -

Installing MySQL on Ubuntu

- -1. Install MySQL on Ubuntu 12 or Ubuntu 14. -2. Configure the database instance. - -

Installing and configuring MySQL on CentOS

- -The following procedure is based on Install MySQL Server 5.6 in CentOS 6.x and Red Hat 6.x Linux. - -1. Install the MySQL database: - -
cd /tmp
-wget http://repo.mysql.com/mysql-community-release-el6-5.noarch.rpm
-rpm -ivh mysql-community-release-el6-5.noarch.rpm
-yum -y install mysql-server
- -2. Start MySQL. - - `service mysqld start` - -3. Set a password for the root user and set other security-related options. Enter the following command and follow the prompts on your screen to complete the configuration. - - `mysql_secure_installation` - -

Configuring the Magento database instance

- -This section discusses how to create a new database instance for Magento. Although a new database instance is recommended, you can optionally install Magento into an existing database instance. - -To configure a MySQL database instance: - -1. Log in to your database server as any user. -2. Enter the following command to get to a MySQL command prompt: - - `mysql -u root -p` - -3. Enter the MySQL `root` user's password when prompted. -4. Enter the following commands in the order shown to create a database instance named `magento` with user name `magento`: -
create database magento;
-GRANT ALL ON magento.* TO magento@localhost IDENTIFIED BY 'magento';
- -5. Enter `exit` to quit the command prompt. - -

PHP

- -Magento 2 requires PHP 5.4.11 or later or PHP 5.5.x. - -**Note**: Magento 2 does *not* support PHP 5.6. - -

PHP 5.5 or 5.4 on Ubuntu

- -
Install PHP 5.5 on Ubuntu 14
- -To install PHP 5.5 on Ubuntu 14: - -1. Enter the following command: - - `apt-get -y install php5` - -2. Verify the PHP version by entering `php -v`. Messages similar to the following should display: - -
PHP 5.5.9-1ubuntu4.4 (cli) (built: Sep  4 2014 06:56:34)
-	Copyright (c) 1997-2014 The PHP Group
-	Zend Engine v2.5.0, Copyright (c) 1998-2014 Zend Technologies
-    with Zend OPcache v7.0.3, Copyright (c) 1999-2014, by Zend Technologies
- -
Install PHP 5.5 on Ubuntu 12
- -1. Use the following commands from dev-metal: - -
add-apt-repository ppa:ondrej/php5
-	apt-get update
-	sudo apt-get install php5
- -2. Verify the PHP version by entering `php -v`. Messages similar to the following should display: - -
PHP 5.5.18-1+deb.sury.org~precise+1 (cli) (built: Oct 17 2014 15:11:34)
-	Copyright (c) 1997-2014 The PHP Group
-	Zend Engine v2.5.0, Copyright (c) 1998-2014 Zend Technologies
-    with Zend OPcache v7.0.4-dev, Copyright (c) 1999-2014, by Zend Technologies
- -
Install PHP 5.4 on Ubuntu 12
- -To install PHP 5.4 on Ubuntu 12: - -1. Use the following instructions from askubuntu: - -
add-apt-repository ppa:ondrej/php5-oldstable
-	apt-get update
-	apt-get upgrade
-	apt-get install php5
- -2. Verify the PHP version by entering `php -v`. Messages similar to the following should display: - -
PHP 5.4.33-2+deb.sury.org~precise+1 (cli) (built: Sep 25 2014 09:06:25)
-	Copyright (c) 1997-2014 The PHP Group
-	Zend Engine v2.4.0, Copyright (c) 1998-2014 Zend Technologies
- -3. Restart Apache: `service apache2 restart` - -
Upgrade to PHP 5.4 on Ubuntu
- -To upgrade to PHP 5.4 on Ubuntu: - -1. Use the instructions on phpave. -2. After upgrading, verify the PHP version by entering `php -v`. Messages similar to the following should display: - -
PHP 5.4.33-2+deb.sury.org~precise+1 (cli) (built: Sep 25 2014 09:06:25)
-	Copyright (c) 1997-2014 The PHP Group
-	Zend Engine v2.4.0, Copyright (c) 1998-2014 Zend Technologies
- -3. Restart Apache: `service apache2 restart` - -

Install required PHP extensions on Ubuntu

- -Enter the following command to install required PHP extensions: - -
apt-get -y install php5 php5-mhash php5-mcrypt php5-curl php5-cli php5-mysql php5-gd
- -

Ubuntu 14 only: workaround for mcrypt issue

- -There is a known issue in Ubuntu 14 with the `mcrypt` PHP extension. To work around the issue, see askubuntu. - -

PHP 5.5 or 5.4 on CentOS

- -PHP 5.3 is the default PHP version on CentOS distributions. Upgrade to PHP 5.4 using a repository like remi. - -The following resources are also available: - -* kb.parallels -* stackoverflow -* remi repository - -To verify if PHP is installed already, enter `php -v`. If PHP is *not* installed, install it by entering the following command: - -
yum -y install php php-xml
- -
PHP 5.5 on CentOS
- -To upgrade to PHP 5.5: - -There is more than one way to upgrade CentOS 6.5 to PHP 5.5; the following is a suggestion only. Consult a reference for additional options. - -Enter the following commands in the order shown. - -
cd /tmp
-rpm -Uvh https://mirror.webtatic.com/yum/el6/latest.rpm
-yum -y remove php-common-5.3.3-40.el6_6.x86_64
-yum -y install php55w php55w-opcache
- -Restart Apache: `service httpd restart` - -
PHP 5.4 on CentOS
- -To upgrade to PHP 5.4: - -1. Enter the following commands: - -
cd /tmp
-	rpm -Uvh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
-	rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
-	yum -y --enablerepo=remi install httpd php php-common
- -2. To verify PHP 5.4 is installed, enter `php -v`. The command displays results similar to the following: - -
PHP 5.4.33 (cli) (built: Sep 20 2014 16:20:03)
-	Copyright (c) 1997-2014 The PHP Group
-	Zend Engine v2.4.0, Copyright (c) 1998-2014 Zend Technologies
- -3. Restart Apache: `service httpd restart` - -

Install required PHP extensions on CentOS

- -Enter the following command to install required PHP extensions: - -`yum -y --enablerepo=remi install php-xml php-mcrypt.x86_64 gd gd-devel php-gd php-mysql` - -

Setting the PHP timezone (all operating systems)

- -Before you install Magento, you might need to set the system time zone for PHP; otherwise, errors like the following display during the installation and time-related operations like cron might not work: - -`PHP Warning: date(): It is not safe to rely on the system's timezone settings.` [more messages follow] - -To set your time zone: - -1. Locate your server's time zone in the available time zone settings. -2. Locate `php.ini` by entering the following command: - - `php -i | grep "Loaded Configuration File"` - - Typical locations follow: - - Ubuntu: `/etc/php5/cli/php.ini` - - CentOS: `/etc/php.ini` - -3. Open `php.ini` in a text editor. - -4. Locate the following setting and uncomment it if necessary: - - `date.timezone =` - -5. Add the time zone setting you found in step 1. -6. Save your changes to `php.ini` and exit the text editor. - -

Setting the PHP memory limit (all operating systems)

- -Increase `memory_limit` in `php.ini` to at least 512MB for normal operation or 2GB for testing: - -1. Open one of the following in a text editor: - - * Ubuntu: `/etc/php5/apache2/php.ini` - * CentOS: `/etc/php.ini` -2. Change `memory_limit` to: - - `memory_limit = 512M` or more for normal operation - - `memory_limit = 2G` or more for testing - -3. Save your changes and exit the text editor. - -4. Restart Apache: - - Ubuntu: `service apache2 restart` - - CentOS: `service httpd restart` - - -

Installing Composer

- -To install Composer: - -1. Change to or create an empty directory on your Magento server. - -2. Enter the following commands: - -
curl -sS https://getcomposer.org/installer | php
-	mv composer.phar /usr/local/bin/composer
- - For additional installation options, see the Composer installation documentation. - -

Cloning the Magento 2 GitHub repository

- -To clone the Magento 2 GitHub repository: - -1. Change to your web server's docroot directory. - - Typically, for Ubuntu, it's `/var/www` and for CentOS it's `/var/www/html`. - -2. Enter any of the following commands as a user with privileges to write to the web server docroot: - - To clone using HTTPS, use either of the following: - - `git clone https://github.com/magento/magento2.git` - - `git clone https://[your github.com user name]:[password]@github.com/magento/magento2.git` - - To clone using SSH: `git clone git@github.com:magento/magento2.git` - -3. Wait for the repository to clone on your server. - -**Note**: If you get an error that includes `Permission denied (publickey)`, see Troubleshooting. - -

Installing or reinstalling the Magento 2 software

- -Before you begin, make sure that: - -1. Your system meets the requirements discussed in Magento 2 system requirements. -2. You completed all prerequisite tasks discussed in Prerequisites. -3. You installed Composer. -4. You cloned the Magento 2 GitHub repository. - -

Setting file system permissions and ownership before you install

- -To make sure the installation completes successfully, we suggest the following file system permissions and ownership: - -* All files and directories owned by the web server user -* Certain directories must be writable - -

Finding the web server user

- -To find the web server user, enter one of the following commands: - -* Ubuntu: `ps -ef | grep apache2` -* CentOS: `grep User /etc/httpd/conf/httpd.conf` - -

Pre-installation permissions and ownership

- -Before the installation, set the following permissions: - -* All directories have 700 permissions `(drwx------)`. - - 700 permissions give full control (that is, read/write/execute) to the owner and no permissions to anyone else. - -* All files have 600 permissions `(-rw-------)`. - - 600 permissions mean the owner can read and write but other users have no permissions. - -

Setting permissions and ownership

- -1. To set ownership, enter the following commands as a user with `root` privileges: - -
cd [your Magento installation directory]
-	chown -R [web server user name] .
- - CentOS example: - -
cd /var/www/html/magento2
-	chown -R apache .
- - Ubuntu example: - -
cd /var/www/magento2
-	chown -R www-data .
- -2. Set file and directory permissions: - -
find . -type d -exec chmod 700 {} \;
-	find . -type f -exec chmod 600 {} \;
- -

Getting started with your installation

- -After you complete the tasks discussed in the preceding section, update Composer and run the installer: - -1. Log in to your Magento server as a user with `root` privileges. -2. Change to the Magento 2 installation directory. For example, - - `cd /var/www/html/magento2` - - **Note**: On Ubuntu, you might have to use the `sudo -s` or equivalent command to access this directory. - -3. As user with privileges to write to the web server docroot, enter `composer install` - - This command updates package dependencies and can take a few minutes to complete. - -4. Change to the Magento 2 `setup` subdirectory and enter `composer install`. - -**Note**: You must run `composer install` from *both* directories. - -

Running the Magento 2 installer

- -This section discusses how to run the command-line installer for Magento 2. - -**Note**: You must install Magento from its `setup` subdirectory. - -The installer is designed to be run multiple times if necessary so you can: - -* Provide different values - - For example, after you configure your web server for Secure Sockets Layer (SSL), you can run the installer to set SSL options. -* Correct mistakes in previous installations -* Install Magento in a different database instance - -**Note**: By default, the installer doesn't overwrite the Magento database if you install the Magento software in the same database instance. You can use the optional clean_database parameter to change this behavior. - -**Note**: If you get errors during the installation, see Troubleshooting. - -Before you begin, you can run the following commands to find values for some required options: - - - - - - - - - - - - - - - - - - - - -
Installer optionCommand
Languagephp -f index.php help languages
Time zonephp -f index.php help timezones
Currencyphp -f index.php help currencies
- -

The format of the command follows:

- - php -f index.php install [--[installation option name]=[installation option value] ... - -

The following table discusses the meanings of installation option names and values. An example is provided in Sample localhost installation.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameValueRequired?
base_url

Base URL to use to access your Magento Admin and storefront in the format http[s]://[host or ip]/[your Magento base dir]/.

-

Note: The scheme (http:// or https://) and a trailing slash are both required.

-

[your Magento base dir] is the docroot-relative path in which to install the Magento 2 software. Depending on how you set up your web server and virtual hosts, the path might be magento2 or it might be blank.

-

To access Magento on localhost, you can use either http://localhost/[your Magento base dir]/ or http://127.0.0.1/[your Magento base dir]/.

-
Yes
backend_frontnamePath to access the Magento Admin. This path is appended to Base URL. -For example, if Base URL is http://www.example.com and Admin Path is admin, the Admin Panel's URL is http://www.example.com/admin—provided you configured your web server for server rewrites.Yes
db_host

Use any of the following:

-
  • The database server's fully qualified host name or IP address.
  • -
  • localhost if your database serve is on the same host as your web server.
  • -
  • UNIX socket; for example, /var/run/mysqld/mysqld.sock
-

Note: You can optionally specify the database server port in its host name like www.example.com:9000

-
Yes
db_nameName of the Magento database instance in which you want to install the Magento database tables.Yes
db_userUser name of the Magento database instance owner.Yes
db_passMagento database instance owner's password.No
db_prefix

Use only if you're installing the Magento database tables in a database instance that has Magento tables in it already.

-

In that case, use a prefix to identify the Magento tables for this installation. Some customers have more than one Magento instance running on a server with all tables in the same database.

-

This option enables those customers to share the database server with more than one Magento installation.

No
admin_firstnameMagento administrator user's first name.Yes
admin_lastnameMagento administrator user's last name.Yes
admin_emailMagento administrator user's e-mail address.Yes
admin_usernameMagento administrator user name.Yes
admin_passwordMagento administrator user password.Yes
languageLanguage code to use in the Admin and storefront. (If you have not done so already, you can view the list of language codes by entering php -f index.php help languages from the setup directory.)Yes
currencyDefault currency to use in the storefront. (If you have not done so already, you can view the list of currencies by entering php -f index.php help currencies from the setup directory.)Yes
timezoneDefault time zone to use in the Admin and storefront. (If you have not done so already, you can view the list of time zones by entering php -f index.php help timezones from the setup directory.)Yes
use_secure

1 enables the use of Secure Sockets Layer (SSL) in all URLs (both Admin and storefront). Make sure your web server supports SSL before you select this option.

-

0 disables the use of SSL with Magento. In this case, all other secure URL options are assumed to also be 0.

No
base_secure_url

1 means SSL is preferred in Magento URLs designed to use it (for example, the checkout page). Make sure your web server supports SSL before you select this option.

-

0 means SSL is not used.

No
use_secure_admin

1 means you use SSL to access the Magento Admin. Make sure your web server supports SSL before you select this option.

-

0 means you do not use SSL with the Admin.

No
admin_use_security_key

1 causes the Magento software to use a randomly generated key value to access pages in the Magento Admin and in forms. These key values help prevent cross-site script forgery attacks.

-

0 disables the use of the key.

No
session_save

Use any of the following:

-
  • files to store session data in the file system. File-based session storage is appropriate unless the Magento file system access is slow or you have a clustered database.
  • -
  • db.files to store session data in the database. Choose database storage if you have a clustered database; otherwise, there might not be much benefit over file-based storage.
No
keyIf you have one, specify a key to encrypt sensitive data in the Magento database. (This includes passwords and personally identifiable customer information.) If you don't have one, Magento generates one for you.No
cleanup_databaseTo drop database tables before installing the Magento 2 software, specify this parameter without a value. Otherwise, the Magento database is left intact.No
db_init_statementsAdvanced MySQL configuration parameter. Uses database initialization statements to run when connecting to the MySQL database. Consult a reference similar to this one before you set any values.No
sales_order_increment_prefixSpecify a string value to use as a prefix for sales orders. Typically, this is used to guarantee unique order numbers for payment processors.No
- -

Sample localhost installation

- -The following example installs Magento with the following options: - -* The Magento software is installed in the `magento2` directory relative to the web server docroot on `localhost` and the path to the Magento Admin is `admin`; therefore: - - Your storefront URL is `http://localhost` and you can access the Magento Admin at `http://localhost/admin` - -* The database server is on the same host as the web server. - - The database name is `magento`, and the user name and password are both `magento` - -* The Magento administrator has the following properties: - - * First and last name are is `Magento User` - * User name is `admin` and the password is `iamtheadmin` - * E-mail address is `user@example.com` - -* Default language is `en_US` (U.S. English) -* Default currency is U.S. dollars -* Default time zone is U.S. Central (America/Chicago) - -
php -f index.php install --base_url=http://localhost/magento2/
-	--backend_frontname=admin 
-	--db_host=localhost --db_name=magento 
-	--db_user=magento --db_pass=magento 
-	--admin_firstname=Magento --admin_lastname=User 
-	--admin_email=user@example.com 	--admin_username=admin 
-	--admin_password=iamtheadmin --language=en_US
-	--currency=USD --timezone=America/Chicago
- -

Reinstalling the Magento 2 software

- -This section discusses how to install the Magento 2 software after you installed it previously. You might do this in an development environment especially to get all the latest code changes. - -To reinstall the Magento 2 software: - -1. Optionally delete and re-create the database instance. -2. Log in to your Magento server as a user with permissions to modify files in the Magento file system. -3. Enter the following commands in the order shown: - -
cd [your Magento install dir]
-git pull
-composer install
-cd setup
-composer install
- -4. Repeat the tasks discussed in Installing or reinstalling the Magento 2 software. - -

Verifying the installation

- -

Verifying the storefront

- -Go to the storefront in a web browser. For example, if your Magento 2 installation base URL is `http://www.example.com`, enter it in your browser's address or location bar. - -The following figure shows a sample storefront page. If it displays as follows, your installation was a success! - -

Magento storefront which verifies a successful installation

- -If the page appears unconfigured (no styles, only text), see Troubleshooting. - -

Verifying the Magento Admin

- -Go to the Magento Admin in a web browser. For example, if your Magento 2 installation base URL is `http://www.example.com`, and the Admin URL is `admin`, enter `http://www.example.com/admin` in your browser's address or location bar. - -(The Admin URL is specified by the value of the `backend_frontname` installation parameter.) - -When prompted, log in as a Magento Administrator. - -The following figure shows a sample Magento Admin page. If it displays as follows, your installation was a success! - -

Magento Admin which verifies a successful installation

- -If the page appears unconfigured (no styles, only text), see Troubleshooting. - -If you get a 404 (Not Found) error similar to the following, see Troubleshooting: - -`The requested URL /magento2index.php/admin/admin/dashboard/index/key/0c81957145a968b697c32a846598dc2e/ was not found on this server.` - -

Troubleshooting

- -### Problem: Cannot clone the Magento 2 GitHub repository - -**Detail**: Error is similar to the following: - -
Cloning into 'magento2'...
-Permission denied (publickey).
-fatal: The remote end hung up unexpectedly
- -**Solution**: Upload your SSH key to GitHub as discussed in the GitHub help page. - -### Problem: Cannot run 'composer install' - -**Suggestion**: Change to the directory in which you installed Composer and enter the following command: - -`mv composer.phar /usr/local/bin/composer` - -### Problem: During installation, PHP date warning - -**Details**: During the installation, the following message displays: - -`PHP Warning: date(): It is not safe to rely on the system's timezone settings. [more]` - -**Solution**: Set the PHP timezone properly. - -### Problem: During installation, the following fatal error displays: - -`PHP Fatal error: Class 'PDO' not found in /var/www/html/magento2/setup/module/Magento/Setup/src/Module/Setup/ConnectionFactory.php on line 44` - -**Solution**: Make sure you installed all required PHP extensions. - -### Problem: You cannot access Magento in a web browser - -**Details**: The following message displays when you try to access the Magento storefront or Admin: - -
Whoops, it looks like you have an invalid PHP version.
-Magento supports PHP 5.4.11 or newer. 
- -**Solution**: Either upgrade PHP or restart Apache (Apache might not be using the same PHP version as is on the file system). - -To restart Apache: - -* Ubuntu: `service apache2 restart` -* CentOS: `service httpd restart` - -### Problem: Error after logging in to the Magento Admin: - -`The requested URL /magento2index.php/admin/admin/dashboard/index/key/0c81957145a968b697c32a846598dc2e/ was not found on this server.` - -Note the lack of a slash character between magento2 and index.php in the URL. - -**Solution**: The base URL is not correct. The base URL must start with http:// or https:// *and* it must end with a slash (/). Run the installation again with a valid value. +

Step 2: Prepare to install

-### Problem: After installing, images and stylesheets do not load; only text displays, no graphics. +After verifying your prerequisites, perform the following tasks in order to prepare to install the Magento software. -**Details**: The path to images and stylesheets is not correct, either because of an incorrect base URL or because server rewrites are not set up properly. To confirm this is the case, use a web browser inspector to check the paths to static assets and verify those assets are located on the Magento file system. +1. Install Composer +2. Clone the Magento repository -Magento 2 static assets should be located under `[your Magento install dir]/pub/static/` (there should be `frontend` and `adminhtml` directories). +

Step 3: Install and verify the installation

-Verify your server rewrites setting and your base URL and try again. +1. Update installation dependencies +2. Install Magento: + * Install Magento software using the web interface + * Install Magento software using the command line +2. Verify the installation diff --git a/app/code/Magento/AdminNotification/composer.json b/app/code/Magento/AdminNotification/composer.json index 88913e187d7de..888893761470f 100644 --- a/app/code/Magento/AdminNotification/composer.json +++ b/app/code/Magento/AdminNotification/composer.json @@ -3,15 +3,15 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha108", - "magento/module-core": "0.1.0-alpha108", - "magento/module-backend": "0.1.0-alpha108", - "magento/framework": "0.1.0-alpha108", + "magento/module-store": "0.42.0-beta1", + "magento/module-core": "0.42.0-beta1", + "magento/module-backend": "0.42.0-beta1", + "magento/framework": "0.42.0-beta1", "lib-libxml": "*", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha108", + "version": "0.42.0-beta1", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Authorization/composer.json b/app/code/Magento/Authorization/composer.json index 71d8c8417bbbb..38c4e3fbde9c9 100644 --- a/app/code/Magento/Authorization/composer.json +++ b/app/code/Magento/Authorization/composer.json @@ -3,12 +3,12 @@ "description": "Authorization module provides access to Magento ACL functionality.", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-backend": "0.1.0-alpha108", - "magento/framework": "0.1.0-alpha108", + "magento/module-backend": "0.42.0-beta1", + "magento/framework": "0.42.0-beta1", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha108", + "version": "0.42.0-beta1", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Authorizenet/Block/Authorizenet/Form/Cc.php b/app/code/Magento/Authorizenet/Block/Authorizenet/Form/Cc.php deleted file mode 100644 index b966f1baf8454..0000000000000 --- a/app/code/Magento/Authorizenet/Block/Authorizenet/Form/Cc.php +++ /dev/null @@ -1,203 +0,0 @@ -getLayout()->createBlock('Magento\Payment\Block\Form\Cc')->setMethod($this->getMethod()); - } - - /** - * Cards info block - * - * @return string - */ - public function getCardsBlock() - { - return $this->getLayout()->createBlock( - 'Magento\Authorizenet\Block\Authorizenet\Info\Cc' - )->setMethod( - $this->getMethod() - )->setInfo( - $this->getMethod()->getInfoInstance() - )->setCheckoutProgressBlock( - false - )->setHideTitle( - true - ); - } - - /** - * Return url to cancel controller - * - * @return string - */ - public function getCancelUrl() - { - return $this->getUrl('authorizenet/authorizenet_payment/cancel'); - } - - /** - * Return url to admin cancel controller from admin url model - * - * @return string - */ - public function getAdminCancelUrl() - { - return $this->_urlBuilder->getUrl('adminhtml/authorizenet_payment/cancel'); - } - - /** - * Render block HTML - * - * @return string - */ - protected function _toHtml() - { - $this->setChild('cards', $this->getCardsBlock()); - $this->setChild('method_form_block', $this->getMethodFormBlock()); - return parent::_toHtml(); - } - - /** - * Get notice message - * - * @param string $message - * @return string - */ - public function showNoticeMessage($message) - { - return $this->getLayout()->getMessagesBlock()->addNotice(__($message))->getGroupedHtml(); - } - - /** - * Return partial authorization confirmation message and unset it in payment model - * - * @return string|false - */ - public function getPartialAuthorizationConfirmationMessage() - { - $lastActionState = $this->getMethod()->getPartialAuthorizationLastActionState(); - if ($lastActionState == \Magento\Authorizenet\Model\Authorizenet::PARTIAL_AUTH_LAST_SUCCESS) { - $this->getMethod()->unsetPartialAuthorizationLastActionState(); - return __( - 'You don\'t have enough on your credit card to pay for this purchase. To complete your purchase, click "OK" and add a credit card to use for the balance. Otherwise, you can cancel the purchase and release the partial payment we are holding.' - ); - } elseif ($lastActionState == \Magento\Authorizenet\Model\Authorizenet::PARTIAL_AUTH_LAST_DECLINED) { - $this->getMethod()->unsetPartialAuthorizationLastActionState(); - return __( - 'Your credit card has been declined. You can click OK to add another credit card to complete your purchase. Or you can cancel this credit transaction and pay a different way.' - ); - } - return false; - } - - /** - * Return partial authorization form message and unset it in payment model - * - * @return string - */ - public function getPartialAuthorizationFormMessage() - { - $lastActionState = $this->getMethod()->getPartialAuthorizationLastActionState(); - $message = false; - switch ($lastActionState) { - case \Magento\Authorizenet\Model\Authorizenet::PARTIAL_AUTH_ALL_CANCELED: - $message = __('We canceled your payment and released any money we were holding.'); - break; - case \Magento\Authorizenet\Model\Authorizenet::PARTIAL_AUTH_CARDS_LIMIT_EXCEEDED: - $message = __( - 'You can\'t use any more credit cards for this payment, and you don\'t have enough to pay for this purchase. Sorry, but we\'ll have to cancel your transaction.' - ); - break; - case \Magento\Authorizenet\Model\Authorizenet::PARTIAL_AUTH_DATA_CHANGED: - $message = __( - 'Your order has not been placed, because the contents of the shopping cart and/or your address has been changed. Authorized amounts from your previous payment that were left pending are now released. Please go through the checkout process to purchase your cart contents.' - ); - break; - } - if ($message) { - $this->getMethod()->unsetPartialAuthorizationLastActionState(); - } - return $message; - } - - /** - * Return cancel confirmation message - * - * @return string - */ - public function getCancelConfirmationMessage() - { - return __( - 'Are you sure you want to cancel your payment? Click OK to cancel your payment and release the amount on hold. Click Cancel to enter another credit card and continue with your payment.' - ); - } - - /** - * Return flag - is partial authorization process started - * - * @return bool - */ - public function isPartialAuthorization() - { - return $this->getMethod()->isPartialAuthorization(); - } - - /** - * Return HTML content for creating admin panel`s button - * - * @return string - */ - public function getCancelButtonHtml() - { - $cancelButton = $this->getLayout()->createBlock( - 'Magento\Backend\Block\Widget\Button' - )->setData( - ['id' => 'payment_cancel', 'label' => __('Cancel'), 'onclick' => 'cancelPaymentAuthorizations()'] - ); - return $cancelButton->toHtml(); - } - - /** - * Escape single and double quotes - * - * @param string $message - * @return string - */ - public function escapeMessage($message) - { - return htmlspecialchars($message, ENT_QUOTES, 'UTF-8'); - } - - /** - * Return init data for authorizenetAuthenticate widget as json - * - * @return string - */ - public function getWidgetInitData() - { - $initData = [ - 'authorizenetAuthenticate' => [ - 'partialAuthorizationConfirmationMessage' => $this->getPartialAuthorizationConfirmationMessage(), - 'cancelConfirmationMessage' => $this->getCancelConfirmationMessage(), - 'cancelUrl' => $this->getCancelUrl(), - ], - ]; - return \Zend_Json::encode($initData); - } -} diff --git a/app/code/Magento/Authorizenet/Block/Authorizenet/Info/Cc.php b/app/code/Magento/Authorizenet/Block/Authorizenet/Info/Cc.php deleted file mode 100644 index 7326fd3e16d96..0000000000000 --- a/app/code/Magento/Authorizenet/Block/Authorizenet/Info/Cc.php +++ /dev/null @@ -1,115 +0,0 @@ -_coreData = $coreData; - parent::__construct($context, $paymentConfig, $data); - } - - /** - * Render as PDF - * - * @return string - */ - public function toPdf() - { - $this->setTemplate('Magento_Authorizenet::info/pdf.phtml'); - return $this->toHtml(); - } - - /** - * Retrieve card info object - * - * @return \Magento\Payment\Model\Info - */ - public function getInfo() - { - if ($this->hasCardInfoObject()) { - return $this->getCardInfoObject(); - } - return parent::getInfo(); - } - - /** - * Set checkout progress information block flag - * to avoid showing credit card information from payment quote - * in Previously used card information block - * - * @param bool $flag - * @return $this - */ - public function setCheckoutProgressBlock($flag) - { - $this->_isCheckoutProgressBlockFlag = $flag; - return $this; - } - - /** - * Retrieve credit cards info - * - * @return array - */ - public function getCards() - { - $cardsData = $this->getMethod()->getCardsStorage()->getCards(); - $cards = []; - - if (is_array($cardsData)) { - foreach ($cardsData as $cardInfo) { - $data = []; - if ($cardInfo->getProcessedAmount()) { - $amount = $this->_coreData->currency($cardInfo->getProcessedAmount(), true, false); - $data[__('Processed Amount')] = $amount; - } - if ($cardInfo->getBalanceOnCard() && is_numeric($cardInfo->getBalanceOnCard())) { - $balance = $this->_coreData->currency($cardInfo->getBalanceOnCard(), true, false); - $data[__('Remaining Balance')] = $balance; - } - $cardInfo->setMethodInstance($this->getInfo()->getMethodInstance()); - $this->setCardInfoObject($cardInfo); - $cards[] = array_merge($this->getSpecificInformation(), $data); - $this->unsCardInfoObject(); - $this->_paymentSpecificInformation = null; - } - } - if ($this->getInfo()->getCcType() && $this->_isCheckoutProgressBlockFlag) { - $cards[] = $this->getSpecificInformation(); - } - return $cards; - } -} diff --git a/app/code/Magento/Authorizenet/Block/Directpost/Form.php b/app/code/Magento/Authorizenet/Block/Directpost/Form.php deleted file mode 100644 index 0c0c8d3c664c0..0000000000000 --- a/app/code/Magento/Authorizenet/Block/Directpost/Form.php +++ /dev/null @@ -1,80 +0,0 @@ - - */ -class Form extends \Magento\Payment\Block\Form\Cc -{ - /** - * @var string - */ - protected $_template = 'directpost/info.phtml'; - - /** - * @var \Magento\Authorizenet\Model\Directpost - */ - protected $_model; - - /** - * @var \Magento\Checkout\Model\Type\Onepage - */ - protected $_checkoutModel; - - /** - * @param \Magento\Framework\View\Element\Template\Context $context - * @param \Magento\Payment\Model\Config $paymentConfig - * @param \Magento\Authorizenet\Model\Directpost $model - * @param \Magento\Checkout\Model\Type\Onepage $checkoutModel - * @param array $data - */ - public function __construct( - \Magento\Framework\View\Element\Template\Context $context, - \Magento\Payment\Model\Config $paymentConfig, - \Magento\Authorizenet\Model\Directpost $model, - \Magento\Checkout\Model\Type\Onepage $checkoutModel, - array $data = [] - ) { - parent::__construct($context, $paymentConfig, $data); - $this->_model = $model; - $this->_checkoutModel = $checkoutModel; - } - - /** - * Render block HTML - * If method is not directpost - nothing to return - * - * @return string - */ - protected function _toHtml() - { - return $this->getMethod()->getCode() == $this->_model->getCode() ? parent::_toHtml() : ''; - } - - /** - * Set method info - * - * @return $this - */ - public function setMethodInfo() - { - $payment = $this->_checkoutModel->getQuote()->getPayment(); - $this->setMethod($payment->getMethodInstance()); - return $this; - } - - /** - * Get type of request - * - * @return bool - */ - public function isAjaxRequest() - { - return $this->getRequest()->getParam('isAjax'); - } -} diff --git a/app/code/Magento/Authorizenet/Block/Directpost/Iframe.php b/app/code/Magento/Authorizenet/Block/Directpost/Iframe.php deleted file mode 100644 index af9c827e18528..0000000000000 --- a/app/code/Magento/Authorizenet/Block/Directpost/Iframe.php +++ /dev/null @@ -1,52 +0,0 @@ - - */ -namespace Magento\Authorizenet\Block\Directpost; - -class Iframe extends \Magento\Framework\View\Element\Template -{ - /** - * Core registry - * - * @var \Magento\Framework\Registry - */ - protected $_coreRegistry = null; - - /** - * @param \Magento\Framework\View\Element\Template\Context $context - * @param \Magento\Framework\Registry $registry - * @param array $data - */ - public function __construct( - \Magento\Framework\View\Element\Template\Context $context, - \Magento\Framework\Registry $registry, - array $data = [] - ) { - $this->_coreRegistry = $registry; - parent::__construct($context, $data); - } - - /** - * Preparing global layout - * - * You can redefine this method in child classes for changing layout - * - * @return \Magento\Framework\View\Element\AbstractBlock - */ - protected function _prepareLayout() - { - $params = $this->_coreRegistry->registry('authorizenet_directpost_form_params'); - if (is_null($params)) { - $params = []; - } - $this->setParams($params); - return parent::_prepareLayout(); - } -} diff --git a/app/code/Magento/Authorizenet/Controller/Adminhtml/Authorizenet/Directpost/Payment/AddConfigured.php b/app/code/Magento/Authorizenet/Controller/Adminhtml/Authorizenet/Directpost/Payment/AddConfigured.php deleted file mode 100644 index faf362952c7c5..0000000000000 --- a/app/code/Magento/Authorizenet/Controller/Adminhtml/Authorizenet/Directpost/Payment/AddConfigured.php +++ /dev/null @@ -1,10 +0,0 @@ -getRequest()->getParam('payment'); - $controller = $this->getRequest()->getParam('controller'); - $this->getRequest()->setPost('collect_shipping_rates', 1); - $this->_processActionData('save'); - - //get confirmation by email flag - $orderData = $this->getRequest()->getPost('order'); - $sendConfirmationFlag = 0; - if ($orderData) { - $sendConfirmationFlag = !empty($orderData['send_confirmation']) ? 1 : 0; - } else { - $orderData = []; - } - - if (isset($paymentParam['method'])) { - $result = []; - $params = $this->_objectManager->get( - 'Magento\Authorizenet\Helper\Data' - )->getSaveOrderUrlParams( - $controller - ); - //create order partially - $this->_getOrderCreateModel()->setPaymentData($paymentParam); - $this->_getOrderCreateModel()->getQuote()->getPayment()->addData($paymentParam); - - $orderData['send_confirmation'] = 0; - $this->getRequest()->setPost('order', $orderData); - - try { - //do not cancel old order. - $oldOrder = $this->_getOrderCreateModel()->getSession()->getOrder(); - $oldOrder->setActionFlag(\Magento\Sales\Model\Order::ACTION_FLAG_CANCEL, false); - - $order = $this->_getOrderCreateModel()->setIsValidate( - true - )->importPostData( - $this->getRequest()->getPost('order') - )->createOrder(); - - $payment = $order->getPayment(); - if ($payment && $payment->getMethod() == $this->_objectManager->create( - 'Magento\Authorizenet\Model\Directpost' - )->getCode() - ) { - //return json with data. - $session = $this->_objectManager->get('Magento\Authorizenet\Model\Directpost\Session'); - $session->addCheckoutOrderIncrementId($order->getIncrementId()); - $session->setLastOrderIncrementId($order->getIncrementId()); - - $requestToAuthorizenet = $payment->getMethodInstance()->generateRequestFromOrder($order); - $requestToAuthorizenet->setControllerActionName($controller); - $requestToAuthorizenet->setOrderSendConfirmation($sendConfirmationFlag); - $requestToAuthorizenet->setStoreId($this->_getOrderCreateModel()->getQuote()->getStoreId()); - - $adminUrl = $this->_objectManager->get('Magento\Backend\Model\UrlInterface'); - if ($adminUrl->useSecretKey()) { - $requestToAuthorizenet->setKey( - $adminUrl->getSecretKey('adminhtml', 'authorizenet_directpost_payment', 'redirect') - ); - } - $result['directpost'] = ['fields' => $requestToAuthorizenet->getData()]; - } - - $result['success'] = 1; - $isError = false; - } catch (\Magento\Framework\Model\Exception $e) { - $message = $e->getMessage(); - if (!empty($message)) { - $this->messageManager->addError($message); - } - $isError = true; - } catch (\Exception $e) { - $this->messageManager->addException($e, __('Order saving error: %1', $e->getMessage())); - $isError = true; - } - - if ($isError) { - $result['success'] = 0; - $result['error'] = 1; - $result['redirect'] = $this->_objectManager->get( - 'Magento\Backend\Model\UrlInterface' - )->getUrl( - 'sales/order_create/' - ); - } - - $this->getResponse()->representJson( - $this->_objectManager->get('Magento\Core\Helper\Data')->jsonEncode($result) - ); - } else { - $result = ['error_messages' => __('Please choose a payment method.')]; - $this->getResponse()->representJson( - $this->_objectManager->get('Magento\Core\Helper\Data')->jsonEncode($result) - ); - } - } -} diff --git a/app/code/Magento/Authorizenet/Controller/Adminhtml/Authorizenet/Directpost/Payment/ProcessData.php b/app/code/Magento/Authorizenet/Controller/Adminhtml/Authorizenet/Directpost/Payment/ProcessData.php deleted file mode 100644 index bc2698c8418ad..0000000000000 --- a/app/code/Magento/Authorizenet/Controller/Adminhtml/Authorizenet/Directpost/Payment/ProcessData.php +++ /dev/null @@ -1,10 +0,0 @@ -_coreRegistry = $coreRegistry; - parent::__construct($context, $productHelper); - } - - /** - * Return quote - * - * @param bool $cancelOrder - * @param string $errorMsg - * @return void - */ - protected function _returnQuote($cancelOrder, $errorMsg) - { - $directpostSession = $this->_objectManager->get('Magento\Authorizenet\Model\Directpost\Session'); - $incrementId = $directpostSession->getLastOrderIncrementId(); - if ($incrementId && $directpostSession->isCheckoutOrderIncrementIdExist($incrementId)) { - /* @var $order \Magento\Sales\Model\Order */ - $order = $this->_objectManager->create('Magento\Sales\Model\Order')->loadByIncrementId($incrementId); - if ($order->getId()) { - $directpostSession->removeCheckoutOrderIncrementId($order->getIncrementId()); - if ($cancelOrder && $order->getState() == \Magento\Sales\Model\Order::STATE_PENDING_PAYMENT) { - $order->registerCancellation($errorMsg)->save(); - } - } - } - } - - /** - * Retrieve params and put javascript into iframe - * - * @return void - */ - public function execute() - { - $redirectParams = $this->getRequest()->getParams(); - $params = []; - if (!empty($redirectParams['success']) && isset( - $redirectParams['x_invoice_num'] - ) && isset( - $redirectParams['controller_action_name'] - ) - ) { - $params['redirect_parent'] = $this->_objectManager->get( - 'Magento\Authorizenet\Helper\HelperInterface' - )->getSuccessOrderUrl( - $redirectParams - ); - $directpostSession = $this->_objectManager->get('Magento\Authorizenet\Model\Directpost\Session'); - $directpostSession->unsetData('quote_id'); - //cancel old order - $oldOrder = $this->_getOrderCreateModel()->getSession()->getOrder(); - if ($oldOrder->getId()) { - /* @var $order \Magento\Sales\Model\Order */ - $order = $this->_objectManager->create( - 'Magento\Sales\Model\Order' - )->loadByIncrementId( - $redirectParams['x_invoice_num'] - ); - if ($order->getId()) { - $oldOrder->cancel()->save(); - $order->save(); - $this->_getOrderCreateModel()->getSession()->unsOrderId(); - } - } - //clear sessions - $this->_getSession()->clearStorage(); - $directpostSession->removeCheckoutOrderIncrementId($redirectParams['x_invoice_num']); - $this->_objectManager->get('Magento\Backend\Model\Session')->clearStorage(); - $this->messageManager->addSuccess(__('You created the order.')); - } - - if (!empty($redirectParams['error_msg'])) { - $cancelOrder = empty($redirectParams['x_invoice_num']); - $this->_returnQuote($cancelOrder, $redirectParams['error_msg']); - } - - $this->_coreRegistry->register('authorizenet_directpost_form_params', array_merge($params, $redirectParams)); - $this->_view->loadLayout(false)->renderLayout(); - } -} diff --git a/app/code/Magento/Authorizenet/Controller/Adminhtml/Authorizenet/Directpost/Payment/Reorder.php b/app/code/Magento/Authorizenet/Controller/Adminhtml/Authorizenet/Directpost/Payment/Reorder.php deleted file mode 100644 index a89d188eb7fc6..0000000000000 --- a/app/code/Magento/Authorizenet/Controller/Adminhtml/Authorizenet/Directpost/Payment/Reorder.php +++ /dev/null @@ -1,10 +0,0 @@ -_objectManager->get('Magento\Authorizenet\Model\Directpost\Session'); - $incrementId = $directpostSession->getLastOrderIncrementId(); - if ($incrementId && $directpostSession->isCheckoutOrderIncrementIdExist($incrementId)) { - /* @var $order \Magento\Sales\Model\Order */ - $order = $this->_objectManager->create('Magento\Sales\Model\Order')->loadByIncrementId($incrementId); - if ($order->getId()) { - $directpostSession->removeCheckoutOrderIncrementId($order->getIncrementId()); - } - } - } - - /** - * Return order quote by ajax - * - * @return void - */ - public function execute() - { - $this->_returnQuote(); - $this->getResponse()->representJson( - $this->_objectManager->get('Magento\Core\Helper\Data')->jsonEncode(['success' => 1]) - ); - } -} diff --git a/app/code/Magento/Authorizenet/Controller/Adminhtml/Authorizenet/Directpost/Payment/Save.php b/app/code/Magento/Authorizenet/Controller/Adminhtml/Authorizenet/Directpost/Payment/Save.php deleted file mode 100644 index 646ead3488a74..0000000000000 --- a/app/code/Magento/Authorizenet/Controller/Adminhtml/Authorizenet/Directpost/Payment/Save.php +++ /dev/null @@ -1,10 +0,0 @@ -_sessionQuote = $sessionQuote; - parent::__construct($context); - } - - /** - * Cancel active partial authorizations - * - * @return void - */ - public function execute() - { - $result['success'] = false; - try { - $paymentMethod = $this->_objectManager->get( - 'Magento\Payment\Helper\Data' - )->getMethodInstance( - \Magento\Authorizenet\Model\Authorizenet::METHOD_CODE - ); - - $paymentMethod->setStore($this->_sessionQuote->getQuote()->getStoreId()); - $paymentMethod->cancelPartialAuthorization($this->_sessionQuote->getQuote()->getPayment()); - - $result['success'] = true; - $result['update_html'] = $this->_objectManager->get( - 'Magento\Authorizenet\Helper\Data' - )->getPaymentMethodsHtml( - $this->_view - ); - } catch (\Magento\Framework\Model\Exception $e) { - $this->_objectManager->get('Magento\Framework\Logger')->logException($e); - $result['error_message'] = $e->getMessage(); - } catch (\Exception $e) { - $this->_objectManager->get('Magento\Framework\Logger')->logException($e); - $result['error_message'] = __('Something went wrong canceling the transactions.'); - } - - $this->_sessionQuote->getQuote()->getPayment()->save(); - $this->getResponse()->representJson( - $this->_objectManager->get('Magento\Core\Helper\Data')->jsonEncode($result) - ); - } -} diff --git a/app/code/Magento/Authorizenet/Controller/Authorizenet/Payment/Cancel.php b/app/code/Magento/Authorizenet/Controller/Authorizenet/Payment/Cancel.php deleted file mode 100644 index 6963049e7fd5e..0000000000000 --- a/app/code/Magento/Authorizenet/Controller/Authorizenet/Payment/Cancel.php +++ /dev/null @@ -1,67 +0,0 @@ -_session = $session; - parent::__construct($context); - } - - /** - * Cancel active partial authorizations - * - * @return void - */ - public function execute() - { - $result['success'] = false; - try { - $paymentMethod = $this->_objectManager->get( - 'Magento\Payment\Helper\Data' - )->getMethodInstance( - \Magento\Authorizenet\Model\Authorizenet::METHOD_CODE - ); - - $paymentMethod->cancelPartialAuthorization($this->_session->getQuote()->getPayment()); - - $result['success'] = true; - $result['update_html'] = $this->_objectManager->get( - 'Magento\Authorizenet\Helper\Data' - )->getPaymentMethodsHtml( - $this->_view - ); - } catch (\Magento\Framework\Model\Exception $e) { - $this->_objectManager->get('Magento\Framework\Logger')->logException($e); - $result['error_message'] = $e->getMessage(); - } catch (\Exception $e) { - $this->_objectManager->get('Magento\Framework\Logger')->logException($e); - $result['error_message'] = __( - 'There was an error canceling transactions. Please contact us or try again later.' - ); - } - - $this->_session->getQuote()->getPayment()->save(); - $this->getResponse()->representJson( - $this->_objectManager->get('Magento\Core\Helper\Data')->jsonEncode($result) - ); - } -} diff --git a/app/code/Magento/Authorizenet/Controller/Directpost/Payment.php b/app/code/Magento/Authorizenet/Controller/Directpost/Payment.php deleted file mode 100644 index b1230ac217ca9..0000000000000 --- a/app/code/Magento/Authorizenet/Controller/Directpost/Payment.php +++ /dev/null @@ -1,137 +0,0 @@ - - */ -class Payment extends \Magento\Framework\App\Action\Action -{ - /** - * Core registry - * - * @var \Magento\Framework\Registry - */ - protected $_coreRegistry = null; - - /** - * @param \Magento\Framework\App\Action\Context $context - * @param \Magento\Framework\Registry $coreRegistry - */ - public function __construct( - \Magento\Framework\App\Action\Context $context, - \Magento\Framework\Registry $coreRegistry - ) { - $this->_coreRegistry = $coreRegistry; - parent::__construct($context); - } - - /** - * @return \Magento\Checkout\Model\Session - */ - protected function _getCheckout() - { - return $this->_objectManager->get('Magento\Checkout\Model\Session'); - } - - /** - * Get session model - * - * @return \Magento\Authorizenet\Model\Directpost\Session - */ - protected function _getDirectPostSession() - { - return $this->_objectManager->get('Magento\Authorizenet\Model\Directpost\Session'); - } - - /** - * Response action. - * Action for Authorize.net SIM Relay Request. - * - * @param \Magento\Authorizenet\Helper\HelperInterface $helper - * @return void - */ - protected function _responseAction(\Magento\Authorizenet\Helper\HelperInterface $helper) - { - $params = []; - $data = $this->getRequest()->getPost(); - /* @var $paymentMethod \Magento\Authorizenet\Model\DirectPost */ - $paymentMethod = $this->_objectManager->create('Magento\Authorizenet\Model\Directpost'); - - $result = []; - if (!empty($data['x_invoice_num'])) { - $result['x_invoice_num'] = $data['x_invoice_num']; - } - - try { - if (!empty($data['store_id'])) { - $paymentMethod->setStore($data['store_id']); - } - $paymentMethod->process($data); - $result['success'] = 1; - } catch (\Magento\Framework\Model\Exception $e) { - $this->_objectManager->get('Magento\Framework\Logger')->logException($e); - $result['success'] = 0; - $result['error_msg'] = $e->getMessage(); - } catch (\Exception $e) { - $this->_objectManager->get('Magento\Framework\Logger')->logException($e); - $result['success'] = 0; - $result['error_msg'] = __('We couldn\'t process your order right now. Please try again later.'); - } - - if (!empty($data['controller_action_name']) && strpos( - $data['controller_action_name'], - 'sales_order_' - ) === false - ) { - if (!empty($data['key'])) { - $result['key'] = $data['key']; - } - $result['controller_action_name'] = $data['controller_action_name']; - $result['is_secure'] = isset($data['is_secure']) ? $data['is_secure'] : false; - $params['redirect'] = $helper->getRedirectIframeUrl($result); - } - - $this->_coreRegistry->register('authorizenet_directpost_form_params', $params); - $this->_view->addPageLayoutHandles(); - $this->_view->loadLayout(false)->renderLayout(); - } - - /** - * Return customer quote - * - * @param bool $cancelOrder - * @param string $errorMsg - * @return void - */ - protected function _returnCustomerQuote($cancelOrder = false, $errorMsg = '') - { - $incrementId = $this->_getDirectPostSession()->getLastOrderIncrementId(); - if ($incrementId && $this->_getDirectPostSession()->isCheckoutOrderIncrementIdExist($incrementId)) { - /* @var $order \Magento\Sales\Model\Order */ - $order = $this->_objectManager->create('Magento\Sales\Model\Order')->loadByIncrementId($incrementId); - if ($order->getId()) { - try { - /** @var \Magento\Sales\Model\QuoteRepository $quoteRepository */ - $quoteRepository = $this->_objectManager->create('Magento\Sales\Model\QuoteRepository'); - /** @var \Magento\Sales\Model\Quote $quote */ - $quote = $quoteRepository->get($order->getQuoteId()); - - $quote->setIsActive(1)->setReservedOrderId(null); - $quoteRepository->save($quote); - $this->_getCheckout()->replaceQuote($quote); - } catch (\Magento\Framework\Exception\NoSuchEntityException $e) { - } - $this->_getDirectPostSession()->removeCheckoutOrderIncrementId($incrementId); - $this->_getDirectPostSession()->unsetData('quote_id'); - if ($cancelOrder) { - $order->registerCancellation($errorMsg)->save(); - } - } - } - } -} diff --git a/app/code/Magento/Authorizenet/Controller/Directpost/Payment/BackendResponse.php b/app/code/Magento/Authorizenet/Controller/Directpost/Payment/BackendResponse.php deleted file mode 100644 index 9a99cf585b217..0000000000000 --- a/app/code/Magento/Authorizenet/Controller/Directpost/Payment/BackendResponse.php +++ /dev/null @@ -1,20 +0,0 @@ -_responseAction($this->_objectManager->get('Magento\Authorizenet\Helper\Backend')); - } -} diff --git a/app/code/Magento/Authorizenet/Controller/Directpost/Payment/Place.php b/app/code/Magento/Authorizenet/Controller/Directpost/Payment/Place.php deleted file mode 100644 index cea2f90f1662f..0000000000000 --- a/app/code/Magento/Authorizenet/Controller/Directpost/Payment/Place.php +++ /dev/null @@ -1,39 +0,0 @@ -getRequest()->getParam('payment'); - $controller = $this->getRequest()->getParam('controller'); - if (isset($paymentParam['method'])) { - $params = $this->_objectManager->get( - 'Magento\Authorizenet\Helper\Data' - )->getSaveOrderUrlParams( - $controller - ); - $this->_getDirectPostSession()->setQuoteId($this->_getCheckout()->getQuote()->getId()); - $this->_forward( - $params['action'], - $params['controller'], - $params['module'], - $this->getRequest()->getParams() - ); - } else { - $result = ['error_messages' => __('Please choose a payment method.'), 'goto_section' => 'payment']; - $this->getResponse()->representJson( - $this->_objectManager->get('Magento\Core\Helper\Data')->jsonEncode($result) - ); - } - } -} diff --git a/app/code/Magento/Authorizenet/Controller/Directpost/Payment/Redirect.php b/app/code/Magento/Authorizenet/Controller/Directpost/Payment/Redirect.php deleted file mode 100644 index aaad3cdfb79bd..0000000000000 --- a/app/code/Magento/Authorizenet/Controller/Directpost/Payment/Redirect.php +++ /dev/null @@ -1,52 +0,0 @@ -getRequest()->getParams(); - $params = []; - if (!empty($redirectParams['success']) && isset( - $redirectParams['x_invoice_num'] - ) && isset( - $redirectParams['controller_action_name'] - ) - ) { - $this->_getDirectPostSession()->unsetData('quote_id'); - $params['redirect_parent'] = $this->_objectManager->get( - 'Magento\Authorizenet\Helper\HelperInterface' - )->getSuccessOrderUrl( - $redirectParams - ); - } - if (!empty($redirectParams['error_msg'])) { - $cancelOrder = empty($redirectParams['x_invoice_num']); - $this->_returnCustomerQuote($cancelOrder, $redirectParams['error_msg']); - } - - if (isset( - $redirectParams['controller_action_name'] - ) && strpos( - $redirectParams['controller_action_name'], - 'sales_order_' - ) !== false - ) { - unset($redirectParams['controller_action_name']); - unset($params['redirect_parent']); - } - - $this->_coreRegistry->register('authorizenet_directpost_form_params', array_merge($params, $redirectParams)); - $this->_view->addPageLayoutHandles(); - $this->_view->loadLayout(false)->renderLayout(); - } -} diff --git a/app/code/Magento/Authorizenet/Controller/Directpost/Payment/Response.php b/app/code/Magento/Authorizenet/Controller/Directpost/Payment/Response.php deleted file mode 100644 index 0a3d61246a3ba..0000000000000 --- a/app/code/Magento/Authorizenet/Controller/Directpost/Payment/Response.php +++ /dev/null @@ -1,20 +0,0 @@ -_responseAction($this->_objectManager->get('Magento\Authorizenet\Helper\Data')); - } -} diff --git a/app/code/Magento/Authorizenet/Controller/Directpost/Payment/ReturnQuote.php b/app/code/Magento/Authorizenet/Controller/Directpost/Payment/ReturnQuote.php deleted file mode 100644 index 518be2645616a..0000000000000 --- a/app/code/Magento/Authorizenet/Controller/Directpost/Payment/ReturnQuote.php +++ /dev/null @@ -1,22 +0,0 @@ -_returnCustomerQuote(); - $this->getResponse()->representJson( - $this->_objectManager->get('Magento\Core\Helper\Data')->jsonEncode(['success' => 1]) - ); - } -} diff --git a/app/code/Magento/Authorizenet/Helper/Backend.php b/app/code/Magento/Authorizenet/Helper/Backend.php deleted file mode 100644 index c23f5e53ae2ef..0000000000000 --- a/app/code/Magento/Authorizenet/Helper/Backend.php +++ /dev/null @@ -1,95 +0,0 @@ -_urlBuilder = $backendUrl; - } - - /** - * Return URL for admin area - * - * @param string $route - * @param array $params - * @return string - */ - protected function _getUrl($route, $params = []) - { - return $this->_urlBuilder->getUrl($route, $params); - } - - /** - * Retrieve place order url in admin - * - * @return string - */ - public function getPlaceOrderAdminUrl() - { - return $this->_getUrl('adminhtml/authorizenet_directpost_payment/place', []); - } - - /** - * Retrieve place order url - * - * @param array $params - * @return string - */ - public function getSuccessOrderUrl($params) - { - $param = []; - $route = 'sales/order/view'; - $order = $this->_orderFactory->create()->loadByIncrementId($params['x_invoice_num']); - $param['order_id'] = $order->getId(); - return $this->_getUrl($route, $param); - } - - /** - * Retrieve redirect iframe url - * - * @param array $params - * @return string - */ - public function getRedirectIframeUrl($params) - { - return $this->_getUrl('adminhtml/authorizenet_directpost_payment/redirect', $params); - } - - /** - * Get direct post rely url - * - * @param null|int|string $storeId - * @return string - */ - public function getRelyUrl($storeId = null) - { - $defaultStore = $this->_storeManager->getDefaultStoreView(); - if (!$defaultStore) { - $allStores = $this->_storeManager->getStores(); - if (isset($allStores[0])) { - $defaultStore = $allStores[0]; - } - } - return $defaultStore->getBaseUrl( - \Magento\Framework\UrlInterface::URL_TYPE_LINK - ) . 'authorizenet/directpost_payment/backendResponse'; - } -} diff --git a/app/code/Magento/Authorizenet/Helper/Data.php b/app/code/Magento/Authorizenet/Helper/Data.php deleted file mode 100644 index ba1f68df936d0..0000000000000 --- a/app/code/Magento/Authorizenet/Helper/Data.php +++ /dev/null @@ -1,282 +0,0 @@ -_storeManager = $storeManager; - $this->_orderFactory = $orderFactory; - } - - /** - * Set secure url checkout is secure for current store. - * - * @param string $route - * @param array $params - * @return string - */ - protected function _getUrl($route, $params = []) - { - $params['_type'] = \Magento\Framework\UrlInterface::URL_TYPE_LINK; - if (isset($params['is_secure'])) { - $params['_secure'] = (bool)$params['is_secure']; - } elseif ($this->_storeManager->getStore()->isCurrentlySecure()) { - $params['_secure'] = true; - } - return parent::_getUrl($route, $params); - } - - /** - * Retrieve save order url params - * - * @param string $controller - * @return array - */ - public function getSaveOrderUrlParams($controller) - { - $route = []; - switch ($controller) { - case 'onepage': - $route['action'] = 'saveOrder'; - $route['controller'] = 'onepage'; - $route['module'] = 'checkout'; - break; - - case 'sales_order_create': - case 'sales_order_edit': - $route['action'] = 'save'; - $route['controller'] = 'sales_order_create'; - $route['module'] = 'admin'; - break; - - default: - break; - } - - return $route; - } - - /** - * Retrieve redirect iframe url - * - * @param array $params - * @return string - */ - public function getRedirectIframeUrl($params) - { - switch ($params['controller_action_name']) { - case 'onepage': - $route = 'authorizenet/directpost_payment/redirect'; - break; - - default: - $route = 'authorizenet/directpost_payment/redirect'; - break; - } - - return $this->_getUrl($route, $params); - } - - /** - * Retrieve place order url on front - * - * @return string - */ - public function getPlaceOrderFrontUrl() - { - return $this->_getUrl('authorizenet/directpost_payment/place'); - } - - /** - * Retrieve place order url - * - * @param array $params - * @return string - */ - public function getSuccessOrderUrl($params) - { - $param = []; - switch ($params['controller_action_name']) { - case 'onepage': - $route = 'checkout/onepage/success'; - break; - - default: - $route = 'checkout/onepage/success'; - break; - } - - return $this->_getUrl($route, $param); - } - - /** - * Update all child and parent order's edit increment numbers. - * Needed for Admin area. - * - * @param \Magento\Sales\Model\Order $order - * @return void - */ - public function updateOrderEditIncrements(\Magento\Sales\Model\Order $order) - { - if ($order->getId() && $order->getOriginalIncrementId()) { - $collection = $order->getCollection(); - $quotedIncrId = $collection->getConnection()->quote($order->getOriginalIncrementId()); - $collection->getSelect()->where( - "original_increment_id = {$quotedIncrId} OR increment_id = {$quotedIncrId}" - ); - - foreach ($collection as $orderToUpdate) { - $orderToUpdate->setEditIncrement($order->getEditIncrement()); - $orderToUpdate->save(); - } - } - } - - /** - * Converts a lot of messages to message - * - * @param array $messages - * @return string - */ - public function convertMessagesToMessage($messages) - { - return implode(' | ', $messages); - } - - /** - * Return message for gateway transaction request - * - * @param \Magento\Payment\Model\Info $payment - * @param string $requestType - * @param string $lastTransactionId - * @param \Magento\Framework\Object $card - * @param bool|float $amount - * @param bool|string $exception - * @param bool|string $additionalMessage - * @return bool|string - */ - public function getTransactionMessage( - $payment, - $requestType, - $lastTransactionId, - $card, - $amount = false, - $exception = false, - $additionalMessage = false - ) { - $message[] = __('Credit Card: xxxx-%1', $card->getCcLast4()); - if ($amount) { - $message[] = __('amount %1', $this->_formatPrice($payment, $amount)); - } - $operation = $this->_getOperation($requestType); - if (!$operation) { - return false; - } else { - $message[] = $operation; - } - $message[] = ($exception) ? '- ' . __('failed.') : '- ' . __('successful.'); - if (!is_null($lastTransactionId)) { - $message[] = __('Authorize.Net Transaction ID %1.', $lastTransactionId); - } - if ($additionalMessage) { - $message[] = $additionalMessage; - } - if ($exception) { - $message[] = $exception; - } - return implode(' ', $message); - } - - /** - * Return operation name for request type - * - * @param string $requestType - * @return bool|string - */ - protected function _getOperation($requestType) - { - switch ($requestType) { - case \Magento\Authorizenet\Model\Authorizenet::REQUEST_TYPE_AUTH_ONLY: - return __('authorize'); - case \Magento\Authorizenet\Model\Authorizenet::REQUEST_TYPE_AUTH_CAPTURE: - return __('authorize and capture'); - case \Magento\Authorizenet\Model\Authorizenet::REQUEST_TYPE_PRIOR_AUTH_CAPTURE: - return __('capture'); - case \Magento\Authorizenet\Model\Authorizenet::REQUEST_TYPE_CREDIT: - return __('refund'); - case \Magento\Authorizenet\Model\Authorizenet::REQUEST_TYPE_VOID: - return __('void'); - default: - return false; - } - } - - /** - * Format price with currency sign - * @param \Magento\Payment\Model\Info $payment - * @param float $amount - * @return string - */ - protected function _formatPrice($payment, $amount) - { - return $payment->getOrder()->getBaseCurrency()->formatTxt($amount); - } - - /** - * Get payment method step html - * - * @param \Magento\Framework\App\ViewInterface $view - * @return string - */ - public function getPaymentMethodsHtml(\Magento\Framework\App\ViewInterface $view) - { - $layout = $view->getLayout(); - $update = $layout->getUpdate(); - $update->load('checkout_onepage_paymentmethod'); - $layout->generateXml(); - $layout->generateElements(); - $output = $layout->getOutput(); - return $output; - } - - /** - * Get direct post rely url - * - * @param null|int|string $storeId - * @return string - */ - public function getRelyUrl($storeId = null) - { - return $this->_storeManager->getStore( - $storeId - )->getBaseUrl( - \Magento\Framework\UrlInterface::URL_TYPE_LINK - ) . 'authorizenet/directpost_payment/response'; - } -} diff --git a/app/code/Magento/Authorizenet/Helper/HelperInterface.php b/app/code/Magento/Authorizenet/Helper/HelperInterface.php deleted file mode 100644 index 5cede4f82220e..0000000000000 --- a/app/code/Magento/Authorizenet/Helper/HelperInterface.php +++ /dev/null @@ -1,35 +0,0 @@ -" 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/Authorizenet/LICENSE_AFL.txt b/app/code/Magento/Authorizenet/LICENSE_AFL.txt deleted file mode 100644 index 87943b95d43a5..0000000000000 --- a/app/code/Magento/Authorizenet/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 " 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/Authorizenet/Model/Authorizenet.php b/app/code/Magento/Authorizenet/Model/Authorizenet.php deleted file mode 100644 index 36ff1c26ee846..0000000000000 --- a/app/code/Magento/Authorizenet/Model/Authorizenet.php +++ /dev/null @@ -1,1850 +0,0 @@ - 'x_cardholder_authentication_value', - 'centinel_eci' => 'x_authentication_indicator', - ]; - - /** - * @var \Magento\Authorizenet\Model\Authorizenet\Cards - */ - protected $_cardsStorage = null; - - /** - * Authorize.net data - * - * @var \Magento\Authorizenet\Helper\Data - */ - protected $_authorizenetData = null; - - /** - * Session - * - * @var \Magento\Framework\Session\SessionManagerInterface - */ - protected $_session; - - /** - * Order factory - * - * @var \Magento\Sales\Model\OrderFactory - */ - protected $_orderFactory; - - /** - * Result factory - * - * @var \Magento\Authorizenet\Model\Authorizenet\ResultFactory - */ - protected $_resultFactory; - - /** - * Request factory - * - * @var \Magento\Authorizenet\Model\Authorizenet\RequestFactory - */ - protected $_requestFactory; - - /** - * Cards factory - * - * @var \Magento\Authorizenet\Model\Authorizenet\CardsFactory - */ - protected $_cardsFactory; - - /** - * @param \Magento\Framework\Event\ManagerInterface $eventManager - * @param \Magento\Payment\Helper\Data $paymentData - * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig - * @param \Magento\Framework\Logger\AdapterFactory $logAdapterFactory - * @param \Magento\Framework\Logger $logger - * @param \Magento\Framework\Module\ModuleListInterface $moduleList - * @param \Magento\Framework\Stdlib\DateTime\TimezoneInterface $localeDate - * @param \Magento\Centinel\Model\Service $centinelService - * @param \Magento\Authorizenet\Model\Authorizenet\CardsFactory $cardsFactory - * @param \Magento\Authorizenet\Model\Authorizenet\RequestFactory $requestFactory - * @param \Magento\Authorizenet\Model\Authorizenet\ResultFactory $resultFactory - * @param \Magento\Sales\Model\OrderFactory $orderFactory - * @param \Magento\Framework\Session\SessionManagerInterface $session - * @param \Magento\Authorizenet\Helper\Data $authorizenetData - * @param array $data - * - * @SuppressWarnings(PHPMD.ExcessiveParameterList) - */ - public function __construct( - \Magento\Framework\Event\ManagerInterface $eventManager, - \Magento\Payment\Helper\Data $paymentData, - \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, - \Magento\Framework\Logger\AdapterFactory $logAdapterFactory, - \Magento\Framework\Logger $logger, - \Magento\Framework\Module\ModuleListInterface $moduleList, - \Magento\Framework\Stdlib\DateTime\TimezoneInterface $localeDate, - \Magento\Centinel\Model\Service $centinelService, - \Magento\Authorizenet\Model\Authorizenet\CardsFactory $cardsFactory, - \Magento\Authorizenet\Model\Authorizenet\RequestFactory $requestFactory, - \Magento\Authorizenet\Model\Authorizenet\ResultFactory $resultFactory, - \Magento\Sales\Model\OrderFactory $orderFactory, - \Magento\Framework\Session\SessionManagerInterface $session, - \Magento\Authorizenet\Helper\Data $authorizenetData, - array $data = [] - ) { - $this->_cardsFactory = $cardsFactory; - $this->_requestFactory = $requestFactory; - $this->_resultFactory = $resultFactory; - $this->_orderFactory = $orderFactory; - $this->_session = $session; - $this->_authorizenetData = $authorizenetData; - parent::__construct( - $eventManager, - $paymentData, - $scopeConfig, - $logAdapterFactory, - $logger, - $moduleList, - $localeDate, - $centinelService, - $data - ); - } - - /** - * Check method for processing with base currency - * - * @param string $currencyCode - * @return bool - */ - public function canUseForCurrency($currencyCode) - { - if (!in_array($currencyCode, $this->getAcceptedCurrencyCodes())) { - return false; - } - return true; - } - - /** - * Return array of currency codes supplied by Payment Gateway - * - * @return array - */ - public function getAcceptedCurrencyCodes() - { - if (!$this->hasData('_accepted_currency')) { - $acceptedCurrencyCodes = $this->_allowCurrencyCode; - $acceptedCurrencyCodes[] = $this->getConfigData('currency'); - $this->setData('_accepted_currency', $acceptedCurrencyCodes); - } - return $this->_getData('_accepted_currency'); - } - - /** - * Check capture availability - * - * @return bool - */ - public function canCapture() - { - if ($this->_isGatewayActionsLocked($this->getInfoInstance())) { - return false; - } - if ($this->_isPreauthorizeCapture($this->getInfoInstance())) { - return true; - } - - /** - * If there are not transactions it is placing order and capturing is available - */ - foreach ($this->getCardsStorage()->getCards() as $card) { - $lastTransaction = $this->getInfoInstance()->getTransaction($card->getLastTransId()); - if ($lastTransaction) { - return false; - } - } - return true; - } - - /** - * Check refund availability - * - * @return bool - */ - public function canRefund() - { - if ($this->_isGatewayActionsLocked($this->getInfoInstance()) || $this->getCardsStorage()->getCardsCount() <= 0 - ) { - return false; - } - foreach ($this->getCardsStorage()->getCards() as $card) { - $lastTransaction = $this->getInfoInstance()->getTransaction($card->getLastTransId()); - if ($lastTransaction && - $lastTransaction->getTxnType() == \Magento\Sales\Model\Order\Payment\Transaction::TYPE_CAPTURE && - !$lastTransaction->getIsClosed() - ) { - return true; - } - } - return false; - } - - /** - * Check void availability - * - * @param \Magento\Framework\Object $payment - * @return bool - */ - public function canVoid(\Magento\Framework\Object $payment) - { - if ($this->_isGatewayActionsLocked($this->getInfoInstance())) { - return false; - } - return $this->_isPreauthorizeCapture($this->getInfoInstance()); - } - - /** - * Set partial authorization last action state into session - * - * @param string $state - * @return $this - */ - public function setPartialAuthorizationLastActionState($state) - { - $this->_session->setData($this->_partialAuthorizationLastActionStateSessionKey, $state); - return $this; - } - - /** - * Return partial authorization last action state from session - * - * @return string - */ - public function getPartialAuthorizationLastActionState() - { - return $this->_session->getData($this->_partialAuthorizationLastActionStateSessionKey); - } - - /** - * Unset partial authorization last action state in session - * - * @return $this - */ - public function unsetPartialAuthorizationLastActionState() - { - $this->_session->setData($this->_partialAuthorizationLastActionStateSessionKey, false); - return $this; - } - - /** - * Send authorize request to gateway - * - * @param \Magento\Payment\Model\Info $payment - * @param float $amount - * @return $this - * @throws \Magento\Framework\Model\Exception - */ - public function authorize(\Magento\Framework\Object $payment, $amount) - { - if ($amount <= 0) { - throw new \Magento\Framework\Model\Exception(__('This is an invalid amount for authorization.')); - } - - $this->_initCardsStorage($payment); - - if ($this->isPartialAuthorization($payment)) { - $this->_partialAuthorization($payment, $amount, self::REQUEST_TYPE_AUTH_ONLY); - $payment->setSkipTransactionCreation(true); - return $this; - } - - $this->_place($payment, $amount, self::REQUEST_TYPE_AUTH_ONLY); - $payment->setSkipTransactionCreation(true); - return $this; - } - - /** - * Send capture request to gateway - * - * @param \Magento\Payment\Model\Info $payment - * @param float $amount - * @return $this - * @throws \Magento\Framework\Model\Exception - */ - public function capture(\Magento\Framework\Object $payment, $amount) - { - if ($amount <= 0) { - throw new \Magento\Framework\Model\Exception(__('This is an invalid amount for capture.')); - } - $this->_initCardsStorage($payment); - if ($this->_isPreauthorizeCapture($payment)) { - $this->_preauthorizeCapture($payment, $amount); - } elseif ($this->isPartialAuthorization($payment)) { - $this->_partialAuthorization($payment, $amount, self::REQUEST_TYPE_AUTH_CAPTURE); - } else { - $this->_place($payment, $amount, self::REQUEST_TYPE_AUTH_CAPTURE); - } - $payment->setSkipTransactionCreation(true); - return $this; - } - - /** - * Void the payment through gateway - * - * @param \Magento\Payment\Model\Info $payment - * @return $this - */ - public function void(\Magento\Framework\Object $payment) - { - $cardsStorage = $this->getCardsStorage($payment); - - $messages = []; - $isSuccessful = false; - $isFiled = false; - foreach ($cardsStorage->getCards() as $card) { - try { - $newTransaction = $this->_voidCardTransaction($payment, $card); - $messages[] = $newTransaction->getMessage(); - $isSuccessful = true; - } catch (\Exception $e) { - $messages[] = $e->getMessage(); - $isFiled = true; - continue; - } - $cardsStorage->updateCard($card); - } - - if ($isFiled) { - $this->_processFailureMultitransactionAction($payment, $messages, $isSuccessful); - } - - $payment->setSkipTransactionCreation(true); - return $this; - } - - /** - * Cancel the payment through gateway - * - * @param \Magento\Payment\Model\Info $payment - * @return $this - */ - public function cancel(\Magento\Framework\Object $payment) - { - return $this->void($payment); - } - - /** - * Refund the amount with transaction id - * - * @param \Magento\Payment\Model\Info $payment - * @param float $requestedAmount - * @return $this - * @throws \Magento\Framework\Model\Exception - */ - public function refund(\Magento\Framework\Object $payment, $requestedAmount) - { - $cardsStorage = $this->getCardsStorage($payment); - - if ($this->_formatAmount( - $cardsStorage->getCapturedAmount() - $cardsStorage->getRefundedAmount() - ) < $requestedAmount - ) { - throw new \Magento\Framework\Model\Exception(__('This is an invalid amount for refund.')); - } - - $messages = []; - $isSuccessful = false; - $isFiled = false; - foreach ($cardsStorage->getCards() as $card) { - if ($requestedAmount > 0) { - $cardAmountForRefund = $this->_formatAmount($card->getCapturedAmount() - $card->getRefundedAmount()); - if ($cardAmountForRefund <= 0) { - continue; - } - if ($cardAmountForRefund > $requestedAmount) { - $cardAmountForRefund = $requestedAmount; - } - try { - $newTransaction = $this->_refundCardTransaction($payment, $cardAmountForRefund, $card); - $messages[] = $newTransaction->getMessage(); - $isSuccessful = true; - } catch (\Exception $e) { - $messages[] = $e->getMessage(); - $isFiled = true; - continue; - } - $card->setRefundedAmount($this->_formatAmount($card->getRefundedAmount() + $cardAmountForRefund)); - $cardsStorage->updateCard($card); - $requestedAmount = $this->_formatAmount($requestedAmount - $cardAmountForRefund); - } else { - $payment->setSkipTransactionCreation(true); - return $this; - } - } - - if ($isFiled) { - $this->_processFailureMultitransactionAction($payment, $messages, $isSuccessful); - } - - $payment->setSkipTransactionCreation(true); - return $this; - } - - /** - * Cancel partial authorizations and flush current split_tender_id record - * - * @param \Magento\Payment\Model\Info $payment - * @return void - * @throws \Magento\Framework\Model\Exception - */ - public function cancelPartialAuthorization(\Magento\Payment\Model\Info $payment) - { - if (!$payment->getAdditionalInformation($this->_splitTenderIdKey)) { - throw new \Magento\Framework\Model\Exception(__('This is an invalid split tenderId ID.')); - } - - $request = $this->_getRequest(); - $request->setXSplitTenderId($payment->getAdditionalInformation($this->_splitTenderIdKey)); - - $request->setXType(self::REQUEST_TYPE_VOID)->setXMethod(self::REQUEST_METHOD_CC); - $result = $this->_postRequest($request); - - switch ($result->getResponseCode()) { - case self::RESPONSE_CODE_APPROVED: - $payment->setAdditionalInformation($this->_splitTenderIdKey, null); - $this->_session->setData($this->_partialAuthorizationChecksumSessionKey, null); - $this->getCardsStorage($payment)->flushCards(); - $this->setPartialAuthorizationLastActionState(self::PARTIAL_AUTH_ALL_CANCELED); - return; - default: - throw new \Magento\Framework\Model\Exception(__('Something went wrong while canceling the payment.')); - } - } - - /** - * Send request with new payment to gateway - * - * @param \Magento\Payment\Model\Info $payment - * @param float $amount - * @param string $requestType - * @return $this - * @throws \Magento\Framework\Model\Exception - */ - protected function _place($payment, $amount, $requestType) - { - $payment->setAnetTransType($requestType); - $payment->setAmount($amount); - $request = $this->_buildRequest($payment); - $result = $this->_postRequest($request); - - switch ($requestType) { - case self::REQUEST_TYPE_AUTH_ONLY: - $newTransactionType = \Magento\Sales\Model\Order\Payment\Transaction::TYPE_AUTH; - $defaultExceptionMessage = __('Something went wrong while authorizing the payment.'); - break; - case self::REQUEST_TYPE_AUTH_CAPTURE: - $newTransactionType = \Magento\Sales\Model\Order\Payment\Transaction::TYPE_CAPTURE; - $defaultExceptionMessage = __('Something went wrong while capturing the payment.'); - break; - } - - switch ($result->getResponseCode()) { - case self::RESPONSE_CODE_APPROVED: - $this->getCardsStorage($payment)->flushCards(); - $card = $this->_registerCard($result, $payment); - $this->_addTransaction( - $payment, - $card->getLastTransId(), - $newTransactionType, - ['is_transaction_closed' => 0], - [$this->_realTransactionIdKey => $card->getLastTransId()], - $this->_authorizenetData->getTransactionMessage( - $payment, - $requestType, - $card->getLastTransId(), - $card, - $amount - ) - ); - if ($requestType == self::REQUEST_TYPE_AUTH_CAPTURE) { - $card->setCapturedAmount($card->getProcessedAmount()); - $this->getCardsStorage($payment)->updateCard($card); - } - return $this; - case self::RESPONSE_CODE_HELD: - if ($result->getResponseReasonCode() == self::RESPONSE_REASON_CODE_PENDING_REVIEW_AUTHORIZED || - $result->getResponseReasonCode() == self::RESPONSE_REASON_CODE_PENDING_REVIEW - ) { - $card = $this->_registerCard($result, $payment); - $this->_addTransaction( - $payment, - $card->getLastTransId(), - $newTransactionType, - ['is_transaction_closed' => 0], - [ - $this->_realTransactionIdKey => $card->getLastTransId(), - $this->_isTransactionFraud => true - ], - $this->_authorizenetData->getTransactionMessage( - $payment, - $requestType, - $card->getLastTransId(), - $card, - $amount - ) - ); - if ($requestType == self::REQUEST_TYPE_AUTH_CAPTURE) { - $card->setCapturedAmount($card->getProcessedAmount()); - $this->getCardsStorage()->updateCard($card); - } - $payment->setIsTransactionPending(true)->setIsFraudDetected(true); - return $this; - } - if ($result->getResponseReasonCode() == self::RESPONSE_REASON_CODE_PARTIAL_APPROVE) { - $checksum = $this->_generateChecksum($request, $this->_partialAuthorizationChecksumDataKeys); - $this->_session->setData($this->_partialAuthorizationChecksumSessionKey, $checksum); - if ($this->_processPartialAuthorizationResponse($result, $payment)) { - return $this; - } - } - throw new \Magento\Framework\Model\Exception($defaultExceptionMessage); - case self::RESPONSE_CODE_DECLINED: - case self::RESPONSE_CODE_ERROR: - throw new \Magento\Framework\Model\Exception($this->_wrapGatewayError($result->getResponseReasonText())); - default: - throw new \Magento\Framework\Model\Exception($defaultExceptionMessage); - } - return $this; - } - - /** - * Send request with new payment to gateway during partial authorization process - * - * @param \Magento\Payment\Model\Info $payment - * @param float $amount - * @param string $requestType - * @return $this - * @throws \Magento\Payment\Model\Info\Exception - * @throws \Magento\Framework\Model\Exception - */ - protected function _partialAuthorization($payment, $amount, $requestType) - { - $payment->setAnetTransType($requestType); - - /* - * Try to build checksum of first request and compare with current checksum - */ - if ($this->getConfigData('partial_authorization_checksum_checking')) { - $payment->setAmount($amount); - $firstPlacingRequest = $this->_buildRequest($payment); - $newChecksum = $this->_generateChecksum( - $firstPlacingRequest, - $this->_partialAuthorizationChecksumDataKeys - ); - $previosChecksum = $this->_session->getData($this->_partialAuthorizationChecksumSessionKey); - if ($newChecksum != $previosChecksum) { - $quotePayment = $payment->getOrder()->getQuote()->getPayment(); - $this->cancelPartialAuthorization($payment); - $this->_clearAssignedData($quotePayment); - $this->setPartialAuthorizationLastActionState(self::PARTIAL_AUTH_DATA_CHANGED); - $quotePayment->setAdditionalInformation($payment->getAdditionalInformation()); - throw new \Magento\Payment\Model\Info\Exception( - __('The shopping cart contents and/or address has been changed.') - ); - } - } - - $amount = $amount - $this->getCardsStorage()->getProcessedAmount(); - if ($amount <= 0) { - throw new \Magento\Framework\Model\Exception(__('This is an invalid amount for partial authorization.')); - } - $payment->setAmount($amount); - $request = $this->_buildRequest($payment); - $result = $this->_postRequest($request); - $this->_processPartialAuthorizationResponse($result, $payment); - - switch ($requestType) { - case self::REQUEST_TYPE_AUTH_ONLY: - $newTransactionType = \Magento\Sales\Model\Order\Payment\Transaction::TYPE_AUTH; - break; - case self::REQUEST_TYPE_AUTH_CAPTURE: - $newTransactionType = \Magento\Sales\Model\Order\Payment\Transaction::TYPE_CAPTURE; - break; - } - - foreach ($this->getCardsStorage()->getCards() as $card) { - $this->_addTransaction( - $payment, - $card->getLastTransId(), - $newTransactionType, - ['is_transaction_closed' => 0], - [$this->_realTransactionIdKey => $card->getLastTransId()], - $this->_authorizenetData->getTransactionMessage( - $payment, - $requestType, - $card->getLastTransId(), - $card, - $card->getProcessedAmount() - ) - ); - if ($requestType == self::REQUEST_TYPE_AUTH_CAPTURE) { - $card->setCapturedAmount($card->getProcessedAmount()); - $this->getCardsStorage()->updateCard($card); - } - } - $this->_session->setData($this->_partialAuthorizationChecksumSessionKey, null); - return $this; - } - - /** - * Return true if there are authorized transactions - * - * @param \Magento\Payment\Model\Info $payment - * @return bool - */ - protected function _isPreauthorizeCapture($payment) - { - if ($this->getCardsStorage()->getCardsCount() <= 0) { - return false; - } - foreach ($this->getCardsStorage()->getCards() as $card) { - $lastTransaction = $payment->getTransaction($card->getLastTransId()); - if (!$lastTransaction || - $lastTransaction->getTxnType() != \Magento\Sales\Model\Order\Payment\Transaction::TYPE_AUTH - ) { - return false; - } - } - return true; - } - - /** - * Send capture request to gateway for capture authorized transactions - * - * @param \Magento\Payment\Model\Info $payment - * @param float $requestedAmount - * @return $this - * @throws \Magento\Framework\Model\Exception - */ - protected function _preauthorizeCapture($payment, $requestedAmount) - { - $cardsStorage = $this->getCardsStorage($payment); - - if ($this->_formatAmount( - $cardsStorage->getProcessedAmount() - $cardsStorage->getCapturedAmount() - ) < $requestedAmount - ) { - throw new \Magento\Framework\Model\Exception(__('This is an invalid amount for capture.')); - } - - $messages = []; - $isSuccessful = false; - $isFiled = false; - foreach ($cardsStorage->getCards() as $card) { - if ($requestedAmount > 0) { - $cardAmountForCapture = $card->getProcessedAmount(); - if ($cardAmountForCapture > $requestedAmount) { - $cardAmountForCapture = $requestedAmount; - } - try { - $newTransaction = $this->_preauthorizeCaptureCardTransaction( - $payment, - $cardAmountForCapture, - $card - ); - $messages[] = $newTransaction->getMessage(); - $isSuccessful = true; - } catch (\Exception $e) { - $messages[] = $e->getMessage(); - $isFiled = true; - continue; - } - $card->setCapturedAmount($cardAmountForCapture); - $cardsStorage->updateCard($card); - $requestedAmount = $this->_formatAmount($requestedAmount - $cardAmountForCapture); - } - } - - if ($isFiled) { - $this->_processFailureMultitransactionAction($payment, $messages, $isSuccessful); - } - return $this; - } - - /** - * Send capture request to gateway for capture authorized transactions of card - * - * @param \Magento\Payment\Model\Info $payment - * @param float $amount - * @param \Magento\Framework\Object $card - * @return \Magento\Sales\Model\Order\Payment\Transaction - * @throws \Magento\Framework\Model\Exception - */ - protected function _preauthorizeCaptureCardTransaction($payment, $amount, $card) - { - $authTransactionId = $card->getLastTransId(); - $authTransaction = $payment->getTransaction($authTransactionId); - $realAuthTransactionId = $authTransaction->getAdditionalInformation($this->_realTransactionIdKey); - - $payment->setAnetTransType(self::REQUEST_TYPE_PRIOR_AUTH_CAPTURE); - $payment->setXTransId($realAuthTransactionId); - $payment->setAmount($amount); - - $request = $this->_buildRequest($payment); - $result = $this->_postRequest($request); - - switch ($result->getResponseCode()) { - case self::RESPONSE_CODE_APPROVED: - if ($result->getResponseReasonCode() == self::RESPONSE_REASON_CODE_APPROVED) { - $captureTransactionId = $result->getTransactionId() . '-capture'; - $card->setLastTransId($captureTransactionId); - return $this->_addTransaction( - $payment, - $captureTransactionId, - \Magento\Sales\Model\Order\Payment\Transaction::TYPE_CAPTURE, - ['is_transaction_closed' => 0, 'parent_transaction_id' => $authTransactionId], - [$this->_realTransactionIdKey => $result->getTransactionId()], - $this->_authorizenetData->getTransactionMessage( - $payment, - self::REQUEST_TYPE_PRIOR_AUTH_CAPTURE, - $result->getTransactionId(), - $card, - $amount - ) - ); - } - $exceptionMessage = $this->_wrapGatewayError($result->getResponseReasonText()); - break; - case self::RESPONSE_CODE_HELD: - case self::RESPONSE_CODE_DECLINED: - case self::RESPONSE_CODE_ERROR: - $exceptionMessage = $this->_wrapGatewayError($result->getResponseReasonText()); - break; - default: - $exceptionMessage = __('Something went wrong while capturing the payment.'); - break; - } - - $exceptionMessage = $this->_authorizenetData->getTransactionMessage( - $payment, - self::REQUEST_TYPE_PRIOR_AUTH_CAPTURE, - $realAuthTransactionId, - $card, - $amount, - $exceptionMessage - ); - throw new \Magento\Framework\Model\Exception($exceptionMessage); - } - - /** - * Void the card transaction through gateway - * - * @param \Magento\Payment\Model\Info $payment - * @param \Magento\Framework\Object $card - * @return \Magento\Sales\Model\Order\Payment\Transaction - * @throws \Magento\Framework\Model\Exception - */ - protected function _voidCardTransaction($payment, $card) - { - $authTransactionId = $card->getLastTransId(); - $authTransaction = $payment->getTransaction($authTransactionId); - $realAuthTransactionId = $authTransaction->getAdditionalInformation($this->_realTransactionIdKey); - - $payment->setAnetTransType(self::REQUEST_TYPE_VOID); - $payment->setXTransId($realAuthTransactionId); - - $request = $this->_buildRequest($payment); - $result = $this->_postRequest($request); - - switch ($result->getResponseCode()) { - case self::RESPONSE_CODE_APPROVED: - if ($result->getResponseReasonCode() == self::RESPONSE_REASON_CODE_APPROVED) { - $voidTransactionId = $result->getTransactionId() . '-void'; - $card->setLastTransId($voidTransactionId); - return $this->_addTransaction( - $payment, - $voidTransactionId, - \Magento\Sales\Model\Order\Payment\Transaction::TYPE_VOID, - [ - 'is_transaction_closed' => 1, - 'should_close_parent_transaction' => 1, - 'parent_transaction_id' => $authTransactionId - ], - [$this->_realTransactionIdKey => $result->getTransactionId()], - $this->_authorizenetData->getTransactionMessage( - $payment, - self::REQUEST_TYPE_VOID, - $result->getTransactionId(), - $card - ) - ); - } - $exceptionMessage = $this->_wrapGatewayError($result->getResponseReasonText()); - break; - case self::RESPONSE_CODE_DECLINED: - case self::RESPONSE_CODE_ERROR: - if ($result->getResponseReasonCode() == self::RESPONSE_REASON_CODE_NOT_FOUND && - $this->_isTransactionExpired( - $realAuthTransactionId - ) - ) { - $voidTransactionId = $realAuthTransactionId . '-void'; - return $this->_addTransaction( - $payment, - $voidTransactionId, - \Magento\Sales\Model\Order\Payment\Transaction::TYPE_VOID, - [ - 'is_transaction_closed' => 1, - 'should_close_parent_transaction' => 1, - 'parent_transaction_id' => $authTransactionId - ], - [], - $this->_authorizenetData->getTransactionMessage( - $payment, - self::REQUEST_TYPE_VOID, - null, - $card, - false, - false, - __('Parent Authorize.Net transaction (ID %1) expired.', $realAuthTransactionId) - ) - ); - } - $exceptionMessage = $this->_wrapGatewayError($result->getResponseReasonText()); - break; - default: - $exceptionMessage = __('Something went wrong while voiding the payment.'); - break; - } - - $exceptionMessage = $this->_authorizenetData->getTransactionMessage( - $payment, - self::REQUEST_TYPE_VOID, - $realAuthTransactionId, - $card, - false, - $exceptionMessage - ); - throw new \Magento\Framework\Model\Exception($exceptionMessage); - } - - /** - * Check if transaction is expired - * - * @param string $realAuthTransactionId - * @return bool - */ - protected function _isTransactionExpired($realAuthTransactionId) - { - $transactionDetails = $this->_getTransactionDetails($realAuthTransactionId); - return $transactionDetails->getTransactionStatus() == self::TRANSACTION_STATUS_EXPIRED; - } - - /** - * Refund the card transaction through gateway - * - * @param \Magento\Payment\Model\Info $payment - * @param float $amount - * @param \Magento\Framework\Object $card - * @return \Magento\Sales\Model\Order\Payment\Transaction - * @throws \Magento\Framework\Model\Exception - */ - protected function _refundCardTransaction($payment, $amount, $card) - { - /** - * Card has last transaction with type "refund" when all captured amount is refunded. - * Until this moment card has last transaction with type "capture". - */ - $captureTransactionId = $card->getLastTransId(); - $captureTransaction = $payment->getTransaction($captureTransactionId); - $realCaptureTransactionId = $captureTransaction->getAdditionalInformation($this->_realTransactionIdKey); - - $payment->setAnetTransType(self::REQUEST_TYPE_CREDIT); - $payment->setXTransId($realCaptureTransactionId); - $payment->setAmount($amount); - - $request = $this->_buildRequest($payment); - $request->setXCardNum($card->getCcLast4()); - $result = $this->_postRequest($request); - - switch ($result->getResponseCode()) { - case self::RESPONSE_CODE_APPROVED: - if ($result->getResponseReasonCode() == self::RESPONSE_REASON_CODE_APPROVED) { - $refundTransactionId = $result->getTransactionId() . '-refund'; - $shouldCloseCaptureTransaction = 0; - /** - * If it is last amount for refund, transaction with type "capture" will be closed - * and card will has last transaction with type "refund" - */ - if ($this->_formatAmount($card->getCapturedAmount() - $card->getRefundedAmount()) == $amount) { - $card->setLastTransId($refundTransactionId); - $shouldCloseCaptureTransaction = 1; - } - return $this->_addTransaction( - $payment, - $refundTransactionId, - \Magento\Sales\Model\Order\Payment\Transaction::TYPE_REFUND, - [ - 'is_transaction_closed' => 1, - 'should_close_parent_transaction' => $shouldCloseCaptureTransaction, - 'parent_transaction_id' => $captureTransactionId - ], - [$this->_realTransactionIdKey => $result->getTransactionId()], - $this->_authorizenetData->getTransactionMessage( - $payment, - self::REQUEST_TYPE_CREDIT, - $result->getTransactionId(), - $card, - $amount - ) - ); - } - $exceptionMessage = $this->_wrapGatewayError($result->getResponseReasonText()); - break; - case self::RESPONSE_CODE_DECLINED: - case self::RESPONSE_CODE_ERROR: - $exceptionMessage = $this->_wrapGatewayError($result->getResponseReasonText()); - break; - default: - $exceptionMessage = __('Something went wrong while refunding the payment.'); - break; - } - - $exceptionMessage = $this->_authorizenetData->getTransactionMessage( - $payment, - self::REQUEST_TYPE_CREDIT, - $realCaptureTransactionId, - $card, - $amount, - $exceptionMessage - ); - throw new \Magento\Framework\Model\Exception($exceptionMessage); - } - - /** - * Init cards storage model - * - * @param \Magento\Payment\Model\Info $payment - * @return void - */ - protected function _initCardsStorage($payment) - { - $this->_cardsStorage = $this->_cardsFactory->create()->setPayment($payment); - } - - /** - * Return cards storage model - * - * @param \Magento\Payment\Model\Info $payment - * @return \Magento\Authorizenet\Model\Authorizenet\Cards - */ - public function getCardsStorage($payment = null) - { - if (is_null($payment)) { - $payment = $this->getInfoInstance(); - } - if (is_null($this->_cardsStorage)) { - $this->_initCardsStorage($payment); - } - return $this->_cardsStorage; - } - - /** - * If partial authorization is started method will return true - * - * @param \Magento\Payment\Model\Info $payment - * @return bool - */ - public function isPartialAuthorization($payment = null) - { - if (is_null($payment)) { - $payment = $this->getInfoInstance(); - } - return $payment->getAdditionalInformation($this->_splitTenderIdKey); - } - - /** - * Mock capture transaction id in invoice - * - * @param \Magento\Sales\Model\Order\Invoice $invoice - * @param \Magento\Sales\Model\Order\Payment $payment - * @return $this - */ - public function processInvoice($invoice, $payment) - { - $invoice->setTransactionId(1); - return $this; - } - - /** - * Set transaction ID into creditmemo for informational purposes - * @param \Magento\Sales\Model\Order\Creditmemo $creditmemo - * @param \Magento\Sales\Model\Order\Payment $payment - * @return $this - */ - public function processCreditmemo($creditmemo, $payment) - { - $creditmemo->setTransactionId(1); - return $this; - } - - /** - * Fetch transaction details info - * - * Update transaction info if there is one placing transaction only - * - * @param \Magento\Payment\Model\Info $payment - * @param string $transactionId - * @return array - */ - public function fetchTransactionInfo(\Magento\Payment\Model\Info $payment, $transactionId) - { - $cardsStorage = $this->getCardsStorage($payment); - if ($cardsStorage->getCardsCount() != 1) { - return parent::fetchTransactionInfo($payment, $transactionId); - } - $cards = $cardsStorage->getCards(); - $card = array_shift($cards); - $transactionId = $card->getLastTransId(); - $transaction = $payment->getTransaction($transactionId); - - if (!$transaction->getAdditionalInformation($this->_isTransactionFraud)) { - return parent::fetchTransactionInfo($payment, $transactionId); - } - - $response = $this->_getTransactionDetails($transactionId); - if ($response->getResponseCode() == self::RESPONSE_CODE_APPROVED) { - $transaction->setAdditionalInformation($this->_isTransactionFraud, false); - $payment->setIsTransactionApproved(true); - } elseif ($response->getResponseReasonCode() == self::RESPONSE_REASON_CODE_PENDING_REVIEW_DECLINED) { - $payment->setIsTransactionDenied(true); - } - return parent::fetchTransactionInfo($payment, $transactionId); - } - - /** - * Set split_tender_id to quote payment if needed - * - * @param \Magento\Framework\Object $response - * @param float $orderPayment - * @throws \Magento\Payment\Model\Info\Exception - * @return bool - */ - protected function _processPartialAuthorizationResponse($response, $orderPayment) - { - if (!$response->getSplitTenderId()) { - return false; - } - - $quotePayment = $orderPayment->getOrder()->getQuote()->getPayment(); - $this->setPartialAuthorizationLastActionState(self::PARTIAL_AUTH_LAST_DECLINED); - $exceptionMessage = null; - - try { - switch ($response->getResponseCode()) { - case self::RESPONSE_CODE_APPROVED: - $this->_registerCard($response, $orderPayment); - $this->_clearAssignedData($quotePayment); - $this->setPartialAuthorizationLastActionState(self::PARTIAL_AUTH_LAST_SUCCESS); - return true; - case self::RESPONSE_CODE_HELD: - if ($response->getResponseReasonCode() != self::RESPONSE_REASON_CODE_PARTIAL_APPROVE) { - return false; - } - if ($this->getCardsStorage($orderPayment)->getCardsCount() + 1 >= self::PARTIAL_AUTH_CARDS_LIMIT) { - $this->cancelPartialAuthorization($orderPayment); - $this->_clearAssignedData($quotePayment); - $this->setPartialAuthorizationLastActionState(self::PARTIAL_AUTH_CARDS_LIMIT_EXCEEDED); - $quotePayment->setAdditionalInformation($orderPayment->getAdditionalInformation()); - $exceptionMessage = __( - 'You have reached the maximum number of credit cards ' . - 'allowed to be used for the payment.' - ); - break; - } - $orderPayment->setAdditionalInformation($this->_splitTenderIdKey, $response->getSplitTenderId()); - $this->_registerCard($response, $orderPayment); - $this->_clearAssignedData($quotePayment); - $this->setPartialAuthorizationLastActionState(self::PARTIAL_AUTH_LAST_SUCCESS); - $quotePayment->setAdditionalInformation($orderPayment->getAdditionalInformation()); - $exceptionMessage = $this->_wrapGatewayError($response->getResponseReasonText()); - break; - case self::RESPONSE_CODE_DECLINED: - case self::RESPONSE_CODE_ERROR: - $this->setPartialAuthorizationLastActionState(self::PARTIAL_AUTH_LAST_DECLINED); - $quotePayment->setAdditionalInformation($orderPayment->getAdditionalInformation()); - $exceptionMessage = $this->_wrapGatewayError($response->getResponseReasonText()); - break; - default: - $this->setPartialAuthorizationLastActionState(self::PARTIAL_AUTH_LAST_DECLINED); - $quotePayment->setAdditionalInformation($orderPayment->getAdditionalInformation()); - $exceptionMessage = $this->_wrapGatewayError( - __('Something went wrong while authorizing the partial payment.') - ); - } - } catch (\Exception $e) { - $exceptionMessage = $e->getMessage(); - } - - throw new \Magento\Payment\Model\Info\Exception($exceptionMessage); - } - - /** - * Return authorize payment request - * - * @return \Magento\Authorizenet\Model\Authorizenet\Request - */ - protected function _getRequest() - { - $request = $this->_requestFactory->create()->setXVersion( - 3.1 - )->setXDelimData( - 'True' - )->setXRelayResponse( - 'False' - )->setXTestRequest( - $this->getConfigData('test') ? 'TRUE' : 'FALSE' - )->setXLogin( - $this->getConfigData('login') - )->setXTranKey( - $this->getConfigData('trans_key') - ); - - return $request; - } - - /** - * Prepare request to gateway - * - * @param \Magento\Framework\Object|\Magento\Payment\Model\Info $payment - * @return \Magento\Authorizenet\Model\Authorizenet\Request - * @link http://www.authorize.net/support/AIM_guide.pdf - */ - protected function _buildRequest(\Magento\Framework\Object $payment) - { - /** @var \Magento\Sales\Model\Order $order */ - $order = $payment->getOrder(); - - $this->setStore($order->getStoreId()); - - $request = $this->_getRequest()->setXType($payment->getAnetTransType())->setXMethod(self::REQUEST_METHOD_CC); - - if ($order && $order->getIncrementId()) { - $request->setXInvoiceNum($order->getIncrementId()); - } - - if ($payment->getAmount()) { - $request->setXAmount($payment->getAmount(), 2); - $request->setXCurrencyCode($order->getBaseCurrencyCode()); - } - - switch ($payment->getAnetTransType()) { - case self::REQUEST_TYPE_AUTH_CAPTURE: - $request->setXAllowPartialAuth($this->getConfigData('allow_partial_authorization') ? 'True' : 'False'); - if ($payment->getAdditionalInformation($this->_splitTenderIdKey)) { - $request->setXSplitTenderId($payment->getAdditionalInformation($this->_splitTenderIdKey)); - } - break; - case self::REQUEST_TYPE_AUTH_ONLY: - $request->setXAllowPartialAuth($this->getConfigData('allow_partial_authorization') ? 'True' : 'False'); - if ($payment->getAdditionalInformation($this->_splitTenderIdKey)) { - $request->setXSplitTenderId($payment->getAdditionalInformation($this->_splitTenderIdKey)); - } - break; - case self::REQUEST_TYPE_CREDIT: - /** - * Send last 4 digits of credit card number to authorize.net - * otherwise it will give an error - */ - $request->setXCardNum($payment->getCcLast4()); - $request->setXTransId($payment->getXTransId()); - break; - case self::REQUEST_TYPE_VOID: - $request->setXTransId($payment->getXTransId()); - break; - case self::REQUEST_TYPE_PRIOR_AUTH_CAPTURE: - $request->setXTransId($payment->getXTransId()); - break; - case self::REQUEST_TYPE_CAPTURE_ONLY: - $request->setXAuthCode($payment->getCcAuthCode()); - break; - } - - if ($this->getIsCentinelValidationEnabled()) { - $params = $this->getCentinelValidator()->exportCmpiData([]); - $request = \Magento\Framework\Object\Mapper::accumulateByMap($params, $request, $this->_centinelFieldMap); - } - - if (!empty($order)) { - $billing = $order->getBillingAddress(); - if (!empty($billing)) { - $request->setXFirstName( - $billing->getFirstname() - )->setXLastName( - $billing->getLastname() - )->setXCompany( - $billing->getCompany() - )->setXAddress( - $billing->getStreetLine(1) - )->setXCity( - $billing->getCity() - )->setXState( - $billing->getRegion() - )->setXZip( - $billing->getPostcode() - )->setXCountry( - $billing->getCountry() - )->setXPhone( - $billing->getTelephone() - )->setXFax( - $billing->getFax() - )->setXCustId( - $order->getCustomerId() - )->setXCustomerIp( - $order->getRemoteIp() - )->setXCustomerTaxId( - $billing->getTaxId() - )->setXEmail( - $order->getCustomerEmail() - )->setXEmailCustomer( - $this->getConfigData('email_customer') - )->setXMerchantEmail( - $this->getConfigData('merchant_email') - ); - } - - $shipping = $order->getShippingAddress(); - if (!empty($shipping)) { - $request->setXShipToFirstName( - $shipping->getFirstname() - )->setXShipToLastName( - $shipping->getLastname() - )->setXShipToCompany( - $shipping->getCompany() - )->setXShipToAddress( - $shipping->getStreetLine(1) - )->setXShipToCity( - $shipping->getCity() - )->setXShipToState( - $shipping->getRegion() - )->setXShipToZip( - $shipping->getPostcode() - )->setXShipToCountry( - $shipping->getCountry() - ); - } - - $request->setXPoNum( - $payment->getPoNumber() - )->setXTax( - $order->getBaseTaxAmount() - )->setXFreight( - $order->getBaseShippingAmount() - ); - } - - if ($payment->getCcNumber()) { - $request->setXCardNum( - $payment->getCcNumber() - )->setXExpDate( - sprintf('%02d-%04d', $payment->getCcExpMonth(), $payment->getCcExpYear()) - )->setXCardCode( - $payment->getCcCid() - ); - } - - return $request; - } - - /** - * Post request to gateway and return response - * - * @param \Magento\Authorizenet\Model\Authorizenet\Request $request - * @return \Magento\Authorizenet\Model\Authorizenet\Result - * @throws \Magento\Framework\Model\Exception - */ - protected function _postRequest(\Magento\Framework\Object $request) - { - $debugData = ['request' => $request->getData()]; - - $result = $this->_resultFactory->create(); - - $client = new \Magento\Framework\HTTP\ZendClient(); - - $uri = $this->getConfigData('cgi_url'); - $client->setUri($uri ? $uri : self::CGI_URL); - $client->setConfig(['maxredirects' => 0, 'timeout' => 30]); - foreach ($request->getData() as $key => $value) { - $request->setData($key, str_replace(self::RESPONSE_DELIM_CHAR, '', $value)); - } - $request->setXDelimChar(self::RESPONSE_DELIM_CHAR); - - $client->setParameterPost($request->getData()); - $client->setMethod(\Zend_Http_Client::POST); - - try { - $response = $client->request(); - } catch (\Exception $e) { - $result->setResponseCode( - -1 - )->setResponseReasonCode( - $e->getCode() - )->setResponseReasonText( - $e->getMessage() - ); - - $debugData['result'] = $result->getData(); - $this->_debug($debugData); - throw new \Magento\Framework\Model\Exception($this->_wrapGatewayError($e->getMessage())); - } - - $responseBody = $response->getBody(); - - $r = explode(self::RESPONSE_DELIM_CHAR, $responseBody); - - if ($r) { - $result->setResponseCode( - (int)str_replace('"', '', $r[0]) - )->setResponseSubcode( - (int)str_replace('"', '', $r[1]) - )->setResponseReasonCode( - (int)str_replace('"', '', $r[2]) - )->setResponseReasonText( - $r[3] - )->setApprovalCode( - $r[4] - )->setAvsResultCode( - $r[5] - )->setTransactionId( - $r[6] - )->setInvoiceNumber( - $r[7] - )->setDescription( - $r[8] - )->setAmount( - $r[9] - )->setMethod( - $r[10] - )->setTransactionType( - $r[11] - )->setCustomerId( - $r[12] - )->setMd5Hash( - $r[37] - )->setCardCodeResponseCode( - $r[38] - )->setCAVVResponseCode( - isset($r[39]) ? $r[39] : null - )->setSplitTenderId( - $r[52] - )->setAccNumber( - $r[50] - )->setCardType( - $r[51] - )->setRequestedAmount( - $r[53] - )->setBalanceOnCard( - $r[54] - ); - } else { - throw new \Magento\Framework\Model\Exception(__('Something went wrong in the payment gateway.')); - } - - $debugData['result'] = $result->getData(); - $this->_debug($debugData); - - return $result; - } - - /** - * Gateway response wrapper - * - * @param string $text - * @return string - */ - protected function _wrapGatewayError($text) - { - return __('Gateway error: %1', $text); - } - - /** - * It sets card`s data into additional information of payment model - * - * @param \Magento\Framework\Object $response - * @param \Magento\Sales\Model\Order\Payment $payment - * @return string - */ - protected function _registerCard(\Magento\Framework\Object $response, \Magento\Sales\Model\Order\Payment $payment) - { - $cardsStorage = $this->getCardsStorage($payment); - $card = $cardsStorage->registerCard(); - $card->setRequestedAmount( - $response->getRequestedAmount() - )->setBalanceOnCard( - $response->getBalanceOnCard() - )->setLastTransId( - $response->getTransactionId() - )->setProcessedAmount( - $response->getAmount() - )->setCcType( - $payment->getCcType() - )->setCcOwner( - $payment->getCcOwner() - )->setCcLast4( - $payment->getCcLast4() - )->setCcExpMonth( - $payment->getCcExpMonth() - )->setCcExpYear( - $payment->getCcExpYear() - )->setCcSsIssue( - $payment->getCcSsIssue() - )->setCcSsStartMonth( - $payment->getCcSsStartMonth() - )->setCcSsStartYear( - $payment->getCcSsStartYear() - ); - - $cardsStorage->updateCard($card); - $this->_clearAssignedData($payment); - return $card; - } - - /** - * Reset assigned data in payment info model - * - * @param \Magento\Payment\Model\Info $payment - * @return $this - */ - private function _clearAssignedData($payment) - { - $payment->setCcType( - null - )->setCcOwner( - null - )->setCcLast4( - null - )->setCcNumber( - null - )->setCcCid( - null - )->setCcExpMonth( - null - )->setCcExpYear( - null - )->setCcSsIssue( - null - )->setCcSsStartMonth( - null - )->setCcSsStartYear( - null - ); - return $this; - } - - /** - * Add payment transaction - * - * @param \Magento\Sales\Model\Order\Payment $payment - * @param string $transactionId - * @param string $transactionType - * @param array $transactionDetails - * @param array $transactionAdditionalInfo - * @param bool $message - * @return null|\Magento\Sales\Model\Order\Payment\Transaction - */ - protected function _addTransaction( - \Magento\Sales\Model\Order\Payment $payment, - $transactionId, - $transactionType, - array $transactionDetails = [], - array $transactionAdditionalInfo = [], - $message = false - ) { - $payment->setTransactionId($transactionId); - $payment->resetTransactionAdditionalInfo(); - foreach ($transactionDetails as $key => $value) { - $payment->setData($key, $value); - } - foreach ($transactionAdditionalInfo as $key => $value) { - $payment->setTransactionAdditionalInfo($key, $value); - } - $transaction = $payment->addTransaction($transactionType, null, false, $message); - foreach ($transactionDetails as $key => $value) { - $payment->unsetData($key); - } - $payment->unsLastTransId(); - - /** - * It for self using - */ - $transaction->setMessage($message); - - return $transaction; - } - - /** - * Round up and cast specified amount to float or string - * - * @param string|float $amount - * @param bool $asFloat - * @return string|float - */ - protected function _formatAmount($amount, $asFloat = false) - { - $amount = sprintf('%.2F', $amount); - // "f" depends on locale, "F" doesn't - return $asFloat ? (double)$amount : $amount; - } - - /** - * If gateway actions are locked return true - * - * @param \Magento\Payment\Model\Info $payment - * @return bool - */ - protected function _isGatewayActionsLocked($payment) - { - return $payment->getAdditionalInformation($this->_isGatewayActionsLockedKey); - } - - /** - * Process exceptions for gateway action with a lot of transactions - * - * @param \Magento\Payment\Model\Info $payment - * @param string $messages - * @param bool $isSuccessfulTransactions - * @return void - * @throws \Magento\Framework\Model\Exception - */ - protected function _processFailureMultitransactionAction($payment, $messages, $isSuccessfulTransactions) - { - if ($isSuccessfulTransactions) { - $messages[] = __( - 'Gateway actions are locked because the gateway cannot complete ' . - 'one or more of the transactions. ' . - 'Please log in to your Authorize.Net account to manually resolve the issue(s).' - ); - /** - * If there is successful transactions we can not to cancel order but - * have to save information about processed transactions in order`s comments and disable - * opportunity to voiding\capturing\refunding in future. Current order and payment will not be saved because we have to - * load new order object and set information into this object. - */ - $currentOrderId = $payment->getOrder()->getId(); - $copyOrder = $this->_orderFactory->create()->load($currentOrderId); - $copyOrder->getPayment()->setAdditionalInformation($this->_isGatewayActionsLockedKey, 1); - foreach ($messages as $message) { - $copyOrder->addStatusHistoryComment($message); - } - $copyOrder->save(); - } - throw new \Magento\Framework\Model\Exception($this->_authorizenetData->convertMessagesToMessage($messages)); - } - - /** - * Generate checksum for object - * - * @param \Magento\Framework\Object $object - * @param array $checkSumDataKeys - * @return string - */ - protected function _generateChecksum(\Magento\Framework\Object $object, $checkSumDataKeys = []) - { - $data = []; - foreach ($checkSumDataKeys as $dataKey) { - $data[] = $dataKey; - $data[] = $object->getData($dataKey); - } - return md5(implode($data, '_')); - } - - /** - * This function returns full transaction details for a specified transaction ID. - * - * @param string $transactionId - * @return \Magento\Framework\Object - * @throws \Magento\Framework\Model\Exception - * @link http://www.authorize.net/support/ReportingGuide_XML.pdf - * @link http://developer.authorize.net/api/transaction_details/ - */ - protected function _getTransactionDetails($transactionId) - { - $requestBody = sprintf( - '' . - '' . - '%s%s' . - '%s' . - '', - $this->getConfigData('login'), - $this->getConfigData('trans_key'), - $transactionId - ); - - $client = new \Magento\Framework\HTTP\ZendClient(); - $uri = $this->getConfigData('cgi_url_td'); - $client->setUri($uri ? $uri : self::CGI_URL_TD); - $client->setConfig(['timeout' => 45]); - $client->setHeaders(['Content-Type: text/xml']); - $client->setMethod(\Zend_Http_Client::POST); - $client->setRawData($requestBody); - - $debugData = ['request' => $requestBody]; - - try { - $responseBody = $client->request()->getBody(); - $debugData['result'] = $responseBody; - $this->_debug($debugData); - libxml_use_internal_errors(true); - $responseXmlDocument = new \Magento\Framework\Simplexml\Element($responseBody); - libxml_use_internal_errors(false); - } catch (\Exception $e) { - throw new \Magento\Framework\Model\Exception(__('Payment updating error.')); - } - - $response = new \Magento\Framework\Object(); - $response->setResponseCode( - (string)$responseXmlDocument->transaction->responseCode - )->setResponseReasonCode( - (string)$responseXmlDocument->transaction->responseReasonCode - )->setTransactionStatus( - (string)$responseXmlDocument->transaction->transactionStatus - ); - return $response; - } -} diff --git a/app/code/Magento/Authorizenet/Model/Authorizenet/Cards.php b/app/code/Magento/Authorizenet/Model/Authorizenet/Cards.php deleted file mode 100644 index f9344fd2f6efc..0000000000000 --- a/app/code/Magento/Authorizenet/Model/Authorizenet/Cards.php +++ /dev/null @@ -1,210 +0,0 @@ -_payment = $payment; - $this->_initCards(); - return $this; - } - - /** - * Init cards data - * - * @return void - */ - protected function _initCards() - { - $paymentCardsInformation = $this->_payment->getAdditionalInformation(self::CARDS_NAMESPACE); - if ($paymentCardsInformation) { - $additionalInfo = $this->_payment->getAdditionalInformation(); - unset($additionalInfo[self::CARDS_NAMESPACE]); - - foreach ($paymentCardsInformation as $cardId => $data) { - $paymentCardsInformation[$cardId]['additional_information'] = $additionalInfo; - } - - $this->_cards = $paymentCardsInformation; - } - } - - /** - * Add based on $cardInfo card to payment and return Id of new item - * - * @param mixed $cardInfo - * @return string - */ - public function registerCard($cardInfo = []) - { - $this->_isPaymentValid(); - $cardId = md5(microtime(1)); - $cardInfo[self::CARD_ID_KEY] = $cardId; - $this->_cards[$cardId] = $cardInfo; - $this->_payment->setAdditionalInformation(self::CARDS_NAMESPACE, $this->_cards); - return $this->getCard($cardId); - } - - /** - * Save data from card object in cards storage - * - * @param \Magento\Framework\Object $card - * @return $this - */ - public function updateCard($card) - { - $cardId = $card->getData(self::CARD_ID_KEY); - if ($cardId && isset($this->_cards[$cardId])) { - $this->_cards[$cardId] = $card->getData(); - $this->_payment->setAdditionalInformation(self::CARDS_NAMESPACE, $this->_cards); - } - return $this; - } - - /** - * Retrieve card by ID - * - * @param string $cardId - * @return \Magento\Framework\Object|false - */ - public function getCard($cardId) - { - if (isset($this->_cards[$cardId])) { - $card = new \Magento\Framework\Object($this->_cards[$cardId]); - return $card; - } - return false; - } - - /** - * Get all stored cards - * - * @return array - */ - public function getCards() - { - $this->_isPaymentValid(); - $_cards = []; - foreach (array_keys($this->_cards) as $key) { - $_cards[$key] = $this->getCard($key); - } - return $_cards; - } - - /** - * Return count of saved cards - * - * @return int - */ - public function getCardsCount() - { - $this->_isPaymentValid(); - return count($this->_cards); - } - - /** - * Return processed amount for all cards - * - * @return float - */ - public function getProcessedAmount() - { - return $this->_getAmount(self::CARD_PROCESSED_AMOUNT_KEY); - } - - /** - * Return captured amount for all cards - * - * @return float - */ - public function getCapturedAmount() - { - return $this->_getAmount(self::CARD_CAPTURED_AMOUNT_KEY); - } - - /** - * Return refunded amount for all cards - * - * @return float - */ - public function getRefundedAmount() - { - return $this->_getAmount(self::CARD_REFUNDED_AMOUNT_KEY); - } - - /** - * Remove all cards from payment instance - * - * @return $this - */ - public function flushCards() - { - $this->_cards = []; - $this->_payment->setAdditionalInformation(self::CARDS_NAMESPACE, null); - return $this; - } - - /** - * Check for payment instance present - * - * @return void - * @throws \Exception - */ - protected function _isPaymentValid() - { - if (!$this->_payment) { - throw new \Exception('Payment instance is not set'); - } - } - - /** - * Return total for cards data fields - * - * @param string $key - * @return float - */ - public function _getAmount($key) - { - $amount = 0; - foreach ($this->_cards as $card) { - if (isset($card[$key])) { - $amount += $card[$key]; - } - } - return $amount; - } -} diff --git a/app/code/Magento/Authorizenet/Model/Authorizenet/Debug.php b/app/code/Magento/Authorizenet/Model/Authorizenet/Debug.php deleted file mode 100644 index f41cc13c48d6a..0000000000000 --- a/app/code/Magento/Authorizenet/Model/Authorizenet/Debug.php +++ /dev/null @@ -1,34 +0,0 @@ - - */ -class Debug extends \Magento\Framework\Model\AbstractModel -{ - /** - * @return void - */ - protected function _construct() - { - $this->_init('Magento\Authorizenet\Model\Resource\Authorizenet\Debug'); - } -} diff --git a/app/code/Magento/Authorizenet/Model/Authorizenet/Request.php b/app/code/Magento/Authorizenet/Model/Authorizenet/Request.php deleted file mode 100644 index bc2bba74e8dba..0000000000000 --- a/app/code/Magento/Authorizenet/Model/Authorizenet/Request.php +++ /dev/null @@ -1,9 +0,0 @@ - - */ -class Cctype extends \Magento\Payment\Model\Source\Cctype -{ - /** - * @return string[] - */ - public function getAllowedTypes() - { - return ['VI', 'MC', 'AE', 'DI', 'OT']; - } -} diff --git a/app/code/Magento/Authorizenet/Model/Authorizenet/Source/PaymentAction.php b/app/code/Magento/Authorizenet/Model/Authorizenet/Source/PaymentAction.php deleted file mode 100644 index cc25f02fb7ac9..0000000000000 --- a/app/code/Magento/Authorizenet/Model/Authorizenet/Source/PaymentAction.php +++ /dev/null @@ -1,31 +0,0 @@ - - */ -class PaymentAction implements \Magento\Framework\Option\ArrayInterface -{ - /** - * {@inheritdoc} - */ - public function toOptionArray() - { - return [ - [ - 'value' => \Magento\Authorizenet\Model\Authorizenet::ACTION_AUTHORIZE, - 'label' => __('Authorize Only'), - ], - [ - 'value' => \Magento\Authorizenet\Model\Authorizenet::ACTION_AUTHORIZE_CAPTURE, - 'label' => __('Authorize and Capture') - ] - ]; - } -} diff --git a/app/code/Magento/Authorizenet/Model/Directpost.php b/app/code/Magento/Authorizenet/Model/Directpost.php deleted file mode 100644 index 7013687d3e1e6..0000000000000 --- a/app/code/Magento/Authorizenet/Model/Directpost.php +++ /dev/null @@ -1,785 +0,0 @@ -_storeManager = $storeManager; - $this->quoteRepository = $quoteRepository; - $this->_requestFactory = $directRequestFactory; - $this->_response = $response; - $this->_helper = $helper; - $this->orderSender = $orderSender; - } - - /** - * Do not validate payment form using server methods - * - * @return bool - */ - public function validate() - { - return true; - } - - /** - * Send authorize request to gateway - * - * @param \Magento\Framework\Object $payment - * @param float $amount - * @return void - */ - public function authorize(\Magento\Framework\Object $payment, $amount) - { - $payment->setAdditionalInformation('payment_type', $this->getConfigData('payment_action')); - } - - /** - * Send capture request to gateway - * - * @param \Magento\Framework\Object $payment - * @param float $amount - * @return $this - * @throws \Magento\Framework\Model\Exception - */ - public function capture(\Magento\Framework\Object $payment, $amount) - { - if ($amount <= 0) { - throw new \Magento\Framework\Model\Exception(__('Invalid amount for capture.')); - } - - $payment->setAmount($amount); - - if ($payment->getParentTransactionId()) { - $payment->setAnetTransType(self::REQUEST_TYPE_PRIOR_AUTH_CAPTURE); - $payment->setXTransId($this->_getRealParentTransactionId($payment)); - } else { - $payment->setAnetTransType(self::REQUEST_TYPE_AUTH_CAPTURE); - } - - $request = $this->_buildRequest($payment); - $result = $this->_postRequest($request); - - switch ($result->getResponseCode()) { - case self::RESPONSE_CODE_APPROVED: - if ($result->getResponseReasonCode() == self::RESPONSE_REASON_CODE_APPROVED) { - if (!$payment->getParentTransactionId() || - $result->getTransactionId() != $payment->getParentTransactionId() - ) { - $payment->setTransactionId($result->getTransactionId()); - } - $payment->setIsTransactionClosed( - 0 - )->setTransactionAdditionalInfo( - $this->_realTransactionIdKey, - $result->getTransactionId() - ); - return $this; - } - throw new \Magento\Framework\Model\Exception($this->_wrapGatewayError($result->getResponseReasonText())); - case self::RESPONSE_CODE_DECLINED: - case self::RESPONSE_CODE_ERROR: - throw new \Magento\Framework\Model\Exception($this->_wrapGatewayError($result->getResponseReasonText())); - default: - throw new \Magento\Framework\Model\Exception(__('Payment capturing error.')); - } - } - - /** - * Check refund availability - * - * @return bool - */ - public function canRefund() - { - return $this->_canRefund; - } - - /** - * Check void availability - * - * @param \Magento\Framework\Object $payment - * @return bool - */ - public function canVoid(\Magento\Framework\Object $payment) - { - return $this->_canVoid; - } - - /** - * Void the payment through gateway - * - * @param \Magento\Framework\Object $payment - * @return $this - * @throws \Magento\Framework\Model\Exception - */ - public function void(\Magento\Framework\Object $payment) - { - if (!$payment->getParentTransactionId()) { - throw new \Magento\Framework\Model\Exception(__('Invalid transaction ID.')); - } - - $payment->setAnetTransType(self::REQUEST_TYPE_VOID); - $payment->setXTransId($this->_getRealParentTransactionId($payment)); - - $request = $this->_buildRequest($payment); - $result = $this->_postRequest($request); - - switch ($result->getResponseCode()) { - case self::RESPONSE_CODE_APPROVED: - if ($result->getResponseReasonCode() == self::RESPONSE_REASON_CODE_APPROVED) { - if ($result->getTransactionId() != $payment->getParentTransactionId()) { - $payment->setTransactionId($result->getTransactionId()); - } - $payment->setIsTransactionClosed( - 1 - )->setShouldCloseParentTransaction( - 1 - )->setTransactionAdditionalInfo( - $this->_realTransactionIdKey, - $result->getTransactionId() - ); - return $this; - } - throw new \Magento\Framework\Model\Exception($this->_wrapGatewayError($result->getResponseReasonText())); - case self::RESPONSE_CODE_DECLINED: - case self::RESPONSE_CODE_ERROR: - throw new \Magento\Framework\Model\Exception($this->_wrapGatewayError($result->getResponseReasonText())); - default: - throw new \Magento\Framework\Model\Exception(__('Payment voiding error.')); - } - } - - /** - * Set capture transaction ID to invoice for informational purposes - * @param \Magento\Sales\Model\Order\Invoice $invoice - * @param \Magento\Sales\Model\Order\Payment $payment - * @return \Magento\Payment\Model\Method\AbstractMethod - */ - public function processInvoice($invoice, $payment) - { - return \Magento\Payment\Model\Method\AbstractMethod::processInvoice($invoice, $payment); - } - - /** - * Set transaction ID into creditmemo for informational purposes - * @param \Magento\Sales\Model\Order\Creditmemo $creditmemo - * @param \Magento\Sales\Model\Order\Payment $payment - * @return \Magento\Payment\Model\Method\AbstractMethod - */ - public function processCreditmemo($creditmemo, $payment) - { - return \Magento\Payment\Model\Method\AbstractMethod::processCreditmemo($creditmemo, $payment); - } - - /** - * Refund the amount - * Need to decode last 4 digits for request. - * - * @param \Magento\Framework\Object $payment - * @param float $amount - * @return $this - * @throws \Exception - */ - public function refund(\Magento\Framework\Object $payment, $amount) - { - $last4 = $payment->getCcLast4(); - $payment->setCcLast4($payment->decrypt($last4)); - try { - $this->_refund($payment, $amount); - } catch (\Exception $e) { - $payment->setCcLast4($last4); - throw $e; - } - $payment->setCcLast4($last4); - return $this; - } - - /** - * Refund the amount with transaction id - * - * @param \Magento\Framework\Object $payment - * @param float $amount - * @return $this - * @throws \Magento\Framework\Model\Exception - */ - protected function _refund(\Magento\Framework\Object $payment, $amount) - { - if ($amount <= 0) { - throw new \Magento\Framework\Model\Exception(__('Invalid amount for refund.')); - } - - if (!$payment->getParentTransactionId()) { - throw new \Magento\Framework\Model\Exception(__('Invalid transaction ID.')); - } - - $payment->setAnetTransType(self::REQUEST_TYPE_CREDIT); - $payment->setAmount($amount); - $payment->setXTransId($this->_getRealParentTransactionId($payment)); - - $request = $this->_buildRequest($payment); - $result = $this->_postRequest($request); - - switch ($result->getResponseCode()) { - case self::RESPONSE_CODE_APPROVED: - if ($result->getResponseReasonCode() == self::RESPONSE_REASON_CODE_APPROVED) { - if ($result->getTransactionId() != $payment->getParentTransactionId()) { - $payment->setTransactionId($result->getTransactionId()); - } - $shouldCloseCaptureTransaction = $payment->getOrder()->canCreditmemo() ? 0 : 1; - $payment->setIsTransactionClosed( - 1 - )->setShouldCloseParentTransaction( - $shouldCloseCaptureTransaction - )->setTransactionAdditionalInfo( - $this->_realTransactionIdKey, - $result->getTransactionId() - ); - return $this; - } - throw new \Magento\Framework\Model\Exception($this->_wrapGatewayError($result->getResponseReasonText())); - case self::RESPONSE_CODE_DECLINED: - case self::RESPONSE_CODE_ERROR: - throw new \Magento\Framework\Model\Exception($this->_wrapGatewayError($result->getResponseReasonText())); - default: - throw new \Magento\Framework\Model\Exception(__('Payment refunding error.')); - } - } - - /** - * Get CGI url - * - * @return string - */ - public function getCgiUrl() - { - $uri = $this->getConfigData('cgi_url'); - return $uri ? $uri : self::CGI_URL; - } - - /** - * Return URL on which Authorize.net server will return payment result data in hidden request. - * - * @param int $storeId - * @return string - */ - public function getRelayUrl($storeId = null) - { - if ($storeId == null && $this->getStore()) { - $storeId = $this->getStore(); - } - return $this->_helper->getRelyUrl($storeId); - } - - /** - * Return response. - * - * @return \Magento\Authorizenet\Model\Directpost\Response - */ - public function getResponse() - { - return $this->_response; - } - - /** - * Instantiate state and set it to state object - * - * @param string $paymentAction - * @param \Magento\Framework\Object $stateObject - * @return void - */ - public function initialize($paymentAction, $stateObject) - { - switch ($paymentAction) { - case self::ACTION_AUTHORIZE: - case self::ACTION_AUTHORIZE_CAPTURE: - $payment = $this->getInfoInstance(); - $order = $payment->getOrder(); - $order->setCanSendNewEmailFlag(false); - $payment->authorize(true, $order->getBaseTotalDue()); - // base amount will be set inside - $payment->setAmountAuthorized($order->getTotalDue()); - - $order->setState(\Magento\Sales\Model\Order::STATE_PENDING_PAYMENT, 'pending_payment', '', false); - - $stateObject->setState(\Magento\Sales\Model\Order::STATE_PENDING_PAYMENT); - $stateObject->setStatus('pending_payment'); - $stateObject->setIsNotified(false); - break; - default: - break; - } - } - - /** - * Generate request object and fill its fields from Quote or Order object - * - * @param \Magento\Sales\Model\Order $order Quote or order object. - * @return \Magento\Authorizenet\Model\Directpost\Request - */ - public function generateRequestFromOrder(\Magento\Sales\Model\Order $order) - { - $request = $this->_requestFactory->create()->setConstantData( - $this - )->setDataFromOrder( - $order, - $this - )->signRequestData(); - - $this->_debug(['request' => $request->getData()]); - - return $request; - } - - /** - * Fill response with data. - * - * @param array $postData - * @return $this - */ - public function setResponseData(array $postData) - { - $this->getResponse()->setData($postData); - return $this; - } - - /** - * Validate response data. Needed in controllers. - * - * @return bool true in case of validation success. - * @throws \Magento\Framework\Model\Exception In case of validation error - */ - public function validateResponse() - { - $response = $this->getResponse(); - //md5 check - if (!$this->getConfigData( - 'trans_md5' - ) || !$this->getConfigData( - 'login' - ) || !$response->isValidHash( - $this->getConfigData('trans_md5'), - $this->getConfigData('login') - ) - ) { - throw new \Magento\Framework\Model\Exception( - __('The transaction was declined because the response hash validation failed.') - ); - } - return true; - } - - /** - * Operate with order using data from $_POST which came from authorize.net by Relay URL. - * - * @param array $responseData data from Authorize.net from $_POST - * @return void - * @throws \Magento\Framework\Model\Exception In case of validation error or order creation error - */ - public function process(array $responseData) - { - $debugData = ['response' => $responseData]; - $this->_debug($debugData); - - $this->setResponseData($responseData); - - //check MD5 error or others response errors - //throws exception on false. - $this->validateResponse(); - - $response = $this->getResponse(); - //operate with order - $orderIncrementId = $response->getXInvoiceNum(); - $responseText = $this->_wrapGatewayError($response->getXResponseReasonText()); - $isError = false; - if ($orderIncrementId) { - /* @var $order \Magento\Sales\Model\Order */ - $order = $this->_orderFactory->create()->loadByIncrementId($orderIncrementId); - //check payment method - $payment = $order->getPayment(); - if (!$payment || $payment->getMethod() != $this->getCode()) { - throw new \Magento\Framework\Model\Exception( - __('This payment didn\'t work out because we can\'t find this order.') - ); - } - if ($order->getId() && $order->getState() == \Magento\Sales\Model\Order::STATE_PENDING_PAYMENT) { - //operate with order - $this->_authOrder($order); - } else { - $isError = true; - } - } else { - $isError = true; - } - - if ($isError) { - throw new \Magento\Framework\Model\Exception( - $responseText && !$response->isApproved() ? $responseText : __( - 'This payment didn\'t work out because we can\'t find this order.' - ) - ); - } - } - - /** - * Fill payment with credit card data from response from Authorize.net. - * - * @param \Magento\Framework\Object $payment - * @return void - */ - protected function _fillPaymentByResponse(\Magento\Framework\Object $payment) - { - $response = $this->getResponse(); - $payment->setTransactionId( - $response->getXTransId() - )->setParentTransactionId( - null - )->setIsTransactionClosed( - 0 - )->setTransactionAdditionalInfo( - $this->_realTransactionIdKey, - $response->getXTransId() - ); - - if ($response->getXMethod() == self::REQUEST_METHOD_CC) { - $payment->setCcAvsStatus( - $response->getXAvsCode() - )->setCcLast4( - $payment->encrypt(substr($response->getXAccountNumber(), -4)) - ); - } - } - - /** - * Check response code came from Authorize.net. - * - * @return true in case of Approved response - * @throws \Magento\Framework\Model\Exception In case of Declined or Error response from Authorize.net - */ - public function checkResponseCode() - { - switch ($this->getResponse()->getXResponseCode()) { - case self::RESPONSE_CODE_APPROVED: - return true; - case self::RESPONSE_CODE_DECLINED: - case self::RESPONSE_CODE_ERROR: - throw new \Magento\Framework\Model\Exception( - $this->_wrapGatewayError($this->getResponse()->getXResponseReasonText()) - ); - default: - throw new \Magento\Framework\Model\Exception(__('There was a payment authorization error.')); - } - } - - /** - * Check transaction id came from Authorize.net - * - * @return true in case of right transaction id - * @throws \Magento\Framework\Model\Exception In case of bad transaction id. - */ - public function checkTransId() - { - if (!$this->getResponse()->getXTransId()) { - throw new \Magento\Framework\Model\Exception( - __('This payment was not authorized because the transaction ID field is empty.') - ); - } - return true; - } - - /** - * Compare amount with amount from the response from Authorize.net. - * - * @param float $amount - * @return bool - */ - protected function _matchAmount($amount) - { - return sprintf('%.2F', $amount) == sprintf('%.2F', $this->getResponse()->getXAmount()); - } - - /** - * Operate with order using information from Authorize.net. - * Authorize order or authorize and capture it. - * - * @param \Magento\Sales\Model\Order $order - * @return void - * @throws \Magento\Framework\Model\Exception - * @throws \Exception - */ - protected function _authOrder(\Magento\Sales\Model\Order $order) - { - try { - $this->checkResponseCode(); - $this->checkTransId(); - } catch (\Exception $e) { - //decline the order (in case of wrong response code) but don't return money to customer. - $message = $e->getMessage(); - $this->_declineOrder($order, $message, false); - throw $e; - } - - $response = $this->getResponse(); - - //create transaction. need for void if amount will not match. - $payment = $order->getPayment(); - $this->_fillPaymentByResponse($payment); - - $payment->addTransaction(\Magento\Sales\Model\Order\Payment\Transaction::TYPE_AUTH); - - // Set transaction approval message - $message = __( - 'Amount of %1 approved by payment gateway. Transaction ID: "%2".', - $order->getBaseCurrency()->formatTxt($payment->getBaseAmountAuthorized()), - $response->getXTransId() - ); - - $orderState = \Magento\Sales\Model\Order::STATE_PROCESSING; - $orderStatus = $this->getConfigData('order_status'); - if (!$orderStatus || $order->getIsVirtual()) { - $orderStatus = $order->getConfig()->getStateDefaultStatus($orderState); - } - - $order->setState($orderState, $orderStatus ? $orderStatus : true, $message, false)->save(); - - //match amounts. should be equals for authorization. - //decline the order if amount does not match. - if (!$this->_matchAmount($payment->getBaseAmountAuthorized())) { - $message = __( - 'Something went wrong: the paid amount doesn\'t match the order amount. Please correct this and try again.' - ); - $this->_declineOrder($order, $message, true); - throw new \Magento\Framework\Model\Exception($message); - } - - //capture order using AIM if needed - $this->_captureOrder($order); - - try { - if (!$response->hasOrderSendConfirmation() || $response->getOrderSendConfirmation()) { - $this->orderSender->send($order); - } - - $quote = $this->quoteRepository->get($order->getQuoteId())->setIsActive(false); - $this->quoteRepository->save($quote); - } catch (\Exception $e) { - // do not cancel order if we couldn't send email - } - } - - /** - * Register order cancellation. Return money to customer if needed. - * - * @param \Magento\Sales\Model\Order $order - * @param string $message - * @param bool $voidPayment - * @return void - */ - protected function _declineOrder(\Magento\Sales\Model\Order $order, $message = '', $voidPayment = true) - { - try { - $response = $this->getResponse(); - if ($voidPayment && $response->getXTransId() && strtoupper( - $response->getXType() - ) == self::REQUEST_TYPE_AUTH_ONLY - ) { - $order->getPayment()->setTransactionId(null)->setParentTransactionId($response->getXTransId())->void(); - } - $order->registerCancellation($message)->save(); - } catch (\Exception $e) { - //quiet decline - $this->_logger->logException($e); - } - } - - /** - * Capture order's payment using AIM. - * - * @param \Magento\Sales\Model\Order $order - * @return void - */ - protected function _captureOrder(\Magento\Sales\Model\Order $order) - { - $payment = $order->getPayment(); - if ($payment->getAdditionalInformation('payment_type') == self::ACTION_AUTHORIZE_CAPTURE) { - try { - $payment->setTransactionId( - null - )->setParentTransactionId( - $this->getResponse()->getXTransId() - )->capture( - null - ); - - // set status from config for AUTH_AND_CAPTURE orders. - if ($order->getState() == \Magento\Sales\Model\Order::STATE_PROCESSING) { - $orderStatus = $this->getConfigData('order_status'); - if (!$orderStatus || $order->getIsVirtual()) { - $orderStatus = $order->getConfig()->getStateDefaultStatus( - \Magento\Sales\Model\Order::STATE_PROCESSING - ); - } - if ($orderStatus) { - $order->setStatus($orderStatus); - } - } - - $order->save(); - } catch (\Exception $e) { - //if we couldn't capture order, just leave it as NEW order. - $this->_logger->logException($e); - } - } - } - - /** - * Return additional information`s transaction_id value of parent transaction model - * - * @param \Magento\Sales\Model\Order\Payment $payment - * @return string - */ - protected function _getRealParentTransactionId($payment) - { - $transaction = $payment->getTransaction($payment->getParentTransactionId()); - return $transaction->getAdditionalInformation($this->_realTransactionIdKey); - } -} diff --git a/app/code/Magento/Authorizenet/Model/Directpost/Observer.php b/app/code/Magento/Authorizenet/Model/Directpost/Observer.php deleted file mode 100644 index 87152492bed80..0000000000000 --- a/app/code/Magento/Authorizenet/Model/Directpost/Observer.php +++ /dev/null @@ -1,144 +0,0 @@ - - */ -class Observer -{ - /** - * Core registry - * - * @var \Magento\Framework\Registry - */ - protected $_coreRegistry; - - /** - * Core helper - * - * @var \Magento\Core\Helper\Data - */ - protected $_coreData; - - /** - * Authorizenet helper - * - * @var \Magento\Authorizenet\Helper\Data - */ - protected $_authorizenetData; - - /** - * @var \Magento\Authorizenet\Model\Directpost - */ - protected $_payment; - - /** - * @var \Magento\Authorizenet\Model\Directpost\Session - */ - protected $_session; - - /** - * @var \Magento\Store\Model\StoreManagerInterface - */ - protected $_storeManager; - - /** - * @param \Magento\Authorizenet\Helper\Data $authorizenetData - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Framework\Registry $coreRegistry - * @param \Magento\Authorizenet\Model\Directpost $payment - * @param \Magento\Authorizenet\Model\Directpost\Session $session - * @param \Magento\Store\Model\StoreManagerInterface $storeManager - */ - public function __construct( - \Magento\Authorizenet\Helper\Data $authorizenetData, - \Magento\Core\Helper\Data $coreData, - \Magento\Framework\Registry $coreRegistry, - \Magento\Authorizenet\Model\Directpost $payment, - \Magento\Authorizenet\Model\Directpost\Session $session, - \Magento\Store\Model\StoreManagerInterface $storeManager - ) { - $this->_coreRegistry = $coreRegistry; - $this->_authorizenetData = $authorizenetData; - $this->_coreData = $coreData; - $this->_payment = $payment; - $this->_session = $session; - $this->_storeManager = $storeManager; - } - - /** - * Save order into registry to use it in the overloaded controller. - * - * @param \Magento\Framework\Event\Observer $observer - * @return $this - */ - public function saveOrderAfterSubmit(\Magento\Framework\Event\Observer $observer) - { - /* @var $order \Magento\Sales\Model\Order */ - $order = $observer->getEvent()->getData('order'); - $this->_coreRegistry->register('directpost_order', $order, true); - - return $this; - } - - /** - * Set data for response of frontend saveOrder action - * - * @param \Magento\Framework\Event\Observer $observer - * @return $this - */ - public function addAdditionalFieldsToResponseFrontend(\Magento\Framework\Event\Observer $observer) - { - /* @var $order \Magento\Sales\Model\Order */ - $order = $this->_coreRegistry->registry('directpost_order'); - - if ($order && $order->getId()) { - $payment = $order->getPayment(); - if ($payment && $payment->getMethod() == $this->_payment->getCode()) { - /** @var \Magento\Checkout\Controller\Action $controller */ - $controller = $observer->getEvent()->getData('controller_action'); - $request = $controller->getRequest(); - $response = $controller->getResponse(); - $result = $this->_coreData->jsonDecode($response->getBody('default')); - - if (empty($result['error'])) { - $payment = $order->getPayment(); - //if success, then set order to session and add new fields - $this->_session->addCheckoutOrderIncrementId($order->getIncrementId()); - $this->_session->setLastOrderIncrementId($order->getIncrementId()); - $requestToAuthorizenet = $payment->getMethodInstance()->generateRequestFromOrder($order); - $requestToAuthorizenet->setControllerActionName($request->getControllerName()); - $requestToAuthorizenet->setIsSecure((string)$this->_storeManager->getStore()->isCurrentlySecure()); - - $result['directpost'] = ['fields' => $requestToAuthorizenet->getData()]; - - $response->clearHeader('Location'); - $response->representJson($this->_coreData->jsonEncode($result)); - } - } - } - - return $this; - } - - /** - * Update all edit increments for all orders if module is enabled. - * Needed for correct work of edit orders in Admin area. - * - * @param \Magento\Framework\Event\Observer $observer - * @return $this - */ - public function updateAllEditIncrements(\Magento\Framework\Event\Observer $observer) - { - /* @var $order \Magento\Sales\Model\Order */ - $order = $observer->getEvent()->getData('order'); - $this->_authorizenetData->updateOrderEditIncrements($order); - - return $this; - } -} diff --git a/app/code/Magento/Authorizenet/Model/Directpost/Request.php b/app/code/Magento/Authorizenet/Model/Directpost/Request.php deleted file mode 100644 index 3e4141b9c3fd4..0000000000000 --- a/app/code/Magento/Authorizenet/Model/Directpost/Request.php +++ /dev/null @@ -1,203 +0,0 @@ - - */ -class Request extends \Magento\Framework\Object -{ - /** - * @var string - */ - protected $_transKey = null; - - /** - * Return merchant transaction key. - * Needed to generate sign. - * - * @return string - */ - protected function _getTransactionKey() - { - return $this->_transKey; - } - - /** - * Set merchant transaction key. - * Needed to generate sign. - * - * @param string $transKey - * @return $this - */ - protected function _setTransactionKey($transKey) - { - $this->_transKey = $transKey; - return $this; - } - - /** - * Generates the fingerprint for request. - * - * @param string $merchantApiLoginId - * @param string $merchantTransactionKey - * @param string $amount - * @param string $currencyCode - * @param string $fpSequence An invoice number or random number. - * @param string $fpTimestamp - * @return string The fingerprint. - */ - public function generateRequestSign( - $merchantApiLoginId, - $merchantTransactionKey, - $amount, - $currencyCode, - $fpSequence, - $fpTimestamp - ) { - return hash_hmac( - "md5", - $merchantApiLoginId . "^" . $fpSequence . "^" . $fpTimestamp . "^" . $amount . "^" . $currencyCode, - $merchantTransactionKey - ); - } - - /** - * Set Authorizenet data to request. - * - * @param \Magento\Authorizenet\Model\Directpost $paymentMethod - * @return $this - */ - public function setConstantData(\Magento\Authorizenet\Model\Directpost $paymentMethod) - { - $this->setXVersion('3.1')->setXDelimData('FALSE')->setXRelayResponse('TRUE'); - - $this->setXTestRequest($paymentMethod->getConfigData('test') ? 'TRUE' : 'FALSE'); - - $this->setXLogin( - $paymentMethod->getConfigData('login') - )->setXType( - 'AUTH_ONLY' - )->setXMethod( - \Magento\Authorizenet\Model\Authorizenet::REQUEST_METHOD_CC - )->setXRelayUrl( - $paymentMethod->getRelayUrl() - ); - - $this->_setTransactionKey($paymentMethod->getConfigData('trans_key')); - return $this; - } - - /** - * Set entity data to request - * - * @param \Magento\Sales\Model\Order $order - * @param \Magento\Authorizenet\Model\Directpost $paymentMethod - * @return $this - */ - public function setDataFromOrder( - \Magento\Sales\Model\Order $order, - \Magento\Authorizenet\Model\Directpost $paymentMethod - ) { - $payment = $order->getPayment(); - - $this->setXFpSequence($order->getQuoteId()); - $this->setXInvoiceNum($order->getIncrementId()); - $this->setXAmount($payment->getBaseAmountAuthorized()); - $this->setXCurrencyCode($order->getBaseCurrencyCode()); - $this->setXTax( - sprintf('%.2F', $order->getBaseTaxAmount()) - )->setXFreight( - sprintf('%.2F', $order->getBaseShippingAmount()) - ); - - //need to use strval() because NULL values IE6-8 decodes as "null" in JSON in JavaScript, but we need "" for null values. - $billing = $order->getBillingAddress(); - if (!empty($billing)) { - $this->setXFirstName( - strval($billing->getFirstname()) - )->setXLastName( - strval($billing->getLastname()) - )->setXCompany( - strval($billing->getCompany()) - )->setXAddress( - strval($billing->getStreetLine(1)) - )->setXCity( - strval($billing->getCity()) - )->setXState( - strval($billing->getRegion()) - )->setXZip( - strval($billing->getPostcode()) - )->setXCountry( - strval($billing->getCountry()) - )->setXPhone( - strval($billing->getTelephone()) - )->setXFax( - strval($billing->getFax()) - )->setXCustId( - strval($billing->getCustomerId()) - )->setXCustomerIp( - strval($order->getRemoteIp()) - )->setXCustomerTaxId( - strval($billing->getTaxId()) - )->setXEmail( - strval($order->getCustomerEmail()) - )->setXEmailCustomer( - strval($paymentMethod->getConfigData('email_customer')) - )->setXMerchantEmail( - strval($paymentMethod->getConfigData('merchant_email')) - ); - } - - $shipping = $order->getShippingAddress(); - if (!empty($shipping)) { - $this->setXShipToFirstName( - strval($shipping->getFirstname()) - )->setXShipToLastName( - strval($shipping->getLastname()) - )->setXShipToCompany( - strval($shipping->getCompany()) - )->setXShipToAddress( - strval($shipping->getStreetLine(1)) - )->setXShipToCity( - strval($shipping->getCity()) - )->setXShipToState( - strval($shipping->getRegion()) - )->setXShipToZip( - strval($shipping->getPostcode()) - )->setXShipToCountry( - strval($shipping->getCountry()) - ); - } - - $this->setXPoNum(strval($payment->getPoNumber())); - - return $this; - } - - /** - * Set sign hash into the request object. - * All needed fields should be placed in the object fist. - * - * @return $this - */ - public function signRequestData() - { - $fpTimestamp = time(); - $hash = $this->generateRequestSign( - $this->getXLogin(), - $this->_getTransactionKey(), - $this->getXAmount(), - $this->getXCurrencyCode(), - $this->getXFpSequence(), - $fpTimestamp - ); - $this->setXFpTimestamp($fpTimestamp); - $this->setXFpHash($hash); - return $this; - } -} diff --git a/app/code/Magento/Authorizenet/Model/Directpost/Response.php b/app/code/Magento/Authorizenet/Model/Directpost/Response.php deleted file mode 100644 index c9816a5f7d621..0000000000000 --- a/app/code/Magento/Authorizenet/Model/Directpost/Response.php +++ /dev/null @@ -1,60 +0,0 @@ - - */ -namespace Magento\Authorizenet\Model\Directpost; - -class Response extends \Magento\Framework\Object -{ - /** - * Generates an Md5 hash to compare against AuthNet's. - * - * @param string $merchantMd5 - * @param string $merchantApiLogin - * @param string $amount - * @param string $transactionId - * @return string - */ - public function generateHash($merchantMd5, $merchantApiLogin, $amount, $transactionId) - { - if (!$amount) { - $amount = '0.00'; - } - return strtoupper(md5($merchantMd5 . $merchantApiLogin . $transactionId . $amount)); - } - - /** - * Return if is valid order id. - * - * @param string $merchantMd5 - * @param string $merchantApiLogin - * @return bool - */ - public function isValidHash($merchantMd5, $merchantApiLogin) - { - return $this->generateHash( - $merchantMd5, - $merchantApiLogin, - $this->getXAmount(), - $this->getXTransId() - ) == $this->getData( - 'x_MD5_Hash' - ); - } - - /** - * Return if this is approved response from Authorize.net auth request. - * - * @return bool - */ - public function isApproved() - { - return $this->getXResponseCode() == \Magento\Authorizenet\Model\Directpost::RESPONSE_CODE_APPROVED; - } -} diff --git a/app/code/Magento/Authorizenet/Model/Directpost/Session.php b/app/code/Magento/Authorizenet/Model/Directpost/Session.php deleted file mode 100644 index 3670a01ccecce..0000000000000 --- a/app/code/Magento/Authorizenet/Model/Directpost/Session.php +++ /dev/null @@ -1,96 +0,0 @@ -start(); - } - - /** - * Add order IncrementId to session - * - * @param string $orderIncrementId - * @return void - */ - public function addCheckoutOrderIncrementId($orderIncrementId) - { - $orderIncIds = $this->getDirectPostOrderIncrementIds(); - if (!$orderIncIds) { - $orderIncIds = []; - } - $orderIncIds[$orderIncrementId] = 1; - $this->setDirectPostOrderIncrementIds($orderIncIds); - } - - /** - * Remove order IncrementId from session - * - * @param string $orderIncrementId - * @return void - */ - public function removeCheckoutOrderIncrementId($orderIncrementId) - { - $orderIncIds = $this->getDirectPostOrderIncrementIds(); - - if (!is_array($orderIncIds)) { - return; - } - - if (isset($orderIncIds[$orderIncrementId])) { - unset($orderIncIds[$orderIncrementId]); - } - $this->setDirectPostOrderIncrementIds($orderIncIds); - } - - /** - * Return if order incrementId is in session. - * - * @param string $orderIncrementId - * @return bool - */ - public function isCheckoutOrderIncrementIdExist($orderIncrementId) - { - $orderIncIds = $this->getDirectPostOrderIncrementIds(); - if (is_array($orderIncIds) && isset($orderIncIds[$orderIncrementId])) { - return true; - } - return false; - } -} diff --git a/app/code/Magento/Authorizenet/Model/Resource/Authorizenet/Debug.php b/app/code/Magento/Authorizenet/Model/Resource/Authorizenet/Debug.php deleted file mode 100644 index 86bc8d1ff7f43..0000000000000 --- a/app/code/Magento/Authorizenet/Model/Resource/Authorizenet/Debug.php +++ /dev/null @@ -1,23 +0,0 @@ - - */ -class Debug extends \Magento\Framework\Model\Resource\Db\AbstractDb -{ - /** - * Resource initialization - * - * @return void - */ - protected function _construct() - { - $this->_init('authorizenet_debug', 'debug_id'); - } -} diff --git a/app/code/Magento/Authorizenet/Model/Resource/Authorizenet/Debug/Collection.php b/app/code/Magento/Authorizenet/Model/Resource/Authorizenet/Debug/Collection.php deleted file mode 100644 index 0f617d3121fe9..0000000000000 --- a/app/code/Magento/Authorizenet/Model/Resource/Authorizenet/Debug/Collection.php +++ /dev/null @@ -1,26 +0,0 @@ - - */ -class Collection extends \Magento\Framework\Model\Resource\Db\Collection\AbstractCollection -{ - /** - * Resource initialization - * - * @return void - */ - protected function _construct() - { - $this->_init( - 'Magento\Authorizenet\Model\Authorizenet\Debug', - 'Magento\Authorizenet\Model\Resource\Authorizenet\Debug' - ); - } -} diff --git a/app/code/Magento/Authorizenet/README.md b/app/code/Magento/Authorizenet/README.md deleted file mode 100644 index 380161d8b264e..0000000000000 --- a/app/code/Magento/Authorizenet/README.md +++ /dev/null @@ -1 +0,0 @@ -The Magento_Authorizenet module implements the integration with the Authorize.Net payment gateway and makes the latter available as a payment method in Magento. diff --git a/app/code/Magento/Authorizenet/composer.json b/app/code/Magento/Authorizenet/composer.json deleted file mode 100644 index afb76898e10a7..0000000000000 --- a/app/code/Magento/Authorizenet/composer.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "name": "magento/module-authorizenet", - "description": "N/A", - "require": { - "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha108", - "magento/module-sales": "0.1.0-alpha108", - "magento/module-checkout": "0.1.0-alpha108", - "magento/module-backend": "0.1.0-alpha108", - "magento/module-core": "0.1.0-alpha108", - "magento/module-payment": "0.1.0-alpha108", - "magento/module-centinel": "0.1.0-alpha108", - "magento/module-catalog": "0.1.0-alpha108", - "magento/framework": "0.1.0-alpha108", - "magento/magento-composer-installer": "*" - }, - "type": "magento2-module", - "version": "0.1.0-alpha108", - "license": [ - "OSL-3.0", - "AFL-3.0" - ], - "extra": { - "map": [ - [ - "*", - "Magento/Authorizenet" - ] - ] - } -} diff --git a/app/code/Magento/Authorizenet/etc/adminhtml/di.xml b/app/code/Magento/Authorizenet/etc/adminhtml/di.xml deleted file mode 100644 index cfeb1a3d89af2..0000000000000 --- a/app/code/Magento/Authorizenet/etc/adminhtml/di.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - Magento\Backend\Model\Session\Quote - - - - - Magento\Backend\Model\Session\Quote - - - diff --git a/app/code/Magento/Authorizenet/etc/adminhtml/events.xml b/app/code/Magento/Authorizenet/etc/adminhtml/events.xml deleted file mode 100644 index dd2bb9d10453b..0000000000000 --- a/app/code/Magento/Authorizenet/etc/adminhtml/events.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - diff --git a/app/code/Magento/Authorizenet/etc/adminhtml/routes.xml b/app/code/Magento/Authorizenet/etc/adminhtml/routes.xml deleted file mode 100644 index abcce41592cf0..0000000000000 --- a/app/code/Magento/Authorizenet/etc/adminhtml/routes.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - diff --git a/app/code/Magento/Authorizenet/etc/adminhtml/system.xml b/app/code/Magento/Authorizenet/etc/adminhtml/system.xml deleted file mode 100644 index d12f96685551d..0000000000000 --- a/app/code/Magento/Authorizenet/etc/adminhtml/system.xml +++ /dev/null @@ -1,197 +0,0 @@ - - - - -
- - - - Click here to sign up for an Authorize.net account]]> - - - - Magento\Backend\Model\Config\Source\Yesno - - - - Magento\Authorizenet\Model\Authorizenet\Source\Cctype - - - - Magento\Backend\Model\Config\Source\Yesno - - - - Magento\Backend\Model\Config\Source\Yesno - - - - Magento\Backend\Model\Config\Backend\Encrypted - - - - validate-email - - - - Magento\Sales\Model\Config\Source\Order\Status\Processing - - - - - - - Magento\Backend\Model\Config\Source\Yesno - - - - Magento\Backend\Model\Config\Source\Yesno - - - - - - - Magento\Backend\Model\Config\Backend\Encrypted - - - - Magento\Authorizenet\Model\Authorizenet\Source\PaymentAction - - - - - - - Magento\Backend\Model\Config\Source\Locale\Currency - - - - Magento\Payment\Model\Config\Source\Allspecificcountries - - - - Magento\Directory\Model\Config\Source\Country - - - - - - - - - - Magento\Backend\Model\Config\Source\Yesno - - - - Magento\Backend\Block\System\Config\Form\Field\Heading - - - - Magento\Backend\Model\Config\Source\Yesno - - - - Severe Validation Removes Chargeback Liability on Merchant - Magento\Backend\Model\Config\Source\Yesno - - 1 - - - - - If you leave this empty, we'll use a default value. The custom URL may be provided by CardinalCommerce agreement. - Magento\Backend\Model\Config\Source\Yesno - - 1 - - - - - - - - - Magento\Backend\Model\Config\Source\Yesno - - - - Magento\Authorizenet\Model\Authorizenet\Source\PaymentAction - - - - - - - Magento\Backend\Model\Config\Backend\Encrypted - - - - Magento\Backend\Model\Config\Backend\Encrypted - - - - Magento\Backend\Model\Config\Backend\Encrypted - - - - Magento\Sales\Model\Config\Source\Order\Status\Processing - - - - Magento\Backend\Model\Config\Source\Yesno - - - - - - - Magento\Backend\Model\Config\Source\Locale\Currency - - - - Magento\Backend\Model\Config\Source\Yesno - - - - Magento\Backend\Model\Config\Source\Yesno - - - - validate-email - - - - Magento\Authorizenet\Model\Authorizenet\Source\Cctype - - - - Magento\Backend\Model\Config\Source\Yesno - - - - Magento\Payment\Model\Config\Source\Allspecificcountries - - - - Magento\Directory\Model\Config\Source\Country - - - - - - - - - - validate-number - - -
-
-
diff --git a/app/code/Magento/Authorizenet/etc/config.xml b/app/code/Magento/Authorizenet/etc/config.xml deleted file mode 100644 index 20c757b0c6892..0000000000000 --- a/app/code/Magento/Authorizenet/etc/config.xml +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - - 0 - AE,VI,MC,DI - https://secure.authorize.net/gateway/transact.dll - 0 - 0 - - - Magento\Authorizenet\Model\Authorizenet - processing - authorize - 1 - Credit Card (Authorize.net) - - 0 - USD - 1 - - - 0 - AE,VI,MC,DI - https://secure.authorize.net/gateway/transact.dll - 0 - 0 - - - Magento\Authorizenet\Model\Directpost - processing - authorize - 1 - Credit Card Direct Post (Authorize.net) - - - 0 - USD - 1 - - - - diff --git a/app/code/Magento/Authorizenet/etc/di.xml b/app/code/Magento/Authorizenet/etc/di.xml deleted file mode 100644 index 430e01675a298..0000000000000 --- a/app/code/Magento/Authorizenet/etc/di.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - Magento\Authorizenet\Helper\Data\Proxy - Magento\Core\Helper\Data\Proxy - - - - - authorizenet_directpost - - - - - Magento\Authorizenet\Model\Directpost\Session\Storage - - - diff --git a/app/code/Magento/Authorizenet/etc/frontend/di.xml b/app/code/Magento/Authorizenet/etc/frontend/di.xml deleted file mode 100644 index a678e17093305..0000000000000 --- a/app/code/Magento/Authorizenet/etc/frontend/di.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - Magento\Checkout\Model\Session - - - - - - /authorizenet/payment - - - - - - Magento\Checkout\Model\Session - - - diff --git a/app/code/Magento/Authorizenet/etc/frontend/events.xml b/app/code/Magento/Authorizenet/etc/frontend/events.xml deleted file mode 100644 index 8f342fcb03091..0000000000000 --- a/app/code/Magento/Authorizenet/etc/frontend/events.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - diff --git a/app/code/Magento/Authorizenet/etc/frontend/page_types.xml b/app/code/Magento/Authorizenet/etc/frontend/page_types.xml deleted file mode 100644 index bbbca28bf1a04..0000000000000 --- a/app/code/Magento/Authorizenet/etc/frontend/page_types.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - diff --git a/app/code/Magento/Authorizenet/etc/frontend/routes.xml b/app/code/Magento/Authorizenet/etc/frontend/routes.xml deleted file mode 100644 index 2ad14e6eeb4c1..0000000000000 --- a/app/code/Magento/Authorizenet/etc/frontend/routes.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/app/code/Magento/Authorizenet/etc/module.xml b/app/code/Magento/Authorizenet/etc/module.xml deleted file mode 100644 index 2d2c43300da8a..0000000000000 --- a/app/code/Magento/Authorizenet/etc/module.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - diff --git a/app/code/Magento/Authorizenet/etc/payment.xml b/app/code/Magento/Authorizenet/etc/payment.xml deleted file mode 100644 index b1312b86da5b4..0000000000000 --- a/app/code/Magento/Authorizenet/etc/payment.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - 1 - 1 - - - diff --git a/app/code/Magento/Authorizenet/etc/webapi_rest/di.xml b/app/code/Magento/Authorizenet/etc/webapi_rest/di.xml deleted file mode 100644 index e8737087e09b7..0000000000000 --- a/app/code/Magento/Authorizenet/etc/webapi_rest/di.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - diff --git a/app/code/Magento/Authorizenet/etc/webapi_soap/di.xml b/app/code/Magento/Authorizenet/etc/webapi_soap/di.xml deleted file mode 100644 index e8737087e09b7..0000000000000 --- a/app/code/Magento/Authorizenet/etc/webapi_soap/di.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - diff --git a/app/code/Magento/Authorizenet/i18n/de_DE.csv b/app/code/Magento/Authorizenet/i18n/de_DE.csv deleted file mode 100644 index 93426979dd339..0000000000000 --- a/app/code/Magento/Authorizenet/i18n/de_DE.csv +++ /dev/null @@ -1,101 +0,0 @@ -Cancel,Abbrechen -"You don't have enough on your credit card to pay for this purchase. To complete your purchase, click ""OK"" and add a credit card to use for the balance. Otherwise, you can cancel the purchase and release the partial payment we are holding.","You don't have enough on your credit card to pay for this purchase. To complete your purchase, click ""OK"" and add a credit card to use for the balance. Otherwise, you can cancel the purchase and release the partial payment we are holding." -"Your credit card has been declined. You can click OK to add another credit card to complete your purchase. Or you can cancel this credit transaction and pay a different way.","Your credit card has been declined. You can click OK to add another credit card to complete your purchase. Or you can cancel this credit transaction and pay a different way." -"We canceled your payment and released any money we were holding.","We canceled your payment and released any money we were holding." -"You can't use any more credit cards for this payment, and you don't have enough to pay for this purchase. Sorry, but we'll have to cancel your transaction.","You can't use any more credit cards for this payment, and you don't have enough to pay for this purchase. Sorry, but we'll have to cancel your transaction." -"Your order has not been placed, because the contents of the shopping cart and/or your address has been changed. Authorized amounts from your previous payment that were left pending are now released. Please go through the checkout process to purchase your cart contents.","Your order has not been placed, because the contents of the shopping cart and/or your address has been changed. Authorized amounts from your previous payment that were left pending are now released. Please go through the checkout process to purchase your cart contents." -"Are you sure you want to cancel your payment? Click OK to cancel your payment and release the amount on hold. Click Cancel to enter another credit card and continue with your payment.","Sind Sie sicher, dass Sie die Zahlung abbrechen möchten? Klicken Sie auf OK, um Ihre Zahlung abzubrechen und den Betrag wieder frei verfügbar zu machen. Klicken Sie auf Abbrechen, um eine andere Kreditkarte anzugeben und mit der Zahlung fortzufahren." -"Processed Amount","Bearbeiteter Betrag" -"Remaining Balance","Verbleibender Betrag" -"Order saving error: %1","Order saving error: %1" -"Please choose a payment method.","Please choose a payment method." -"You created the order.","You created the order." -"Something went wrong canceling the transactions.","Something went wrong canceling the transactions." -"There was an error canceling transactions. Please contact us or try again later.","Es ist ein Fehler beim Abbruch der Transaktion aufgetreten. Bitte kontaktieren Sie uns oder probieren Sie es später noch einmal." -"We couldn't process your order right now. Please try again later.","We couldn't process your order right now. Please try again later." -"amount %1","amount %1" -failed,fehlgeschlagen -successful,erfolgreich -"Credit Card: xxxx-%1","Credit Card: xxxx-%1" -"Authorize.Net Transaction ID %1","Authorize.Net Transaction ID %1" -authorize,Autorisieren -"authorize and capture","Autorisieren und Erfassen" -capture,Erfassen -refund,Rückerstattung -void,ungültig -"This is an invalid amount for authorization.","This is an invalid amount for authorization." -"This is an invalid amount for capture.","This is an invalid amount for capture." -"This is an invalid amount for refund.","This is an invalid amount for refund." -"This is an invalid split tenderId ID.","This is an invalid split tenderId ID." -"Something went wrong while canceling the payment.","Something went wrong while canceling the payment." -"Something went wrong while authorizing the payment.","Something went wrong while authorizing the payment." -"Something went wrong while capturing the payment.","Something went wrong while capturing the payment." -"The shopping cart contents and/or address has been changed.","The shopping cart contents and/or address has been changed." -"This is an invalid amount for partial authorization.","This is an invalid amount for partial authorization." -"Parent Authorize.Net transaction (ID %1) expired","Parent Authorize.Net transaction (ID %1) expired" -"Something went wrong while voiding the payment.","Something went wrong while voiding the payment." -"Something went wrong while refunding the payment.","Something went wrong while refunding the payment." -"You have reached the maximum number of credit cards ' 'allowed to be used for the payment.","You have reached the maximum number of credit cards ' 'allowed to be used for the payment." -"Something went wrong while authorizing the partial payment.","Something went wrong while authorizing the partial payment." -"Something went wrong in the payment gateway.","Something went wrong in the payment gateway." -"Gateway error: %1","Gateway error: %1" -"Gateway actions are locked because the gateway cannot complete ' 'one or more of the transactions. ' 'Please log in to your Authorize.Net account to manually resolve the issue(s).","Gateway actions are locked because the gateway cannot complete ' 'one or more of the transactions. ' 'Please log in to your Authorize.Net account to manually resolve the issue(s)." -"Payment updating error.","Fehler beim Zahlungsupdate." -"Authorize Only","Nur genehmigen" -"Authorize and Capture","Genehmigen und erfassen" -"Invalid amount for capture.","Ungültiger Betrag für die Erfassung." -"Payment capturing error.","Fehler bei Zahlungserfassung." -"Invalid transaction ID.","Invalid transaction ID." -"Payment voiding error.","Fehler beim Stornieren der Zahlung." -"Invalid amount for refund.","Ungültiger Betrag für eine Rückerstattung." -"Payment refunding error.","Fehler bei der Rückerstattung." -"The transaction was declined because the response hash validation failed.","The transaction was declined because the response hash validation failed." -"This payment didn't work out because we can't find this order.","This payment didn't work out because we can't find this order." -"There was a payment authorization error.","There was a payment authorization error." -"This payment was not authorized because the transaction ID field is empty.","This payment was not authorized because the transaction ID field is empty." -"Amount of %1 approved by payment gateway. Transaction ID: ""%2"".","Amount of %1 approved by payment gateway. Transaction ID: ""%2""." -"Something went wrong: the paid amount doesn't match the order amount. Please correct this and try again.","Something went wrong: the paid amount doesn't match the order amount. Please correct this and try again." -"Credit Card Type",Kreditkartentyp -"Credit Card Number",Kreditkartennummer -"Expiration Date",Ablaufdatum -"Card Verification Number",Kreditkartenprüfnummer -"Click ""Cancel"" to remove any pending status and release money already processed during this payment.","Click ""Cancel"" to remove any pending status and release money already processed during this payment." -"Please enter a different credit card number to complete your purchase.","Please enter a different credit card number to complete your purchase." -"Credit Card %1","Credit Card %1" -"Credit Card Information",Kreditkarteninformationen -"--Please Select--","--Bitte wählen--" -"Card Verification Number Visual Reference","Kartenprüfnummer Sichtmerkmale" -"What is this?","Was ist das?" -"You'll be asked for your payment details before placing an order.","You'll be asked for your payment details before placing an order." -"To cancel pending authorizations and release amounts that have already been processed during this payment, click Cancel.","To cancel pending authorizations and release amounts that have already been processed during this payment, click Cancel." -Processing...,Processing... -Enabled,Enabled -"Sort Order","Sort Order" -Title,Title -"3D Secure Card Validation","3D Secure Card Validation" -"New Order Status","New Order Status" -"No confirmation","No confirmation" -Authorize.net,Authorize.net -"Credit Card Types","Credit Card Types" -"Credit Card Verification","Credit Card Verification" -"Email Customer","Email Customer" -"API Login ID","API Login ID" -"Merchant's Email","Merchant's Email" -"Test Mode","Test Mode" -Debug,Debug -"Transaction Key","Transaction Key" -"Payment Action","Payment Action" -"Accepted Currency","Accepted Currency" -"Payment from Applicable Countries","Payment from Applicable Countries" -"Payment from Specific Countries","Payment from Specific Countries" -"Minimum Order Total","Minimum Order Total" -"Maximum Order Total","Maximum Order Total" -"Allow Partial Authorization","Allow Partial Authorization" -"3D Secure","3D Secure" -"Severe 3D Secure Card Validation","Severe 3D Secure Card Validation" -"Severe Validation Removes Chargeback Liability on Merchant","Severe Validation Removes Chargeback Liability on Merchant" -"Centinel API URL","Centinel API URL" -"If you leave this empty, we'll use a default value. The custom URL may be provided by CardinalCommerce agreement.","If you leave this empty, we'll use a default value. The custom URL may be provided by CardinalCommerce agreement." -"Authorize.net Direct Post","Authorize.net Direct Post" -"Merchant MD5","Merchant MD5" -"Gateway URL","Gateway URL" diff --git a/app/code/Magento/Authorizenet/i18n/en_US.csv b/app/code/Magento/Authorizenet/i18n/en_US.csv deleted file mode 100644 index 3b3f69fda4462..0000000000000 --- a/app/code/Magento/Authorizenet/i18n/en_US.csv +++ /dev/null @@ -1,101 +0,0 @@ -Cancel,Cancel -"You don't have enough on your credit card to pay for this purchase. To complete your purchase, click ""OK"" and add a credit card to use for the balance. Otherwise, you can cancel the purchase and release the partial payment we are holding.","You don't have enough on your credit card to pay for this purchase. To complete your purchase, click ""OK"" and add a credit card to use for the balance. Otherwise, you can cancel the purchase and release the partial payment we are holding." -"Your credit card has been declined. You can click OK to add another credit card to complete your purchase. Or you can cancel this credit transaction and pay a different way.","Your credit card has been declined. You can click OK to add another credit card to complete your purchase. Or you can cancel this credit transaction and pay a different way." -"We canceled your payment and released any money we were holding.","We canceled your payment and released any money we were holding." -"You can't use any more credit cards for this payment, and you don't have enough to pay for this purchase. Sorry, but we'll have to cancel your transaction.","You can't use any more credit cards for this payment, and you don't have enough to pay for this purchase. Sorry, but we'll have to cancel your transaction." -"Your order has not been placed, because the contents of the shopping cart and/or your address has been changed. Authorized amounts from your previous payment that were left pending are now released. Please go through the checkout process to purchase your cart contents.","Your order has not been placed, because the contents of the shopping cart and/or your address has been changed. Authorized amounts from your previous payment that were left pending are now released. Please go through the checkout process to purchase your cart contents." -"Are you sure you want to cancel your payment? Click OK to cancel your payment and release the amount on hold. Click Cancel to enter another credit card and continue with your payment.","Are you sure you want to cancel your payment? Click OK to cancel your payment and release the amount on hold. Click Cancel to enter another credit card and continue with your payment." -"Processed Amount","Processed Amount" -"Remaining Balance","Remaining Balance" -"Order saving error: %1","Order saving error: %1" -"Please choose a payment method.","Please choose a payment method." -"You created the order.","You created the order." -"Something went wrong canceling the transactions.","Something went wrong canceling the transactions." -"There was an error canceling transactions. Please contact us or try again later.","There was an error canceling transactions. Please contact us or try again later." -"We couldn't process your order right now. Please try again later.","We couldn't process your order right now. Please try again later." -"amount %1","amount %1" -failed,failed -successful,successful -"Credit Card: xxxx-%1","Credit Card: xxxx-%1" -"Authorize.Net Transaction ID %1","Authorize.Net Transaction ID %1" -authorize,authorize -"authorize and capture","authorize and capture" -capture,capture -refund,refund -void,void -"This is an invalid amount for authorization.","This is an invalid amount for authorization." -"This is an invalid amount for capture.","This is an invalid amount for capture." -"This is an invalid amount for refund.","This is an invalid amount for refund." -"This is an invalid split tenderId ID.","This is an invalid split tenderId ID." -"Something went wrong while canceling the payment.","Something went wrong while canceling the payment." -"Something went wrong while authorizing the payment.","Something went wrong while authorizing the payment." -"Something went wrong while capturing the payment.","Something went wrong while capturing the payment." -"The shopping cart contents and/or address has been changed.","The shopping cart contents and/or address has been changed." -"This is an invalid amount for partial authorization.","This is an invalid amount for partial authorization." -"Parent Authorize.Net transaction (ID %1) expired","Parent Authorize.Net transaction (ID %1) expired" -"Something went wrong while voiding the payment.","Something went wrong while voiding the payment." -"Something went wrong while refunding the payment.","Something went wrong while refunding the payment." -"You have reached the maximum number of credit cards ' 'allowed to be used for the payment.","You have reached the maximum number of credit cards ' 'allowed to be used for the payment." -"Something went wrong while authorizing the partial payment.","Something went wrong while authorizing the partial payment." -"Something went wrong in the payment gateway.","Something went wrong in the payment gateway." -"Gateway error: %1","Gateway error: %1" -"Gateway actions are locked because the gateway cannot complete ' 'one or more of the transactions. ' 'Please log in to your Authorize.Net account to manually resolve the issue(s).","Gateway actions are locked because the gateway cannot complete ' 'one or more of the transactions. ' 'Please log in to your Authorize.Net account to manually resolve the issue(s)." -"Payment updating error.","Payment updating error." -"Authorize Only","Authorize Only" -"Authorize and Capture","Authorize and Capture" -"Invalid amount for capture.","Invalid amount for capture." -"Payment capturing error.","Payment capturing error." -"Invalid transaction ID.","Invalid transaction ID." -"Payment voiding error.","Payment voiding error." -"Invalid amount for refund.","Invalid amount for refund." -"Payment refunding error.","Payment refunding error." -"The transaction was declined because the response hash validation failed.","The transaction was declined because the response hash validation failed." -"This payment didn't work out because we can't find this order.","This payment didn't work out because we can't find this order." -"There was a payment authorization error.","There was a payment authorization error." -"This payment was not authorized because the transaction ID field is empty.","This payment was not authorized because the transaction ID field is empty." -"Amount of %1 approved by payment gateway. Transaction ID: ""%2"".","Amount of %1 approved by payment gateway. Transaction ID: ""%2""." -"Something went wrong: the paid amount doesn't match the order amount. Please correct this and try again.","Something went wrong: the paid amount doesn't match the order amount. Please correct this and try again." -"Credit Card Type","Credit Card Type" -"Credit Card Number","Credit Card Number" -"Expiration Date","Expiration Date" -"Card Verification Number","Card Verification Number" -"Click ""Cancel"" to remove any pending status and release money already processed during this payment.","Click ""Cancel"" to remove any pending status and release money already processed during this payment." -"Please enter a different credit card number to complete your purchase.","Please enter a different credit card number to complete your purchase." -"Credit Card %1","Credit Card %1" -"Credit Card Information","Credit Card Information" -"--Please Select--","--Please Select--" -"Card Verification Number Visual Reference","Card Verification Number Visual Reference" -"What is this?","What is this?" -"You'll be asked for your payment details before placing an order.","You'll be asked for your payment details before placing an order." -"To cancel pending authorizations and release amounts that have already been processed during this payment, click Cancel.","To cancel pending authorizations and release amounts that have already been processed during this payment, click Cancel." -Processing...,Processing... -Enabled,Enabled -"Sort Order","Sort Order" -Title,Title -"3D Secure Card Validation","3D Secure Card Validation" -"New Order Status","New Order Status" -"No confirmation","No confirmation" -Authorize.net,Authorize.net -"Credit Card Types","Credit Card Types" -"Credit Card Verification","Credit Card Verification" -"Email Customer","Email Customer" -"API Login ID","API Login ID" -"Merchant's Email","Merchant's Email" -"Test Mode","Test Mode" -Debug,Debug -"Transaction Key","Transaction Key" -"Payment Action","Payment Action" -"Accepted Currency","Accepted Currency" -"Payment from Applicable Countries","Payment from Applicable Countries" -"Payment from Specific Countries","Payment from Specific Countries" -"Minimum Order Total","Minimum Order Total" -"Maximum Order Total","Maximum Order Total" -"Allow Partial Authorization","Allow Partial Authorization" -"3D Secure","3D Secure" -"Severe 3D Secure Card Validation","Severe 3D Secure Card Validation" -"Severe Validation Removes Chargeback Liability on Merchant","Severe Validation Removes Chargeback Liability on Merchant" -"Centinel API URL","Centinel API URL" -"If you leave this empty, we'll use a default value. The custom URL may be provided by CardinalCommerce agreement.","If you leave this empty, we'll use a default value. The custom URL may be provided by CardinalCommerce agreement." -"Authorize.net Direct Post","Authorize.net Direct Post" -"Merchant MD5","Merchant MD5" -"Gateway URL","Gateway URL" diff --git a/app/code/Magento/Authorizenet/i18n/es_ES.csv b/app/code/Magento/Authorizenet/i18n/es_ES.csv deleted file mode 100644 index 6767161d42171..0000000000000 --- a/app/code/Magento/Authorizenet/i18n/es_ES.csv +++ /dev/null @@ -1,101 +0,0 @@ -Cancel,Cancelar -"You don't have enough on your credit card to pay for this purchase. To complete your purchase, click ""OK"" and add a credit card to use for the balance. Otherwise, you can cancel the purchase and release the partial payment we are holding.","You don't have enough on your credit card to pay for this purchase. To complete your purchase, click ""OK"" and add a credit card to use for the balance. Otherwise, you can cancel the purchase and release the partial payment we are holding." -"Your credit card has been declined. You can click OK to add another credit card to complete your purchase. Or you can cancel this credit transaction and pay a different way.","Your credit card has been declined. You can click OK to add another credit card to complete your purchase. Or you can cancel this credit transaction and pay a different way." -"We canceled your payment and released any money we were holding.","We canceled your payment and released any money we were holding." -"You can't use any more credit cards for this payment, and you don't have enough to pay for this purchase. Sorry, but we'll have to cancel your transaction.","You can't use any more credit cards for this payment, and you don't have enough to pay for this purchase. Sorry, but we'll have to cancel your transaction." -"Your order has not been placed, because the contents of the shopping cart and/or your address has been changed. Authorized amounts from your previous payment that were left pending are now released. Please go through the checkout process to purchase your cart contents.","Your order has not been placed, because the contents of the shopping cart and/or your address has been changed. Authorized amounts from your previous payment that were left pending are now released. Please go through the checkout process to purchase your cart contents." -"Are you sure you want to cancel your payment? Click OK to cancel your payment and release the amount on hold. Click Cancel to enter another credit card and continue with your payment.","¿Está seguro de que desea cancelar su pago? Pinche en Aceptar para cancelar el pago y liberar la cantidad retenida. Pinche en ""Cancelar"" para introducir otra tarjeta de crédito y continuar con su pago." -"Processed Amount","Cantidad Procesada" -"Remaining Balance","Saldo Restante" -"Order saving error: %1","Order saving error: %1" -"Please choose a payment method.","Please choose a payment method." -"You created the order.","You created the order." -"Something went wrong canceling the transactions.","Something went wrong canceling the transactions." -"There was an error canceling transactions. Please contact us or try again later.","Ha habido un error en la cancelación de las transacciones. Por favor, póngase en contacto con nosotros o inténtelo más tarde de nuevo." -"We couldn't process your order right now. Please try again later.","We couldn't process your order right now. Please try again later." -"amount %1","amount %1" -failed,error -successful,exitoso -"Credit Card: xxxx-%1","Credit Card: xxxx-%1" -"Authorize.Net Transaction ID %1","Authorize.Net Transaction ID %1" -authorize,autorizar -"authorize and capture","autorizar y capturar" -capture,capturar -refund,reembolso -void,vacío -"This is an invalid amount for authorization.","This is an invalid amount for authorization." -"This is an invalid amount for capture.","This is an invalid amount for capture." -"This is an invalid amount for refund.","This is an invalid amount for refund." -"This is an invalid split tenderId ID.","This is an invalid split tenderId ID." -"Something went wrong while canceling the payment.","Something went wrong while canceling the payment." -"Something went wrong while authorizing the payment.","Something went wrong while authorizing the payment." -"Something went wrong while capturing the payment.","Something went wrong while capturing the payment." -"The shopping cart contents and/or address has been changed.","The shopping cart contents and/or address has been changed." -"This is an invalid amount for partial authorization.","This is an invalid amount for partial authorization." -"Parent Authorize.Net transaction (ID %1) expired","Parent Authorize.Net transaction (ID %1) expired" -"Something went wrong while voiding the payment.","Something went wrong while voiding the payment." -"Something went wrong while refunding the payment.","Something went wrong while refunding the payment." -"You have reached the maximum number of credit cards ' 'allowed to be used for the payment.","You have reached the maximum number of credit cards ' 'allowed to be used for the payment." -"Something went wrong while authorizing the partial payment.","Something went wrong while authorizing the partial payment." -"Something went wrong in the payment gateway.","Something went wrong in the payment gateway." -"Gateway error: %1","Gateway error: %1" -"Gateway actions are locked because the gateway cannot complete ' 'one or more of the transactions. ' 'Please log in to your Authorize.Net account to manually resolve the issue(s).","Gateway actions are locked because the gateway cannot complete ' 'one or more of the transactions. ' 'Please log in to your Authorize.Net account to manually resolve the issue(s)." -"Payment updating error.","Error de actualización del pago." -"Authorize Only","Sólo autorizar" -"Authorize and Capture","Autorizar y capturar" -"Invalid amount for capture.","Cantidad para retención no válida." -"Payment capturing error.","Error en el pago de retención." -"Invalid transaction ID.","Invalid transaction ID." -"Payment voiding error.","Error en la anulación del pago." -"Invalid amount for refund.","Cantidad de reembolso no válida." -"Payment refunding error.","Error en el pago de reembolso." -"The transaction was declined because the response hash validation failed.","The transaction was declined because the response hash validation failed." -"This payment didn't work out because we can't find this order.","This payment didn't work out because we can't find this order." -"There was a payment authorization error.","There was a payment authorization error." -"This payment was not authorized because the transaction ID field is empty.","This payment was not authorized because the transaction ID field is empty." -"Amount of %1 approved by payment gateway. Transaction ID: ""%2"".","Amount of %1 approved by payment gateway. Transaction ID: ""%2""." -"Something went wrong: the paid amount doesn't match the order amount. Please correct this and try again.","Something went wrong: the paid amount doesn't match the order amount. Please correct this and try again." -"Credit Card Type","Tipo de Tarjeta de Crédito" -"Credit Card Number","Número de Tarjeta de Crédito" -"Expiration Date","Fecha de Caducidad" -"Card Verification Number","Número de Verificación de Tarjeta" -"Click ""Cancel"" to remove any pending status and release money already processed during this payment.","Click ""Cancel"" to remove any pending status and release money already processed during this payment." -"Please enter a different credit card number to complete your purchase.","Please enter a different credit card number to complete your purchase." -"Credit Card %1","Credit Card %1" -"Credit Card Information","Información de la tarjeta de crédito" -"--Please Select--","--Por favor, seleccione-" -"Card Verification Number Visual Reference","Referencia visual del número de verificación de tarjeta" -"What is this?","¿Qué es esto?" -"You'll be asked for your payment details before placing an order.","You'll be asked for your payment details before placing an order." -"To cancel pending authorizations and release amounts that have already been processed during this payment, click Cancel.","To cancel pending authorizations and release amounts that have already been processed during this payment, click Cancel." -Processing...,Processing... -Enabled,Enabled -"Sort Order","Sort Order" -Title,Title -"3D Secure Card Validation","3D Secure Card Validation" -"New Order Status","New Order Status" -"No confirmation","No confirmation" -Authorize.net,Authorize.net -"Credit Card Types","Credit Card Types" -"Credit Card Verification","Credit Card Verification" -"Email Customer","Email Customer" -"API Login ID","API Login ID" -"Merchant's Email","Merchant's Email" -"Test Mode","Test Mode" -Debug,Debug -"Transaction Key","Transaction Key" -"Payment Action","Payment Action" -"Accepted Currency","Accepted Currency" -"Payment from Applicable Countries","Payment from Applicable Countries" -"Payment from Specific Countries","Payment from Specific Countries" -"Minimum Order Total","Minimum Order Total" -"Maximum Order Total","Maximum Order Total" -"Allow Partial Authorization","Allow Partial Authorization" -"3D Secure","3D Secure" -"Severe 3D Secure Card Validation","Severe 3D Secure Card Validation" -"Severe Validation Removes Chargeback Liability on Merchant","Severe Validation Removes Chargeback Liability on Merchant" -"Centinel API URL","Centinel API URL" -"If you leave this empty, we'll use a default value. The custom URL may be provided by CardinalCommerce agreement.","If you leave this empty, we'll use a default value. The custom URL may be provided by CardinalCommerce agreement." -"Authorize.net Direct Post","Authorize.net Direct Post" -"Merchant MD5","Merchant MD5" -"Gateway URL","Gateway URL" diff --git a/app/code/Magento/Authorizenet/i18n/fr_FR.csv b/app/code/Magento/Authorizenet/i18n/fr_FR.csv deleted file mode 100644 index 86c3b1feb6e05..0000000000000 --- a/app/code/Magento/Authorizenet/i18n/fr_FR.csv +++ /dev/null @@ -1,101 +0,0 @@ -Cancel,Annuler -"You don't have enough on your credit card to pay for this purchase. To complete your purchase, click ""OK"" and add a credit card to use for the balance. Otherwise, you can cancel the purchase and release the partial payment we are holding.","You don't have enough on your credit card to pay for this purchase. To complete your purchase, click ""OK"" and add a credit card to use for the balance. Otherwise, you can cancel the purchase and release the partial payment we are holding." -"Your credit card has been declined. You can click OK to add another credit card to complete your purchase. Or you can cancel this credit transaction and pay a different way.","Your credit card has been declined. You can click OK to add another credit card to complete your purchase. Or you can cancel this credit transaction and pay a different way." -"We canceled your payment and released any money we were holding.","We canceled your payment and released any money we were holding." -"You can't use any more credit cards for this payment, and you don't have enough to pay for this purchase. Sorry, but we'll have to cancel your transaction.","You can't use any more credit cards for this payment, and you don't have enough to pay for this purchase. Sorry, but we'll have to cancel your transaction." -"Your order has not been placed, because the contents of the shopping cart and/or your address has been changed. Authorized amounts from your previous payment that were left pending are now released. Please go through the checkout process to purchase your cart contents.","Your order has not been placed, because the contents of the shopping cart and/or your address has been changed. Authorized amounts from your previous payment that were left pending are now released. Please go through the checkout process to purchase your cart contents." -"Are you sure you want to cancel your payment? Click OK to cancel your payment and release the amount on hold. Click Cancel to enter another credit card and continue with your payment.","Etes-vous sûr de vouloir annuler votre paiement ? Cliquez sur OK pour annuler le paiement et débloquer le montant en attente. Cliquez sur Quitter pour entrer une autre carte bancaire et continuer le paiemetn." -"Processed Amount","Montant réalisé" -"Remaining Balance","Balance restante" -"Order saving error: %1","Order saving error: %1" -"Please choose a payment method.","Please choose a payment method." -"You created the order.","You created the order." -"Something went wrong canceling the transactions.","Something went wrong canceling the transactions." -"There was an error canceling transactions. Please contact us or try again later.","Une erreur s'est produite lors de l'annulation de transactions. Veuillez nous contacter ou réessayer ultérieurement." -"We couldn't process your order right now. Please try again later.","We couldn't process your order right now. Please try again later." -"amount %1","amount %1" -failed,échoué -successful,réussi -"Credit Card: xxxx-%1","Credit Card: xxxx-%1" -"Authorize.Net Transaction ID %1","Authorize.Net Transaction ID %1" -authorize,autoriser -"authorize and capture","autoriser et saisir" -capture,saisir -refund,remboursement -void,vide -"This is an invalid amount for authorization.","This is an invalid amount for authorization." -"This is an invalid amount for capture.","This is an invalid amount for capture." -"This is an invalid amount for refund.","This is an invalid amount for refund." -"This is an invalid split tenderId ID.","This is an invalid split tenderId ID." -"Something went wrong while canceling the payment.","Something went wrong while canceling the payment." -"Something went wrong while authorizing the payment.","Something went wrong while authorizing the payment." -"Something went wrong while capturing the payment.","Something went wrong while capturing the payment." -"The shopping cart contents and/or address has been changed.","The shopping cart contents and/or address has been changed." -"This is an invalid amount for partial authorization.","This is an invalid amount for partial authorization." -"Parent Authorize.Net transaction (ID %1) expired","Parent Authorize.Net transaction (ID %1) expired" -"Something went wrong while voiding the payment.","Something went wrong while voiding the payment." -"Something went wrong while refunding the payment.","Something went wrong while refunding the payment." -"You have reached the maximum number of credit cards ' 'allowed to be used for the payment.","You have reached the maximum number of credit cards ' 'allowed to be used for the payment." -"Something went wrong while authorizing the partial payment.","Something went wrong while authorizing the partial payment." -"Something went wrong in the payment gateway.","Something went wrong in the payment gateway." -"Gateway error: %1","Gateway error: %1" -"Gateway actions are locked because the gateway cannot complete ' 'one or more of the transactions. ' 'Please log in to your Authorize.Net account to manually resolve the issue(s).","Gateway actions are locked because the gateway cannot complete ' 'one or more of the transactions. ' 'Please log in to your Authorize.Net account to manually resolve the issue(s)." -"Payment updating error.","Erreur lors de la mise à jour du paiement." -"Authorize Only","Autoriser uniquement" -"Authorize and Capture","Autoriser et enregistrer" -"Invalid amount for capture.","Montant invalide" -"Payment capturing error.","Erreur lors de la saisie du paiement" -"Invalid transaction ID.","Invalid transaction ID." -"Payment voiding error.","Erreur annulant le paiement" -"Invalid amount for refund.","Montant invalide pour un remboursement" -"Payment refunding error.","Erreur de remboursement du paiement" -"The transaction was declined because the response hash validation failed.","The transaction was declined because the response hash validation failed." -"This payment didn't work out because we can't find this order.","This payment didn't work out because we can't find this order." -"There was a payment authorization error.","There was a payment authorization error." -"This payment was not authorized because the transaction ID field is empty.","This payment was not authorized because the transaction ID field is empty." -"Amount of %1 approved by payment gateway. Transaction ID: ""%2"".","Amount of %1 approved by payment gateway. Transaction ID: ""%2""." -"Something went wrong: the paid amount doesn't match the order amount. Please correct this and try again.","Something went wrong: the paid amount doesn't match the order amount. Please correct this and try again." -"Credit Card Type","Type de carte de crédit" -"Credit Card Number","Numéro de carte de crédit" -"Expiration Date","Date d'expiration" -"Card Verification Number","Numéro de vérification de la carte" -"Click ""Cancel"" to remove any pending status and release money already processed during this payment.","Click ""Cancel"" to remove any pending status and release money already processed during this payment." -"Please enter a different credit card number to complete your purchase.","Please enter a different credit card number to complete your purchase." -"Credit Card %1","Credit Card %1" -"Credit Card Information","Renseignements sur la carte de crédit" -"--Please Select--","--Veuillez choisir--" -"Card Verification Number Visual Reference","Référence visuelle du numéro de vérification de la carte" -"What is this?","Qu'est-ce que c'est ?" -"You'll be asked for your payment details before placing an order.","You'll be asked for your payment details before placing an order." -"To cancel pending authorizations and release amounts that have already been processed during this payment, click Cancel.","To cancel pending authorizations and release amounts that have already been processed during this payment, click Cancel." -Processing...,Processing... -Enabled,Enabled -"Sort Order","Sort Order" -Title,Title -"3D Secure Card Validation","3D Secure Card Validation" -"New Order Status","New Order Status" -"No confirmation","No confirmation" -Authorize.net,Authorize.net -"Credit Card Types","Credit Card Types" -"Credit Card Verification","Credit Card Verification" -"Email Customer","Email Customer" -"API Login ID","API Login ID" -"Merchant's Email","Merchant's Email" -"Test Mode","Test Mode" -Debug,Debug -"Transaction Key","Transaction Key" -"Payment Action","Payment Action" -"Accepted Currency","Accepted Currency" -"Payment from Applicable Countries","Payment from Applicable Countries" -"Payment from Specific Countries","Payment from Specific Countries" -"Minimum Order Total","Minimum Order Total" -"Maximum Order Total","Maximum Order Total" -"Allow Partial Authorization","Allow Partial Authorization" -"3D Secure","3D Secure" -"Severe 3D Secure Card Validation","Severe 3D Secure Card Validation" -"Severe Validation Removes Chargeback Liability on Merchant","Severe Validation Removes Chargeback Liability on Merchant" -"Centinel API URL","Centinel API URL" -"If you leave this empty, we'll use a default value. The custom URL may be provided by CardinalCommerce agreement.","If you leave this empty, we'll use a default value. The custom URL may be provided by CardinalCommerce agreement." -"Authorize.net Direct Post","Authorize.net Direct Post" -"Merchant MD5","Merchant MD5" -"Gateway URL","Gateway URL" diff --git a/app/code/Magento/Authorizenet/i18n/nl_NL.csv b/app/code/Magento/Authorizenet/i18n/nl_NL.csv deleted file mode 100644 index ccb0ae09a5e13..0000000000000 --- a/app/code/Magento/Authorizenet/i18n/nl_NL.csv +++ /dev/null @@ -1,101 +0,0 @@ -Cancel,Annuleren -"You don't have enough on your credit card to pay for this purchase. To complete your purchase, click ""OK"" and add a credit card to use for the balance. Otherwise, you can cancel the purchase and release the partial payment we are holding.","You don't have enough on your credit card to pay for this purchase. To complete your purchase, click ""OK"" and add a credit card to use for the balance. Otherwise, you can cancel the purchase and release the partial payment we are holding." -"Your credit card has been declined. You can click OK to add another credit card to complete your purchase. Or you can cancel this credit transaction and pay a different way.","Your credit card has been declined. You can click OK to add another credit card to complete your purchase. Or you can cancel this credit transaction and pay a different way." -"We canceled your payment and released any money we were holding.","We canceled your payment and released any money we were holding." -"You can't use any more credit cards for this payment, and you don't have enough to pay for this purchase. Sorry, but we'll have to cancel your transaction.","You can't use any more credit cards for this payment, and you don't have enough to pay for this purchase. Sorry, but we'll have to cancel your transaction." -"Your order has not been placed, because the contents of the shopping cart and/or your address has been changed. Authorized amounts from your previous payment that were left pending are now released. Please go through the checkout process to purchase your cart contents.","Your order has not been placed, because the contents of the shopping cart and/or your address has been changed. Authorized amounts from your previous payment that were left pending are now released. Please go through the checkout process to purchase your cart contents." -"Are you sure you want to cancel your payment? Click OK to cancel your payment and release the amount on hold. Click Cancel to enter another credit card and continue with your payment.","Weet u zeker dat u uw betaling wilt annuleren? Klik op OK om uw betaling te annuleren en het geld vrij te geven. Klik op Cancel om een andere kredietkaart te gebruiken en verder te gaan met uw betaling." -"Processed Amount","Verwerkte hoeveelheid" -"Remaining Balance","Resterend balans" -"Order saving error: %1","Order saving error: %1" -"Please choose a payment method.","Please choose a payment method." -"You created the order.","You created the order." -"Something went wrong canceling the transactions.","Something went wrong canceling the transactions." -"There was an error canceling transactions. Please contact us or try again later.","Er heeft zich een fout voorgedaan tijdens het annuleren van de transacties. Neem contact met ons op of probeer later." -"We couldn't process your order right now. Please try again later.","We couldn't process your order right now. Please try again later." -"amount %1","amount %1" -failed,mislukt -successful,succesvol -"Credit Card: xxxx-%1","Credit Card: xxxx-%1" -"Authorize.Net Transaction ID %1","Authorize.Net Transaction ID %1" -authorize,autoriseer -"authorize and capture","autoriseer en vang" -capture,vang -refund,teruggave -void,ongeldig -"This is an invalid amount for authorization.","This is an invalid amount for authorization." -"This is an invalid amount for capture.","This is an invalid amount for capture." -"This is an invalid amount for refund.","This is an invalid amount for refund." -"This is an invalid split tenderId ID.","This is an invalid split tenderId ID." -"Something went wrong while canceling the payment.","Something went wrong while canceling the payment." -"Something went wrong while authorizing the payment.","Something went wrong while authorizing the payment." -"Something went wrong while capturing the payment.","Something went wrong while capturing the payment." -"The shopping cart contents and/or address has been changed.","The shopping cart contents and/or address has been changed." -"This is an invalid amount for partial authorization.","This is an invalid amount for partial authorization." -"Parent Authorize.Net transaction (ID %1) expired","Parent Authorize.Net transaction (ID %1) expired" -"Something went wrong while voiding the payment.","Something went wrong while voiding the payment." -"Something went wrong while refunding the payment.","Something went wrong while refunding the payment." -"You have reached the maximum number of credit cards ' 'allowed to be used for the payment.","You have reached the maximum number of credit cards ' 'allowed to be used for the payment." -"Something went wrong while authorizing the partial payment.","Something went wrong while authorizing the partial payment." -"Something went wrong in the payment gateway.","Something went wrong in the payment gateway." -"Gateway error: %1","Gateway error: %1" -"Gateway actions are locked because the gateway cannot complete ' 'one or more of the transactions. ' 'Please log in to your Authorize.Net account to manually resolve the issue(s).","Gateway actions are locked because the gateway cannot complete ' 'one or more of the transactions. ' 'Please log in to your Authorize.Net account to manually resolve the issue(s)." -"Payment updating error.","Fout bij het bijwerken van de betaling." -"Authorize Only","Alleen authoriseren" -"Authorize and Capture","Authoriseren en opnemen" -"Invalid amount for capture.","Ongeldige aantal voor vangst." -"Payment capturing error.","Fout in het ophalen van de betaling." -"Invalid transaction ID.","Invalid transaction ID." -"Payment voiding error.","Fout in het vernietigen van de betaling." -"Invalid amount for refund.","Ongeldige aantal voor teruggave." -"Payment refunding error.","Fout in het terugbetalen van de betaling." -"The transaction was declined because the response hash validation failed.","The transaction was declined because the response hash validation failed." -"This payment didn't work out because we can't find this order.","This payment didn't work out because we can't find this order." -"There was a payment authorization error.","There was a payment authorization error." -"This payment was not authorized because the transaction ID field is empty.","This payment was not authorized because the transaction ID field is empty." -"Amount of %1 approved by payment gateway. Transaction ID: ""%2"".","Amount of %1 approved by payment gateway. Transaction ID: ""%2""." -"Something went wrong: the paid amount doesn't match the order amount. Please correct this and try again.","Something went wrong: the paid amount doesn't match the order amount. Please correct this and try again." -"Credit Card Type",Creditcardtype -"Credit Card Number",Creditcardnummer -"Expiration Date",vervaldatum -"Card Verification Number","Kaart verificatie nummer" -"Click ""Cancel"" to remove any pending status and release money already processed during this payment.","Click ""Cancel"" to remove any pending status and release money already processed during this payment." -"Please enter a different credit card number to complete your purchase.","Please enter a different credit card number to complete your purchase." -"Credit Card %1","Credit Card %1" -"Credit Card Information","Creditcard informatie" -"--Please Select--","--selecteer a.u.b.--" -"Card Verification Number Visual Reference","Kaart verificatie nummer visuele referentie" -"What is this?","Wat is dit?" -"You'll be asked for your payment details before placing an order.","You'll be asked for your payment details before placing an order." -"To cancel pending authorizations and release amounts that have already been processed during this payment, click Cancel.","To cancel pending authorizations and release amounts that have already been processed during this payment, click Cancel." -Processing...,Processing... -Enabled,Enabled -"Sort Order","Sort Order" -Title,Title -"3D Secure Card Validation","3D Secure Card Validation" -"New Order Status","New Order Status" -"No confirmation","No confirmation" -Authorize.net,Authorize.net -"Credit Card Types","Credit Card Types" -"Credit Card Verification","Credit Card Verification" -"Email Customer","Email Customer" -"API Login ID","API Login ID" -"Merchant's Email","Merchant's Email" -"Test Mode","Test Mode" -Debug,Debug -"Transaction Key","Transaction Key" -"Payment Action","Payment Action" -"Accepted Currency","Accepted Currency" -"Payment from Applicable Countries","Payment from Applicable Countries" -"Payment from Specific Countries","Payment from Specific Countries" -"Minimum Order Total","Minimum Order Total" -"Maximum Order Total","Maximum Order Total" -"Allow Partial Authorization","Allow Partial Authorization" -"3D Secure","3D Secure" -"Severe 3D Secure Card Validation","Severe 3D Secure Card Validation" -"Severe Validation Removes Chargeback Liability on Merchant","Severe Validation Removes Chargeback Liability on Merchant" -"Centinel API URL","Centinel API URL" -"If you leave this empty, we'll use a default value. The custom URL may be provided by CardinalCommerce agreement.","If you leave this empty, we'll use a default value. The custom URL may be provided by CardinalCommerce agreement." -"Authorize.net Direct Post","Authorize.net Direct Post" -"Merchant MD5","Merchant MD5" -"Gateway URL","Gateway URL" diff --git a/app/code/Magento/Authorizenet/i18n/pt_BR.csv b/app/code/Magento/Authorizenet/i18n/pt_BR.csv deleted file mode 100644 index 3c465b2d15419..0000000000000 --- a/app/code/Magento/Authorizenet/i18n/pt_BR.csv +++ /dev/null @@ -1,101 +0,0 @@ -Cancel,Cancelar -"You don't have enough on your credit card to pay for this purchase. To complete your purchase, click ""OK"" and add a credit card to use for the balance. Otherwise, you can cancel the purchase and release the partial payment we are holding.","You don't have enough on your credit card to pay for this purchase. To complete your purchase, click ""OK"" and add a credit card to use for the balance. Otherwise, you can cancel the purchase and release the partial payment we are holding." -"Your credit card has been declined. You can click OK to add another credit card to complete your purchase. Or you can cancel this credit transaction and pay a different way.","Your credit card has been declined. You can click OK to add another credit card to complete your purchase. Or you can cancel this credit transaction and pay a different way." -"We canceled your payment and released any money we were holding.","We canceled your payment and released any money we were holding." -"You can't use any more credit cards for this payment, and you don't have enough to pay for this purchase. Sorry, but we'll have to cancel your transaction.","You can't use any more credit cards for this payment, and you don't have enough to pay for this purchase. Sorry, but we'll have to cancel your transaction." -"Your order has not been placed, because the contents of the shopping cart and/or your address has been changed. Authorized amounts from your previous payment that were left pending are now released. Please go through the checkout process to purchase your cart contents.","Your order has not been placed, because the contents of the shopping cart and/or your address has been changed. Authorized amounts from your previous payment that were left pending are now released. Please go through the checkout process to purchase your cart contents." -"Are you sure you want to cancel your payment? Click OK to cancel your payment and release the amount on hold. Click Cancel to enter another credit card and continue with your payment.","Tem certeza de que deseja cancelar o seu pagamento? Clique em OK para cancelar o seu pagamento e liberar o montante em espera. Clique em Cancelar para inserir outro cartão de crédito e continuar com o seu pagamento." -"Processed Amount","Valor Processado" -"Remaining Balance","Balanço Restante" -"Order saving error: %1","Order saving error: %1" -"Please choose a payment method.","Please choose a payment method." -"You created the order.","You created the order." -"Something went wrong canceling the transactions.","Something went wrong canceling the transactions." -"There was an error canceling transactions. Please contact us or try again later.","Ocorreu um erro ao cancelar as transações. Por favor entre em contato conosco ou tente novamente mais tarde." -"We couldn't process your order right now. Please try again later.","We couldn't process your order right now. Please try again later." -"amount %1","amount %1" -failed,fracassado -successful,"bem sucedido" -"Credit Card: xxxx-%1","Credit Card: xxxx-%1" -"Authorize.Net Transaction ID %1","Authorize.Net Transaction ID %1" -authorize,autorizar -"authorize and capture","autorizar e capturar" -capture,capturar -refund,reembolso -void,vazio -"This is an invalid amount for authorization.","This is an invalid amount for authorization." -"This is an invalid amount for capture.","This is an invalid amount for capture." -"This is an invalid amount for refund.","This is an invalid amount for refund." -"This is an invalid split tenderId ID.","This is an invalid split tenderId ID." -"Something went wrong while canceling the payment.","Something went wrong while canceling the payment." -"Something went wrong while authorizing the payment.","Something went wrong while authorizing the payment." -"Something went wrong while capturing the payment.","Something went wrong while capturing the payment." -"The shopping cart contents and/or address has been changed.","The shopping cart contents and/or address has been changed." -"This is an invalid amount for partial authorization.","This is an invalid amount for partial authorization." -"Parent Authorize.Net transaction (ID %1) expired","Parent Authorize.Net transaction (ID %1) expired" -"Something went wrong while voiding the payment.","Something went wrong while voiding the payment." -"Something went wrong while refunding the payment.","Something went wrong while refunding the payment." -"You have reached the maximum number of credit cards ' 'allowed to be used for the payment.","You have reached the maximum number of credit cards ' 'allowed to be used for the payment." -"Something went wrong while authorizing the partial payment.","Something went wrong while authorizing the partial payment." -"Something went wrong in the payment gateway.","Something went wrong in the payment gateway." -"Gateway error: %1","Gateway error: %1" -"Gateway actions are locked because the gateway cannot complete ' 'one or more of the transactions. ' 'Please log in to your Authorize.Net account to manually resolve the issue(s).","Gateway actions are locked because the gateway cannot complete ' 'one or more of the transactions. ' 'Please log in to your Authorize.Net account to manually resolve the issue(s)." -"Payment updating error.","Erro de atualização de pagamento." -"Authorize Only","Somente Autorizar" -"Authorize and Capture","Autorizar e Controlar" -"Invalid amount for capture.","Valor inválido para captura." -"Payment capturing error.","Erro de captura de pagamento." -"Invalid transaction ID.","Invalid transaction ID." -"Payment voiding error.","Erro de anulamento de pagamento." -"Invalid amount for refund.","Valor inválido para reembolso." -"Payment refunding error.","Erro de reembolso de pagamento." -"The transaction was declined because the response hash validation failed.","The transaction was declined because the response hash validation failed." -"This payment didn't work out because we can't find this order.","This payment didn't work out because we can't find this order." -"There was a payment authorization error.","There was a payment authorization error." -"This payment was not authorized because the transaction ID field is empty.","This payment was not authorized because the transaction ID field is empty." -"Amount of %1 approved by payment gateway. Transaction ID: ""%2"".","Amount of %1 approved by payment gateway. Transaction ID: ""%2""." -"Something went wrong: the paid amount doesn't match the order amount. Please correct this and try again.","Something went wrong: the paid amount doesn't match the order amount. Please correct this and try again." -"Credit Card Type","Tipo de Cartão de Crédito" -"Credit Card Number","Número do Cartão de Crédito" -"Expiration Date","Data de Validade" -"Card Verification Number","Número de Verificação do Cartão" -"Click ""Cancel"" to remove any pending status and release money already processed during this payment.","Click ""Cancel"" to remove any pending status and release money already processed during this payment." -"Please enter a different credit card number to complete your purchase.","Please enter a different credit card number to complete your purchase." -"Credit Card %1","Credit Card %1" -"Credit Card Information","Informações do Cartão de Crédito" -"--Please Select--","--Por Favor, Escolha--" -"Card Verification Number Visual Reference","Referência Visual de Número de Verificação do Cartão" -"What is this?","O que é isso?" -"You'll be asked for your payment details before placing an order.","You'll be asked for your payment details before placing an order." -"To cancel pending authorizations and release amounts that have already been processed during this payment, click Cancel.","To cancel pending authorizations and release amounts that have already been processed during this payment, click Cancel." -Processing...,Processing... -Enabled,Enabled -"Sort Order","Sort Order" -Title,Title -"3D Secure Card Validation","3D Secure Card Validation" -"New Order Status","New Order Status" -"No confirmation","No confirmation" -Authorize.net,Authorize.net -"Credit Card Types","Credit Card Types" -"Credit Card Verification","Credit Card Verification" -"Email Customer","Email Customer" -"API Login ID","API Login ID" -"Merchant's Email","Merchant's Email" -"Test Mode","Test Mode" -Debug,Debug -"Transaction Key","Transaction Key" -"Payment Action","Payment Action" -"Accepted Currency","Accepted Currency" -"Payment from Applicable Countries","Payment from Applicable Countries" -"Payment from Specific Countries","Payment from Specific Countries" -"Minimum Order Total","Minimum Order Total" -"Maximum Order Total","Maximum Order Total" -"Allow Partial Authorization","Allow Partial Authorization" -"3D Secure","3D Secure" -"Severe 3D Secure Card Validation","Severe 3D Secure Card Validation" -"Severe Validation Removes Chargeback Liability on Merchant","Severe Validation Removes Chargeback Liability on Merchant" -"Centinel API URL","Centinel API URL" -"If you leave this empty, we'll use a default value. The custom URL may be provided by CardinalCommerce agreement.","If you leave this empty, we'll use a default value. The custom URL may be provided by CardinalCommerce agreement." -"Authorize.net Direct Post","Authorize.net Direct Post" -"Merchant MD5","Merchant MD5" -"Gateway URL","Gateway URL" diff --git a/app/code/Magento/Authorizenet/i18n/zh_CN.csv b/app/code/Magento/Authorizenet/i18n/zh_CN.csv deleted file mode 100644 index e7af229d6e85e..0000000000000 --- a/app/code/Magento/Authorizenet/i18n/zh_CN.csv +++ /dev/null @@ -1,101 +0,0 @@ -Cancel,取消 -"You don't have enough on your credit card to pay for this purchase. To complete your purchase, click ""OK"" and add a credit card to use for the balance. Otherwise, you can cancel the purchase and release the partial payment we are holding.","You don't have enough on your credit card to pay for this purchase. To complete your purchase, click ""OK"" and add a credit card to use for the balance. Otherwise, you can cancel the purchase and release the partial payment we are holding." -"Your credit card has been declined. You can click OK to add another credit card to complete your purchase. Or you can cancel this credit transaction and pay a different way.","Your credit card has been declined. You can click OK to add another credit card to complete your purchase. Or you can cancel this credit transaction and pay a different way." -"We canceled your payment and released any money we were holding.","We canceled your payment and released any money we were holding." -"You can't use any more credit cards for this payment, and you don't have enough to pay for this purchase. Sorry, but we'll have to cancel your transaction.","You can't use any more credit cards for this payment, and you don't have enough to pay for this purchase. Sorry, but we'll have to cancel your transaction." -"Your order has not been placed, because the contents of the shopping cart and/or your address has been changed. Authorized amounts from your previous payment that were left pending are now released. Please go through the checkout process to purchase your cart contents.","Your order has not been placed, because the contents of the shopping cart and/or your address has been changed. Authorized amounts from your previous payment that were left pending are now released. Please go through the checkout process to purchase your cart contents." -"Are you sure you want to cancel your payment? Click OK to cancel your payment and release the amount on hold. Click Cancel to enter another credit card and continue with your payment.",您是否确定要取消支付?单击确定可取消您的支付,并释放占用的额度。单击取消可输入其他信用卡,并继续进行支付。 -"Processed Amount",处理的额度 -"Remaining Balance",剩下的余额 -"Order saving error: %1","Order saving error: %1" -"Please choose a payment method.","Please choose a payment method." -"You created the order.","You created the order." -"Something went wrong canceling the transactions.","Something went wrong canceling the transactions." -"There was an error canceling transactions. Please contact us or try again later.",取消交易时遇到了错误。请联系我们或稍候重试。 -"We couldn't process your order right now. Please try again later.","We couldn't process your order right now. Please try again later." -"amount %1","amount %1" -failed,失败 -successful,成功 -"Credit Card: xxxx-%1","Credit Card: xxxx-%1" -"Authorize.Net Transaction ID %1","Authorize.Net Transaction ID %1" -authorize,授权 -"authorize and capture",授权和获取 -capture,获取 -refund,退款 -void,避免 -"This is an invalid amount for authorization.","This is an invalid amount for authorization." -"This is an invalid amount for capture.","This is an invalid amount for capture." -"This is an invalid amount for refund.","This is an invalid amount for refund." -"This is an invalid split tenderId ID.","This is an invalid split tenderId ID." -"Something went wrong while canceling the payment.","Something went wrong while canceling the payment." -"Something went wrong while authorizing the payment.","Something went wrong while authorizing the payment." -"Something went wrong while capturing the payment.","Something went wrong while capturing the payment." -"The shopping cart contents and/or address has been changed.","The shopping cart contents and/or address has been changed." -"This is an invalid amount for partial authorization.","This is an invalid amount for partial authorization." -"Parent Authorize.Net transaction (ID %1) expired","Parent Authorize.Net transaction (ID %1) expired" -"Something went wrong while voiding the payment.","Something went wrong while voiding the payment." -"Something went wrong while refunding the payment.","Something went wrong while refunding the payment." -"You have reached the maximum number of credit cards ' 'allowed to be used for the payment.","You have reached the maximum number of credit cards ' 'allowed to be used for the payment." -"Something went wrong while authorizing the partial payment.","Something went wrong while authorizing the partial payment." -"Something went wrong in the payment gateway.","Something went wrong in the payment gateway." -"Gateway error: %1","Gateway error: %1" -"Gateway actions are locked because the gateway cannot complete ' 'one or more of the transactions. ' 'Please log in to your Authorize.Net account to manually resolve the issue(s).","Gateway actions are locked because the gateway cannot complete ' 'one or more of the transactions. ' 'Please log in to your Authorize.Net account to manually resolve the issue(s)." -"Payment updating error.",支付更新错误。 -"Authorize Only",仅供授权 -"Authorize and Capture",授权和捕获 -"Invalid amount for capture.",获取的额度无效。 -"Payment capturing error.",支付捕获出错。 -"Invalid transaction ID.","Invalid transaction ID." -"Payment voiding error.",支付的作废出错。 -"Invalid amount for refund.",退款额度无效。 -"Payment refunding error.",支付的退款出错。 -"The transaction was declined because the response hash validation failed.","The transaction was declined because the response hash validation failed." -"This payment didn't work out because we can't find this order.","This payment didn't work out because we can't find this order." -"There was a payment authorization error.","There was a payment authorization error." -"This payment was not authorized because the transaction ID field is empty.","This payment was not authorized because the transaction ID field is empty." -"Amount of %1 approved by payment gateway. Transaction ID: ""%2"".","Amount of %1 approved by payment gateway. Transaction ID: ""%2""." -"Something went wrong: the paid amount doesn't match the order amount. Please correct this and try again.","Something went wrong: the paid amount doesn't match the order amount. Please correct this and try again." -"Credit Card Type",信用卡类型 -"Credit Card Number",信用卡号码 -"Expiration Date",过期日期 -"Card Verification Number",卡片验证号码 -"Click ""Cancel"" to remove any pending status and release money already processed during this payment.","Click ""Cancel"" to remove any pending status and release money already processed during this payment." -"Please enter a different credit card number to complete your purchase.","Please enter a different credit card number to complete your purchase." -"Credit Card %1","Credit Card %1" -"Credit Card Information",信用卡信息 -"--Please Select--","-- 请选择 --" -"Card Verification Number Visual Reference","信用卡验证号码 视觉参考" -"What is this?",这是什么? -"You'll be asked for your payment details before placing an order.","You'll be asked for your payment details before placing an order." -"To cancel pending authorizations and release amounts that have already been processed during this payment, click Cancel.","To cancel pending authorizations and release amounts that have already been processed during this payment, click Cancel." -Processing...,Processing... -Enabled,Enabled -"Sort Order","Sort Order" -Title,Title -"3D Secure Card Validation","3D Secure Card Validation" -"New Order Status","New Order Status" -"No confirmation","No confirmation" -Authorize.net,Authorize.net -"Credit Card Types","Credit Card Types" -"Credit Card Verification","Credit Card Verification" -"Email Customer","Email Customer" -"API Login ID","API Login ID" -"Merchant's Email","Merchant's Email" -"Test Mode","Test Mode" -Debug,Debug -"Transaction Key","Transaction Key" -"Payment Action","Payment Action" -"Accepted Currency","Accepted Currency" -"Payment from Applicable Countries","Payment from Applicable Countries" -"Payment from Specific Countries","Payment from Specific Countries" -"Minimum Order Total","Minimum Order Total" -"Maximum Order Total","Maximum Order Total" -"Allow Partial Authorization","Allow Partial Authorization" -"3D Secure","3D Secure" -"Severe 3D Secure Card Validation","Severe 3D Secure Card Validation" -"Severe Validation Removes Chargeback Liability on Merchant","Severe Validation Removes Chargeback Liability on Merchant" -"Centinel API URL","Centinel API URL" -"If you leave this empty, we'll use a default value. The custom URL may be provided by CardinalCommerce agreement.","If you leave this empty, we'll use a default value. The custom URL may be provided by CardinalCommerce agreement." -"Authorize.net Direct Post","Authorize.net Direct Post" -"Merchant MD5","Merchant MD5" -"Gateway URL","Gateway URL" diff --git a/app/code/Magento/Authorizenet/view/adminhtml/layout/adminhtml_authorizenet_directpost_payment_redirect.xml b/app/code/Magento/Authorizenet/view/adminhtml/layout/adminhtml_authorizenet_directpost_payment_redirect.xml deleted file mode 100644 index 009e940dcde5a..0000000000000 --- a/app/code/Magento/Authorizenet/view/adminhtml/layout/adminhtml_authorizenet_directpost_payment_redirect.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - diff --git a/app/code/Magento/Authorizenet/view/adminhtml/templates/directpost/iframe.phtml b/app/code/Magento/Authorizenet/view/adminhtml/templates/directpost/iframe.phtml deleted file mode 100644 index 9fdae6e64d5e9..0000000000000 --- a/app/code/Magento/Authorizenet/view/adminhtml/templates/directpost/iframe.phtml +++ /dev/null @@ -1,33 +0,0 @@ - -getParams(); -/* @var $_helper \Magento\Authorizenet\Helper\Data */ -$_helper = $this->helper('Magento\Authorizenet\Helper\HelperInterface'); -?> - - - - - - diff --git a/app/code/Magento/Authorizenet/view/adminhtml/templates/directpost/info.phtml b/app/code/Magento/Authorizenet/view/adminhtml/templates/directpost/info.phtml deleted file mode 100644 index 9406b08dac3b7..0000000000000 --- a/app/code/Magento/Authorizenet/view/adminhtml/templates/directpost/info.phtml +++ /dev/null @@ -1,141 +0,0 @@ - -getMethodCode(); -$_method = $_form->getMethod(); -$_controller = $this->getRequest()->getControllerName(); -$_orderUrl = $this->helper('Magento\Authorizenet\Helper\Backend')->getPlaceOrderAdminUrl(); -?> - - - - - - diff --git a/app/code/Magento/Authorizenet/view/adminhtml/templates/form/cc.phtml b/app/code/Magento/Authorizenet/view/adminhtml/templates/form/cc.phtml deleted file mode 100644 index d40a6a459c06b..0000000000000 --- a/app/code/Magento/Authorizenet/view/adminhtml/templates/form/cc.phtml +++ /dev/null @@ -1,60 +0,0 @@ - - - -getPartialAuthorizationFormMessage(); ?> -isPartialAuthorization(); ?> - - - -getChildHtml('method_form_block') ?> diff --git a/app/code/Magento/Authorizenet/view/adminhtml/templates/info/cc.phtml b/app/code/Magento/Authorizenet/view/adminhtml/templates/info/cc.phtml deleted file mode 100644 index 7338405b7c397..0000000000000 --- a/app/code/Magento/Authorizenet/view/adminhtml/templates/info/cc.phtml +++ /dev/null @@ -1,35 +0,0 @@ - - -
- -getHideTitle()): ?> -
escapeHtml($this->getMethod()->getTitle()) ?>
- - -getCards(); - $showCount = count($cards) > 1; -?> - - $card): ?> - - - - - - - $_value):?> - - - - - - -
escapeHtml($_label)?>:getValueAsArray($_value, true), "\n"))?>
- - -
diff --git a/app/code/Magento/Authorizenet/view/adminhtml/templates/info/pdf.phtml b/app/code/Magento/Authorizenet/view/adminhtml/templates/info/pdf.phtml deleted file mode 100644 index 1c820721b9ea6..0000000000000 --- a/app/code/Magento/Authorizenet/view/adminhtml/templates/info/pdf.phtml +++ /dev/null @@ -1,22 +0,0 @@ - - -getCards(); - $showCount = count($cards) > 1; -?> - -escapeHtml($this->getMethod()->getTitle()) ?>{{pdf_row_separator}} - $card): ?> - - - {{pdf_row_separator}} - - - $_value):?> - : getValueAsArray($_value), ' ')?>{{pdf_row_separator}} - - diff --git a/app/code/Magento/Authorizenet/view/adminhtml/web/js/direct-post.js b/app/code/Magento/Authorizenet/view/adminhtml/web/js/direct-post.js deleted file mode 100644 index 29288ea598886..0000000000000 --- a/app/code/Magento/Authorizenet/view/adminhtml/web/js/direct-post.js +++ /dev/null @@ -1,411 +0,0 @@ -/** - * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) - */ -(function (factory) { - if (typeof define === 'function' && define.amd) { - define([ - "jquery", - "mage/backend/validation", - "prototype" - ], factory); - } else { - factory(jQuery); - } -}(function (jQuery) { - -window.directPost = Class.create(); -directPost.prototype = { - initialize : function(methodCode, iframeId, controller, orderSaveUrl, - cgiUrl, nativeAction) { - this.iframeId = iframeId; - this.controller = controller; - this.orderSaveUrl = orderSaveUrl; - this.nativeAction = nativeAction; - this.cgiUrl = cgiUrl; - this.code = methodCode; - this.inputs = ['cc_type', 'cc_number', 'expiration', 'expiration_yr', 'cc_cid']; - this.headers = []; - this.isValid = true; - this.paymentRequestSent = false; - this.isResponse = false; - this.orderIncrementId = false; - this.successUrl = false; - this.hasError = false; - this.tmpForm = false; - - this.onSaveOnepageOrderSuccess = this.saveOnepageOrderSuccess.bindAsEventListener(this); - this.onLoadIframe = this.loadIframe.bindAsEventListener(this); - this.onLoadOrderIframe = this.loadOrderIframe.bindAsEventListener(this); - this.onSubmitAdminOrder = this.submitAdminOrder.bindAsEventListener(this); - - this.preparePayment(); - }, - - validate : function() { - this.isValid = true; - this.inputs.each(function(elemIndex) { - if ($(this.code + '_' + elemIndex)) { - if (!jQuery.validator.validateElement($(this.code + '_' + elemIndex))) { - this.isValid = false; - } - } - }, this); - - return this.isValid; - }, - - changeInputOptions : function(param, value) { - this.inputs.each(function(elemIndex) { - if ($(this.code + '_' + elemIndex)) { - $(this.code + '_' + elemIndex).writeAttribute(param, value); - } - }, this); - }, - - preparePayment : function() { - this.changeInputOptions('autocomplete', 'off'); - if ($(this.iframeId)) { - switch (this.controller) { - case 'onepage': - this.headers = $$('#' + checkout.accordion.container.readAttribute('id') + ' .section'); - var button = $('review-buttons-container').down('button'); - button.writeAttribute('onclick', ''); - button.stopObserving('click'); - button.observe('click', function() { - if ($(this.iframeId)) { - if (this.validate()) { - this.saveOnepageOrder(); - } - } else { - review.save(); - } - }.bind(this)); - break; - case 'order_create': - case 'order_edit': - // Temporary solution will be removed after refactoring Authorize.Net (sales) functionality - jQuery('.scalable.save:not(disabled)').removeAttr('onclick'); - jQuery(document).off('click.directPost'); - jQuery(document).on( - 'click.directPost', - '.scalable.save:not(disabled)', - jQuery.proxy(this.onSubmitAdminOrder, this) - ); - - $('order-' + this.iframeId).observe('load', this.onLoadOrderIframe); - break; - } - - $(this.iframeId).observe('load', this.onLoadIframe); - } - }, - - loadIframe : function() { - if (this.paymentRequestSent) { - switch (this.controller) { - case 'onepage': - this.paymentRequestSent = false; - if (!this.hasError) { - this.returnQuote(); - } - break; - case 'order_edit': - case 'order_create': - if (!this.orderRequestSent) { - this.paymentRequestSent = false; - if (!this.hasError) { - this.returnQuote(); - } else { - this.changeInputOptions('disabled', false); - jQuery('body').trigger('processStop'); - enableElements('save'); - } - } - break; - } - if (this.tmpForm) { - document.body.removeChild(this.tmpForm); - } - } - }, - - loadOrderIframe : function() { - if (this.orderRequestSent) { - $(this.iframeId).hide(); - var data = $('order-' + this.iframeId).contentWindow.document.body.getElementsByTagName('pre')[0].innerHTML; - this.saveAdminOrderSuccess(data); - this.orderRequestSent = false; - } - }, - - showError : function(msg) { - this.hasError = true; - if (this.controller == 'onepage') { - $(this.iframeId).hide(); - this.resetLoadWaiting(); - } - alert(msg); - }, - - returnQuote : function() { - var url = this.orderSaveUrl.replace('place', 'returnQuote'); - new Ajax.Request(url, { - onSuccess : function(transport) { - try { - response = eval('(' + transport.responseText + ')'); - } catch (e) { - response = {}; - } - if (response.error_message) { - alert(response.error_message); - } - $(this.iframeId).show(); - switch (this.controller) { - case 'onepage': - this.resetLoadWaiting(); - break; - case 'order_edit': - case 'order_create': - this.changeInputOptions('disabled', false); - jQuery('body').trigger('processStop'); - enableElements('save'); - break; - } - }.bind(this) - }); - }, - - setLoadWaiting : function() { - this.headers.each(function(header) { - header.removeClassName('allow'); - }); - checkout.setLoadWaiting('review'); - }, - - resetLoadWaiting : function() { - this.headers.each(function(header) { - header.addClassName('allow'); - }); - checkout.setLoadWaiting(false); - }, - - saveOnepageOrder : function() { - this.hasError = false; - this.setLoadWaiting(); - var params = Form.serialize(payment.form); - if (review.agreementsForm) { - params += '&' + Form.serialize(review.agreementsForm); - } - params += '&controller=' + this.controller; - new Ajax.Request(this.orderSaveUrl, { - method : 'post', - parameters : params, - onComplete : this.onSaveOnepageOrderSuccess, - onFailure : function(transport) { - this.resetLoadWaiting(); - if (transport.status == 403) { - checkout.ajaxFailure(); - } - } - }); - }, - - saveOnepageOrderSuccess : function(transport) { - if (transport.status == 403) { - checkout.ajaxFailure(); - } - try { - response = eval('(' + transport.responseText + ')'); - } catch (e) { - response = {}; - } - - if (response.success && response.directpost) { - this.orderIncrementId = response.directpost.fields.x_invoice_num; - var paymentData = {}; - for ( var key in response.directpost.fields) { - paymentData[key] = response.directpost.fields[key]; - } - var preparedData = this.preparePaymentRequest(paymentData); - this.sendPaymentRequest(preparedData); - } else { - var msg = response.error_messages; - if (typeof (msg) == 'object') { - msg = msg.join("\n"); - } - if (msg) { - alert(msg); - } - - if (response.update_section) { - $('checkout-' + response.update_section.name + '-load').replace(response.update_section.html); - response.update_section.html.evalScripts(); - } - - if (response.goto_section) { - checkout.gotoSection(response.goto_section); - checkout.reloadProgressBlock(); - } - } - }, - - submitAdminOrder : function() { - // Temporary solution will be removed after refactoring Authorize.Net (sales) functionality - var editForm = jQuery('#edit_form'); - if (editForm.valid()) { - // Temporary solution will be removed after refactoring Authorize.Net (sales) functionality - paymentMethodEl = editForm.find(':radio[name="payment[method]"]:checked'); - this.hasError = false; - if (paymentMethodEl.val() == this.code) { - jQuery('body').trigger('processStart'); - setLoaderPosition(); - this.changeInputOptions('disabled', 'disabled'); - this.paymentRequestSent = true; - this.orderRequestSent = true; - // Temporary solutions will be removed after refactoring Authorize.Net (sales) functionality - editForm.attr('action', this.orderSaveUrl); - editForm.attr('target', - jQuery('#order-' + this.iframeId).attr('name')); - editForm.append(this.createHiddenElement('controller', this.controller)); - disableElements('save'); - // Temporary solutions will be removed after refactoring Authorize.Net (sales) functionality - order.submit(); - } else { - editForm.attr('action', this.nativeAction); - editForm.attr('target', '_top'); - disableElements('save'); - // Temporary solutions will be removed after refactoring Authorize.Net (sales) functionality - order.submit(); - } - } - }, - - recollectQuote : function() { - var area = [ 'sidebar', 'items', 'shipping_method', 'billing_method', 'totals', 'giftmessage' ]; - area = order.prepareArea(area); - var url = order.loadBaseUrl + 'block/' + area; - var info = $('order-items_grid').select('input', 'select', 'textarea'); - var data = {}; - for ( var i = 0; i < info.length; i++) { - if (!info[i].disabled && (info[i].type != 'checkbox' || info[i].checked)) { - data[info[i].name] = info[i].getValue(); - } - } - data.reset_shipping = true; - data.update_items = true; - if ($('coupons:code') && $F('coupons:code')) { - data['order[coupon][code]'] = $F('coupons:code'); - } - data.json = true; - new Ajax.Request(url, { - parameters : data, - loaderArea : 'html-body', - onSuccess : function(transport) { - jQuery('#edit_form').submit(); - }.bind(this) - }); - - }, - - saveAdminOrderSuccess : function(data) { - try { - response = eval('(' + data + ')'); - } catch (e) { - response = {}; - } - - if (response.directpost) { - this.orderIncrementId = response.directpost.fields.x_invoice_num; - var paymentData = {}; - for ( var key in response.directpost.fields) { - paymentData[key] = response.directpost.fields[key]; - } - var preparedData = this.preparePaymentRequest(paymentData); - this.sendPaymentRequest(preparedData); - } else { - if (response.redirect) { - window.location = response.redirect; - } - if (response.error_messages) { - var msg = response.error_messages; - if (typeof (msg) == 'object') { - msg = msg.join("\n"); - } - if (msg) { - alert(msg); - } - } - } - }, - - preparePaymentRequest : function(data) { - if ($(this.code + '_cc_cid')) { - data.x_card_code = $(this.code + '_cc_cid').value; - } - var year = $(this.code + '_expiration_yr').value; - if (year.length > 2) { - year = year.substring(2); - } - var month = parseInt($(this.code + '_expiration').value, 10); - if (month < 10) { - month = '0' + month; - } - - data.x_exp_date = month + '/' + year; - data.x_card_num = $(this.code + '_cc_number').value; - - return data; - }, - - sendPaymentRequest : function(preparedData) { - this.recreateIframe(); - this.tmpForm = document.createElement('form'); - this.tmpForm.style.display = 'none'; - this.tmpForm.enctype = 'application/x-www-form-urlencoded'; - this.tmpForm.method = 'POST'; - document.body.appendChild(this.tmpForm); - this.tmpForm.action = this.cgiUrl; - this.tmpForm.target = $(this.iframeId).readAttribute('name'); - this.tmpForm.setAttribute('target', $(this.iframeId).readAttribute('name')); - - for ( var param in preparedData) { - this.tmpForm.appendChild(this.createHiddenElement(param, preparedData[param])); - } - - this.paymentRequestSent = true; - this.tmpForm.submit(); - }, - - createHiddenElement : function(name, value) { - var field; - if (isIE) { - field = document.createElement('input'); - field.setAttribute('type', 'hidden'); - field.setAttribute('name', name); - field.setAttribute('value', value); - } else { - field = document.createElement('input'); - field.type = 'hidden'; - field.name = name; - field.value = value; - } - - return field; - }, - - recreateIframe : function() { - if ($(this.iframeId)) { - var nextElement = $(this.iframeId).next(); - var src = $(this.iframeId).readAttribute('src'); - var name = $(this.iframeId).readAttribute('name'); - $(this.iframeId).stopObserving(); - $(this.iframeId).remove(); - var iframe = ' -
$this->getRequest()->isSecure()]) ?>"}, "validation":[]}'> -
-
-
- -
- -
-
-
- -
- -
-
-
- -
-
-
-
- -
-
-
-
- getInfoData('cc_exp_year') ?> - -
-
-
-
-
- hasVerification()): ?> -
- -
- - getViewFileUrl('Magento_Checkout::cvv.gif') . '\" alt=\"' . __('Card Verification Number Visual Reference') . '\" title=\"' . __('Card Verification Number Visual Reference') . '\" />'; ?> -
- -
-
-
- - getChildHtml() ?> -
-
diff --git a/app/code/Magento/Authorizenet/view/frontend/templates/directpost/iframe.phtml b/app/code/Magento/Authorizenet/view/frontend/templates/directpost/iframe.phtml deleted file mode 100644 index ef27bc0e32f0c..0000000000000 --- a/app/code/Magento/Authorizenet/view/frontend/templates/directpost/iframe.phtml +++ /dev/null @@ -1,34 +0,0 @@ - -getParams(); -/* @var $_helper \Magento\Authorizenet\Helper\Data */ -$_helper = $this->helper('Magento\Authorizenet\Helper\HelperInterface'); -?> - - - - - - - diff --git a/app/code/Magento/Authorizenet/view/frontend/templates/directpost/info.phtml b/app/code/Magento/Authorizenet/view/frontend/templates/directpost/info.phtml deleted file mode 100644 index 935039e0da4d6..0000000000000 --- a/app/code/Magento/Authorizenet/view/frontend/templates/directpost/info.phtml +++ /dev/null @@ -1,12 +0,0 @@ - - diff --git a/app/code/Magento/Authorizenet/view/frontend/templates/form/cc.phtml b/app/code/Magento/Authorizenet/view/frontend/templates/form/cc.phtml deleted file mode 100644 index 20a5a1ef9b224..0000000000000 --- a/app/code/Magento/Authorizenet/view/frontend/templates/form/cc.phtml +++ /dev/null @@ -1,32 +0,0 @@ - - - -getPartialAuthorizationFormMessage(); ?> -isPartialAuthorization(); ?> - - - -getChildHtml('method_form_block') ?> diff --git a/app/code/Magento/Authorizenet/view/frontend/templates/info/cc.phtml b/app/code/Magento/Authorizenet/view/frontend/templates/info/cc.phtml deleted file mode 100644 index a5bee1a9de8c4..0000000000000 --- a/app/code/Magento/Authorizenet/view/frontend/templates/info/cc.phtml +++ /dev/null @@ -1,35 +0,0 @@ - - -
-getHideTitle()): ?> -
escapeHtml($this->getMethod()->getTitle()) ?>
- -getCards(); - $showCount = count($cards) > 1; -?> -
-
- $card): ?> - -
- -
- - - $_value): ?> - - - - - -
escapeHtml($_label) ?>getValueAsArray($_value, true), "\n")) ?>
-
- -
-
-
diff --git a/app/code/Magento/Authorizenet/view/frontend/templates/js/components.phtml b/app/code/Magento/Authorizenet/view/frontend/templates/js/components.phtml deleted file mode 100644 index 5c84082b62f01..0000000000000 --- a/app/code/Magento/Authorizenet/view/frontend/templates/js/components.phtml +++ /dev/null @@ -1,6 +0,0 @@ - -getChildHtml() ?> diff --git a/app/code/Magento/Authorizenet/view/frontend/web/authorizenet-authenticate.js b/app/code/Magento/Authorizenet/view/frontend/web/authorizenet-authenticate.js deleted file mode 100644 index 00cf4a88f0e53..0000000000000 --- a/app/code/Magento/Authorizenet/view/frontend/web/authorizenet-authenticate.js +++ /dev/null @@ -1,68 +0,0 @@ -/** - * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) - */ -/*jshint browser:true jquery:true*/ -define([ - "jquery", - "jquery/ui", - "mage/translate" -], function($){ - "use strict"; - - $.widget('mage.authorizenetAuthenticate', { - options : { - cancelButtonSelector: 'button[name="cancel"]', - partialAuthorizationConfirmationMessage: '', - cancelConfirmationMessage: '', - cancelUrl: '', - cancelPleaseWaitSelector: '#cancel-please-wait', - checkoutPaymentMethodLoad: '#checkout-payment-method-load' - }, - - _create : function() { - // listen for the custom event for changing state - this.element.find(this.options.cancelButtonSelector).on("click", $.proxy(this._cancelPaymentAuthorizations, this)); - - // go through the dialog if there is a message - if (this.options.partialAuthorizationConfirmationMessage.length > 0) { - this._confirmMessage(this.options.partialAuthorizationConfirmationMessage); - } - }, - - _confirmMessage: function(msg) { - if (!window.confirm(msg)) { - this._cancelPaymentAuthorizations(true, true); - } - }, - - _cancelPaymentAuthorizations: function(event, hideConfirm) { - if (!hideConfirm && !window.confirm(this.options.cancelConfirmationMessage)) { - window.alert($.mage.__("No confirmation")); - return; - } - // this is a global selector due to the fact it is a sibling of the widget's html - $(this.options.cancelPleaseWaitSelector).show(); - $.ajax({ - url: this.options.cancelUrl, - type: 'get', - dataType: 'json', - context: this, - success : function(response) { - $(this.options.cancelPleaseWaitSelector).hide(); - if (response.success) { - this.element.find(this.options.cancelButtonSelector).remove(); - // this is a global selector due to the fact it is not even close to the widget's html - $(this.options.checkoutPaymentMethodLoad).html(response.update_html).trigger('gotoSection', 'payment').trigger('contentUpdate'); - } else { - var msg = response.error_message; - if (msg) { - window.alert($.mage.__(msg)); - } - } - } - }); - } - }); - - return $.mage.authorizenetAuthenticate; -}); \ No newline at end of file diff --git a/app/code/Magento/Authorizenet/view/frontend/web/js/direct-post.js b/app/code/Magento/Authorizenet/view/frontend/web/js/direct-post.js deleted file mode 100644 index e7da6150feebb..0000000000000 --- a/app/code/Magento/Authorizenet/view/frontend/web/js/direct-post.js +++ /dev/null @@ -1,132 +0,0 @@ -/** - * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) - */ -/*jshint browser:true jquery:true*/ -/*global alert:true*/ -define([ - "jquery", - "jquery/ui", - "jquery/template" -], function($){ - "use strict"; - - $.widget('mage.directpost', { - options: { - placeOrderSelector: '[data-role="review-save"]', - paymentFormSelector: '#co-payment-form', - updateSelectorPrefix: '#checkout-', - updateSelectorSuffix: '-load', - ccNumberSelector: '[data-container="cc-number"]', - ccMonthSelector: '[data-container="cc-month"]', - ccYearSelector: '[data-container="cc-year"]', - ccCvvSelector: '[data-container="cc-cvv"]', - iframeSelector: '[data-container="authorize-net-iframe"]', - hiddenFormTmpl: '
' + - '{{each(key, val) inputs}} {{/each}}' + - '
', - reviewAgreementForm: '#checkout-agreements', - cgiUrl: null, - orderSaveUrl: null, - controller: null - }, - - _create: function() { - $(this.options.placeOrderSelector) - .off('click') - .on('click', $.proxy(this._placeOrderHandler, this)); - }, - - /** - * handler for Place Order button to call authorize.net for credit card validation - * @return {Boolean} - * @private - */ - _placeOrderHandler: function() { - if (this.element.validation && this.element.validation('isValid')) { - this._orderSave(); - } - return false; - }, - - /** - * Save order and generate post data for authorize.net call - * @private - */ - _orderSave: function() { - var postData = $(this.options.paymentFormSelector).serialize(); - if ($(this.options.reviewAgreementForm).length) { - postData += '&' + $(this.options.reviewAgreementForm).serialize(); - } - postData += '&controller=' + this.options.controller; - $.ajax({ - url: this.options.orderSaveUrl, - type: 'post', - context: this, - data: postData, - dataType: 'json', - beforeSend: function() {this.element.trigger('showAjaxLoader');}, - complete: function() {this.element.trigger('hideAjaxLoader');}, - success: function(response) { - if (response.success && response.directpost) { - var preparedData = this._preparePaymentData(response.directpost.fields); - this._postPaymentToAuthorizeNet(preparedData); - } else { - var msg = response.error_messages; - if (typeof (msg) === 'object') { - msg = msg.join("\n"); - } - if (msg) { - alert(msg); - } - if (response.update_section) { - $(this.options.updateSelectorPrefix + response.update_section.name + this.options.updateSelectorSuffix) - .html($(response.update_section.html)).trigger('contentUpdated'); - } - if (response.goto_section) { - this.element.trigger('gotoSection', response.goto_section); - } - } - } - }); - }, - - /** - * Post data to auhtorize.net for credit card validation - * @param data - * @private - */ - _postPaymentToAuthorizeNet: function(data) { - $(this.options.iframeSelector).show(); - $.template('hiddenFormTmpl', this.options.hiddenFormTmpl); - $.tmpl('hiddenFormTmpl', { - target: $(this.options.iframeSelector).attr('name'), - action: this.options.cgiUrl, - inputs: data - }).appendTo('body').submit(); - }, - - /** - * Add credit card fields to post data for authorize.net - * @param data - * @private - */ - _preparePaymentData: function(data) { - var year = this.element.find(this.options.ccYearSelector).val(), - month = parseInt(this.element.find(this.options.ccMonthSelector).val(), 10); - if (year.length > 2) { - year = year.substring(2); - } - if (this.element.find(this.options.ccCvvSelector).length) { - data.x_card_code = this.element.find(this.options.ccCvvSelector).val(); - } - if (month < 10) { - month = '0' + month; - } - data.x_exp_date = month + '/' + year; - data.x_card_num = this.element.find(this.options.ccNumberSelector).val(); - return data; - } - }); - - return $.mage.directpost; -}); \ No newline at end of file diff --git a/app/code/Magento/Backend/Block/System/Config/Form/Fieldset.php b/app/code/Magento/Backend/Block/System/Config/Form/Fieldset.php index 42d4bda76f867..868645fd0a919 100644 --- a/app/code/Magento/Backend/Block/System/Config/Form/Fieldset.php +++ b/app/code/Magento/Backend/Block/System/Config/Form/Fieldset.php @@ -8,6 +8,8 @@ */ namespace Magento\Backend\Block\System\Config\Form; +use Magento\Framework\Data\Form\Element\AbstractElement; + class Fieldset extends \Magento\Backend\Block\AbstractBlock implements \Magento\Framework\Data\Form\Element\Renderer\RendererInterface { @@ -21,6 +23,13 @@ class Fieldset extends \Magento\Backend\Block\AbstractBlock implements */ protected $_jsHelper; + /** + * Whether is collapsed by default + * + * @var bool + */ + protected $isCollapsedDefault = false; + /** * @param \Magento\Backend\Block\Context $context * @param \Magento\Backend\Model\Auth\Session $authSession @@ -41,7 +50,7 @@ public function __construct( /** * Render fieldset html * - * @param \Magento\Framework\Data\Form\Element\AbstractElement $element + * @param AbstractElement $element * @return string */ public function render(\Magento\Framework\Data\Form\Element\AbstractElement $element) @@ -65,7 +74,7 @@ public function render(\Magento\Framework\Data\Form\Element\AbstractElement $ele /** * Return header html for fieldset * - * @param \Magento\Framework\Data\Form\Element\AbstractElement $element + * @param AbstractElement $element * @return string */ protected function _getHeaderHtml($element) @@ -110,9 +119,8 @@ protected function _getHeaderHtml($element) /** * Get frontend class * - * @param \Magento\Framework\Data\Form\Element\AbstractElement $element + * @param AbstractElement $element * @return string - * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ protected function _getFrontendClass($element) { @@ -124,7 +132,7 @@ protected function _getFrontendClass($element) /** * Return header title part of html for fieldset * - * @param \Magento\Framework\Data\Form\Element\AbstractElement $element + * @param AbstractElement $element * @return string */ protected function _getHeaderTitleHtml($element) @@ -144,7 +152,7 @@ protected function _getHeaderTitleHtml($element) /** * Return header comment part of html for fieldset * - * @param \Magento\Framework\Data\Form\Element\AbstractElement $element + * @param AbstractElement $element * @return string */ protected function _getHeaderCommentHtml($element) @@ -169,7 +177,7 @@ protected function _getFieldsetCss() * Return footer html for fieldset * Add extra tooltip comments to elements * - * @param \Magento\Framework\Data\Form\Element\AbstractElement $element + * @param AbstractElement $element * @return string */ protected function _getFooterHtml($element) @@ -199,7 +207,7 @@ protected function _getFooterHtml($element) * - observe fieldset rows; * - apply collapse; * - * @param \Magento\Framework\Data\Form\Element\AbstractElement $element + * @param AbstractElement $element * @return string */ protected function _getExtraJs($element) @@ -212,7 +220,7 @@ protected function _getExtraJs($element) /** * Collapsed or expanded fieldset when page loaded? * - * @param \Magento\Framework\Data\Form\Element\AbstractElement $element + * @param AbstractElement $element * @return bool */ protected function _isCollapseState($element) @@ -220,10 +228,11 @@ protected function _isCollapseState($element) if ($element->getExpanded()) { return true; } + $extra = $this->_authSession->getUser()->getExtra(); if (isset($extra['configState'][$element->getId()])) { return $extra['configState'][$element->getId()]; } - return false; + return $this->isCollapsedDefault; } } diff --git a/app/code/Magento/Backend/Block/System/Store/Delete.php b/app/code/Magento/Backend/Block/System/Store/Delete.php index d86d5dfcf2c52..80032cbcb3f05 100644 --- a/app/code/Magento/Backend/Block/System/Store/Delete.php +++ b/app/code/Magento/Backend/Block/System/Store/Delete.php @@ -28,7 +28,7 @@ protected function _construct() $this->buttonList->remove('save'); $this->buttonList->remove('reset'); - $this->buttonList->update('delete', 'region', 'footer'); + $this->buttonList->update('delete', 'region', 'toolbar'); $this->buttonList->update('delete', 'onclick', null); $this->buttonList->update( 'delete', @@ -41,7 +41,7 @@ protected function _construct() ['label' => __('Cancel'), 'onclick' => 'setLocation(\'' . $this->getBackUrl() . '\')'], 2, 100, - 'footer' + 'toolbar' ); } diff --git a/app/code/Magento/Backend/Controller/Adminhtml/System/Config/State.php b/app/code/Magento/Backend/Controller/Adminhtml/System/Config/State.php index 4170a61ce08a9..dbccfdd26931b 100644 --- a/app/code/Magento/Backend/Controller/Adminhtml/System/Config/State.php +++ b/app/code/Magento/Backend/Controller/Adminhtml/System/Config/State.php @@ -17,14 +17,14 @@ class State extends AbstractScopeConfig * @param \Magento\Backend\Model\Config\Structure $configStructure * @param \Magento\Backend\Controller\Adminhtml\System\ConfigSectionChecker $sectionChecker * @param \Magento\Backend\Model\Config $backendConfig - * @param \Magento\Backend\Model\View\Result\RedirectFactory $resultRawFactory + * @param \Magento\Framework\Controller\Result\RawFactory $resultRawFactory */ public function __construct( \Magento\Backend\App\Action\Context $context, \Magento\Backend\Model\Config\Structure $configStructure, \Magento\Backend\Controller\Adminhtml\System\ConfigSectionChecker $sectionChecker, \Magento\Backend\Model\Config $backendConfig, - \Magento\Backend\Model\View\Result\RedirectFactory $resultRawFactory + \Magento\Framework\Controller\Result\RawFactory $resultRawFactory ) { parent::__construct($context, $configStructure, $sectionChecker, $backendConfig); $this->resultRawFactory = $resultRawFactory; diff --git a/app/code/Magento/Backend/Model/Session/Quote.php b/app/code/Magento/Backend/Model/Session/Quote.php index 73f13a070c5f5..3b1b7149aed18 100644 --- a/app/code/Magento/Backend/Model/Session/Quote.php +++ b/app/code/Magento/Backend/Model/Session/Quote.php @@ -140,7 +140,7 @@ public function getQuote() $this->quoteRepository->save($this->_quote); $this->setQuoteId($this->_quote->getId()); } else { - $this->_quote = $this->quoteRepository->get($this->getQuoteId()); + $this->_quote = $this->quoteRepository->get($this->getQuoteId(), [$this->getStoreId()]); $this->_quote->setStoreId($this->getStoreId()); } diff --git a/app/code/Magento/Backend/composer.json b/app/code/Magento/Backend/composer.json index 05df2a2799ec6..53c2f7f28212d 100644 --- a/app/code/Magento/Backend/composer.json +++ b/app/code/Magento/Backend/composer.json @@ -3,26 +3,26 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha108", - "magento/module-directory": "0.1.0-alpha108", - "magento/module-core": "0.1.0-alpha108", - "magento/module-eav": "0.1.0-alpha108", - "magento/module-cron": "0.1.0-alpha108", - "magento/module-theme": "0.1.0-alpha108", - "magento/module-reports": "0.1.0-alpha108", - "magento/module-sales": "0.1.0-alpha108", - "magento/module-catalog": "0.1.0-alpha108", - "magento/module-user": "0.1.0-alpha108", - "magento/module-backup": "0.1.0-alpha108", - "magento/module-email": "0.1.0-alpha108", - "magento/module-customer": "0.1.0-alpha108", - "magento/module-translation": "0.1.0-alpha108", - "magento/module-require-js": "0.1.0-alpha108", - "magento/framework": "0.1.0-alpha108", + "magento/module-store": "0.42.0-beta1", + "magento/module-directory": "0.42.0-beta1", + "magento/module-core": "0.42.0-beta1", + "magento/module-eav": "0.42.0-beta1", + "magento/module-cron": "0.42.0-beta1", + "magento/module-theme": "0.42.0-beta1", + "magento/module-reports": "0.42.0-beta1", + "magento/module-sales": "0.42.0-beta1", + "magento/module-catalog": "0.42.0-beta1", + "magento/module-user": "0.42.0-beta1", + "magento/module-backup": "0.42.0-beta1", + "magento/module-email": "0.42.0-beta1", + "magento/module-customer": "0.42.0-beta1", + "magento/module-translation": "0.42.0-beta1", + "magento/module-require-js": "0.42.0-beta1", + "magento/framework": "0.42.0-beta1", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha108", + "version": "0.42.0-beta1", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Backend/etc/adminhtml/system.xml b/app/code/Magento/Backend/etc/adminhtml/system.xml index 85606547aad08..46b73ca4621c4 100644 --- a/app/code/Magento/Backend/etc/adminhtml/system.xml +++ b/app/code/Magento/Backend/etc/adminhtml/system.xml @@ -401,7 +401,7 @@ Please enter a number 1 or greater in this field. - required-entry validate-digits validate-digits-range digits-range-1- + required-entry integer validate-greater-than-zero Magento\Backend\Model\Config\Backend\Admin\Password\Link\Expirationperiod diff --git a/app/code/Magento/Backend/view/adminhtml/layout/adminhtml_auth_login.xml b/app/code/Magento/Backend/view/adminhtml/layout/adminhtml_auth_login.xml index 4c90357e421c4..e5d5f1b8fdeee 100644 --- a/app/code/Magento/Backend/view/adminhtml/layout/adminhtml_auth_login.xml +++ b/app/code/Magento/Backend/view/adminhtml/layout/adminhtml_auth_login.xml @@ -6,6 +6,7 @@ --> + diff --git a/app/code/Magento/Backend/view/adminhtml/templates/system/config/edit.phtml b/app/code/Magento/Backend/view/adminhtml/templates/system/config/edit.phtml index ce05ab1a768e1..a043f39c7c25c 100644 --- a/app/code/Magento/Backend/view/adminhtml/templates/system/config/edit.phtml +++ b/app/code/Magento/Backend/view/adminhtml/templates/system/config/edit.phtml @@ -345,7 +345,7 @@ require([ handleHash(); }); - - jQuery('body').trigger('adminConfigDefined'); + + jQuery(window).load(function(){jQuery('body').trigger('adminConfigDefined')}) }); diff --git a/app/code/Magento/Backup/composer.json b/app/code/Magento/Backup/composer.json index 736fe39278ff5..e942ee4651adb 100644 --- a/app/code/Magento/Backup/composer.json +++ b/app/code/Magento/Backup/composer.json @@ -3,15 +3,15 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha108", - "magento/module-core": "0.1.0-alpha108", - "magento/module-backend": "0.1.0-alpha108", - "magento/module-cron": "0.1.0-alpha108", - "magento/framework": "0.1.0-alpha108", + "magento/module-store": "0.42.0-beta1", + "magento/module-core": "0.42.0-beta1", + "magento/module-backend": "0.42.0-beta1", + "magento/module-cron": "0.42.0-beta1", + "magento/framework": "0.42.0-beta1", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha108", + "version": "0.42.0-beta1", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Bundle/Pricing/Price/BundleOptionPrice.php b/app/code/Magento/Bundle/Pricing/Price/BundleOptionPrice.php index f71cbd443c11a..93fd69876a382 100644 --- a/app/code/Magento/Bundle/Pricing/Price/BundleOptionPrice.php +++ b/app/code/Magento/Bundle/Pricing/Price/BundleOptionPrice.php @@ -96,7 +96,7 @@ public function getOptions() $bundleProduct ); - $priceOptions = $optionCollection->appendSelections($selectionCollection, false, false); + $priceOptions = $optionCollection->appendSelections($selectionCollection, true, false); return $priceOptions; } diff --git a/app/code/Magento/Bundle/Pricing/Price/BundleSelectionPrice.php b/app/code/Magento/Bundle/Pricing/Price/BundleSelectionPrice.php index 3a3da12ec5ab2..4868f3b09423f 100644 --- a/app/code/Magento/Bundle/Pricing/Price/BundleSelectionPrice.php +++ b/app/code/Magento/Bundle/Pricing/Price/BundleSelectionPrice.php @@ -122,13 +122,14 @@ public function getValue() $value = $product->getData('final_price') * ($selectionPriceValue / 100); } else { // calculate price for selection type fixed - $value = $this->priceCurrency->convertAndRound($selectionPriceValue); + $value = $this->priceCurrency->convert($selectionPriceValue) * $this->quantity; } } if (!$this->useRegularPrice) { $value = $this->discountCalculator->calculateDiscount($this->bundleProduct, $value); } - $this->value = $value; + $this->value = $this->priceCurrency->round($value); + return $this->value; } diff --git a/app/code/Magento/Bundle/composer.json b/app/code/Magento/Bundle/composer.json index 06a885ddc94bd..775e22220ac22 100644 --- a/app/code/Magento/Bundle/composer.json +++ b/app/code/Magento/Bundle/composer.json @@ -3,24 +3,24 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha108", - "magento/module-catalog": "0.1.0-alpha108", - "magento/module-tax": "0.1.0-alpha108", - "magento/module-core": "0.1.0-alpha108", - "magento/module-backend": "0.1.0-alpha108", - "magento/module-sales": "0.1.0-alpha108", - "magento/module-checkout": "0.1.0-alpha108", - "magento/module-catalog-inventory": "0.1.0-alpha108", - "magento/module-customer": "0.1.0-alpha108", - "magento/module-catalog-rule": "0.1.0-alpha108", - "magento/module-eav": "0.1.0-alpha108", - "magento/module-gift-message": "0.1.0-alpha108", - "magento/framework": "0.1.0-alpha108", - "magento/module-webapi": "0.1.0-alpha108", + "magento/module-store": "0.42.0-beta1", + "magento/module-catalog": "0.42.0-beta1", + "magento/module-tax": "0.42.0-beta1", + "magento/module-core": "0.42.0-beta1", + "magento/module-backend": "0.42.0-beta1", + "magento/module-sales": "0.42.0-beta1", + "magento/module-checkout": "0.42.0-beta1", + "magento/module-catalog-inventory": "0.42.0-beta1", + "magento/module-customer": "0.42.0-beta1", + "magento/module-catalog-rule": "0.42.0-beta1", + "magento/module-eav": "0.42.0-beta1", + "magento/module-gift-message": "0.42.0-beta1", + "magento/framework": "0.42.0-beta1", + "magento/module-webapi": "0.42.0-beta1", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha108", + "version": "0.42.0-beta1", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Bundle/view/adminhtml/templates/product/edit/bundle/option.phtml b/app/code/Magento/Bundle/view/adminhtml/templates/product/edit/bundle/option.phtml index 9400bd038a580..766cfdb8d4af9 100644 --- a/app/code/Magento/Bundle/view/adminhtml/templates/product/edit/bundle/option.phtml +++ b/app/code/Magento/Bundle/view/adminhtml/templates/product/edit/bundle/option.phtml @@ -186,18 +186,22 @@ Bundle.Option.prototype = { remove : function(event){ var element = Event.findElement(event, 'div').up('.option-box'); + if (element) { + var idInput = Element.select(element, '[name$="[option_id]"]')[0]; + if (idInput.value == '') { + element.remove(); + } else { + Element.select(element, '[data-state="deleted"]').each(function (elem) { + elem.value = '1'; + }); - if(element){ - Element.select(element, '[data-state="deleted"]').each(function(elem) { - elem.value = '1'; - }); - - Element.select(element, ['input', 'select']).each(function(elem) { - elem.hide(); - elem.className = ''; - }); + Element.select(element, ['input', 'select']).each(function (elem) { + elem.hide(); + elem.className = ''; + }); - Element.hide(element); + Element.hide(element); + } } }, diff --git a/app/code/Magento/Captcha/composer.json b/app/code/Magento/Captcha/composer.json index 4278c18adb3f4..280c374d3137f 100644 --- a/app/code/Magento/Captcha/composer.json +++ b/app/code/Magento/Captcha/composer.json @@ -3,16 +3,16 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha108", - "magento/module-customer": "0.1.0-alpha108", - "magento/module-checkout": "0.1.0-alpha108", - "magento/module-core": "0.1.0-alpha108", - "magento/module-backend": "0.1.0-alpha108", - "magento/framework": "0.1.0-alpha108", + "magento/module-store": "0.42.0-beta1", + "magento/module-customer": "0.42.0-beta1", + "magento/module-checkout": "0.42.0-beta1", + "magento/module-core": "0.42.0-beta1", + "magento/module-backend": "0.42.0-beta1", + "magento/framework": "0.42.0-beta1", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha108", + "version": "0.42.0-beta1", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Captcha/view/frontend/templates/default.phtml b/app/code/Magento/Captcha/view/frontend/templates/default.phtml index 7289428924b50..469409aca6c9c 100644 --- a/app/code/Magento/Captcha/view/frontend/templates/default.phtml +++ b/app/code/Magento/Captcha/view/frontend/templates/default.phtml @@ -15,6 +15,7 @@ data-captcha="getFormId()?>" id="captcha-container-getFormId()?>" data-mage-init='{"captcha":{"url": "getRefreshUrl()?>", + "imageLoader": "getViewFileUrl('images/loader-2.gif') ?>", "type": "getFormId() ?>"}}'>
<?php echo __('Please type the letters below')?> diff --git a/app/code/Magento/Captcha/view/frontend/web/captcha.js b/app/code/Magento/Captcha/view/frontend/web/captcha.js index d1264dff17a6b..218ea4c983982 100644 --- a/app/code/Magento/Captcha/view/frontend/web/captcha.js +++ b/app/code/Magento/Captcha/view/frontend/web/captcha.js @@ -12,7 +12,8 @@ define([ options: { refreshClass: 'refreshing', reloadSelector: '.captcha-reload', - imageSelector: '.captcha-img' + imageSelector: '.captcha-img', + imageLoader: '' }, /** @@ -28,8 +29,13 @@ define([ * @param e - Event */ refresh: function(e) { - var reloadImage = $(e.currentTarget); - reloadImage.addClass(this.options.refreshClass); + var imageLoader = this.options.imageLoader; + + if (imageLoader) { + this.element.find(this.options.imageSelector).attr('src', imageLoader); + } + this.element.addClass(this.options.refreshClass); + $.ajax({ url: this.options.url, type: 'post', @@ -45,7 +51,7 @@ define([ } }, complete: function() { - reloadImage.removeClass(this.options.refreshClass); + this.element.removeClass(this.options.refreshClass); } }); } diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Category/AbstractCategory.php b/app/code/Magento/Catalog/Block/Adminhtml/Category/AbstractCategory.php index bb0a3d90c5024..8746bd4877e8a 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Category/AbstractCategory.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Category/AbstractCategory.php @@ -252,7 +252,7 @@ public function getNode($parentNodeCategory, $recursionLevel = 2) */ public function getSaveUrl(array $args = []) { - $params = ['_current' => false, '_query' => false]; + $params = ['_current' => false, '_query' => false, 'store' => $this->getStore()->getId()]; $params = array_merge($params, $args); return $this->getUrl('catalog/*/save', $params); } diff --git a/app/code/Magento/Catalog/Controller/Adminhtml/Category/Save.php b/app/code/Magento/Catalog/Controller/Adminhtml/Category/Save.php index 7299f101977a3..5e470317e2bf6 100644 --- a/app/code/Magento/Catalog/Controller/Adminhtml/Category/Save.php +++ b/app/code/Magento/Catalog/Controller/Adminhtml/Category/Save.php @@ -185,12 +185,17 @@ public function execute() ); } + $redirectParams = [ + '_current' => true, + 'id' => $category->getId() + ]; + if ($storeId) { + $redirectParams['store'] = $storeId; + } + return $resultRedirect->setPath( 'catalog/*/edit', - [ - '_current' => true, - 'id' => $category->getId() - ] + $redirectParams ); } } diff --git a/app/code/Magento/Catalog/Controller/Adminhtml/Product/NewAction.php b/app/code/Magento/Catalog/Controller/Adminhtml/Product/NewAction.php index 2794c5eb21d87..8c0a46ef7cbf6 100644 --- a/app/code/Magento/Catalog/Controller/Adminhtml/Product/NewAction.php +++ b/app/code/Magento/Catalog/Controller/Adminhtml/Product/NewAction.php @@ -59,6 +59,12 @@ public function execute() $product = $this->productBuilder->build($this->getRequest()); $productData = $this->getRequest()->getPost('product'); + if (!$productData) { + $sessionData = $this->_session->getProductData(true); + if (!empty($sessionData['product'])) { + $productData = $sessionData['product']; + } + } if ($productData) { $stockData = isset($productData['stock_data']) ? $productData['stock_data'] : []; $productData['stock_data'] = $this->stockFilter->filter($stockData); diff --git a/app/code/Magento/Catalog/Controller/Adminhtml/Product/Save.php b/app/code/Magento/Catalog/Controller/Adminhtml/Product/Save.php index 38d4776a6f6d7..3e55766a835c5 100644 --- a/app/code/Magento/Catalog/Controller/Adminhtml/Product/Save.php +++ b/app/code/Magento/Catalog/Controller/Adminhtml/Product/Save.php @@ -114,11 +114,12 @@ public function execute() } catch (\Magento\Framework\Model\Exception $e) { $this->messageManager->addError($e->getMessage()); $this->_session->setProductData($data); - $redirectBack = true; + $redirectBack = $productId ? true : 'new'; } catch (\Exception $e) { $this->_objectManager->get('Magento\Framework\Logger')->logException($e); $this->messageManager->addError($e->getMessage()); - $redirectBack = true; + $this->_session->setProductData($data); + $redirectBack = $productId ? true : 'new'; } } diff --git a/app/code/Magento/Catalog/Controller/Product/Compare/Index.php b/app/code/Magento/Catalog/Controller/Product/Compare/Index.php index 825dea8063df8..60700d407579f 100644 --- a/app/code/Magento/Catalog/Controller/Product/Compare/Index.php +++ b/app/code/Magento/Catalog/Controller/Product/Compare/Index.php @@ -5,8 +5,67 @@ */ namespace Magento\Catalog\Controller\Product\Compare; +use Magento\Catalog\Api\ProductRepositoryInterface; +use Magento\Core\App\Action\FormKeyValidator; +use Magento\Framework\Controller\Result; +use Magento\Framework\View\Result\PageFactory; + class Index extends \Magento\Catalog\Controller\Product\Compare { + /** + * @var \Magento\Framework\Url\DecoderInterface + */ + protected $urlDecoder; + + /** + * @param \Magento\Framework\App\Action\Context $context + * @param \Magento\Catalog\Model\Product\Compare\ItemFactory $compareItemFactory + * @param \Magento\Catalog\Model\Resource\Product\Compare\Item\CollectionFactory $itemCollectionFactory + * @param \Magento\Customer\Model\Session $customerSession + * @param \Magento\Customer\Model\Visitor $customerVisitor + * @param \Magento\Catalog\Model\Product\Compare\ListCompare $catalogProductCompareList + * @param \Magento\Catalog\Model\Session $catalogSession + * @param \Magento\Store\Model\StoreManagerInterface $storeManager + * @param FormKeyValidator $formKeyValidator + * @param Result\RedirectFactory $resultRedirectFactory + * @param PageFactory $resultPageFactory + * @param ProductRepositoryInterface $productRepository + * @param \Magento\Framework\Url\DecoderInterface $urlDecoder + * + * @SuppressWarnings(PHPMD.ExcessiveParameterList) + */ + public function __construct( + \Magento\Framework\App\Action\Context $context, + \Magento\Catalog\Model\Product\Compare\ItemFactory $compareItemFactory, + \Magento\Catalog\Model\Resource\Product\Compare\Item\CollectionFactory $itemCollectionFactory, + \Magento\Customer\Model\Session $customerSession, + \Magento\Customer\Model\Visitor $customerVisitor, + \Magento\Catalog\Model\Product\Compare\ListCompare $catalogProductCompareList, + \Magento\Catalog\Model\Session $catalogSession, + \Magento\Store\Model\StoreManagerInterface $storeManager, + FormKeyValidator $formKeyValidator, + Result\RedirectFactory $resultRedirectFactory, + PageFactory $resultPageFactory, + ProductRepositoryInterface $productRepository, + \Magento\Framework\Url\DecoderInterface $urlDecoder + ) { + parent::__construct( + $context, + $compareItemFactory, + $itemCollectionFactory, + $customerSession, + $customerVisitor, + $catalogProductCompareList, + $catalogSession, + $storeManager, + $formKeyValidator, + $resultRedirectFactory, + $resultPageFactory, + $productRepository + ); + $this->urlDecoder = $urlDecoder; + } + /** * Compare index action * @@ -19,7 +78,7 @@ public function execute() $beforeUrl = $this->getRequest()->getParam(self::PARAM_NAME_URL_ENCODED); if ($beforeUrl) { $this->_catalogSession->setBeforeCompareUrl( - $this->_objectManager->get('Magento\Core\Helper\Data')->urlDecode($beforeUrl) + $this->urlDecoder->decode($beforeUrl) ); } diff --git a/app/code/Magento/Catalog/Plugin/Model/Indexer/Category/Product/Execute.php b/app/code/Magento/Catalog/Plugin/Model/Indexer/Category/Product/Execute.php new file mode 100644 index 0000000000000..b18eb5606580e --- /dev/null +++ b/app/code/Magento/Catalog/Plugin/Model/Indexer/Category/Product/Execute.php @@ -0,0 +1,48 @@ +config = $config; + $this->typeList = $typeList; + } + + /** + * @param AbstractAction $subject + * @param AbstractAction $result + * @return AbstractAction + * + * @SuppressWarnings(PHPMD.UnusedFormalParameter) + */ + public function afterExecute(AbstractAction $subject, AbstractAction $result) + { + if ($this->config->isEnabled()) { + $this->typeList->invalidate('full_page'); + } + return $result; + } +} diff --git a/app/code/Magento/Catalog/Plugin/Model/Resource/Attribute/Save.php b/app/code/Magento/Catalog/Plugin/Model/Resource/Attribute/Save.php new file mode 100644 index 0000000000000..1a36e6ec2ca02 --- /dev/null +++ b/app/code/Magento/Catalog/Plugin/Model/Resource/Attribute/Save.php @@ -0,0 +1,51 @@ +config = $config; + $this->typeList = $typeList; + } + + /** + * @param \Magento\Catalog\Model\Resource\Attribute $subject + * @param callable $proceed + * @param \Magento\Framework\Model\AbstractModel $attribute + * @return mixed + * + * @SuppressWarnings(PHPMD.UnusedFormalParameter) + */ + public function aroundSave( + \Magento\Catalog\Model\Resource\Attribute $subject, + \Closure $proceed, + \Magento\Framework\Model\AbstractModel $attribute + ) { + $result = $proceed($attribute); + if ($this->config->isEnabled()) { + $this->typeList->invalidate('full_page'); + } + return $result; + } +} diff --git a/app/code/Magento/Catalog/composer.json b/app/code/Magento/Catalog/composer.json index f0b89746bede9..2fd878e153020 100644 --- a/app/code/Magento/Catalog/composer.json +++ b/app/code/Magento/Catalog/composer.json @@ -3,33 +3,33 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha108", - "magento/module-eav": "0.1.0-alpha108", - "magento/module-cms": "0.1.0-alpha108", - "magento/module-indexer": "0.1.0-alpha108", - "magento/module-customer": "0.1.0-alpha108", - "magento/module-core": "0.1.0-alpha108", - "magento/module-theme": "0.1.0-alpha108", - "magento/module-checkout": "0.1.0-alpha108", - "magento/module-log": "0.1.0-alpha108", - "magento/module-backend": "0.1.0-alpha108", - "magento/module-widget": "0.1.0-alpha108", - "magento/module-wishlist": "0.1.0-alpha108", - "magento/module-tax": "0.1.0-alpha108", - "magento/module-msrp": "0.1.0-alpha108", - "magento/module-catalog-inventory": "0.1.0-alpha108", - "magento/module-directory": "0.1.0-alpha108", - "magento/module-catalog-rule": "0.1.0-alpha108", - "magento/module-sales": "0.1.0-alpha108", - "magento/module-product-alert": "0.1.0-alpha108", - "magento/module-url-rewrite": "0.1.0-alpha108", - "magento/module-catalog-url-rewrite": "0.1.0-alpha108", - "magento/module-page-cache": "0.1.0-alpha108", - "magento/framework": "0.1.0-alpha108", + "magento/module-store": "0.42.0-beta1", + "magento/module-eav": "0.42.0-beta1", + "magento/module-cms": "0.42.0-beta1", + "magento/module-indexer": "0.42.0-beta1", + "magento/module-customer": "0.42.0-beta1", + "magento/module-core": "0.42.0-beta1", + "magento/module-theme": "0.42.0-beta1", + "magento/module-checkout": "0.42.0-beta1", + "magento/module-log": "0.42.0-beta1", + "magento/module-backend": "0.42.0-beta1", + "magento/module-widget": "0.42.0-beta1", + "magento/module-wishlist": "0.42.0-beta1", + "magento/module-tax": "0.42.0-beta1", + "magento/module-msrp": "0.42.0-beta1", + "magento/module-catalog-inventory": "0.42.0-beta1", + "magento/module-directory": "0.42.0-beta1", + "magento/module-catalog-rule": "0.42.0-beta1", + "magento/module-sales": "0.42.0-beta1", + "magento/module-product-alert": "0.42.0-beta1", + "magento/module-url-rewrite": "0.42.0-beta1", + "magento/module-catalog-url-rewrite": "0.42.0-beta1", + "magento/module-page-cache": "0.42.0-beta1", + "magento/framework": "0.42.0-beta1", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha108", + "version": "0.42.0-beta1", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Catalog/etc/adminhtml/di.xml b/app/code/Magento/Catalog/etc/adminhtml/di.xml index fcc101ebddf36..0689066072d40 100644 --- a/app/code/Magento/Catalog/etc/adminhtml/di.xml +++ b/app/code/Magento/Catalog/etc/adminhtml/di.xml @@ -59,4 +59,10 @@ + + + + + + diff --git a/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_attribute_edit_popup.xml b/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_attribute_edit_popup.xml index 9aa7bb493a982..d4a6996660f09 100644 --- a/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_attribute_edit_popup.xml +++ b/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_attribute_edit_popup.xml @@ -4,20 +4,20 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) */ --> - + - - - - Magento_Catalog::catalog/product/attribute/form.phtml - - - - - - - - - + + + + + + + + + + + + + diff --git a/app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/edit.phtml b/app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/edit.phtml index 1ea5d33994627..af9c18595b2a2 100644 --- a/app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/edit.phtml +++ b/app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/edit.phtml @@ -56,10 +56,11 @@ diff --git a/app/code/Magento/Centinel/composer.json b/app/code/Magento/Centinel/composer.json index c758ae8b393b9..171bd6c6ccf6c 100644 --- a/app/code/Magento/Centinel/composer.json +++ b/app/code/Magento/Centinel/composer.json @@ -3,16 +3,16 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha108", - "magento/module-checkout": "0.1.0-alpha108", - "magento/module-core": "0.1.0-alpha108", - "magento/module-backend": "0.1.0-alpha108", - "magento/module-sales": "0.1.0-alpha108", - "magento/framework": "0.1.0-alpha108", + "magento/module-store": "0.42.0-beta1", + "magento/module-checkout": "0.42.0-beta1", + "magento/module-core": "0.42.0-beta1", + "magento/module-backend": "0.42.0-beta1", + "magento/module-sales": "0.42.0-beta1", + "magento/framework": "0.42.0-beta1", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha108", + "version": "0.42.0-beta1", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Checkout/Model/Type/Onepage.php b/app/code/Magento/Checkout/Model/Type/Onepage.php index 1b11589918e96..00496f62cd207 100644 --- a/app/code/Magento/Checkout/Model/Type/Onepage.php +++ b/app/code/Magento/Checkout/Model/Type/Onepage.php @@ -786,6 +786,10 @@ protected function _prepareNewCustomerQuote() $customer = $quote->getCustomer(); $customerBillingData = $billing->exportCustomerAddress(); + $dataArray = $this->_objectCopyService->getDataFromFieldset('checkout_onepage_quote', 'to_customer', $quote); + $customer = $this->_customerBuilder->mergeDataObjectWithArray($customer, $dataArray); + $quote->setCustomer($customer->create())->setCustomerId(true); + $customerBillingData = $this->_addressBuilder->populate( $customerBillingData )->setDefaultBilling( @@ -813,10 +817,6 @@ protected function _prepareNewCustomerQuote() ->create(); } $billing->setCustomerAddressData($customerBillingData); - - $dataArray = $this->_objectCopyService->getDataFromFieldset('checkout_onepage_quote', 'to_customer', $quote); - $customer = $this->_customerBuilder->mergeDataObjectWithArray($customer, $dataArray); - $quote->setCustomer($customer->create())->setCustomerId(true); // TODO : Eventually need to remove this legacy hack // Add billing address to quote since customer Data Object does not hold address information $quote->addCustomerAddress($customerBillingData); diff --git a/app/code/Magento/Checkout/composer.json b/app/code/Magento/Checkout/composer.json index 6bc5de2a32665..c9f6e783f684d 100644 --- a/app/code/Magento/Checkout/composer.json +++ b/app/code/Magento/Checkout/composer.json @@ -3,28 +3,28 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha108", - "magento/module-sales": "0.1.0-alpha108", - "magento/module-authorization": "0.1.0-alpha108", - "magento/module-catalog-inventory": "0.1.0-alpha108", - "magento/module-core": "0.1.0-alpha108", - "magento/module-customer": "0.1.0-alpha108", - "magento/module-catalog": "0.1.0-alpha108", - "magento/module-payment": "0.1.0-alpha108", - "magento/module-tax": "0.1.0-alpha108", - "magento/module-directory": "0.1.0-alpha108", - "magento/module-eav": "0.1.0-alpha108", - "magento/module-gift-message": "0.1.0-alpha108", - "magento/module-wishlist": "0.1.0-alpha108", - "magento/module-page-cache": "0.1.0-alpha108", - "magento/module-theme": "0.1.0-alpha108", - "magento/module-msrp": "0.1.0-alpha108", - "magento/framework": "0.1.0-alpha108", - "magento/module-ui": "0.1.0-alpha108", + "magento/module-store": "0.42.0-beta1", + "magento/module-sales": "0.42.0-beta1", + "magento/module-authorization": "0.42.0-beta1", + "magento/module-catalog-inventory": "0.42.0-beta1", + "magento/module-core": "0.42.0-beta1", + "magento/module-customer": "0.42.0-beta1", + "magento/module-catalog": "0.42.0-beta1", + "magento/module-payment": "0.42.0-beta1", + "magento/module-tax": "0.42.0-beta1", + "magento/module-directory": "0.42.0-beta1", + "magento/module-eav": "0.42.0-beta1", + "magento/module-gift-message": "0.42.0-beta1", + "magento/module-wishlist": "0.42.0-beta1", + "magento/module-page-cache": "0.42.0-beta1", + "magento/module-theme": "0.42.0-beta1", + "magento/module-msrp": "0.42.0-beta1", + "magento/framework": "0.42.0-beta1", + "magento/module-ui": "0.42.0-beta1", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha108", + "version": "0.42.0-beta1", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Checkout/view/frontend/templates/onepage/billing.phtml b/app/code/Magento/Checkout/view/frontend/templates/onepage/billing.phtml index 01d7aba771945..e3ba09c0a7c55 100644 --- a/app/code/Magento/Checkout/view/frontend/templates/onepage/billing.phtml +++ b/app/code/Magento/Checkout/view/frontend/templates/onepage/billing.phtml @@ -98,7 +98,7 @@
- +
diff --git a/app/code/Magento/Checkout/view/frontend/templates/onepage/shipping.phtml b/app/code/Magento/Checkout/view/frontend/templates/onepage/shipping.phtml index ea5e740b61cb6..59c0c325c7309 100644 --- a/app/code/Magento/Checkout/view/frontend/templates/onepage/shipping.phtml +++ b/app/code/Magento/Checkout/view/frontend/templates/onepage/shipping.phtml @@ -67,7 +67,7 @@
- +
@@ -102,8 +102,10 @@ getAddress()->getSameAsBilling()): ?> checked="checked" class="checkbox" />
-
-
+
+
+ +
diff --git a/app/code/Magento/Checkout/view/frontend/web/js/opc-checkout-method.js b/app/code/Magento/Checkout/view/frontend/web/js/opc-checkout-method.js index a826082838bdd..e59d6efc4b74a 100644 --- a/app/code/Magento/Checkout/view/frontend/web/js/opc-checkout-method.js +++ b/app/code/Magento/Checkout/view/frontend/web/js/opc-checkout-method.js @@ -218,9 +218,7 @@ define([ } if ($.type(response) === 'object' && !$.isEmptyObject(response)) { if (response.error) { - var msg = response.message || response.error_messages || response.error, - billingEmailId, - hasBillingEmail; + var msg = response.message || response.error_messages || response.error; if (msg) { if (Array.isArray(msg)) { @@ -234,17 +232,6 @@ define([ $(this.options.countrySelector).trigger('change'); - billingEmailId = this.options.billing.emailAddressName; - hasBillingEmail = $('[name="' + billingEmailId + '"]').length; - - if (hasBillingEmail) { - var emailAddress = {}; - emailAddress[billingEmailId] = msg; - - var billingFormValidator = $(this.options.billing.form).validate(); - billingFormValidator.showErrors(emailAddress); - } - alert(msg); } diff --git a/app/code/Magento/CheckoutAgreements/composer.json b/app/code/Magento/CheckoutAgreements/composer.json index a251d39f5b2cf..ea79b7e58e0ea 100644 --- a/app/code/Magento/CheckoutAgreements/composer.json +++ b/app/code/Magento/CheckoutAgreements/composer.json @@ -3,14 +3,14 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-checkout": "0.1.0-alpha108", - "magento/module-store": "0.1.0-alpha108", - "magento/module-backend": "0.1.0-alpha108", - "magento/framework": "0.1.0-alpha108", + "magento/module-checkout": "0.42.0-beta1", + "magento/module-store": "0.42.0-beta1", + "magento/module-backend": "0.42.0-beta1", + "magento/framework": "0.42.0-beta1", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha108", + "version": "0.42.0-beta1", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/CheckoutAgreements/view/frontend/layout/paypal_express_review.xml b/app/code/Magento/CheckoutAgreements/view/frontend/layout/paypal_express_review.xml deleted file mode 100644 index 5bddffa892e38..0000000000000 --- a/app/code/Magento/CheckoutAgreements/view/frontend/layout/paypal_express_review.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - diff --git a/app/code/Magento/CheckoutAgreements/view/frontend/layout/paypal_payflowexpress_review.xml b/app/code/Magento/CheckoutAgreements/view/frontend/layout/paypal_payflowexpress_review.xml deleted file mode 100644 index 5bddffa892e38..0000000000000 --- a/app/code/Magento/CheckoutAgreements/view/frontend/layout/paypal_payflowexpress_review.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - diff --git a/app/code/Magento/Cms/Controller/Adminhtml/Wysiwyg/Directive.php b/app/code/Magento/Cms/Controller/Adminhtml/Wysiwyg/Directive.php index 878071667990f..29019f02ee3e8 100644 --- a/app/code/Magento/Cms/Controller/Adminhtml/Wysiwyg/Directive.php +++ b/app/code/Magento/Cms/Controller/Adminhtml/Wysiwyg/Directive.php @@ -5,8 +5,27 @@ */ namespace Magento\Cms\Controller\Adminhtml\Wysiwyg; +use Magento\Backend\App\Action; + class Directive extends \Magento\Backend\App\Action { + /** + * @var \Magento\Framework\Url\DecoderInterface + */ + protected $urlDecoder; + + /** + * @param Action\Context $context + * @param \Magento\Framework\Url\DecoderInterface $urlDecoder + */ + public function __construct( + Action\Context $context, + \Magento\Framework\Url\DecoderInterface $urlDecoder + ) { + parent::__construct($context); + $this->urlDecoder = $urlDecoder; + } + /** * Template directives callback * @@ -17,7 +36,7 @@ class Directive extends \Magento\Backend\App\Action public function execute() { $directive = $this->getRequest()->getParam('___directive'); - $directive = $this->_objectManager->get('Magento\Core\Helper\Data')->urlDecode($directive); + $directive = $this->urlDecoder->decode($directive); $url = $this->_objectManager->create('Magento\Email\Model\Template\Filter')->filter($directive); /** @var \Magento\Framework\Image\Adapter\AdapterInterface $image */ $image = $this->_objectManager->get('Magento\Framework\Image\AdapterFactory')->create(); diff --git a/app/code/Magento/Cms/Ui/DataProvider/Page/Row/Actions.php b/app/code/Magento/Cms/Ui/DataProvider/Page/Row/Actions.php index 08c8309cfc7a3..8c10225dd3e7a 100644 --- a/app/code/Magento/Cms/Ui/DataProvider/Page/Row/Actions.php +++ b/app/code/Magento/Cms/Ui/DataProvider/Page/Row/Actions.php @@ -16,7 +16,7 @@ class Actions implements RowInterface /** * Url path */ - const URL_PATH = '*/*/edit'; + const URL_PATH = 'adminhtml/cms_page/edit'; /** * @var UrlBuilder diff --git a/app/code/Magento/Cms/composer.json b/app/code/Magento/Cms/composer.json index f3185cd2d3381..6ab46844c9711 100644 --- a/app/code/Magento/Cms/composer.json +++ b/app/code/Magento/Cms/composer.json @@ -3,19 +3,19 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha108", - "magento/module-core": "0.1.0-alpha108", - "magento/module-theme": "0.1.0-alpha108", - "magento/module-widget": "0.1.0-alpha108", - "magento/module-backend": "0.1.0-alpha108", - "magento/module-catalog": "0.1.0-alpha108", - "magento/module-email": "0.1.0-alpha108", - "magento/module-ui": "0.1.0-alpha108", - "magento/framework": "0.1.0-alpha108", + "magento/module-store": "0.42.0-beta1", + "magento/module-core": "0.42.0-beta1", + "magento/module-theme": "0.42.0-beta1", + "magento/module-widget": "0.42.0-beta1", + "magento/module-backend": "0.42.0-beta1", + "magento/module-catalog": "0.42.0-beta1", + "magento/module-email": "0.42.0-beta1", + "magento/module-ui": "0.42.0-beta1", + "magento/framework": "0.42.0-beta1", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha108", + "version": "0.42.0-beta1", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Cms/data/cms_setup/data-install-1.6.0.0.php b/app/code/Magento/Cms/data/cms_setup/data-install-1.6.0.0.php deleted file mode 100644 index 4d3f4e2eb3ade..0000000000000 --- a/app/code/Magento/Cms/data/cms_setup/data-install-1.6.0.0.php +++ /dev/null @@ -1,47 +0,0 @@ - '404 Not Found', - 'page_layout' => '2columns-right', - 'meta_keywords' => 'Page keywords', - 'meta_description' => 'Page description', - 'identifier' => 'no-route', - 'content_heading' => 'Whoops, our bad...', - 'content' => "
\r\n
The page you requested was not found, and we have a fine guess why.
\r\n
\r\n
    \r\n
  • If you typed the URL directly, please make sure the spelling is correct.
  • \r\n
  • If you clicked on a link to get here, the link is outdated.
  • \r\n
\r\n
\r\n
\r\n
What can you do?
\r\n
Have no fear, help is near! There are many ways you can get back on track with Magento Store.
\r\n
\r\n
    \r\n
  • Go back to the previous page.
  • \r\n
  • Use the search bar at the top of the page to search for your products.
  • \r\n
  • Follow these links to get you back on track!
    Store Home | My Account
\r\n", - 'is_active' => 1, - 'stores' => [0], - 'sort_order' => 0, - ], - [ - 'title' => 'Home page', - 'page_layout' => '1column', - 'identifier' => 'home', - 'content_heading' => 'Home Page', - 'content' => "

CMS homepage content goes here.

\r\n", - 'is_active' => 1, - 'stores' => [0], - 'sort_order' => 0 - ], - [ - 'title' => 'Enable Cookies', - 'page_layout' => '1column', - 'identifier' => 'enable-cookies', - 'content_heading' => 'What are Cookies?', - 'content' => "
\r\n
Please enable cookies in your web browser to continue.
\r\n
\r\n

Cookies are short pieces of data that are sent to your computer when you visit a website. On later visits, this data is then returned to that website. Cookies allow us to recognize you automatically whenever you visit our site so that we can personalize your experience and provide you with better service. We also use cookies (and similar browser data, such as Flash cookies) for fraud prevention and other purposes. If your web browser is set to refuse cookies from our website, you will not be able to complete a purchase or take advantage of certain features of our website, such as storing items in your Shopping Cart or receiving personalized recommendations. As a result, we strongly encourage you to configure your web browser to accept cookies from our website.

\r\n

Enabling Cookies

\r\n \r\n

Internet Explorer 7.x

\r\n
    \r\n
  1. \r\n

    Start Internet Explorer

    \r\n
  2. \r\n
  3. \r\n

    Under the Tools menu, click Internet Options

    \r\n

    \"\"

    \r\n
  4. \r\n
  5. \r\n

    Click the Privacy tab

    \r\n

    \"\"

    \r\n
  6. \r\n
  7. \r\n

    Click the Advanced button

    \r\n

    \"\"

    \r\n
  8. \r\n
  9. \r\n

    Put a check mark in the box for Override Automatic Cookie Handling, put another check mark in the Always accept session cookies box

    \r\n

    \"\"

    \r\n
  10. \r\n
  11. \r\n

    Click OK

    \r\n

    \"\"

    \r\n
  12. \r\n
  13. \r\n

    Click OK

    \r\n

    \"\"

    \r\n
  14. \r\n
  15. \r\n

    Restart Internet Explore

    \r\n
  16. \r\n
\r\n

Back to Top

\r\n

Internet Explorer 6.x

\r\n
    \r\n
  1. \r\n

    Select Internet Options from the Tools menu

    \r\n

    \"\"

    \r\n
  2. \r\n
  3. \r\n

    Click on the Privacy tab

    \r\n
  4. \r\n
  5. \r\n

    Click the Default button (or manually slide the bar down to Medium) under Settings. Click OK

    \r\n

    \"\"

    \r\n
  6. \r\n
\r\n

Back to Top

\r\n

Mozilla/Firefox

\r\n
    \r\n
  1. \r\n

    Click on the Tools-menu in Mozilla

    \r\n
  2. \r\n
  3. \r\n

    Click on the Options... item in the menu - a new window open

    \r\n
  4. \r\n
  5. \r\n

    Click on the Privacy selection in the left part of the window. (See image below)

    \r\n

    \"\"

    \r\n
  6. \r\n
  7. \r\n

    Expand the Cookies section

    \r\n
  8. \r\n
  9. \r\n

    Check the Enable cookies and Accept cookies normally checkboxes

    \r\n
  10. \r\n
  11. \r\n

    Save changes by clicking Ok.

    \r\n
  12. \r\n
\r\n

Back to Top

\r\n

Opera 7.x

\r\n
    \r\n
  1. \r\n

    Click on the Tools menu in Opera

    \r\n
  2. \r\n
  3. \r\n

    Click on the Preferences... item in the menu - a new window open

    \r\n
  4. \r\n
  5. \r\n

    Click on the Privacy selection near the bottom left of the window. (See image below)

    \r\n

    \"\"

    \r\n
  6. \r\n
  7. \r\n

    The Enable cookies checkbox must be checked, and Accept all cookies should be selected in the "Normal cookies" drop-down

    \r\n
  8. \r\n
  9. \r\n

    Save changes by clicking Ok

    \r\n
  10. \r\n
\r\n

Back to Top

\r\n", - 'is_active' => 1, - 'stores' => [0] - ], -]; - -/** - * Insert default and system pages - */ -foreach ($cmsPages as $data) { - $this->createPage()->setData($data)->save(); -} diff --git a/app/code/Magento/Cms/data/cms_setup/data-install-2.0.0.php b/app/code/Magento/Cms/data/cms_setup/data-install-2.0.0.php new file mode 100644 index 0000000000000..f396184b43084 --- /dev/null +++ b/app/code/Magento/Cms/data/cms_setup/data-install-2.0.0.php @@ -0,0 +1,333 @@ + '404 Not Found', + 'page_layout' => '2columns-right', + 'meta_keywords' => 'Page keywords', + 'meta_description' => 'Page description', + 'identifier' => 'no-route', + 'content_heading' => 'Whoops, our bad...', + 'content' => "
\r\n
The page you requested was not found, and we have a fine guess why.
\r\n
\r\n
    \r\n
  • If you typed the URL directly, please make sure the spelling is correct.
  • \r\n
  • If you clicked on a link to get here, the link is outdated.
  • \r\n
\r\n
\r\n
\r\n
What can you do?
\r\n
Have no fear, help is near! There are many ways you can get back on track with Magento Store.
\r\n
\r\n
    \r\n
  • Go back to the previous page.
  • \r\n
  • Use the search bar at the top of the page to search for your products.
  • \r\n
  • Follow these links to get you back on track!
    Store Home | My Account
\r\n", + 'is_active' => 1, + 'stores' => [0], + 'sort_order' => 0 + ], + [ + 'title' => 'Home page', + 'page_layout' => '1column', + 'identifier' => 'home', + 'content_heading' => 'Home Page', + 'content' => "

CMS homepage content goes here.

\r\n", + 'is_active' => 1, + 'stores' => [0], + 'sort_order' => 0 + ], + [ + 'title' => 'Enable Cookies', + 'page_layout' => '1column', + 'identifier' => 'enable-cookies', + 'content_heading' => 'What are Cookies?', + 'content' => "
\r\n
Please enable cookies in your web browser to continue.
\r\n
\r\n

Cookies are short pieces of data that are sent to your computer when you visit a website. On later visits, this data is then returned to that website. Cookies allow us to recognize you automatically whenever you visit our site so that we can personalize your experience and provide you with better service. We also use cookies (and similar browser data, such as Flash cookies) for fraud prevention and other purposes. If your web browser is set to refuse cookies from our website, you will not be able to complete a purchase or take advantage of certain features of our website, such as storing items in your Shopping Cart or receiving personalized recommendations. As a result, we strongly encourage you to configure your web browser to accept cookies from our website.

\r\n

Enabling Cookies

\r\n \r\n

Internet Explorer 7.x

\r\n
    \r\n
  1. \r\n

    Start Internet Explorer

    \r\n
  2. \r\n
  3. \r\n

    Under the Tools menu, click Internet Options

    \r\n

    \"\"

    \r\n
  4. \r\n
  5. \r\n

    Click the Privacy tab

    \r\n

    \"\"

    \r\n
  6. \r\n
  7. \r\n

    Click the Advanced button

    \r\n

    \"\"

    \r\n
  8. \r\n
  9. \r\n

    Put a check mark in the box for Override Automatic Cookie Handling, put another check mark in the Always accept session cookies box

    \r\n

    \"\"

    \r\n
  10. \r\n
  11. \r\n

    Click OK

    \r\n

    \"\"

    \r\n
  12. \r\n
  13. \r\n

    Click OK

    \r\n

    \"\"

    \r\n
  14. \r\n
  15. \r\n

    Restart Internet Explore

    \r\n
  16. \r\n
\r\n

Back to Top

\r\n

Internet Explorer 6.x

\r\n
    \r\n
  1. \r\n

    Select Internet Options from the Tools menu

    \r\n

    \"\"

    \r\n
  2. \r\n
  3. \r\n

    Click on the Privacy tab

    \r\n
  4. \r\n
  5. \r\n

    Click the Default button (or manually slide the bar down to Medium) under Settings. Click OK

    \r\n

    \"\"

    \r\n
  6. \r\n
\r\n

Back to Top

\r\n

Mozilla/Firefox

\r\n
    \r\n
  1. \r\n

    Click on the Tools-menu in Mozilla

    \r\n
  2. \r\n
  3. \r\n

    Click on the Options... item in the menu - a new window open

    \r\n
  4. \r\n
  5. \r\n

    Click on the Privacy selection in the left part of the window. (See image below)

    \r\n

    \"\"

    \r\n
  6. \r\n
  7. \r\n

    Expand the Cookies section

    \r\n
  8. \r\n
  9. \r\n

    Check the Enable cookies and Accept cookies normally checkboxes

    \r\n
  10. \r\n
  11. \r\n

    Save changes by clicking Ok.

    \r\n
  12. \r\n
\r\n

Back to Top

\r\n

Opera 7.x

\r\n
    \r\n
  1. \r\n

    Click on the Tools menu in Opera

    \r\n
  2. \r\n
  3. \r\n

    Click on the Preferences... item in the menu - a new window open

    \r\n
  4. \r\n
  5. \r\n

    Click on the Privacy selection near the bottom left of the window. (See image below)

    \r\n

    \"\"

    \r\n
  6. \r\n
  7. \r\n

    The Enable cookies checkbox must be checked, and Accept all cookies should be selected in the "Normal cookies" drop-down

    \r\n
  8. \r\n
  9. \r\n

    Save changes by clicking Ok

    \r\n
  10. \r\n
\r\n

Back to Top

\r\n", + 'is_active' => 1, + 'stores' => [0] + ] +]; + +/** + * Insert default and system pages + */ +foreach ($cmsPages as $data) { + $this->createPage()->setData($data)->save(); +} + +$pageContent = << + + Please replace this text with you Privacy Policy. + Please add any additional cookies your website uses below (e.g., Google Analytics) + +
+

+ This privacy policy sets out how {{config path="general/store_information/name"}} uses and protects any information + that you give {{config path="general/store_information/name"}} when you use this website. + {{config path="general/store_information/name"}} is committed to ensuring that your privacy is protected. + Should we ask you to provide certain information by which you can be identified when using this website, + then you can be assured that it will only be used in accordance with this privacy statement. + {{config path="general/store_information/name"}} may change this policy from time to time by updating this page. + You should check this page from time to time to ensure that you are happy with any changes. +

+

What we collect

+

We may collect the following information:

+
    +
  • name
  • +
  • contact information including email address
  • +
  • demographic information such as postcode, preferences and interests
  • +
  • other information relevant to customer surveys and/or offers
  • +
+

+ For the exhaustive list of cookies we collect see the List of cookies we collect section. +

+

What we do with the information we gather

+

+ We require this information to understand your needs and provide you with a better service, + and in particular for the following reasons: +

+
    +
  • Internal record keeping.
  • +
  • We may use the information to improve our products and services.
  • +
  • + We may periodically send promotional emails about new products, special offers or other information which we + think you may find interesting using the email address which you have provided. +
  • +
  • + From time to time, we may also use your information to contact you for market research purposes. + We may contact you by email, phone, fax or mail. We may use the information to customise the website + according to your interests. +
  • +
+

Security

+

+ We are committed to ensuring that your information is secure. In order to prevent unauthorised access or disclosure, + we have put in place suitable physical, electronic and managerial procedures to safeguard and secure + the information we collect online. +

+

How we use cookies

+

+ A cookie is a small file which asks permission to be placed on your computer's hard drive. + Once you agree, the file is added and the cookie helps analyse web traffic or lets you know when you visit + a particular site. Cookies allow web applications to respond to you as an individual. The web application + can tailor its operations to your needs, likes and dislikes by gathering and remembering information about + your preferences. +

+

+ We use traffic log cookies to identify which pages are being used. This helps us analyse data about web page traffic + and improve our website in order to tailor it to customer needs. We only use this information for statistical + analysis purposes and then the data is removed from the system. +

+

+ Overall, cookies help us provide you with a better website, by enabling us to monitor which pages you find useful + and which you do not. A cookie in no way gives us access to your computer or any information about you, + other than the data you choose to share with us. You can choose to accept or decline cookies. + Most web browsers automatically accept cookies, but you can usually modify your browser setting + to decline cookies if you prefer. This may prevent you from taking full advantage of the website. +

+

Links to other websites

+

+ Our website may contain links to other websites of interest. However, once you have used these links + to leave our site, you should note that we do not have any control over that other website. + Therefore, we cannot be responsible for the protection and privacy of any information which you provide whilst + visiting such sites and such sites are not governed by this privacy statement. + You should exercise caution and look at the privacy statement applicable to the website in question. +

+

Controlling your personal information

+

You may choose to restrict the collection or use of your personal information in the following ways:

+
    +
  • + whenever you are asked to fill in a form on the website, look for the box that you can click to indicate + that you do not want the information to be used by anybody for direct marketing purposes +
  • +
  • + if you have previously agreed to us using your personal information for direct marketing purposes, + you may change your mind at any time by writing to or emailing us at + {{config path="trans_email/ident_general/email"}} +
  • +
+

+ We will not sell, distribute or lease your personal information to third parties unless we have your permission + or are required by law to do so. We may use your personal information to send you promotional information + about third parties which we think you may find interesting if you tell us that you wish this to happen. +

+

+ You may request details of personal information which we hold about you under the Data Protection Act 1998. + A small fee will be payable. If you would like a copy of the information held on you please write to + {{config path="general/store_information/address"}}. +

+

+ If you believe that any information we are holding on you is incorrect or incomplete, + please write to or email us as soon as possible, at the above address. + We will promptly correct any information found to be incorrect. +

+

List of cookies we collect

+

The table below lists the cookies we collect and what information they store.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
COOKIE nameCOOKIE Description
CARTThe association with your shopping cart.
CATEGORY_INFOStores the category info on the page, that allows to display pages more quickly.
COMPAREThe items that you have in the Compare Products list.
CUSTOMERAn encrypted version of your customer id with the store.
CUSTOMER_AUTHAn indicator if you are currently logged into the store.
CUSTOMER_INFOAn encrypted version of the customer group you belong to.
CUSTOMER_SEGMENT_IDSStores the Customer Segment ID
EXTERNAL_NO_CACHEA flag, which indicates whether caching is disabled or not.
FRONTENDYou sesssion ID on the server.
GUEST-VIEWAllows guests to edit their orders.
LAST_CATEGORYThe last category you visited.
LAST_PRODUCTThe most recent product you have viewed.
NEWMESSAGEIndicates whether a new message has been received.
NO_CACHEIndicates whether it is allowed to use cache.
PERSISTENT_SHOPPING_CARTA link to information about your cart and viewing history if you have asked the site.
RECENTLYCOMPAREDThe items that you have recently compared.
STFInformation on products you have emailed to friends.
STOREThe store view or language you have selected.
USER_ALLOWED_SAVE_COOKIEIndicates whether a customer allowed to use cookies.
VIEWED_PRODUCT_IDSThe products that you have recently viewed.
WISHLISTAn encrypted list of products added to your Wishlist.
WISHLIST_CNTThe number of items in your Wishlist.
+EOD; + +$privacyPageData = [ + 'title' => 'Privacy and Cookie Policy', + 'content_heading' => 'Privacy and Cookie Policy', + 'page_layout' => '1column', + 'identifier' => 'privacy-policy-cookie-restriction-mode', + 'content' => $pageContent, + 'is_active' => 1, + 'stores' => [0], + 'sort_order' => 0, +]; + +$this->createPage()->setData($privacyPageData)->save(); + +$footerLinksBlock = $this->createPage()->load('footer_links', 'identifier'); + +if ($footerLinksBlock->getId()) { + $content = $footerLinksBlock->getContent(); + if (preg_match('/"; + $content = preg_replace('/<\\/ul>/ims', $replacment, $content); + $footerLinksBlock->setContent($content)->save(); + } +} + +$installer = $this->createMigrationSetup(); +$installer->startSetup(); + +$installer->appendClassAliasReplace( + 'cms_block', + 'content', + \Magento\Framework\Module\Setup\Migration::ENTITY_TYPE_BLOCK, + \Magento\Framework\Module\Setup\Migration::FIELD_CONTENT_TYPE_WIKI, + ['block_id'] +); +$installer->appendClassAliasReplace( + 'cms_page', + 'content', + \Magento\Framework\Module\Setup\Migration::ENTITY_TYPE_BLOCK, + \Magento\Framework\Module\Setup\Migration::FIELD_CONTENT_TYPE_WIKI, + ['page_id'] +); +$installer->appendClassAliasReplace( + 'cms_page', + 'layout_update_xml', + \Magento\Framework\Module\Setup\Migration::ENTITY_TYPE_BLOCK, + \Magento\Framework\Module\Setup\Migration::FIELD_CONTENT_TYPE_XML, + ['page_id'] +); +$installer->appendClassAliasReplace( + 'cms_page', + 'custom_layout_update_xml', + \Magento\Framework\Module\Setup\Migration::ENTITY_TYPE_BLOCK, + \Magento\Framework\Module\Setup\Migration::FIELD_CONTENT_TYPE_XML, + ['page_id'] +); + +$installer->doUpdateClassAliases(); + +$installer->endSetup(); + +$cookieRestriction = $this->createPage()->load('privacy-policy-cookie-restriction-mode', 'identifier'); + +if ($cookieRestriction->getId()) { + $content = $cookieRestriction->getContent(); + $replacment = '{{config path="general/store_information/street_line1"}} ' . + '{{config path="general/store_information/street_line2"}} ' . + '{{config path="general/store_information/city"}} ' . + '{{config path="general/store_information/postcode"}} ' . + '{{config path="general/store_information/region_id"}} ' . + '{{config path="general/store_information/country_id"}}'; + $content = preg_replace('/{{config path="general\\/store_information\\/address"}}/ims', $replacment, $content); + $cookieRestriction->setContent($content)->save(); +} diff --git a/app/code/Magento/Cms/data/cms_setup/data-upgrade-1.6.0.0-1.6.0.1.php b/app/code/Magento/Cms/data/cms_setup/data-upgrade-1.6.0.0-1.6.0.1.php deleted file mode 100644 index c35a8c83e7b53..0000000000000 --- a/app/code/Magento/Cms/data/cms_setup/data-upgrade-1.6.0.0-1.6.0.1.php +++ /dev/null @@ -1,242 +0,0 @@ - - - Please replace this text with you Privacy Policy. - Please add any additional cookies your website uses below (e.g., Google Analytics) - -
-

- This privacy policy sets out how {{config path="general/store_information/name"}} uses and protects any information - that you give {{config path="general/store_information/name"}} when you use this website. - {{config path="general/store_information/name"}} is committed to ensuring that your privacy is protected. - Should we ask you to provide certain information by which you can be identified when using this website, - then you can be assured that it will only be used in accordance with this privacy statement. - {{config path="general/store_information/name"}} may change this policy from time to time by updating this page. - You should check this page from time to time to ensure that you are happy with any changes. -

-

What we collect

-

We may collect the following information:

-
    -
  • name
  • -
  • contact information including email address
  • -
  • demographic information such as postcode, preferences and interests
  • -
  • other information relevant to customer surveys and/or offers
  • -
-

- For the exhaustive list of cookies we collect see the List of cookies we collect section. -

-

What we do with the information we gather

-

- We require this information to understand your needs and provide you with a better service, - and in particular for the following reasons: -

-
    -
  • Internal record keeping.
  • -
  • We may use the information to improve our products and services.
  • -
  • - We may periodically send promotional emails about new products, special offers or other information which we - think you may find interesting using the email address which you have provided. -
  • -
  • - From time to time, we may also use your information to contact you for market research purposes. - We may contact you by email, phone, fax or mail. We may use the information to customise the website - according to your interests. -
  • -
-

Security

-

- We are committed to ensuring that your information is secure. In order to prevent unauthorised access or disclosure, - we have put in place suitable physical, electronic and managerial procedures to safeguard and secure - the information we collect online. -

-

How we use cookies

-

- A cookie is a small file which asks permission to be placed on your computer's hard drive. - Once you agree, the file is added and the cookie helps analyse web traffic or lets you know when you visit - a particular site. Cookies allow web applications to respond to you as an individual. The web application - can tailor its operations to your needs, likes and dislikes by gathering and remembering information about - your preferences. -

-

- We use traffic log cookies to identify which pages are being used. This helps us analyse data about web page traffic - and improve our website in order to tailor it to customer needs. We only use this information for statistical - analysis purposes and then the data is removed from the system. -

-

- Overall, cookies help us provide you with a better website, by enabling us to monitor which pages you find useful - and which you do not. A cookie in no way gives us access to your computer or any information about you, - other than the data you choose to share with us. You can choose to accept or decline cookies. - Most web browsers automatically accept cookies, but you can usually modify your browser setting - to decline cookies if you prefer. This may prevent you from taking full advantage of the website. -

-

Links to other websites

-

- Our website may contain links to other websites of interest. However, once you have used these links - to leave our site, you should note that we do not have any control over that other website. - Therefore, we cannot be responsible for the protection and privacy of any information which you provide whilst - visiting such sites and such sites are not governed by this privacy statement. - You should exercise caution and look at the privacy statement applicable to the website in question. -

-

Controlling your personal information

-

You may choose to restrict the collection or use of your personal information in the following ways:

-
    -
  • - whenever you are asked to fill in a form on the website, look for the box that you can click to indicate - that you do not want the information to be used by anybody for direct marketing purposes -
  • -
  • - if you have previously agreed to us using your personal information for direct marketing purposes, - you may change your mind at any time by writing to or emailing us at - {{config path="trans_email/ident_general/email"}} -
  • -
-

- We will not sell, distribute or lease your personal information to third parties unless we have your permission - or are required by law to do so. We may use your personal information to send you promotional information - about third parties which we think you may find interesting if you tell us that you wish this to happen. -

-

- You may request details of personal information which we hold about you under the Data Protection Act 1998. - A small fee will be payable. If you would like a copy of the information held on you please write to - {{config path="general/store_information/address"}}. -

-

- If you believe that any information we are holding on you is incorrect or incomplete, - please write to or email us as soon as possible, at the above address. - We will promptly correct any information found to be incorrect. -

-

List of cookies we collect

-

The table below lists the cookies we collect and what information they store.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
COOKIE nameCOOKIE Description
CARTThe association with your shopping cart.
CATEGORY_INFOStores the category info on the page, that allows to display pages more quickly.
COMPAREThe items that you have in the Compare Products list.
CUSTOMERAn encrypted version of your customer id with the store.
CUSTOMER_AUTHAn indicator if you are currently logged into the store.
CUSTOMER_INFOAn encrypted version of the customer group you belong to.
CUSTOMER_SEGMENT_IDSStores the Customer Segment ID
EXTERNAL_NO_CACHEA flag, which indicates whether caching is disabled or not.
FRONTENDYou sesssion ID on the server.
GUEST-VIEWAllows guests to edit their orders.
LAST_CATEGORYThe last category you visited.
LAST_PRODUCTThe most recent product you have viewed.
NEWMESSAGEIndicates whether a new message has been received.
NO_CACHEIndicates whether it is allowed to use cache.
PERSISTENT_SHOPPING_CARTA link to information about your cart and viewing history if you have asked the site.
RECENTLYCOMPAREDThe items that you have recently compared.
STFInformation on products you have emailed to friends.
STOREThe store view or language you have selected.
USER_ALLOWED_SAVE_COOKIEIndicates whether a customer allowed to use cookies.
VIEWED_PRODUCT_IDSThe products that you have recently viewed.
WISHLISTAn encrypted list of products added to your Wishlist.
WISHLIST_CNTThe number of items in your Wishlist.
-EOD; - -$privacyPageData = [ - 'title' => 'Privacy and Cookie Policy', - 'content_heading' => 'Privacy and Cookie Policy', - 'page_layout' => '1column', - 'identifier' => 'privacy-policy-cookie-restriction-mode', - 'content' => $pageContent, - 'is_active' => 1, - 'stores' => [0], - 'sort_order' => 0, -]; - -$this->createPage()->setData($privacyPageData)->save(); - -$footerLinksBlock = $this->createPage()->load('footer_links', 'identifier'); - -if ($footerLinksBlock->getId()) { - $content = $footerLinksBlock->getContent(); - if (preg_match('/"; - $content = preg_replace('/<\\/ul>/ims', $replacment, $content); - $footerLinksBlock->setContent($content)->save(); - } -} diff --git a/app/code/Magento/Cms/data/cms_setup/data-upgrade-1.6.0.2-1.6.0.3.php b/app/code/Magento/Cms/data/cms_setup/data-upgrade-1.6.0.2-1.6.0.3.php deleted file mode 100644 index 2dfbce80b9b40..0000000000000 --- a/app/code/Magento/Cms/data/cms_setup/data-upgrade-1.6.0.2-1.6.0.3.php +++ /dev/null @@ -1,41 +0,0 @@ -createMigrationSetup(); -$installer->startSetup(); - -$installer->appendClassAliasReplace( - 'cms_block', - 'content', - \Magento\Framework\Module\Setup\Migration::ENTITY_TYPE_BLOCK, - \Magento\Framework\Module\Setup\Migration::FIELD_CONTENT_TYPE_WIKI, - ['block_id'] -); -$installer->appendClassAliasReplace( - 'cms_page', - 'content', - \Magento\Framework\Module\Setup\Migration::ENTITY_TYPE_BLOCK, - \Magento\Framework\Module\Setup\Migration::FIELD_CONTENT_TYPE_WIKI, - ['page_id'] -); -$installer->appendClassAliasReplace( - 'cms_page', - 'layout_update_xml', - \Magento\Framework\Module\Setup\Migration::ENTITY_TYPE_BLOCK, - \Magento\Framework\Module\Setup\Migration::FIELD_CONTENT_TYPE_XML, - ['page_id'] -); -$installer->appendClassAliasReplace( - 'cms_page', - 'custom_layout_update_xml', - \Magento\Framework\Module\Setup\Migration::ENTITY_TYPE_BLOCK, - \Magento\Framework\Module\Setup\Migration::FIELD_CONTENT_TYPE_XML, - ['page_id'] -); - -$installer->doUpdateClassAliases(); - -$installer->endSetup(); diff --git a/app/code/Magento/Cms/data/cms_setup/data-upgrade-1.6.0.3-2.0.0.0.php b/app/code/Magento/Cms/data/cms_setup/data-upgrade-1.6.0.3-2.0.0.0.php deleted file mode 100644 index f8803ac29a4a5..0000000000000 --- a/app/code/Magento/Cms/data/cms_setup/data-upgrade-1.6.0.3-2.0.0.0.php +++ /dev/null @@ -1,20 +0,0 @@ -createPage()->load('privacy-policy-cookie-restriction-mode', 'identifier'); - -if ($cookieRestriction->getId()) { - $content = $cookieRestriction->getContent(); - $replacment = '{{config path="general/store_information/street_line1"}} ' . - '{{config path="general/store_information/street_line2"}} ' . - '{{config path="general/store_information/city"}} ' . - '{{config path="general/store_information/postcode"}} ' . - '{{config path="general/store_information/region_id"}} ' . - '{{config path="general/store_information/country_id"}}'; - $content = preg_replace('/{{config path="general\\/store_information\\/address"}}/ims', $replacment, $content); - $cookieRestriction->setContent($content)->save(); -} diff --git a/app/code/Magento/Cms/view/frontend/layout/default.xml b/app/code/Magento/Cms/view/frontend/layout/default.xml index c2b57a22356e6..e892e36d0286a 100644 --- a/app/code/Magento/Cms/view/frontend/layout/default.xml +++ b/app/code/Magento/Cms/view/frontend/layout/default.xml @@ -7,13 +7,15 @@ - - - - footer_links - - - + + + + + Privacy and Cookie Policy + privacy-policy-cookie-restriction-mode + + + diff --git a/app/code/Magento/CmsUrlRewrite/composer.json b/app/code/Magento/CmsUrlRewrite/composer.json index 00a381ba612d4..934d840a0041f 100644 --- a/app/code/Magento/CmsUrlRewrite/composer.json +++ b/app/code/Magento/CmsUrlRewrite/composer.json @@ -3,14 +3,14 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-cms": "0.1.0-alpha108", - "magento/module-store": "0.1.0-alpha108", - "magento/module-url-rewrite": "0.1.0-alpha108", - "magento/framework": "0.1.0-alpha108", + "magento/module-cms": "0.42.0-beta1", + "magento/module-store": "0.42.0-beta1", + "magento/module-url-rewrite": "0.42.0-beta1", + "magento/framework": "0.42.0-beta1", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha108", + "version": "0.42.0-beta1", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/ConfigurableImportExport/composer.json b/app/code/Magento/ConfigurableImportExport/composer.json index 2ef9c71b0feb1..fac1ee9342dc6 100644 --- a/app/code/Magento/ConfigurableImportExport/composer.json +++ b/app/code/Magento/ConfigurableImportExport/composer.json @@ -3,16 +3,16 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-catalog": "0.1.0-alpha108", - "magento/module-catalog-import-export": "0.1.0-alpha108", - "magento/module-eav": "0.1.0-alpha108", - "magento/module-import-export": "0.1.0-alpha108", - "magento/module-configurable-product": "0.1.0-alpha108", - "magento/framework": "0.1.0-alpha108", + "magento/module-catalog": "0.42.0-beta1", + "magento/module-catalog-import-export": "0.42.0-beta1", + "magento/module-eav": "0.42.0-beta1", + "magento/module-import-export": "0.42.0-beta1", + "magento/module-configurable-product": "0.42.0-beta1", + "magento/framework": "0.42.0-beta1", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha108", + "version": "0.42.0-beta1", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/ConfigurableProduct/composer.json b/app/code/Magento/ConfigurableProduct/composer.json index 92b118ba8d616..8b2ef52455183 100644 --- a/app/code/Magento/ConfigurableProduct/composer.json +++ b/app/code/Magento/ConfigurableProduct/composer.json @@ -3,23 +3,23 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha108", - "magento/module-catalog": "0.1.0-alpha108", - "magento/module-catalog-inventory": "0.1.0-alpha108", - "magento/module-sales": "0.1.0-alpha108", - "magento/module-core": "0.1.0-alpha108", - "magento/module-checkout": "0.1.0-alpha108", - "magento/module-backend": "0.1.0-alpha108", - "magento/module-eav": "0.1.0-alpha108", - "magento/module-customer": "0.1.0-alpha108", - "magento/module-catalog-rule": "0.1.0-alpha108", - "magento/module-directory": "0.1.0-alpha108", - "magento/framework": "0.1.0-alpha108", - "magento/module-webapi": "0.1.0-alpha108", + "magento/module-store": "0.42.0-beta1", + "magento/module-catalog": "0.42.0-beta1", + "magento/module-catalog-inventory": "0.42.0-beta1", + "magento/module-sales": "0.42.0-beta1", + "magento/module-core": "0.42.0-beta1", + "magento/module-checkout": "0.42.0-beta1", + "magento/module-backend": "0.42.0-beta1", + "magento/module-eav": "0.42.0-beta1", + "magento/module-customer": "0.42.0-beta1", + "magento/module-catalog-rule": "0.42.0-beta1", + "magento/module-directory": "0.42.0-beta1", + "magento/framework": "0.42.0-beta1", + "magento/module-webapi": "0.42.0-beta1", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha108", + "version": "0.42.0-beta1", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/ConfigurableProduct/data/configurableproduct_setup/data-install-2.0.0.php b/app/code/Magento/ConfigurableProduct/data/configurableproduct_setup/data-install-2.0.0.php index a44e10d861184..1040905b5e286 100644 --- a/app/code/Magento/ConfigurableProduct/data/configurableproduct_setup/data-install-2.0.0.php +++ b/app/code/Magento/ConfigurableProduct/data/configurableproduct_setup/data-install-2.0.0.php @@ -10,6 +10,8 @@ 'country_of_manufacture', 'group_price', 'minimal_price', + 'msrp', + 'msrp_display_actual_price_type', 'price', 'special_price', 'special_from_date', diff --git a/app/code/Magento/ConfigurableProduct/etc/module.xml b/app/code/Magento/ConfigurableProduct/etc/module.xml index e8990945171af..b76e11aec6480 100644 --- a/app/code/Magento/ConfigurableProduct/etc/module.xml +++ b/app/code/Magento/ConfigurableProduct/etc/module.xml @@ -8,6 +8,7 @@ + diff --git a/app/code/Magento/ConfigurableProduct/view/adminhtml/layout/catalog_product_attribute_edit_product_tab_variations_popup.xml b/app/code/Magento/ConfigurableProduct/view/adminhtml/layout/catalog_product_attribute_edit_product_tab_variations_popup.xml index 132ae6e49f1a1..2b0b3e8b5fe5b 100644 --- a/app/code/Magento/ConfigurableProduct/view/adminhtml/layout/catalog_product_attribute_edit_product_tab_variations_popup.xml +++ b/app/code/Magento/ConfigurableProduct/view/adminhtml/layout/catalog_product_attribute_edit_product_tab_variations_popup.xml @@ -4,20 +4,6 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) */ --> - - - - - - Magento_Catalog::catalog/product/attribute/form.phtml - - - - - - - - - - + + diff --git a/app/code/Magento/ConfigurableProduct/view/adminhtml/templates/catalog/product/edit/super/config.phtml b/app/code/Magento/ConfigurableProduct/view/adminhtml/templates/catalog/product/edit/super/config.phtml index 41b144d3721bb..4adacf909f374 100644 --- a/app/code/Magento/ConfigurableProduct/view/adminhtml/templates/catalog/product/edit/super/config.phtml +++ b/app/code/Magento/ConfigurableProduct/view/adminhtml/templates/catalog/product/edit/super/config.phtml @@ -14,7 +14,7 @@ use \Magento\ConfigurableProduct\Model\Product\Type\Configurable; -
+
@@ -81,7 +81,6 @@ require([ attributesInput.prop('disabled', false); - stockAvailabilityField.val(1); inventoryQty.prop('disabled', true); inventoryAvailabilityField.removeProp('disabled'); disableElement(qtyField); diff --git a/app/code/Magento/Contact/composer.json b/app/code/Magento/Contact/composer.json index 76cb3dba93312..988d8a4014eaa 100644 --- a/app/code/Magento/Contact/composer.json +++ b/app/code/Magento/Contact/composer.json @@ -3,15 +3,15 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha108", - "magento/module-customer": "0.1.0-alpha108", - "magento/module-backend": "0.1.0-alpha108", - "magento/module-cms": "0.1.0-alpha108", - "magento/framework": "0.1.0-alpha108", + "magento/module-store": "0.42.0-beta1", + "magento/module-customer": "0.42.0-beta1", + "magento/module-backend": "0.42.0-beta1", + "magento/module-cms": "0.42.0-beta1", + "magento/framework": "0.42.0-beta1", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha108", + "version": "0.42.0-beta1", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Core/App/Router/Base.php b/app/code/Magento/Core/App/Router/Base.php index 43da536a45959..bfb4a0d21550a 100644 --- a/app/code/Magento/Core/App/Router/Base.php +++ b/app/code/Magento/Core/App/Router/Base.php @@ -278,7 +278,6 @@ protected function matchAction(\Magento\Framework\App\RequestInterface $request, $action = null; $actionInstance = null; - $request->setRouteName($this->_routeConfig->getRouteByFrontName($moduleFrontName)); $actionPath = $this->matchActionPath($request, $params['actionPath']); $action = $request->getActionName() ?: ($params['actionName'] ?: $this->_defaultPath->getPart('action')); $this->_checkShouldBeSecure($request, '/' . $moduleFrontName . '/' . $actionPath . '/' . $action); @@ -308,6 +307,7 @@ protected function matchAction(\Magento\Framework\App\RequestInterface $request, $request->setControllerName($actionPath); $request->setActionName($action); $request->setControllerModule($currentModuleName); + $request->setRouteName($this->_routeConfig->getRouteByFrontName($moduleFrontName)); if (isset($params['variables'])) { $request->setParams($params['variables']); } diff --git a/app/code/Magento/Core/Model/Theme.php b/app/code/Magento/Core/Model/Theme.php index 9632b54729e97..b2eb8cbff7a6a 100644 --- a/app/code/Magento/Core/Model/Theme.php +++ b/app/code/Magento/Core/Model/Theme.php @@ -5,6 +5,7 @@ namespace Magento\Core\Model; use Magento\Framework\View\Design\ThemeInterface; +use Magento\Framework\App\Filesystem\DirectoryList; /** * Theme model class @@ -117,7 +118,6 @@ public function __construct( $this->_imageFactory = $imageFactory; $this->_validator = $validator; $this->_customFactory = $customizationFactory; - $this->addData(['type' => self::TYPE_VIRTUAL]); } diff --git a/app/code/Magento/Core/Model/Theme/Image/Path.php b/app/code/Magento/Core/Model/Theme/Image/Path.php index 9f301551982c3..43923d78130a5 100644 --- a/app/code/Magento/Core/Model/Theme/Image/Path.php +++ b/app/code/Magento/Core/Model/Theme/Image/Path.php @@ -60,12 +60,7 @@ public function __construct( */ public function getPreviewImageUrl(ThemeInterface $theme) { - return $theme->isPhysical() - ? $this->assetRepo->getUrlWithParams( - $theme->getPreviewImage(), - ['area' => $theme->getData('area'), 'themeModel' => $theme] - ) - : $this->storeManager->getStore()->getBaseUrl(\Magento\Framework\UrlInterface::URL_TYPE_MEDIA) + return $this->storeManager->getStore()->getBaseUrl(\Magento\Framework\UrlInterface::URL_TYPE_MEDIA) . self::PREVIEW_DIRECTORY_PATH . '/' . $theme->getPreviewImage(); } @@ -77,13 +72,7 @@ public function getPreviewImageUrl(ThemeInterface $theme) */ public function getPreviewImagePath(ThemeInterface $theme) { - return $theme->isPhysical() - ? $this->assetRepo->createAsset( - $theme->getPreviewImage(), - ['area' => $theme->getData('area'), 'themeModel' => $theme] - ) - ->getSourceFile() - : $this->mediaDirectory->getAbsolutePath(self::PREVIEW_DIRECTORY_PATH . '/' . $theme->getPreviewImage()); + return $this->mediaDirectory->getAbsolutePath(self::PREVIEW_DIRECTORY_PATH . '/' . $theme->getPreviewImage()); } /** diff --git a/app/code/Magento/Core/composer.json b/app/code/Magento/Core/composer.json index d08e7912339fb..4f30dd9134661 100644 --- a/app/code/Magento/Core/composer.json +++ b/app/code/Magento/Core/composer.json @@ -3,18 +3,18 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha108", - "magento/module-backend": "0.1.0-alpha108", - "magento/module-cron": "0.1.0-alpha108", - "magento/module-theme": "0.1.0-alpha108", - "magento/module-eav": "0.1.0-alpha108", - "magento/module-page-cache": "0.1.0-alpha108", - "magento/framework": "0.1.0-alpha108", + "magento/module-store": "0.42.0-beta1", + "magento/module-backend": "0.42.0-beta1", + "magento/module-cron": "0.42.0-beta1", + "magento/module-theme": "0.42.0-beta1", + "magento/module-eav": "0.42.0-beta1", + "magento/module-page-cache": "0.42.0-beta1", + "magento/framework": "0.42.0-beta1", "lib-libxml": "*", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha108", + "version": "0.42.0-beta1", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Core/data/core_setup/data-install-2.0.0.php b/app/code/Magento/Core/data/core_setup/data-install-2.0.0.php new file mode 100644 index 0000000000000..f0eeaebc507e2 --- /dev/null +++ b/app/code/Magento/Core/data/core_setup/data-install-2.0.0.php @@ -0,0 +1,84 @@ +createMigrationSetup(); +$installer->startSetup(); + +$installer->appendClassAliasReplace( + 'core_config_data', + 'value', + \Magento\Framework\Module\Setup\Migration::ENTITY_TYPE_MODEL, + \Magento\Framework\Module\Setup\Migration::FIELD_CONTENT_TYPE_PLAIN, + ['config_id'] +); +$installer->appendClassAliasReplace( + 'core_layout_update', + 'xml', + \Magento\Framework\Module\Setup\Migration::ENTITY_TYPE_BLOCK, + \Magento\Framework\Module\Setup\Migration::FIELD_CONTENT_TYPE_XML, + ['layout_update_id'] +); +$installer->doUpdateClassAliases(); + +/** + * Delete rows by condition from authorization_rule + */ +$tableName = $installer->getTable('authorization_rule'); +if ($tableName) { + $installer->getConnection()->delete($tableName, ['resource_id = ?' => 'admin/system/tools/compiler']); +} + +/** + * Delete rows by condition from core_resource + */ +$tableName = $installer->getTable('core_resource'); +if ($tableName) { + $installer->getConnection()->delete($tableName, ['code = ?' => 'admin_setup']); +} + +/** + * Update rows in core_theme + */ +$installer->getConnection()->update( + $installer->getTable('core_theme'), + ['area' => 'frontend'], + ['area = ?' => ''] +); +$installer->getEventManager()->dispatch('theme_registration_from_filesystem'); + +/** + * Update theme's data + */ +$fileCollection = $this->createThemeFactory(); +$fileCollection->addDefaultPattern('*'); +$fileCollection->setItemObjectClass('Magento\Core\Model\Theme\Data'); + +$resourceCollection = $this->createThemeResourceFactory(); +$resourceCollection->setItemObjectClass('Magento\Core\Model\Theme\Data'); + +/** @var $theme \Magento\Framework\View\Design\ThemeInterface */ +foreach ($resourceCollection as $theme) { + $themeType = $fileCollection->hasTheme($theme) + ? \Magento\Framework\View\Design\ThemeInterface::TYPE_PHYSICAL + : \Magento\Framework\View\Design\ThemeInterface::TYPE_VIRTUAL; + $theme->setType($themeType)->save(); +} + +$fileCollection = $this->createThemeFactory(); +$fileCollection->addDefaultPattern('*'); +$fileCollection->setItemObjectClass('Magento\Core\Model\Theme\Data'); + +$themeDbCollection = $this->createThemeResourceFactory(); +$themeDbCollection->setItemObjectClass('Magento\Core\Model\Theme\Data'); + +/** @var $theme \Magento\Framework\View\Design\ThemeInterface */ +foreach ($fileCollection as $theme) { + $dbTheme = $themeDbCollection->getThemeByFullPath($theme->getFullPath()); + $dbTheme->setCode($theme->getCode()); + $dbTheme->save(); +} + +$installer->endSetup(); diff --git a/app/code/Magento/Core/data/core_setup/data-upgrade-1.6.0.10-1.6.0.11.php b/app/code/Magento/Core/data/core_setup/data-upgrade-1.6.0.10-1.6.0.11.php deleted file mode 100644 index 946bfa2ce7225..0000000000000 --- a/app/code/Magento/Core/data/core_setup/data-upgrade-1.6.0.10-1.6.0.11.php +++ /dev/null @@ -1,20 +0,0 @@ -createThemeFactory(); -$fileCollection->addDefaultPattern('*'); -$fileCollection->setItemObjectClass('Magento\Core\Model\Theme\Data'); - -$resourceCollection = $this->createThemeResourceFactory(); -$resourceCollection->setItemObjectClass('Magento\Core\Model\Theme\Data'); -/** @var $theme \Magento\Framework\View\Design\ThemeInterface */ -foreach ($resourceCollection as $theme) { - $themeType = $fileCollection->hasTheme($theme) - ? \Magento\Framework\View\Design\ThemeInterface::TYPE_PHYSICAL - : \Magento\Framework\View\Design\ThemeInterface::TYPE_VIRTUAL; - $theme->setType($themeType)->save(); -} diff --git a/app/code/Magento/Core/data/core_setup/data-upgrade-1.6.0.12-1.6.0.13.php b/app/code/Magento/Core/data/core_setup/data-upgrade-1.6.0.12-1.6.0.13.php deleted file mode 100644 index 20e1af3c2b748..0000000000000 --- a/app/code/Magento/Core/data/core_setup/data-upgrade-1.6.0.12-1.6.0.13.php +++ /dev/null @@ -1,19 +0,0 @@ -createThemeFactory(); -$fileCollection->addDefaultPattern('*'); -$fileCollection->setItemObjectClass('Magento\Core\Model\Theme\Data'); - -$themeDbCollection = $this->createThemeResourceFactory(); -$themeDbCollection->setItemObjectClass('Magento\Core\Model\Theme\Data'); - -/** @var $theme \Magento\Framework\View\Design\ThemeInterface */ -foreach ($fileCollection as $theme) { - $dbTheme = $themeDbCollection->getThemeByFullPath($theme->getFullPath()); - $dbTheme->setCode($theme->getCode()); - $dbTheme->save(); -} diff --git a/app/code/Magento/Core/data/core_setup/data-upgrade-1.6.0.3-1.6.0.4.php b/app/code/Magento/Core/data/core_setup/data-upgrade-1.6.0.3-1.6.0.4.php deleted file mode 100644 index 17dd7f76a85aa..0000000000000 --- a/app/code/Magento/Core/data/core_setup/data-upgrade-1.6.0.3-1.6.0.4.php +++ /dev/null @@ -1,26 +0,0 @@ -createMigrationSetup(); -$installer->startSetup(); - -$installer->appendClassAliasReplace( - 'core_config_data', - 'value', - \Magento\Framework\Module\Setup\Migration::ENTITY_TYPE_MODEL, - \Magento\Framework\Module\Setup\Migration::FIELD_CONTENT_TYPE_PLAIN, - ['config_id'] -); -$installer->appendClassAliasReplace( - 'core_layout_update', - 'xml', - \Magento\Framework\Module\Setup\Migration::ENTITY_TYPE_BLOCK, - \Magento\Framework\Module\Setup\Migration::FIELD_CONTENT_TYPE_XML, - ['layout_update_id'] -); -$installer->doUpdateClassAliases(); - -$installer->endSetup(); diff --git a/app/code/Magento/Core/data/core_setup/data-upgrade-1.6.0.4-1.6.0.5.php b/app/code/Magento/Core/data/core_setup/data-upgrade-1.6.0.4-1.6.0.5.php deleted file mode 100644 index eff4cb82e8f51..0000000000000 --- a/app/code/Magento/Core/data/core_setup/data-upgrade-1.6.0.4-1.6.0.5.php +++ /dev/null @@ -1,19 +0,0 @@ -startSetup(); - -$tableName = $installer->getTable('authorization_rule'); -if ($tableName) { - $installer->getConnection()->delete($tableName, ['resource_id = ?' => 'admin/system/tools/compiler']); -} -$tableName = $installer->getTable('core_resource'); -if ($tableName) { - $installer->getConnection()->delete($tableName, ['code = ?' => 'admin_setup']); -} - -$installer->endSetup(); diff --git a/app/code/Magento/Core/data/core_setup/data-upgrade-1.6.0.5-1.6.0.6.php b/app/code/Magento/Core/data/core_setup/data-upgrade-1.6.0.5-1.6.0.6.php deleted file mode 100644 index 408470a81b155..0000000000000 --- a/app/code/Magento/Core/data/core_setup/data-upgrade-1.6.0.5-1.6.0.6.php +++ /dev/null @@ -1,14 +0,0 @@ -startSetup(); - -$connection = $installer->getConnection(); -$connection->update($installer->getTable('core_theme'), ['area' => 'frontend'], ['area = ?' => '']); - -$installer->endSetup(); -$installer->getEventManager()->dispatch('theme_registration_from_filesystem'); diff --git a/app/code/Magento/Core/etc/module.xml b/app/code/Magento/Core/etc/module.xml index 430e8064b9e3b..bf0d78f9925a8 100644 --- a/app/code/Magento/Core/etc/module.xml +++ b/app/code/Magento/Core/etc/module.xml @@ -5,6 +5,6 @@ */ --> - + diff --git a/app/code/Magento/Core/sql/core_setup/install-1.6.0.0.php b/app/code/Magento/Core/sql/core_setup/install-1.6.0.0.php deleted file mode 100644 index f448eedd6c0fe..0000000000000 --- a/app/code/Magento/Core/sql/core_setup/install-1.6.0.0.php +++ /dev/null @@ -1,507 +0,0 @@ -startSetup(); - -/** - * Create table 'core_resource' - */ -$table = $installer->getConnection()->newTable( - $installer->getTable('core_resource') -)->addColumn( - 'code', - \Magento\Framework\DB\Ddl\Table::TYPE_TEXT, - 50, - ['nullable' => false, 'primary' => true], - 'Resource Code' -)->addColumn( - 'version', - \Magento\Framework\DB\Ddl\Table::TYPE_TEXT, - 50, - [], - 'Resource Version' -)->addColumn( - 'data_version', - \Magento\Framework\DB\Ddl\Table::TYPE_TEXT, - 50, - [], - 'Data Version' -)->setComment( - 'Resources' -); -$installer->getConnection()->createTable($table); - -/** - * Create table 'core_config_data' - */ -$table = $installer->getConnection()->newTable( - $installer->getTable('core_config_data') -)->addColumn( - 'config_id', - \Magento\Framework\DB\Ddl\Table::TYPE_INTEGER, - null, - ['identity' => true, 'unsigned' => true, 'nullable' => false, 'primary' => true], - 'Config Id' -)->addColumn( - 'scope', - \Magento\Framework\DB\Ddl\Table::TYPE_TEXT, - 8, - ['nullable' => false, 'default' => 'default'], - 'Config Scope' -)->addColumn( - 'scope_id', - \Magento\Framework\DB\Ddl\Table::TYPE_INTEGER, - null, - ['nullable' => false, 'default' => '0'], - 'Config Scope Id' -)->addColumn( - 'path', - \Magento\Framework\DB\Ddl\Table::TYPE_TEXT, - 255, - ['nullable' => false, 'default' => 'general'], - 'Config Path' -)->addColumn( - 'value', - \Magento\Framework\DB\Ddl\Table::TYPE_TEXT, - '64k', - [], - 'Config Value' -)->addIndex( - $installer->getIdxName( - 'core_config_data', - ['scope', 'scope_id', 'path'], - \Magento\Framework\DB\Adapter\AdapterInterface::INDEX_TYPE_UNIQUE - ), - ['scope', 'scope_id', 'path'], - ['type' => \Magento\Framework\DB\Adapter\AdapterInterface::INDEX_TYPE_UNIQUE] -)->setComment( - 'Config Data' -); -$installer->getConnection()->createTable($table); - -/** - * Create table 'core_layout_update' - */ -$table = $installer->getConnection()->newTable( - $installer->getTable('core_layout_update') -)->addColumn( - 'layout_update_id', - \Magento\Framework\DB\Ddl\Table::TYPE_INTEGER, - null, - ['identity' => true, 'unsigned' => true, 'nullable' => false, 'primary' => true], - 'Layout Update Id' -)->addColumn( - 'handle', - \Magento\Framework\DB\Ddl\Table::TYPE_TEXT, - 255, - [], - 'Handle' -)->addColumn( - 'xml', - \Magento\Framework\DB\Ddl\Table::TYPE_TEXT, - '64k', - [], - 'Xml' -)->addColumn( - 'sort_order', - \Magento\Framework\DB\Ddl\Table::TYPE_SMALLINT, - null, - ['nullable' => false, 'default' => '0'], - 'Sort Order' -)->addIndex( - $installer->getIdxName('core_layout_update', ['handle']), - ['handle'] -)->setComment( - 'Layout Updates' -); -$installer->getConnection()->createTable($table); - -/** - * Create table 'core_layout_link' - */ -$table = $installer->getConnection()->newTable( - $installer->getTable('core_layout_link') -)->addColumn( - 'layout_link_id', - \Magento\Framework\DB\Ddl\Table::TYPE_INTEGER, - null, - ['identity' => true, 'unsigned' => true, 'nullable' => false, 'primary' => true], - 'Link Id' -)->addColumn( - 'store_id', - \Magento\Framework\DB\Ddl\Table::TYPE_SMALLINT, - null, - ['unsigned' => true, 'nullable' => false, 'default' => '0'], - 'Store Id' -)->addColumn( - 'area', - \Magento\Framework\DB\Ddl\Table::TYPE_TEXT, - 64, - [], - 'Area' -)->addColumn( - 'package', - \Magento\Framework\DB\Ddl\Table::TYPE_TEXT, - 64, - [], - 'Package' -)->addColumn( - 'theme', - \Magento\Framework\DB\Ddl\Table::TYPE_TEXT, - 64, - [], - 'Theme' -)->addColumn( - 'layout_update_id', - \Magento\Framework\DB\Ddl\Table::TYPE_INTEGER, - null, - ['unsigned' => true, 'nullable' => false, 'default' => '0'], - 'Layout Update Id' -)->addIndex( - $installer->getIdxName( - 'core_layout_link', - ['store_id', 'package', 'theme', 'layout_update_id'], - \Magento\Framework\DB\Adapter\AdapterInterface::INDEX_TYPE_UNIQUE - ), - ['store_id', 'package', 'theme', 'layout_update_id'], - ['type' => \Magento\Framework\DB\Adapter\AdapterInterface::INDEX_TYPE_UNIQUE] -)->addIndex( - $installer->getIdxName('core_layout_link', ['layout_update_id']), - ['layout_update_id'] -)->addForeignKey( - $installer->getFkName('core_layout_link', 'store_id', 'store', 'store_id'), - 'store_id', - $installer->getTable('store'), - 'store_id', - \Magento\Framework\DB\Ddl\Table::ACTION_CASCADE, - \Magento\Framework\DB\Ddl\Table::ACTION_CASCADE -)->addForeignKey( - $installer->getFkName('core_layout_link', 'layout_update_id', 'core_layout_update', 'layout_update_id'), - 'layout_update_id', - $installer->getTable('core_layout_update'), - 'layout_update_id', - \Magento\Framework\DB\Ddl\Table::ACTION_CASCADE, - \Magento\Framework\DB\Ddl\Table::ACTION_CASCADE -)->setComment( - 'Layout Link' -); -$installer->getConnection()->createTable($table); - -/** - * Create table 'core_session' - */ -$table = $installer->getConnection()->newTable( - $installer->getTable('core_session') -)->addColumn( - 'session_id', - \Magento\Framework\DB\Ddl\Table::TYPE_TEXT, - 255, - ['nullable' => false, 'primary' => true], - 'Session Id' -)->addColumn( - 'session_expires', - \Magento\Framework\DB\Ddl\Table::TYPE_INTEGER, - null, - ['unsigned' => true, 'nullable' => false, 'default' => '0'], - 'Date of Session Expiration' -)->addColumn( - 'session_data', - \Magento\Framework\DB\Ddl\Table::TYPE_BLOB, - '2M', - ['nullable' => false], - 'Session Data' -)->setComment( - 'Database Sessions Storage' -); -$installer->getConnection()->createTable($table); - -/** - * Create table 'design_change' - */ -$table = $installer->getConnection()->newTable( - $installer->getTable('design_change') -)->addColumn( - 'design_change_id', - \Magento\Framework\DB\Ddl\Table::TYPE_INTEGER, - null, - ['identity' => true, 'nullable' => false, 'primary' => true], - 'Design Change Id' -)->addColumn( - 'store_id', - \Magento\Framework\DB\Ddl\Table::TYPE_SMALLINT, - null, - ['unsigned' => true, 'nullable' => false, 'default' => '0'], - 'Store Id' -)->addColumn( - 'design', - \Magento\Framework\DB\Ddl\Table::TYPE_TEXT, - 255, - [], - 'Design' -)->addColumn( - 'date_from', - \Magento\Framework\DB\Ddl\Table::TYPE_DATE, - null, - [], - 'First Date of Design Activity' -)->addColumn( - 'date_to', - \Magento\Framework\DB\Ddl\Table::TYPE_DATE, - null, - [], - 'Last Date of Design Activity' -)->addIndex( - $installer->getIdxName('design_change', ['store_id']), - ['store_id'] -)->addForeignKey( - $installer->getFkName('design_change', 'store_id', 'store', 'store_id'), - 'store_id', - $installer->getTable('store'), - 'store_id', - \Magento\Framework\DB\Ddl\Table::ACTION_CASCADE, - \Magento\Framework\DB\Ddl\Table::ACTION_CASCADE -)->setComment( - 'Design Changes' -); -$installer->getConnection()->createTable($table); - -/** - * Create table 'core_variable' - */ -$table = $installer->getConnection()->newTable( - $installer->getTable('core_variable') -)->addColumn( - 'variable_id', - \Magento\Framework\DB\Ddl\Table::TYPE_INTEGER, - null, - ['identity' => true, 'unsigned' => true, 'nullable' => false, 'primary' => true], - 'Variable Id' -)->addColumn( - 'code', - \Magento\Framework\DB\Ddl\Table::TYPE_TEXT, - 255, - [], - 'Variable Code' -)->addColumn( - 'name', - \Magento\Framework\DB\Ddl\Table::TYPE_TEXT, - 255, - [], - 'Variable Name' -)->addIndex( - $installer->getIdxName( - 'core_variable', - ['code'], - \Magento\Framework\DB\Adapter\AdapterInterface::INDEX_TYPE_UNIQUE - ), - ['code'], - ['type' => \Magento\Framework\DB\Adapter\AdapterInterface::INDEX_TYPE_UNIQUE] -)->setComment( - 'Variables' -); -$installer->getConnection()->createTable($table); - -/** - * Create table 'core_variable_value' - */ -$table = $installer->getConnection()->newTable( - $installer->getTable('core_variable_value') -)->addColumn( - 'value_id', - \Magento\Framework\DB\Ddl\Table::TYPE_INTEGER, - null, - ['identity' => true, 'unsigned' => true, 'nullable' => false, 'primary' => true], - 'Variable Value Id' -)->addColumn( - 'variable_id', - \Magento\Framework\DB\Ddl\Table::TYPE_INTEGER, - null, - ['unsigned' => true, 'nullable' => false, 'default' => '0'], - 'Variable Id' -)->addColumn( - 'store_id', - \Magento\Framework\DB\Ddl\Table::TYPE_SMALLINT, - null, - ['unsigned' => true, 'nullable' => false, 'default' => '0'], - 'Store Id' -)->addColumn( - 'plain_value', - \Magento\Framework\DB\Ddl\Table::TYPE_TEXT, - '64k', - [], - 'Plain Text Value' -)->addColumn( - 'html_value', - \Magento\Framework\DB\Ddl\Table::TYPE_TEXT, - '64k', - [], - 'Html Value' -)->addIndex( - $installer->getIdxName( - 'core_variable_value', - ['variable_id', 'store_id'], - \Magento\Framework\DB\Adapter\AdapterInterface::INDEX_TYPE_UNIQUE - ), - ['variable_id', 'store_id'], - ['type' => \Magento\Framework\DB\Adapter\AdapterInterface::INDEX_TYPE_UNIQUE] -)->addIndex( - $installer->getIdxName('core_variable_value', ['store_id']), - ['store_id'] -)->addForeignKey( - $installer->getFkName('core_variable_value', 'store_id', 'store', 'store_id'), - 'store_id', - $installer->getTable('store'), - 'store_id', - \Magento\Framework\DB\Ddl\Table::ACTION_CASCADE, - \Magento\Framework\DB\Ddl\Table::ACTION_CASCADE -)->addForeignKey( - $installer->getFkName('core_variable_value', 'variable_id', 'core_variable', 'variable_id'), - 'variable_id', - $installer->getTable('core_variable'), - 'variable_id', - \Magento\Framework\DB\Ddl\Table::ACTION_CASCADE, - \Magento\Framework\DB\Ddl\Table::ACTION_CASCADE -)->setComment( - 'Variable Value' -); -$installer->getConnection()->createTable($table); - -/** - * Create table 'core_cache' - */ -$table = $installer->getConnection()->newTable( - $installer->getTable('core_cache') -)->addColumn( - 'id', - \Magento\Framework\DB\Ddl\Table::TYPE_TEXT, - 200, - ['nullable' => false, 'primary' => true], - 'Cache Id' -)->addColumn( - 'data', - \Magento\Framework\DB\Ddl\Table::TYPE_BLOB, - '2M', - [], - 'Cache Data' -)->addColumn( - 'create_time', - \Magento\Framework\DB\Ddl\Table::TYPE_INTEGER, - null, - [], - 'Cache Creation Time' -)->addColumn( - 'update_time', - \Magento\Framework\DB\Ddl\Table::TYPE_INTEGER, - null, - [], - 'Time of Cache Updating' -)->addColumn( - 'expire_time', - \Magento\Framework\DB\Ddl\Table::TYPE_INTEGER, - null, - [], - 'Cache Expiration Time' -)->addIndex( - $installer->getIdxName('core_cache', ['expire_time']), - ['expire_time'] -)->setComment( - 'Caches' -); -$installer->getConnection()->createTable($table); - -/** - * Create table 'core_cache_tag' - */ -$table = $installer->getConnection()->newTable( - $installer->getTable('core_cache_tag') -)->addColumn( - 'tag', - \Magento\Framework\DB\Ddl\Table::TYPE_TEXT, - 100, - ['nullable' => false, 'primary' => true], - 'Tag' -)->addColumn( - 'cache_id', - \Magento\Framework\DB\Ddl\Table::TYPE_TEXT, - 200, - ['nullable' => false, 'primary' => true], - 'Cache Id' -)->addIndex( - $installer->getIdxName('core_cache_tag', ['cache_id']), - ['cache_id'] -)->setComment( - 'Tag Caches' -); -$installer->getConnection()->createTable($table); - -/** - * Create table 'core_cache_option' - */ -$table = $installer->getConnection()->newTable( - $installer->getTable('core_cache_option') -)->addColumn( - 'code', - \Magento\Framework\DB\Ddl\Table::TYPE_TEXT, - 32, - ['nullable' => false, 'primary' => true], - 'Code' -)->addColumn( - 'value', - \Magento\Framework\DB\Ddl\Table::TYPE_SMALLINT, - null, - [], - 'Value' -)->setComment( - 'Cache Options' -); -$installer->getConnection()->createTable($table); - -/** - * Create table 'core_flag' - */ -$table = $installer->getConnection()->newTable( - $installer->getTable('core_flag') -)->addColumn( - 'flag_id', - \Magento\Framework\DB\Ddl\Table::TYPE_INTEGER, - null, - ['identity' => true, 'unsigned' => true, 'nullable' => false, 'primary' => true], - 'Flag Id' -)->addColumn( - 'flag_code', - \Magento\Framework\DB\Ddl\Table::TYPE_TEXT, - 255, - ['nullable' => false], - 'Flag Code' -)->addColumn( - 'state', - \Magento\Framework\DB\Ddl\Table::TYPE_SMALLINT, - null, - ['unsigned' => true, 'nullable' => false, 'default' => '0'], - 'Flag State' -)->addColumn( - 'flag_data', - \Magento\Framework\DB\Ddl\Table::TYPE_TEXT, - '64k', - [], - 'Flag Data' -)->addColumn( - 'last_update', - \Magento\Framework\DB\Ddl\Table::TYPE_TIMESTAMP, - null, - ['nullable' => false, 'default' => \Magento\Framework\DB\Ddl\Table::TIMESTAMP_INIT_UPDATE], - 'Date of Last Flag Update' -)->addIndex( - $installer->getIdxName('core_flag', ['last_update']), - ['last_update'] -)->setComment( - 'Flag' -); -$installer->getConnection()->createTable($table); - -$installer->endSetup(); diff --git a/app/code/Magento/Core/sql/core_setup/install-2.0.0.php b/app/code/Magento/Core/sql/core_setup/install-2.0.0.php new file mode 100644 index 0000000000000..ef6037e881bc2 --- /dev/null +++ b/app/code/Magento/Core/sql/core_setup/install-2.0.0.php @@ -0,0 +1,631 @@ +getConnection(); + +$installer->startSetup(); + +/** + * Create table 'core_resource' + */ +$table = $connection->newTable( + $installer->getTable('core_resource') +)->addColumn( + 'code', + \Magento\Framework\DB\Ddl\Table::TYPE_TEXT, + 50, + ['nullable' => false, 'primary' => true], + 'Resource Code' +)->addColumn( + 'version', + \Magento\Framework\DB\Ddl\Table::TYPE_TEXT, + 50, + [], + 'Resource Version' +)->addColumn( + 'data_version', + \Magento\Framework\DB\Ddl\Table::TYPE_TEXT, + 50, + [], + 'Data Version' +)->setComment( + 'Resources' +); +$connection->createTable($table); + +/** + * Create table 'core_config_data' + */ +$table = $connection->newTable( + $installer->getTable('core_config_data') +)->addColumn( + 'config_id', + \Magento\Framework\DB\Ddl\Table::TYPE_INTEGER, + null, + ['identity' => true, 'unsigned' => true, 'nullable' => false, 'primary' => true], + 'Config Id' +)->addColumn( + 'scope', + \Magento\Framework\DB\Ddl\Table::TYPE_TEXT, + 8, + ['nullable' => false, 'default' => 'default'], + 'Config Scope' +)->addColumn( + 'scope_id', + \Magento\Framework\DB\Ddl\Table::TYPE_INTEGER, + null, + ['nullable' => false, 'default' => '0'], + 'Config Scope Id' +)->addColumn( + 'path', + \Magento\Framework\DB\Ddl\Table::TYPE_TEXT, + 255, + ['nullable' => false, 'default' => 'general'], + 'Config Path' +)->addColumn( + 'value', + \Magento\Framework\DB\Ddl\Table::TYPE_TEXT, + '64k', + [], + 'Config Value' +)->addIndex( + $installer->getIdxName( + 'core_config_data', + ['scope', 'scope_id', 'path'], + \Magento\Framework\DB\Adapter\AdapterInterface::INDEX_TYPE_UNIQUE + ), + ['scope', 'scope_id', 'path'], + ['type' => \Magento\Framework\DB\Adapter\AdapterInterface::INDEX_TYPE_UNIQUE] +)->setComment( + 'Config Data' +); +$connection->createTable($table); + +/** + * Create table 'core_layout_update' + */ +$table = $connection->newTable( + $installer->getTable('core_layout_update') +)->addColumn( + 'layout_update_id', + \Magento\Framework\DB\Ddl\Table::TYPE_INTEGER, + null, + ['identity' => true, 'unsigned' => true, 'nullable' => false, 'primary' => true], + 'Layout Update Id' +)->addColumn( + 'handle', + \Magento\Framework\DB\Ddl\Table::TYPE_TEXT, + 255, + [], + 'Handle' +)->addColumn( + 'xml', + \Magento\Framework\DB\Ddl\Table::TYPE_TEXT, + '64k', + [], + 'Xml' +)->addColumn( + 'sort_order', + \Magento\Framework\DB\Ddl\Table::TYPE_SMALLINT, + null, + ['nullable' => false, 'default' => '0'], + 'Sort Order' +)->addColumn( + 'updated_at', + \Magento\Framework\DB\Ddl\Table::TYPE_TIMESTAMP, + null, + ['nullable' => true], + 'Last Update Timestamp' +)->addIndex( + $installer->getIdxName('core_layout_update', ['handle']), + ['handle'] +)->setComment( + 'Layout Updates' +); +$connection->createTable($table); + +/** + * Create table 'core_layout_link' + */ +$table = $connection->newTable( + $installer->getTable('core_layout_link') +)->addColumn( + 'layout_link_id', + \Magento\Framework\DB\Ddl\Table::TYPE_INTEGER, + null, + ['identity' => true, 'unsigned' => true, 'nullable' => false, 'primary' => true], + 'Link Id' +)->addColumn( + 'store_id', + \Magento\Framework\DB\Ddl\Table::TYPE_SMALLINT, + null, + ['unsigned' => true, 'nullable' => false, 'default' => '0'], + 'Store Id' +)->addColumn( + 'theme_id', + \Magento\Framework\DB\Ddl\Table::TYPE_INTEGER, + null, + ['unsigned' => true, 'nullable' => false], + 'Theme id' +)->addColumn( + 'layout_update_id', + \Magento\Framework\DB\Ddl\Table::TYPE_INTEGER, + null, + ['unsigned' => true, 'nullable' => false, 'default' => '0'], + 'Layout Update Id' +)->addColumn( + 'is_temporary', + \Magento\Framework\DB\Ddl\Table::TYPE_BOOLEAN, + null, + ['nullable' => false, 'default' => '0'], + 'Defines whether Layout Update is Temporary' +)->addIndex( + $installer->getIdxName('core_layout_link', ['layout_update_id']), + ['layout_update_id'] +)->addForeignKey( + $installer->getFkName('core_layout_link', 'layout_update_id', 'core_layout_update', 'layout_update_id'), + 'layout_update_id', + $installer->getTable('core_layout_update'), + 'layout_update_id', + \Magento\Framework\DB\Ddl\Table::ACTION_CASCADE, + \Magento\Framework\DB\Ddl\Table::ACTION_CASCADE +)->addIndex( + $installer->getIdxName( + 'core_layout_link', + ['store_id', 'theme_id', 'layout_update_id', 'is_temporary'], + \Magento\Framework\DB\Adapter\AdapterInterface::INDEX_TYPE_UNIQUE + ), + ['store_id', 'theme_id', 'layout_update_id', 'is_temporary'] +)->addForeignKey( + $installer->getFkName('core_layout_link', 'store_id', 'store', 'store_id'), + 'store_id', + $installer->getTable('store'), + 'store_id', + \Magento\Framework\DB\Ddl\Table::ACTION_CASCADE, + \Magento\Framework\DB\Ddl\Table::ACTION_CASCADE +)->addForeignKey( + $installer->getFkName('core_layout_link', 'theme_id', 'core_theme', 'theme_id'), + 'theme_id', + $installer->getTable('core_theme'), + 'theme_id', + \Magento\Framework\DB\Ddl\Table::ACTION_CASCADE, + \Magento\Framework\DB\Ddl\Table::ACTION_CASCADE +)->setComment( + 'Layout Link' +); +$connection->createTable($table); + +/** + * Create table 'core_session' + */ +$table = $connection->newTable( + $installer->getTable('core_session') +)->addColumn( + 'session_id', + \Magento\Framework\DB\Ddl\Table::TYPE_TEXT, + 255, + ['nullable' => false, 'primary' => true], + 'Session Id' +)->addColumn( + 'session_expires', + \Magento\Framework\DB\Ddl\Table::TYPE_INTEGER, + null, + ['unsigned' => true, 'nullable' => false, 'default' => '0'], + 'Date of Session Expiration' +)->addColumn( + 'session_data', + \Magento\Framework\DB\Ddl\Table::TYPE_BLOB, + '2M', + ['nullable' => false], + 'Session Data' +)->setComment( + 'Database Sessions Storage' +); +$connection->createTable($table); + +/** + * Create table 'design_change' + */ +$table = $connection->newTable( + $installer->getTable('design_change') +)->addColumn( + 'design_change_id', + \Magento\Framework\DB\Ddl\Table::TYPE_INTEGER, + null, + ['identity' => true, 'nullable' => false, 'primary' => true], + 'Design Change Id' +)->addColumn( + 'store_id', + \Magento\Framework\DB\Ddl\Table::TYPE_SMALLINT, + null, + ['unsigned' => true, 'nullable' => false, 'default' => '0'], + 'Store Id' +)->addColumn( + 'design', + \Magento\Framework\DB\Ddl\Table::TYPE_TEXT, + 255, + [], + 'Design' +)->addColumn( + 'date_from', + \Magento\Framework\DB\Ddl\Table::TYPE_DATE, + null, + [], + 'First Date of Design Activity' +)->addColumn( + 'date_to', + \Magento\Framework\DB\Ddl\Table::TYPE_DATE, + null, + [], + 'Last Date of Design Activity' +)->addIndex( + $installer->getIdxName('design_change', ['store_id']), + ['store_id'] +)->addForeignKey( + $installer->getFkName('design_change', 'store_id', 'store', 'store_id'), + 'store_id', + $installer->getTable('store'), + 'store_id', + \Magento\Framework\DB\Ddl\Table::ACTION_CASCADE, + \Magento\Framework\DB\Ddl\Table::ACTION_CASCADE +)->setComment( + 'Design Changes' +); +$connection->createTable($table); + +/** + * Create table 'core_variable' + */ +$table = $connection->newTable( + $installer->getTable('core_variable') +)->addColumn( + 'variable_id', + \Magento\Framework\DB\Ddl\Table::TYPE_INTEGER, + null, + ['identity' => true, 'unsigned' => true, 'nullable' => false, 'primary' => true], + 'Variable Id' +)->addColumn( + 'code', + \Magento\Framework\DB\Ddl\Table::TYPE_TEXT, + 255, + [], + 'Variable Code' +)->addColumn( + 'name', + \Magento\Framework\DB\Ddl\Table::TYPE_TEXT, + 255, + [], + 'Variable Name' +)->addIndex( + $installer->getIdxName( + 'core_variable', + ['code'], + \Magento\Framework\DB\Adapter\AdapterInterface::INDEX_TYPE_UNIQUE + ), + ['code'], + ['type' => \Magento\Framework\DB\Adapter\AdapterInterface::INDEX_TYPE_UNIQUE] +)->setComment( + 'Variables' +); +$connection->createTable($table); + +/** + * Create table 'core_variable_value' + */ +$table = $connection->newTable( + $installer->getTable('core_variable_value') +)->addColumn( + 'value_id', + \Magento\Framework\DB\Ddl\Table::TYPE_INTEGER, + null, + ['identity' => true, 'unsigned' => true, 'nullable' => false, 'primary' => true], + 'Variable Value Id' +)->addColumn( + 'variable_id', + \Magento\Framework\DB\Ddl\Table::TYPE_INTEGER, + null, + ['unsigned' => true, 'nullable' => false, 'default' => '0'], + 'Variable Id' +)->addColumn( + 'store_id', + \Magento\Framework\DB\Ddl\Table::TYPE_SMALLINT, + null, + ['unsigned' => true, 'nullable' => false, 'default' => '0'], + 'Store Id' +)->addColumn( + 'plain_value', + \Magento\Framework\DB\Ddl\Table::TYPE_TEXT, + '64k', + [], + 'Plain Text Value' +)->addColumn( + 'html_value', + \Magento\Framework\DB\Ddl\Table::TYPE_TEXT, + '64k', + [], + 'Html Value' +)->addIndex( + $installer->getIdxName( + 'core_variable_value', + ['variable_id', 'store_id'], + \Magento\Framework\DB\Adapter\AdapterInterface::INDEX_TYPE_UNIQUE + ), + ['variable_id', 'store_id'], + ['type' => \Magento\Framework\DB\Adapter\AdapterInterface::INDEX_TYPE_UNIQUE] +)->addIndex( + $installer->getIdxName('core_variable_value', ['store_id']), + ['store_id'] +)->addForeignKey( + $installer->getFkName('core_variable_value', 'store_id', 'store', 'store_id'), + 'store_id', + $installer->getTable('store'), + 'store_id', + \Magento\Framework\DB\Ddl\Table::ACTION_CASCADE, + \Magento\Framework\DB\Ddl\Table::ACTION_CASCADE +)->addForeignKey( + $installer->getFkName('core_variable_value', 'variable_id', 'core_variable', 'variable_id'), + 'variable_id', + $installer->getTable('core_variable'), + 'variable_id', + \Magento\Framework\DB\Ddl\Table::ACTION_CASCADE, + \Magento\Framework\DB\Ddl\Table::ACTION_CASCADE +)->setComment( + 'Variable Value' +); +$connection->createTable($table); + +/** + * Create table 'core_cache' + */ +$table = $connection->newTable( + $installer->getTable('core_cache') +)->addColumn( + 'id', + \Magento\Framework\DB\Ddl\Table::TYPE_TEXT, + 200, + ['nullable' => false, 'primary' => true], + 'Cache Id' +)->addColumn( + 'data', + \Magento\Framework\DB\Ddl\Table::TYPE_BLOB, + '2M', + [], + 'Cache Data' +)->addColumn( + 'create_time', + \Magento\Framework\DB\Ddl\Table::TYPE_INTEGER, + null, + [], + 'Cache Creation Time' +)->addColumn( + 'update_time', + \Magento\Framework\DB\Ddl\Table::TYPE_INTEGER, + null, + [], + 'Time of Cache Updating' +)->addColumn( + 'expire_time', + \Magento\Framework\DB\Ddl\Table::TYPE_INTEGER, + null, + [], + 'Cache Expiration Time' +)->addIndex( + $installer->getIdxName('core_cache', ['expire_time']), + ['expire_time'] +)->setComment( + 'Caches' +); +$connection->createTable($table); + +/** + * Create table 'core_cache_tag' + */ +$table = $connection->newTable( + $installer->getTable('core_cache_tag') +)->addColumn( + 'tag', + \Magento\Framework\DB\Ddl\Table::TYPE_TEXT, + 100, + ['nullable' => false, 'primary' => true], + 'Tag' +)->addColumn( + 'cache_id', + \Magento\Framework\DB\Ddl\Table::TYPE_TEXT, + 200, + ['nullable' => false, 'primary' => true], + 'Cache Id' +)->addIndex( + $installer->getIdxName('core_cache_tag', ['cache_id']), + ['cache_id'] +)->setComment( + 'Tag Caches' +); +$connection->createTable($table); + +/** + * Create table 'core_flag' + */ +$table = $connection->newTable( + $installer->getTable('core_flag') +)->addColumn( + 'flag_id', + \Magento\Framework\DB\Ddl\Table::TYPE_INTEGER, + null, + ['identity' => true, 'unsigned' => true, 'nullable' => false, 'primary' => true], + 'Flag Id' +)->addColumn( + 'flag_code', + \Magento\Framework\DB\Ddl\Table::TYPE_TEXT, + 255, + ['nullable' => false], + 'Flag Code' +)->addColumn( + 'state', + \Magento\Framework\DB\Ddl\Table::TYPE_SMALLINT, + null, + ['unsigned' => true, 'nullable' => false, 'default' => '0'], + 'Flag State' +)->addColumn( + 'flag_data', + \Magento\Framework\DB\Ddl\Table::TYPE_TEXT, + '64k', + [], + 'Flag Data' +)->addColumn( + 'last_update', + \Magento\Framework\DB\Ddl\Table::TYPE_TIMESTAMP, + null, + ['nullable' => false, 'default' => \Magento\Framework\DB\Ddl\Table::TIMESTAMP_INIT_UPDATE], + 'Date of Last Flag Update' +)->addIndex( + $installer->getIdxName('core_flag', ['last_update']), + ['last_update'] +)->setComment( + 'Flag' +); +$connection->createTable($table); + +/** + * Drop Foreign Key on core_cache_tag.cache_id + */ +$connection->dropForeignKey( + $installer->getTable('core_cache_tag'), + $installer->getFkName('core_cache_tag', 'cache_id', 'core_cache', 'id') +); + +/** + * Create table 'core_theme' + */ +$table = $connection->newTable( + $installer->getTable('core_theme') +)->addColumn( + 'theme_id', + \Magento\Framework\DB\Ddl\Table::TYPE_INTEGER, + null, + ['identity' => true, 'unsigned' => true, 'nullable' => false, 'primary' => true], + 'Theme identifier' +)->addColumn( + 'parent_id', + \Magento\Framework\DB\Ddl\Table::TYPE_INTEGER, + null, + ['nullable' => true], + 'Parent Id' +)->addColumn( + 'theme_path', + \Magento\Framework\DB\Ddl\Table::TYPE_TEXT, + 255, + ['nullable' => true], + 'Theme Path' +)->addColumn( + 'theme_version', + \Magento\Framework\DB\Ddl\Table::TYPE_TEXT, + 255, + ['nullable' => false], + 'Theme Version' +)->addColumn( + 'theme_title', + \Magento\Framework\DB\Ddl\Table::TYPE_TEXT, + 255, + ['nullable' => false], + 'Theme Title' +)->addColumn( + 'preview_image', + \Magento\Framework\DB\Ddl\Table::TYPE_TEXT, + 255, + ['nullable' => true], + 'Preview Image' +)->addColumn( + 'is_featured', + \Magento\Framework\DB\Ddl\Table::TYPE_BOOLEAN, + null, + ['nullable' => false, 'default' => 0], + 'Is Theme Featured' +)->addColumn( + 'area', + \Magento\Framework\DB\Ddl\Table::TYPE_TEXT, + 255, + ['nullable' => false], + 'Theme Area' +)->addColumn( + 'type', + \Magento\Framework\DB\Ddl\Table::TYPE_SMALLINT, + null, + ['nullable' => false], + 'Theme type: 0:physical, 1:virtual, 2:staging' +)->addColumn( + 'code', + \Magento\Framework\DB\Ddl\Table::TYPE_TEXT, + null, + [], + 'Full theme code, including package' +)->setComment( + 'Core theme' +); +$connection->createTable($table); + +/** + * Create table 'core_theme_file' + */ +$table = $connection->newTable( + $installer->getTable('core_theme_file') +)->addColumn( + 'theme_files_id', + \Magento\Framework\DB\Ddl\Table::TYPE_INTEGER, + null, + ['identity' => true, 'unsigned' => true, 'nullable' => false, 'primary' => true], + 'Theme files identifier' +)->addColumn( + 'theme_id', + \Magento\Framework\DB\Ddl\Table::TYPE_INTEGER, + null, + ['nullable' => false, 'unsigned' => true], + 'Theme Id' +)->addColumn( + 'file_path', + \Magento\Framework\DB\Ddl\Table::TYPE_TEXT, + 255, + ['nullable' => true], + 'Relative path to file' +)->addColumn( + 'file_type', + \Magento\Framework\DB\Ddl\Table::TYPE_TEXT, + 32, + ['nullable' => false], + 'File Type' +)->addColumn( + 'content', + \Magento\Framework\DB\Ddl\Table::TYPE_TEXT, + \Magento\Framework\DB\Ddl\Table::MAX_TEXT_SIZE, + ['nullable' => false], + 'File Content' +)->addColumn( + 'sort_order', + \Magento\Framework\DB\Ddl\Table::TYPE_SMALLINT, + null, + ['nullable' => false, 'default' => 0], + 'Sort Order' +)->addColumn( + 'is_temporary', + \Magento\Framework\DB\Ddl\Table::TYPE_BOOLEAN, + null, + ['nullable' => false, 'default' => 0], + 'Is Temporary File' +)->addForeignKey( + $installer->getFkName('core_theme_file', 'theme_id', 'core_theme', 'theme_id'), + 'theme_id', + $installer->getTable('core_theme'), + 'theme_id', + \Magento\Framework\DB\Ddl\Table::ACTION_CASCADE, + \Magento\Framework\DB\Ddl\Table::ACTION_CASCADE +)->setComment( + 'Core theme files' +); +$connection->createTable($table); + +$installer->endSetup(); diff --git a/app/code/Magento/Core/sql/core_setup/upgrade-1.6.0.1-1.6.0.2.php b/app/code/Magento/Core/sql/core_setup/upgrade-1.6.0.1-1.6.0.2.php deleted file mode 100644 index 527136e33cb5e..0000000000000 --- a/app/code/Magento/Core/sql/core_setup/upgrade-1.6.0.1-1.6.0.2.php +++ /dev/null @@ -1,16 +0,0 @@ -startSetup(); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('core_cache_tag'), - $installer->getFkName('core_cache_tag', 'cache_id', 'core_cache', 'id') -); - -$installer->endSetup(); diff --git a/app/code/Magento/Core/sql/core_setup/upgrade-1.6.0.10-1.6.0.11.php b/app/code/Magento/Core/sql/core_setup/upgrade-1.6.0.10-1.6.0.11.php deleted file mode 100644 index 8dc6ee5b68dc4..0000000000000 --- a/app/code/Magento/Core/sql/core_setup/upgrade-1.6.0.10-1.6.0.11.php +++ /dev/null @@ -1,34 +0,0 @@ -startSetup(); -$connection = $installer->getConnection(); - -/** - * Add column 'type' to 'core_theme' - */ -$connection->addColumn( - $installer->getTable('core_theme'), - 'type', - [ - 'type' => \Magento\Framework\DB\Ddl\Table::TYPE_SMALLINT, - 'nullable' => false, - 'comment' => 'Theme type: 0:physical, 1:virtual, 2:staging' - ] -); - -/** - * Rename table - */ -$wrongName = 'core_theme_files'; -$rightName = 'core_theme_file'; -if ($installer->tableExists($wrongName)) { - $connection->renameTable($installer->getTable($wrongName), $installer->getTable($rightName)); -} - -$installer->endSetup(); diff --git a/app/code/Magento/Core/sql/core_setup/upgrade-1.6.0.11-1.6.0.12.php b/app/code/Magento/Core/sql/core_setup/upgrade-1.6.0.11-1.6.0.12.php deleted file mode 100644 index 5ec940a2fb855..0000000000000 --- a/app/code/Magento/Core/sql/core_setup/upgrade-1.6.0.11-1.6.0.12.php +++ /dev/null @@ -1,127 +0,0 @@ -startSetup(); -$connection = $installer->getConnection(); - -$oldName = 'core_theme_files_link'; -$newName = 'core_theme_file_update'; - -$oldTableName = $installer->getTable($oldName); - -/** - * Drop foreign key and index - */ -$connection->dropForeignKey($oldTableName, $installer->getFkName($oldName, 'theme_id', 'core_theme', 'theme_id')); -$connection->dropIndex($oldTableName, $installer->getFkName($oldName, 'theme_id', 'core_theme', 'theme_id')); - -/** - * Rename table - */ -if ($installer->tableExists($oldName)) { - $connection->renameTable($installer->getTable($oldName), $installer->getTable($newName)); -} - -$newTableName = $installer->getTable($newName); - -/** - * Rename column - */ -$oldColumn = 'files_link_id'; -$newColumn = 'file_update_id'; -$connection->changeColumn( - $newTableName, - $oldColumn, - $newColumn, - [ - 'type' => \Magento\Framework\DB\Ddl\Table::TYPE_INTEGER, - 'primary' => true, - 'nullable' => false, - 'unsigned' => true, - 'comment' => 'Customization file update id' - ] -); - -/** - * Rename column - */ -$oldColumn = 'layout_link_id'; -$newColumn = 'layout_update_id'; -$connection->changeColumn( - $newTableName, - $oldColumn, - $newColumn, - [ - 'type' => \Magento\Framework\DB\Ddl\Table::TYPE_INTEGER, - 'nullable' => false, - 'unsigned' => true, - 'comment' => 'Theme layout update id' - ] -); - -/** - * Add foreign keys and indexes - */ -$connection->addIndex( - $newTableName, - $installer->getIdxName( - $newTableName, - 'theme_id', - \Magento\Framework\DB\Adapter\AdapterInterface::INDEX_TYPE_UNIQUE - ), - 'theme_id', - \Magento\Framework\DB\Adapter\AdapterInterface::INDEX_TYPE_UNIQUE -); -$connection->addForeignKey( - $installer->getFkName($newTableName, 'theme_id', 'core_theme', 'theme_id'), - $newTableName, - 'theme_id', - $installer->getTable('core_theme'), - 'theme_id', - \Magento\Framework\DB\Ddl\Table::ACTION_CASCADE, - \Magento\Framework\DB\Ddl\Table::ACTION_CASCADE -); -$connection->addIndex( - $newTableName, - $installer->getIdxName( - $newTableName, - 'layout_update_id', - \Magento\Framework\DB\Adapter\AdapterInterface::INDEX_TYPE_INDEX - ), - 'layout_update_id', - \Magento\Framework\DB\Adapter\AdapterInterface::INDEX_TYPE_INDEX -); -$connection->addForeignKey( - $installer->getFkName($newTableName, 'layout_update_id', 'core_layout_update', 'layout_update_id'), - $newTableName, - 'layout_update_id', - $installer->getTable('core_layout_update'), - 'layout_update_id', - \Magento\Framework\DB\Ddl\Table::ACTION_CASCADE, - \Magento\Framework\DB\Ddl\Table::ACTION_CASCADE -); - -/** - * Change data - */ -$select = $connection->select()->from( - $newTableName -)->join( - ['link' => $installer->getTable('core_layout_link')], - sprintf('link.layout_link_id = %s.layout_update_id', $newTableName) -); -$rows = $connection->fetchAll($select); -foreach ($rows as $row) { - $connection->update( - $newTableName, - ['layout_update_id' => $row['layout_update_id']], - 'file_update_id = ' . $row['file_update_id'] - ); -} - -$installer->endSetup(); diff --git a/app/code/Magento/Core/sql/core_setup/upgrade-1.6.0.12-1.6.0.13.php b/app/code/Magento/Core/sql/core_setup/upgrade-1.6.0.12-1.6.0.13.php deleted file mode 100644 index 49b3f27223bc6..0000000000000 --- a/app/code/Magento/Core/sql/core_setup/upgrade-1.6.0.12-1.6.0.13.php +++ /dev/null @@ -1,16 +0,0 @@ -startSetup(); - -$installer->getConnection()->addColumn( - $installer->getTable('core_theme'), - 'code', - ['type' => \Magento\Framework\DB\Ddl\Table::TYPE_TEXT, 'comment' => 'Full theme code, including package'] -); - -$installer->endSetup(); diff --git a/app/code/Magento/Core/sql/core_setup/upgrade-1.6.0.13-1.6.0.14.php b/app/code/Magento/Core/sql/core_setup/upgrade-1.6.0.13-1.6.0.14.php deleted file mode 100644 index 00ab1ee3c3c2b..0000000000000 --- a/app/code/Magento/Core/sql/core_setup/upgrade-1.6.0.13-1.6.0.14.php +++ /dev/null @@ -1,8 +0,0 @@ -getConnection(); -$connection->dropTable('core_theme_file_update'); diff --git a/app/code/Magento/Core/sql/core_setup/upgrade-1.6.0.14-1.6.0.15.php b/app/code/Magento/Core/sql/core_setup/upgrade-1.6.0.14-1.6.0.15.php deleted file mode 100644 index 4257a01edf4cf..0000000000000 --- a/app/code/Magento/Core/sql/core_setup/upgrade-1.6.0.14-1.6.0.15.php +++ /dev/null @@ -1,17 +0,0 @@ -startSetup(); - -$connection = $installer->getConnection(); -$table = $installer->getTable('core_theme'); - -$connection->dropColumn($table, 'magento_version_from'); -$connection->dropColumn($table, 'magento_version_to'); - -$installer->endSetup(); diff --git a/app/code/Magento/Core/sql/core_setup/upgrade-1.6.0.15-1.6.0.16.php b/app/code/Magento/Core/sql/core_setup/upgrade-1.6.0.15-1.6.0.16.php deleted file mode 100644 index 0777681baf761..0000000000000 --- a/app/code/Magento/Core/sql/core_setup/upgrade-1.6.0.15-1.6.0.16.php +++ /dev/null @@ -1,8 +0,0 @@ -getConnection(); -$connection->dropTable('core_cache_option'); diff --git a/app/code/Magento/Core/sql/core_setup/upgrade-1.6.0.3-1.6.0.4.php b/app/code/Magento/Core/sql/core_setup/upgrade-1.6.0.3-1.6.0.4.php deleted file mode 100644 index 61eacd7b6cb3d..0000000000000 --- a/app/code/Magento/Core/sql/core_setup/upgrade-1.6.0.3-1.6.0.4.php +++ /dev/null @@ -1,76 +0,0 @@ -startSetup(); - -/** - * Create table 'core_theme' - */ -$table = $installer->getConnection()->newTable( - $installer->getTable('core_theme') -)->addColumn( - 'theme_id', - \Magento\Framework\DB\Ddl\Table::TYPE_INTEGER, - null, - ['identity' => true, 'unsigned' => true, 'nullable' => false, 'primary' => true], - 'Theme identifier' -)->addColumn( - 'parent_id', - \Magento\Framework\DB\Ddl\Table::TYPE_INTEGER, - null, - ['nullable' => true], - 'Parent Id' -)->addColumn( - 'theme_path', - \Magento\Framework\DB\Ddl\Table::TYPE_TEXT, - 255, - ['nullable' => true], - 'Theme Path' -)->addColumn( - 'theme_version', - \Magento\Framework\DB\Ddl\Table::TYPE_TEXT, - 255, - ['nullable' => false], - 'Theme Version' -)->addColumn( - 'theme_title', - \Magento\Framework\DB\Ddl\Table::TYPE_TEXT, - 255, - ['nullable' => false], - 'Theme Title' -)->addColumn( - 'preview_image', - \Magento\Framework\DB\Ddl\Table::TYPE_TEXT, - 255, - ['nullable' => true], - 'Preview Image' -)->addColumn( - 'magento_version_from', - \Magento\Framework\DB\Ddl\Table::TYPE_TEXT, - 255, - ['nullable' => false], - 'Magento Version From' -)->addColumn( - 'magento_version_to', - \Magento\Framework\DB\Ddl\Table::TYPE_TEXT, - 255, - ['nullable' => false], - 'Magento Version To' -)->addColumn( - 'is_featured', - \Magento\Framework\DB\Ddl\Table::TYPE_BOOLEAN, - null, - ['nullable' => false, 'default' => 0], - 'Is Theme Featured' -)->setComment( - 'Core theme' -); - -$installer->getConnection()->createTable($table); - -$installer->endSetup(); diff --git a/app/code/Magento/Core/sql/core_setup/upgrade-1.6.0.5-1.6.0.6.php b/app/code/Magento/Core/sql/core_setup/upgrade-1.6.0.5-1.6.0.6.php deleted file mode 100644 index 3602f4c453887..0000000000000 --- a/app/code/Magento/Core/sql/core_setup/upgrade-1.6.0.5-1.6.0.6.php +++ /dev/null @@ -1,92 +0,0 @@ -startSetup(); -$connection = $installer->getConnection(); - -/** - * Modifying 'core_layout_link' table. Replace columns area, package, theme to theme_id - */ -$tableCoreLayoutLink = $installer->getTable('core_layout_link'); - -$connection->dropForeignKey( - $tableCoreLayoutLink, - $installer->getFkName('core_layout_link', 'store_id', 'store', 'store_id') -); - -$connection->dropIndex( - $tableCoreLayoutLink, - $installer->getIdxName( - 'core_layout_link', - ['store_id', 'package', 'theme', 'layout_update_id'], - \Magento\Framework\DB\Adapter\AdapterInterface::INDEX_TYPE_UNIQUE - ) -); - -$connection->dropColumn($tableCoreLayoutLink, 'area'); - -$connection->dropColumn($tableCoreLayoutLink, 'package'); - -$connection->changeColumn( - $tableCoreLayoutLink, - 'theme', - 'theme_id', - [ - 'type' => \Magento\Framework\DB\Ddl\Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'comment' => 'Theme id' - ] -); - -$connection->addIndex( - $tableCoreLayoutLink, - $installer->getIdxName( - 'core_layout_link', - ['store_id', 'theme_id', 'layout_update_id'], - \Magento\Framework\DB\Adapter\AdapterInterface::INDEX_TYPE_UNIQUE - ), - ['store_id', 'theme_id', 'layout_update_id'], - \Magento\Framework\DB\Adapter\AdapterInterface::INDEX_TYPE_UNIQUE -); - -$connection->addForeignKey( - $installer->getFkName('core_layout_link', 'store_id', 'store', 'store_id'), - $tableCoreLayoutLink, - 'store_id', - $installer->getTable('store'), - 'store_id', - \Magento\Framework\DB\Ddl\Table::ACTION_CASCADE, - \Magento\Framework\DB\Ddl\Table::ACTION_CASCADE -); - -$connection->addForeignKey( - $installer->getFkName('core_layout_link', 'theme_id', 'core_theme', 'theme_id'), - $tableCoreLayoutLink, - 'theme_id', - $installer->getTable('core_theme'), - 'theme_id', - \Magento\Framework\DB\Ddl\Table::ACTION_CASCADE, - \Magento\Framework\DB\Ddl\Table::ACTION_CASCADE -); - -/** - * Add column 'area' to 'core_theme' - */ -$connection->addColumn( - $installer->getTable('core_theme'), - 'area', - [ - 'type' => \Magento\Framework\DB\Ddl\Table::TYPE_TEXT, - 'length' => '255', - 'nullable' => false, - 'comment' => 'Theme Area' - ] -); - -$installer->endSetup(); diff --git a/app/code/Magento/Core/sql/core_setup/upgrade-1.6.0.6-1.6.0.7.php b/app/code/Magento/Core/sql/core_setup/upgrade-1.6.0.6-1.6.0.7.php deleted file mode 100644 index cf57e72be8eec..0000000000000 --- a/app/code/Magento/Core/sql/core_setup/upgrade-1.6.0.6-1.6.0.7.php +++ /dev/null @@ -1,78 +0,0 @@ -startSetup(); -$connection = $installer->getConnection(); - -/** - * Modifying 'core_layout_link' table. Adding 'is_temporary' column - */ -$tableCoreLayoutLink = $installer->getTable('core_layout_link'); - -$connection->addColumn( - $tableCoreLayoutLink, - 'is_temporary', - [ - 'type' => \Magento\Framework\DB\Ddl\Table::TYPE_BOOLEAN, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Defines whether Layout Update is Temporary' - ] -); - -// we must drop next 2 foreign keys to have an ability to drop index -$connection->dropForeignKey( - $tableCoreLayoutLink, - $installer->getFkName($tableCoreLayoutLink, 'store_id', 'store', 'store_id') -); -$connection->dropForeignKey( - $tableCoreLayoutLink, - $installer->getFkName($tableCoreLayoutLink, 'theme_id', 'core_theme', 'theme_id') -); - -$connection->dropIndex( - $tableCoreLayoutLink, - $installer->getIdxName( - $tableCoreLayoutLink, - ['store_id', 'theme_id', 'layout_update_id'], - \Magento\Framework\DB\Adapter\AdapterInterface::INDEX_TYPE_UNIQUE - ) -); - -$connection->addIndex( - $tableCoreLayoutLink, - $installer->getIdxName( - $tableCoreLayoutLink, - ['store_id', 'theme_id', 'layout_update_id', 'is_temporary'], - \Magento\Framework\DB\Adapter\AdapterInterface::INDEX_TYPE_UNIQUE - ), - ['store_id', 'theme_id', 'layout_update_id', 'is_temporary'], - \Magento\Framework\DB\Adapter\AdapterInterface::INDEX_TYPE_UNIQUE -); - -// recreate 2 dropped foreign keys to have an ability to drop index -$connection->addForeignKey( - $installer->getFkName($tableCoreLayoutLink, 'store_id', 'store', 'store_id'), - $tableCoreLayoutLink, - 'store_id', - $installer->getTable('store'), - 'store_id', - \Magento\Framework\DB\Ddl\Table::ACTION_CASCADE, - \Magento\Framework\DB\Ddl\Table::ACTION_CASCADE -); -$connection->addForeignKey( - $installer->getFkName($tableCoreLayoutLink, 'theme_id', 'core_theme', 'theme_id'), - $tableCoreLayoutLink, - 'theme_id', - $installer->getTable('core_theme'), - 'theme_id', - \Magento\Framework\DB\Ddl\Table::ACTION_CASCADE, - \Magento\Framework\DB\Ddl\Table::ACTION_CASCADE -); - -$installer->endSetup(); diff --git a/app/code/Magento/Core/sql/core_setup/upgrade-1.6.0.7-1.6.0.8.php b/app/code/Magento/Core/sql/core_setup/upgrade-1.6.0.7-1.6.0.8.php deleted file mode 100644 index 7ec25a29dcd39..0000000000000 --- a/app/code/Magento/Core/sql/core_setup/upgrade-1.6.0.7-1.6.0.8.php +++ /dev/null @@ -1,21 +0,0 @@ -startSetup(); -$connection = $installer->getConnection(); - -/** - * Add column 'updated_at' to 'core_layout_update' - */ -$connection->addColumn( - $installer->getTable('core_layout_update'), - 'updated_at', - ['type' => \Magento\Framework\DB\Ddl\Table::TYPE_TIMESTAMP, 'nullable' => true, 'comment' => 'Last Update Timestamp'] -); - -$installer->endSetup(); diff --git a/app/code/Magento/Core/sql/core_setup/upgrade-1.6.0.8-1.6.0.9.php b/app/code/Magento/Core/sql/core_setup/upgrade-1.6.0.8-1.6.0.9.php deleted file mode 100644 index 8e02ee9b2d13b..0000000000000 --- a/app/code/Magento/Core/sql/core_setup/upgrade-1.6.0.8-1.6.0.9.php +++ /dev/null @@ -1,66 +0,0 @@ -startSetup(); -$connection = $installer->getConnection(); - -/** - * Create table 'core_theme_files' - */ -$table = $installer->getConnection()->newTable( - $installer->getTable('core_theme_files') -)->addColumn( - 'theme_files_id', - \Magento\Framework\DB\Ddl\Table::TYPE_INTEGER, - null, - ['identity' => true, 'unsigned' => true, 'nullable' => false, 'primary' => true], - 'Theme files identifier' -)->addColumn( - 'theme_id', - \Magento\Framework\DB\Ddl\Table::TYPE_INTEGER, - null, - ['nullable' => false, 'unsigned' => true], - 'Theme Id' -)->addColumn( - 'file_name', - \Magento\Framework\DB\Ddl\Table::TYPE_TEXT, - 255, - ['nullable' => false], - 'File Name' -)->addColumn( - 'file_type', - \Magento\Framework\DB\Ddl\Table::TYPE_TEXT, - 32, - ['nullable' => false], - 'File Type' -)->addColumn( - 'content', - \Magento\Framework\DB\Ddl\Table::TYPE_TEXT, - \Magento\Framework\DB\Ddl\Table::MAX_TEXT_SIZE, - ['nullable' => false], - 'File Content' -)->addColumn( - 'order', - \Magento\Framework\DB\Ddl\Table::TYPE_INTEGER, - null, - ['nullable' => false, 'default' => 0], - 'Order' -)->addForeignKey( - $installer->getFkName('core_theme_files', 'theme_id', 'core_theme', 'theme_id'), - 'theme_id', - $installer->getTable('core_theme'), - 'theme_id', - \Magento\Framework\DB\Ddl\Table::ACTION_CASCADE, - \Magento\Framework\DB\Ddl\Table::ACTION_CASCADE -)->setComment( - 'Core theme files' -); - -$installer->getConnection()->createTable($table); - -$installer->endSetup(); diff --git a/app/code/Magento/Core/sql/core_setup/upgrade-1.6.0.9-1.6.0.10.php b/app/code/Magento/Core/sql/core_setup/upgrade-1.6.0.9-1.6.0.10.php deleted file mode 100644 index f0a8613d0f062..0000000000000 --- a/app/code/Magento/Core/sql/core_setup/upgrade-1.6.0.9-1.6.0.10.php +++ /dev/null @@ -1,78 +0,0 @@ -startSetup(); -$connection = $installer->getConnection(); - -$connection->addColumn( - $installer->getTable('core_theme_files'), - 'is_temporary', - [ - 'type' => \Magento\Framework\DB\Ddl\Table::TYPE_BOOLEAN, - 'nullable' => false, - 'default' => 0, - 'comment' => 'Is Temporary File' - ] -); - -$connection->changeColumn( - $installer->getTable('core_theme_files'), - 'file_name', - 'file_path', - [ - 'type' => \Magento\Framework\DB\Ddl\Table::TYPE_TEXT, - 'length' => 255, - 'nullable' => true, - 'comment' => 'Relative path to file' - ] -); - -$connection->changeColumn( - $installer->getTable('core_theme_files'), - 'order', - 'sort_order', - ['type' => \Magento\Framework\DB\Ddl\Table::TYPE_SMALLINT] -); - -/** - * Create table 'core_theme_files_link' - */ -$table = $connection->newTable( - $installer->getTable('core_theme_files_link') -)->addColumn( - 'files_link_id', - \Magento\Framework\DB\Ddl\Table::TYPE_INTEGER, - null, - ['identity' => true, 'nullable' => false, 'unsigned' => true, 'primary' => true], - 'Customization link id' -)->addColumn( - 'theme_id', - \Magento\Framework\DB\Ddl\Table::TYPE_INTEGER, - null, - ['nullable' => false, 'unsigned' => true], - 'Theme Id' -)->addColumn( - 'layout_link_id', - \Magento\Framework\DB\Ddl\Table::TYPE_INTEGER, - null, - ['nullable' => false, 'unsigned' => true], - 'Theme layout link id' -)->addForeignKey( - $installer->getFkName('core_theme_files_link', 'theme_id', 'core_theme', 'theme_id'), - 'theme_id', - $installer->getTable('core_theme'), - 'theme_id', - \Magento\Framework\DB\Ddl\Table::ACTION_CASCADE, - \Magento\Framework\DB\Ddl\Table::ACTION_CASCADE -)->setComment( - 'Core theme link on layout update' -); - -$installer->getConnection()->createTable($table); - -$installer->endSetup(); diff --git a/app/code/Magento/Cron/Model/Schedule.php b/app/code/Magento/Cron/Model/Schedule.php index 1fc49939fccc5..8547b88d30004 100644 --- a/app/code/Magento/Cron/Model/Schedule.php +++ b/app/code/Magento/Cron/Model/Schedule.php @@ -44,14 +44,14 @@ class Schedule extends \Magento\Framework\Model\AbstractModel const STATUS_ERROR = 'error'; /** - * @var \Magento\Framework\Stdlib\DateTime\DateTime + * @var \Magento\Framework\Stdlib\DateTime\TimezoneInterface */ - protected $_date; + protected $timezone; /** * @param \Magento\Framework\Model\Context $context * @param \Magento\Framework\Registry $registry - * @param \Magento\Framework\Stdlib\DateTime\DateTime $date + * @param \Magento\Framework\Stdlib\DateTime\TimezoneInterface $timezone * @param \Magento\Framework\Model\Resource\AbstractResource $resource * @param \Magento\Framework\Data\Collection\Db $resourceCollection * @param array $data @@ -59,12 +59,12 @@ class Schedule extends \Magento\Framework\Model\AbstractModel public function __construct( \Magento\Framework\Model\Context $context, \Magento\Framework\Registry $registry, - \Magento\Framework\Stdlib\DateTime\DateTime $date, + \Magento\Framework\Stdlib\DateTime\TimezoneInterface $timezone, \Magento\Framework\Model\Resource\AbstractResource $resource = null, \Magento\Framework\Data\Collection\Db $resourceCollection = null, array $data = [] ) { - $this->_date = $date; + $this->timezone = $timezone; parent::__construct($context, $registry, $resource, $resourceCollection, $data); } @@ -111,13 +111,13 @@ public function trySchedule() $time = strtotime($time); } - $d = getdate($this->_date->timestamp($time)); + $dateWithTimezone = $this->timezone->date($time); - $match = $this->matchCronExpression($e[0], $d['minutes']) - && $this->matchCronExpression($e[1], $d['hours']) - && $this->matchCronExpression($e[2], $d['mday']) - && $this->matchCronExpression($e[3], $d['mon']) - && $this->matchCronExpression($e[4], $d['wday']); + $match = $this->matchCronExpression($e[0], $dateWithTimezone->get(\Zend_Date::MINUTE)) + && $this->matchCronExpression($e[1], $dateWithTimezone->get(\Zend_Date::HOUR)) + && $this->matchCronExpression($e[2], $dateWithTimezone->get(\Zend_Date::DAY)) + && $this->matchCronExpression($e[3], $dateWithTimezone->get(\Zend_Date::MONTH)) + && $this->matchCronExpression($e[4], $dateWithTimezone->get(\Zend_Date::WEEKDAY)); return $match; } diff --git a/app/code/Magento/Cron/composer.json b/app/code/Magento/Cron/composer.json index ca61c8c84bac6..99f4759d0ab3c 100644 --- a/app/code/Magento/Cron/composer.json +++ b/app/code/Magento/Cron/composer.json @@ -3,13 +3,13 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha108", - "magento/module-backend": "0.1.0-alpha108", - "magento/framework": "0.1.0-alpha108", + "magento/module-store": "0.42.0-beta1", + "magento/module-backend": "0.42.0-beta1", + "magento/framework": "0.42.0-beta1", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha108", + "version": "0.42.0-beta1", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/CurrencySymbol/composer.json b/app/code/Magento/CurrencySymbol/composer.json index 86629bd73e60d..b3cf1637ddd0c 100644 --- a/app/code/Magento/CurrencySymbol/composer.json +++ b/app/code/Magento/CurrencySymbol/composer.json @@ -3,16 +3,16 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha108", - "magento/module-page-cache": "0.1.0-alpha108", - "magento/module-directory": "0.1.0-alpha108", - "magento/module-backend": "0.1.0-alpha108", - "magento/module-core": "0.1.0-alpha108", - "magento/framework": "0.1.0-alpha108", + "magento/module-store": "0.42.0-beta1", + "magento/module-page-cache": "0.42.0-beta1", + "magento/module-directory": "0.42.0-beta1", + "magento/module-backend": "0.42.0-beta1", + "magento/module-core": "0.42.0-beta1", + "magento/framework": "0.42.0-beta1", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha108", + "version": "0.42.0-beta1", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Customer/Block/Newsletter.php b/app/code/Magento/Customer/Block/Newsletter.php index ba52fb19e574e..9f2c0b08cea43 100644 --- a/app/code/Magento/Customer/Block/Newsletter.php +++ b/app/code/Magento/Customer/Block/Newsletter.php @@ -62,6 +62,6 @@ public function getIsSubscribed() */ public function getAction() { - return $this->getUrl('*/*/save'); + return $this->getUrl('newsletter/manage/save'); } } diff --git a/app/code/Magento/Customer/Controller/Adminhtml/Index/Viewfile.php b/app/code/Magento/Customer/Controller/Adminhtml/Index/Viewfile.php index 4087a265a8def..12ebc5b01068d 100644 --- a/app/code/Magento/Customer/Controller/Adminhtml/Index/Viewfile.php +++ b/app/code/Magento/Customer/Controller/Adminhtml/Index/Viewfile.php @@ -5,11 +5,96 @@ */ namespace Magento\Customer\Controller\Adminhtml\Index; +use Magento\Customer\Api\AccountManagementInterface; +use Magento\Customer\Api\AddressRepositoryInterface; +use Magento\Customer\Api\CustomerRepositoryInterface; +use Magento\Customer\Api\Data\AddressDataBuilder; +use Magento\Customer\Api\Data\CustomerDataBuilder; +use Magento\Customer\Model\Address\Mapper; use Magento\Framework\App\Action\NotFoundException; use Magento\Framework\App\Filesystem\DirectoryList; +use Magento\Framework\ObjectFactory; +/** + * @SuppressWarnings(PHPMD.CouplingBetweenObjects) + */ class Viewfile extends \Magento\Customer\Controller\Adminhtml\Index { + /** + * @var \Magento\Framework\Url\DecoderInterface + */ + protected $urlDecoder; + + /** + * @param \Magento\Backend\App\Action\Context $context + * @param \Magento\Framework\Registry $coreRegistry + * @param \Magento\Framework\App\Response\Http\FileFactory $fileFactory + * @param \Magento\Customer\Model\CustomerFactory $customerFactory + * @param \Magento\Customer\Model\AddressFactory $addressFactory + * @param \Magento\Customer\Model\Metadata\FormFactory $formFactory + * @param \Magento\Newsletter\Model\SubscriberFactory $subscriberFactory + * @param \Magento\Customer\Helper\View $viewHelper + * @param \Magento\Framework\Math\Random $random + * @param CustomerRepositoryInterface $customerRepository + * @param \Magento\Framework\Api\ExtensibleDataObjectConverter $extensibleDataObjectConverter + * @param Mapper $addressMapper + * @param AccountManagementInterface $customerAccountManagement + * @param AddressRepositoryInterface $addressRepository + * @param CustomerDataBuilder $customerDataBuilder + * @param AddressDataBuilder $addressDataBuilder + * @param \Magento\Customer\Model\Customer\Mapper $customerMapper + * @param \Magento\Framework\Reflection\DataObjectProcessor $dataObjectProcessor + * @param ObjectFactory $objectFactory + * @param \Magento\Framework\Url\DecoderInterface $urlDecoder + * + * @SuppressWarnings(PHPMD.ExcessiveParameterList) + */ + public function __construct( + \Magento\Backend\App\Action\Context $context, + \Magento\Framework\Registry $coreRegistry, + \Magento\Framework\App\Response\Http\FileFactory $fileFactory, + \Magento\Customer\Model\CustomerFactory $customerFactory, + \Magento\Customer\Model\AddressFactory $addressFactory, + \Magento\Customer\Model\Metadata\FormFactory $formFactory, + \Magento\Newsletter\Model\SubscriberFactory $subscriberFactory, + \Magento\Customer\Helper\View $viewHelper, + \Magento\Framework\Math\Random $random, + CustomerRepositoryInterface $customerRepository, + \Magento\Framework\Api\ExtensibleDataObjectConverter $extensibleDataObjectConverter, + Mapper $addressMapper, + AccountManagementInterface $customerAccountManagement, + AddressRepositoryInterface $addressRepository, + CustomerDataBuilder $customerDataBuilder, + AddressDataBuilder $addressDataBuilder, + \Magento\Customer\Model\Customer\Mapper $customerMapper, + \Magento\Framework\Reflection\DataObjectProcessor $dataObjectProcessor, + ObjectFactory $objectFactory, + \Magento\Framework\Url\DecoderInterface $urlDecoder + ) { + parent::__construct( + $context, + $coreRegistry, + $fileFactory, + $customerFactory, + $addressFactory, + $formFactory, + $subscriberFactory, + $viewHelper, + $random, + $customerRepository, + $extensibleDataObjectConverter, + $addressMapper, + $customerAccountManagement, + $addressRepository, + $customerDataBuilder, + $addressDataBuilder, + $customerMapper, + $dataObjectProcessor, + $objectFactory + ); + $this->urlDecoder = $urlDecoder; + } + /** * Customer view file action * @@ -24,14 +109,12 @@ public function execute() $plain = false; if ($this->getRequest()->getParam('file')) { // download file - $file = $this->_objectManager->get( - 'Magento\Core\Helper\Data' - )->urlDecode( + $file = $this->urlDecoder->decode( $this->getRequest()->getParam('file') ); } elseif ($this->getRequest()->getParam('image')) { // show plain image - $file = $this->_objectManager->get('Magento\Core\Helper\Data')->urlDecode( + $file = $this->urlDecoder->decode( $this->getRequest()->getParam('image') ); $plain = true; diff --git a/app/code/Magento/Customer/Model/AccountManagement.php b/app/code/Magento/Customer/Model/AccountManagement.php index b9680b1d53405..5d4dec963603d 100644 --- a/app/code/Magento/Customer/Model/AccountManagement.php +++ b/app/code/Magento/Customer/Model/AccountManagement.php @@ -33,7 +33,6 @@ use Magento\Framework\Stdlib\DateTime; use Magento\Framework\Stdlib\String as StringHelper; use Magento\Store\Model\StoreManagerInterface; -use Magento\Framework\UrlInterface; /** * Handle various customer account actions @@ -133,7 +132,7 @@ class AccountManagement implements AccountManagementInterface private $customerMetadataService; /** - * @var UrlInterface + * @var \Magento\Framework\Url */ private $url; @@ -220,7 +219,7 @@ class AccountManagement implements AccountManagementInterface * @param AddressRepositoryInterface $addressRepository * @param CustomerMetadataInterface $customerMetadataService * @param CustomerRegistry $customerRegistry - * @param UrlInterface $url + * @param \Magento\Framework\Url $url * @param Logger $logger * @param Encryptor $encryptor * @param ConfigShare $configShare @@ -249,7 +248,7 @@ public function __construct( AddressRepositoryInterface $addressRepository, CustomerMetadataInterface $customerMetadataService, CustomerRegistry $customerRegistry, - UrlInterface $url, + \Magento\Framework\Url $url, Logger $logger, Encryptor $encryptor, ConfigShare $configShare, @@ -1057,7 +1056,8 @@ public function sendPasswordReminderEmail($customer, $newPasswordToken) 'customer/account/createPassword', [ '_query' => ['id' => $customer->getId(), 'token' => $newPasswordToken], - '_store' => $customer->getStoreId() + '_store' => $customer->getStoreId(), + '_nosid' => true, ] ); diff --git a/app/code/Magento/Customer/Model/Attribute/Backend/Data/Boolean.php b/app/code/Magento/Customer/Model/Attribute/Backend/Data/Boolean.php index 7f290f5ca9f20..26f3aedba5784 100644 --- a/app/code/Magento/Customer/Model/Attribute/Backend/Data/Boolean.php +++ b/app/code/Magento/Customer/Model/Attribute/Backend/Data/Boolean.php @@ -21,6 +21,7 @@ public function beforeSave($customer) { $attributeName = $this->getAttribute()->getName(); $inputValue = $customer->getData($attributeName); + $inputValue = is_null($inputValue) ? $this->getAttribute()->getDefaultValue() : $inputValue; $sanitizedValue = !empty($inputValue) ? '1' : '0'; $customer->setData($attributeName, $sanitizedValue); return $this; diff --git a/app/code/Magento/Customer/Model/Config/Backend/CreateAccount/DisableAutoGroupAssignDefault.php b/app/code/Magento/Customer/Model/Config/Backend/CreateAccount/DisableAutoGroupAssignDefault.php new file mode 100644 index 0000000000000..16b492c800a94 --- /dev/null +++ b/app/code/Magento/Customer/Model/Config/Backend/CreateAccount/DisableAutoGroupAssignDefault.php @@ -0,0 +1,51 @@ +eavConfig = $eavConfig; + parent::__construct($context, $registry, $config, $resource, $resourceCollection, $data); + } + + /** + * Save EAV default value after save + * + * @return $this + */ + public function afterSave() + { + $result = parent::afterSave(); + + $attributeObject = $this->eavConfig->getAttribute('customer', 'disable_auto_group_change'); + $attributeObject->setData('default_value', $this->getValue()); + $attributeObject->save(); + + return $result; + } +} diff --git a/app/code/Magento/Customer/Model/Resource/Address.php b/app/code/Magento/Customer/Model/Resource/Address.php index dddf1e3d0d3c5..4cda0ee8fb84d 100644 --- a/app/code/Magento/Customer/Model/Resource/Address.php +++ b/app/code/Magento/Customer/Model/Resource/Address.php @@ -149,4 +149,22 @@ public function delete($object) $object->setData([]); return $result; } + + /** + * {@inheritdoc} + */ + protected function _afterDelete(\Magento\Framework\Object $address) + { + if ($address->getId()) { + $customer = $this->_createCustomer()->load($address->getCustomerId()); + if ($customer->getDefaultBilling() == $address->getId()) { + $customer->setDefaultBilling(null); + } + if ($customer->getDefaultShipping() == $address->getId()) { + $customer->setDefaultShipping(null); + } + $customer->save(); + } + return parent::_afterDelete($address); + } } diff --git a/app/code/Magento/Customer/composer.json b/app/code/Magento/Customer/composer.json index 6f1e96c3b1ba0..48282323309a2 100644 --- a/app/code/Magento/Customer/composer.json +++ b/app/code/Magento/Customer/composer.json @@ -3,28 +3,28 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha108", - "magento/module-eav": "0.1.0-alpha108", - "magento/module-directory": "0.1.0-alpha108", - "magento/module-core": "0.1.0-alpha108", - "magento/module-catalog": "0.1.0-alpha108", - "magento/module-newsletter": "0.1.0-alpha108", - "magento/module-sales": "0.1.0-alpha108", - "magento/module-checkout": "0.1.0-alpha108", - "magento/module-wishlist": "0.1.0-alpha108", - "magento/module-theme": "0.1.0-alpha108", - "magento/module-backend": "0.1.0-alpha108", - "magento/module-review": "0.1.0-alpha108", - "magento/module-tax": "0.1.0-alpha108", - "magento/module-page-cache": "0.1.0-alpha108", - "magento/framework": "0.1.0-alpha108", - "magento/module-authorization": "0.1.0-alpha108", - "magento/module-integration": "0.1.0-alpha108", - "magento/module-ui": "0.1.0-alpha108", + "magento/module-store": "0.42.0-beta1", + "magento/module-eav": "0.42.0-beta1", + "magento/module-directory": "0.42.0-beta1", + "magento/module-core": "0.42.0-beta1", + "magento/module-catalog": "0.42.0-beta1", + "magento/module-newsletter": "0.42.0-beta1", + "magento/module-sales": "0.42.0-beta1", + "magento/module-checkout": "0.42.0-beta1", + "magento/module-wishlist": "0.42.0-beta1", + "magento/module-theme": "0.42.0-beta1", + "magento/module-backend": "0.42.0-beta1", + "magento/module-review": "0.42.0-beta1", + "magento/module-tax": "0.42.0-beta1", + "magento/module-page-cache": "0.42.0-beta1", + "magento/framework": "0.42.0-beta1", + "magento/module-authorization": "0.42.0-beta1", + "magento/module-integration": "0.42.0-beta1", + "magento/module-ui": "0.42.0-beta1", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha108", + "version": "0.42.0-beta1", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Customer/etc/adminhtml/system.xml b/app/code/Magento/Customer/etc/adminhtml/system.xml index 503a28dc7678d..728f0dd05b623 100644 --- a/app/code/Magento/Customer/etc/adminhtml/system.xml +++ b/app/code/Magento/Customer/etc/adminhtml/system.xml @@ -79,6 +79,7 @@ Magento\Backend\Model\Config\Source\Yesno + Magento\Customer\Model\Config\Backend\CreateAccount\DisableAutoGroupAssignDefault diff --git a/app/code/Magento/Customer/etc/webapi.xml b/app/code/Magento/Customer/etc/webapi.xml index 78a2fa940e54a..df2d11cb16d9f 100644 --- a/app/code/Magento/Customer/etc/webapi.xml +++ b/app/code/Magento/Customer/etc/webapi.xml @@ -178,12 +178,6 @@ - - - - - - @@ -196,13 +190,13 @@ - + - + @@ -244,7 +238,7 @@ - + diff --git a/app/code/Magento/CustomerImportExport/composer.json b/app/code/Magento/CustomerImportExport/composer.json index 28941cb7ca47e..d87b7f176a3ce 100644 --- a/app/code/Magento/CustomerImportExport/composer.json +++ b/app/code/Magento/CustomerImportExport/composer.json @@ -3,18 +3,18 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-backend": "0.1.0-alpha108", - "magento/module-core": "0.1.0-alpha108", - "magento/module-customer": "0.1.0-alpha108", - "magento/module-eav": "0.1.0-alpha108", - "magento/module-import-export": "0.1.0-alpha108", - "magento/module-store": "0.1.0-alpha108", - "magento/module-directory": "0.1.0-alpha108", - "magento/framework": "0.1.0-alpha108", + "magento/module-backend": "0.42.0-beta1", + "magento/module-core": "0.42.0-beta1", + "magento/module-customer": "0.42.0-beta1", + "magento/module-eav": "0.42.0-beta1", + "magento/module-import-export": "0.42.0-beta1", + "magento/module-store": "0.42.0-beta1", + "magento/module-directory": "0.42.0-beta1", + "magento/framework": "0.42.0-beta1", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha108", + "version": "0.42.0-beta1", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/CustomerImportExport/etc/export.xml b/app/code/Magento/CustomerImportExport/etc/export.xml index fcba24cfe012c..633d3693c07ba 100644 --- a/app/code/Magento/CustomerImportExport/etc/export.xml +++ b/app/code/Magento/CustomerImportExport/etc/export.xml @@ -7,4 +7,5 @@ + diff --git a/app/code/Magento/DesignEditor/composer.json b/app/code/Magento/DesignEditor/composer.json index e03b624c0beb7..f5ae9e6fba7ed 100644 --- a/app/code/Magento/DesignEditor/composer.json +++ b/app/code/Magento/DesignEditor/composer.json @@ -3,16 +3,16 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha108", - "magento/module-theme": "0.1.0-alpha108", - "magento/module-backend": "0.1.0-alpha108", - "magento/module-core": "0.1.0-alpha108", - "magento/module-eav": "0.1.0-alpha108", - "magento/framework": "0.1.0-alpha108", + "magento/module-store": "0.42.0-beta1", + "magento/module-theme": "0.42.0-beta1", + "magento/module-backend": "0.42.0-beta1", + "magento/module-core": "0.42.0-beta1", + "magento/module-eav": "0.42.0-beta1", + "magento/framework": "0.42.0-beta1", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha108", + "version": "0.42.0-beta1", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/DesignEditor/etc/adminhtml/menu.xml b/app/code/Magento/DesignEditor/etc/adminhtml/menu.xml deleted file mode 100644 index 450ccb62e23d6..0000000000000 --- a/app/code/Magento/DesignEditor/etc/adminhtml/menu.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - diff --git a/app/code/Magento/Dhl/composer.json b/app/code/Magento/Dhl/composer.json index 0e24645dd3a1c..81853cf04407c 100644 --- a/app/code/Magento/Dhl/composer.json +++ b/app/code/Magento/Dhl/composer.json @@ -3,21 +3,21 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha108", - "magento/module-shipping": "0.1.0-alpha108", - "magento/module-backend": "0.1.0-alpha108", - "magento/module-directory": "0.1.0-alpha108", - "magento/module-core": "0.1.0-alpha108", - "magento/module-sales": "0.1.0-alpha108", - "magento/module-checkout": "0.1.0-alpha108", - "magento/module-catalog": "0.1.0-alpha108", - "magento/module-catalog-inventory": "0.1.0-alpha108", - "magento/framework": "0.1.0-alpha108", + "magento/module-store": "0.42.0-beta1", + "magento/module-shipping": "0.42.0-beta1", + "magento/module-backend": "0.42.0-beta1", + "magento/module-directory": "0.42.0-beta1", + "magento/module-core": "0.42.0-beta1", + "magento/module-sales": "0.42.0-beta1", + "magento/module-checkout": "0.42.0-beta1", + "magento/module-catalog": "0.42.0-beta1", + "magento/module-catalog-inventory": "0.42.0-beta1", + "magento/framework": "0.42.0-beta1", "lib-libxml": "*", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha108", + "version": "0.42.0-beta1", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Directory/Helper/Data.php b/app/code/Magento/Directory/Helper/Data.php index c584342db5c8d..17d96968a6e92 100644 --- a/app/code/Magento/Directory/Helper/Data.php +++ b/app/code/Magento/Directory/Helper/Data.php @@ -182,7 +182,9 @@ public function getRegionJson() ]; } $json = $this->_coreHelper->jsonEncode($regions); - + if ($json === false) { + $json = 'false'; + } $this->_configCacheType->save($json, $cacheKey); } $this->_regionJson = $json; diff --git a/app/code/Magento/Directory/Model/Country.php b/app/code/Magento/Directory/Model/Country.php index 160c355838f45..6088a6c6cc209 100644 --- a/app/code/Magento/Directory/Model/Country.php +++ b/app/code/Magento/Directory/Model/Country.php @@ -10,10 +10,6 @@ * @method \Magento\Directory\Model\Resource\Country getResource() * @method string getCountryId() * @method \Magento\Directory\Model\Country setCountryId(string $value) - * @method string getIso2Code() - * @method \Magento\Directory\Model\Country setIso2Code(string $value) - * @method string getIso3Code() - * @method \Magento\Directory\Model\Country setIso3Code(string $value) */ namespace Magento\Directory\Model; diff --git a/app/code/Magento/Directory/composer.json b/app/code/Magento/Directory/composer.json index 85f885a5e41b3..551abbb12174e 100644 --- a/app/code/Magento/Directory/composer.json +++ b/app/code/Magento/Directory/composer.json @@ -3,15 +3,15 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha108", - "magento/module-core": "0.1.0-alpha108", - "magento/module-backend": "0.1.0-alpha108", - "magento/framework": "0.1.0-alpha108", + "magento/module-store": "0.42.0-beta1", + "magento/module-core": "0.42.0-beta1", + "magento/module-backend": "0.42.0-beta1", + "magento/framework": "0.42.0-beta1", "lib-libxml": "*", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha108", + "version": "0.42.0-beta1", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Downloadable/Block/Catalog/Product/Links.php b/app/code/Magento/Downloadable/Block/Catalog/Product/Links.php index d427f36c14e15..eabb0c4225444 100644 --- a/app/code/Magento/Downloadable/Block/Catalog/Product/Links.php +++ b/app/code/Magento/Downloadable/Block/Catalog/Product/Links.php @@ -5,41 +5,40 @@ namespace Magento\Downloadable\Block\Catalog\Product; use Magento\Catalog\Pricing\Price\FinalPrice; -use Magento\Catalog\Pricing\Price\RegularPrice; use Magento\Downloadable\Model\Link; use Magento\Downloadable\Pricing\Price\LinkPrice; +use Magento\Framework\Json\EncoderInterface; /** * Downloadable Product Links part block - * */ class Links extends \Magento\Catalog\Block\Product\AbstractProduct { /** - * @var \Magento\Framework\Json\EncoderInterface + * @var \Magento\Core\Helper\Data */ - protected $jsonEncoder; + protected $coreData; /** - * @var \Magento\Core\Helper\Data + * @var EncoderInterface */ - protected $coreData; + protected $encoder; /** * @param \Magento\Catalog\Block\Product\Context $context * @param \Magento\Core\Helper\Data $coreData + * @param EncoderInterface $encoder * @param array $data */ public function __construct( \Magento\Catalog\Block\Product\Context $context, \Magento\Core\Helper\Data $coreData, + EncoderInterface $encoder, array $data = [] ) { $this->coreData = $coreData; - parent::__construct( - $context, - $data - ); + $this->encoder = $encoder; + parent::__construct($context, $data); } /** @@ -93,38 +92,18 @@ public function getCurrencyPrice($price) */ public function getJsonConfig() { - $priceInfo = $this->getProduct()->getPriceInfo(); - $finalPrice = $priceInfo->getPrice(FinalPrice::PRICE_CODE); - $regularPrice = $priceInfo->getPrice(RegularPrice::PRICE_CODE); - $config = [ - 'price' => $finalPrice->getAmount()->getValue(), - 'oldPrice' => $regularPrice->getValue(), - ]; - $config['links'] = $this->getLinksConfig(); - - return json_encode($config); - } + $finalPrice = $this->getProduct()->getPriceInfo() + ->getPrice(FinalPrice::PRICE_CODE); - /** - * Get links price config - * - * @return array - */ - protected function getLinksConfig() - { - $finalPrice = $this->getProduct()->getPriceInfo()->getPrice(FinalPrice::PRICE_CODE); $linksConfig = []; foreach ($this->getLinks() as $link) { $amount = $finalPrice->getCustomAmount($link->getPrice()); - $price = $this->coreData->currency($link->getPrice(), false, false); $linksConfig[$link->getId()] = [ - 'price' => $price, - 'oldPrice' => $price, - 'inclTaxPrice' => $amount->getValue(), - 'exclTaxPrice' => $amount->getBaseAmount(), + 'finalPrice' => $amount->getValue(), ]; } - return $linksConfig; + + return $this->encoder->encode(['links' => $linksConfig]); } /** diff --git a/app/code/Magento/Downloadable/composer.json b/app/code/Magento/Downloadable/composer.json index afe28e1458e22..ad7fd26302cea 100644 --- a/app/code/Magento/Downloadable/composer.json +++ b/app/code/Magento/Downloadable/composer.json @@ -3,26 +3,26 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha108", - "magento/module-catalog": "0.1.0-alpha108", - "magento/module-core": "0.1.0-alpha108", - "magento/module-customer": "0.1.0-alpha108", - "magento/module-tax": "0.1.0-alpha108", - "magento/module-theme": "0.1.0-alpha108", - "magento/module-eav": "0.1.0-alpha108", - "magento/module-backend": "0.1.0-alpha108", - "magento/module-sales": "0.1.0-alpha108", - "magento/module-checkout": "0.1.0-alpha108", - "magento/module-directory": "0.1.0-alpha108", - "magento/module-wishlist": "0.1.0-alpha108", - "magento/module-gift-message": "0.1.0-alpha108", - "magento/module-catalog-inventory": "0.1.0-alpha108", - "magento/module-msrp": "0.1.0-alpha108", - "magento/framework": "0.1.0-alpha108", + "magento/module-store": "0.42.0-beta1", + "magento/module-catalog": "0.42.0-beta1", + "magento/module-core": "0.42.0-beta1", + "magento/module-customer": "0.42.0-beta1", + "magento/module-tax": "0.42.0-beta1", + "magento/module-theme": "0.42.0-beta1", + "magento/module-eav": "0.42.0-beta1", + "magento/module-backend": "0.42.0-beta1", + "magento/module-sales": "0.42.0-beta1", + "magento/module-checkout": "0.42.0-beta1", + "magento/module-directory": "0.42.0-beta1", + "magento/module-wishlist": "0.42.0-beta1", + "magento/module-gift-message": "0.42.0-beta1", + "magento/module-catalog-inventory": "0.42.0-beta1", + "magento/module-msrp": "0.42.0-beta1", + "magento/framework": "0.42.0-beta1", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha108", + "version": "0.42.0-beta1", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Downloadable/view/adminhtml/templates/product/edit/downloadable.phtml b/app/code/Magento/Downloadable/view/adminhtml/templates/product/edit/downloadable.phtml index 095cd7c4645fd..faf39261b3df7 100644 --- a/app/code/Magento/Downloadable/view/adminhtml/templates/product/edit/downloadable.phtml +++ b/app/code/Magento/Downloadable/view/adminhtml/templates/product/edit/downloadable.phtml @@ -12,9 +12,10 @@ diff --git a/app/code/Magento/Downloadable/view/adminhtml/templates/product/edit/downloadable/samples.phtml b/app/code/Magento/Downloadable/view/adminhtml/templates/product/edit/downloadable/samples.phtml index 7a4ef1ae0ec01..077837d6bda30 100644 --- a/app/code/Magento/Downloadable/view/adminhtml/templates/product/edit/downloadable/samples.phtml +++ b/app/code/Magento/Downloadable/view/adminhtml/templates/product/edit/downloadable/samples.phtml @@ -49,196 +49,197 @@ $this->getConfigJson(); diff --git a/app/code/Magento/Downloadable/view/frontend/web/downloadable.js b/app/code/Magento/Downloadable/view/frontend/web/downloadable.js index 2432f42a65c76..510d38e287992 100644 --- a/app/code/Magento/Downloadable/view/frontend/web/downloadable.js +++ b/app/code/Magento/Downloadable/view/frontend/web/downloadable.js @@ -4,11 +4,16 @@ /*jshint browser:true jquery:true expr:true*/ define([ "jquery", - "jquery/ui" + "jquery/ui", + "Magento_Catalog/js/price-box" ], function($){ "use strict"; $.widget('mage.downloadable', { + options: { + priceHolderSelector: '.price-box' + }, + _create: function() { var self = this; @@ -36,26 +41,14 @@ define([ * @private */ _reloadPrice: function() { - var price = 0, - oldPrice = 0, - inclTaxPrice = 0, - exclTaxPrice = 0; + var finalPrice = 0; this.element.find(this.options.linkElement + ':checked').each($.proxy(function(index, element) { - price += this.options.config.links[$(element).val()].price; - oldPrice += this.options.config.links[$(element).val()].oldPrice; - inclTaxPrice += this.options.config.links[$(element).val()].inclTaxPrice; - exclTaxPrice += this.options.config.links[$(element).val()].exclTaxPrice; + finalPrice += this.options.config.links[$(element).val()].finalPrice; }, this)); - this.element.trigger('changePrice', { - 'config': 'config', - 'price': { - 'price': price, - 'oldPrice': oldPrice, - 'inclTaxPrice': inclTaxPrice, - 'exclTaxPrice': exclTaxPrice - } - }).trigger('reloadPrice'); + $(this.options.priceHolderSelector).trigger('updatePrice', { + 'prices': { 'finalPrice': { 'amount': finalPrice }} + }); } }); diff --git a/app/code/Magento/Eav/Model/AttributeManagement.php b/app/code/Magento/Eav/Model/AttributeManagement.php index cfbe58eee74ef..357e1acb9367e 100644 --- a/app/code/Magento/Eav/Model/AttributeManagement.php +++ b/app/code/Magento/Eav/Model/AttributeManagement.php @@ -88,8 +88,13 @@ public function assign($entityTypeCode, $attributeSetId, $attributeGroupId, $att if ($setEntityType->getEntityTypeCode() != $entityTypeCode) { throw new InputException('Wrong attribute set id provided'); } + //Check if group exists. If not - expected exception - $this->groupRepository->get($attributeGroupId); + $attributeGroup = $this->groupRepository->get($attributeGroupId); + + if ($attributeGroup->getAttributeSetId() != $attributeSetId) { + throw new InputException('Attribute group does not belong to attribute set'); + } /** @var \Magento\Eav\Api\Data\AttributeInterface $attribute */ $attribute = $this->attributeRepository->get($entityTypeCode, $attributeCode); diff --git a/app/code/Magento/Eav/composer.json b/app/code/Magento/Eav/composer.json index 2b6531a557402..61dd1d12013d7 100644 --- a/app/code/Magento/Eav/composer.json +++ b/app/code/Magento/Eav/composer.json @@ -3,15 +3,15 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha108", - "magento/module-core": "0.1.0-alpha108", - "magento/module-backend": "0.1.0-alpha108", - "magento/module-catalog": "0.1.0-alpha108", - "magento/framework": "0.1.0-alpha108", + "magento/module-store": "0.42.0-beta1", + "magento/module-core": "0.42.0-beta1", + "magento/module-backend": "0.42.0-beta1", + "magento/module-catalog": "0.42.0-beta1", + "magento/framework": "0.42.0-beta1", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha108", + "version": "0.42.0-beta1", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Email/composer.json b/app/code/Magento/Email/composer.json index f649537c160ec..bd8e34bf0d2d6 100644 --- a/app/code/Magento/Email/composer.json +++ b/app/code/Magento/Email/composer.json @@ -3,15 +3,15 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha108", - "magento/module-core": "0.1.0-alpha108", - "magento/module-cms": "0.1.0-alpha108", - "magento/module-backend": "0.1.0-alpha108", - "magento/framework": "0.1.0-alpha108", + "magento/module-store": "0.42.0-beta1", + "magento/module-core": "0.42.0-beta1", + "magento/module-cms": "0.42.0-beta1", + "magento/module-backend": "0.42.0-beta1", + "magento/framework": "0.42.0-beta1", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha108", + "version": "0.42.0-beta1", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Fedex/Model/Carrier.php b/app/code/Magento/Fedex/Model/Carrier.php index 7da84404894b7..c614c29600937 100644 --- a/app/code/Magento/Fedex/Model/Carrier.php +++ b/app/code/Magento/Fedex/Model/Carrier.php @@ -301,7 +301,7 @@ public function setRequest(RateRequest $request) $request->getStoreId() ); } - $r->setOrigCountry($this->_countryFactory->create()->load($origCountry)->getIso2Code()); + $r->setOrigCountry($this->_countryFactory->create()->load($origCountry)->getData('iso2_code')); if ($request->getOrigPostcode()) { $r->setOrigPostal($request->getOrigPostcode()); @@ -320,7 +320,7 @@ public function setRequest(RateRequest $request) } else { $destCountry = self::USA_COUNTRY_ID; } - $r->setDestCountry($this->_countryFactory->create()->load($destCountry)->getIso2Code()); + $r->setDestCountry($this->_countryFactory->create()->load($destCountry)->getData('iso2_code')); if ($request->getDestPostcode()) { $r->setDestPostal($request->getDestPostcode()); diff --git a/app/code/Magento/Fedex/composer.json b/app/code/Magento/Fedex/composer.json index cd722684b5915..1dfde1038b948 100644 --- a/app/code/Magento/Fedex/composer.json +++ b/app/code/Magento/Fedex/composer.json @@ -3,19 +3,19 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha108", - "magento/module-shipping": "0.1.0-alpha108", - "magento/module-directory": "0.1.0-alpha108", - "magento/module-core": "0.1.0-alpha108", - "magento/module-catalog": "0.1.0-alpha108", - "magento/module-sales": "0.1.0-alpha108", - "magento/module-catalog-inventory": "0.1.0-alpha108", - "magento/framework": "0.1.0-alpha108", + "magento/module-store": "0.42.0-beta1", + "magento/module-shipping": "0.42.0-beta1", + "magento/module-directory": "0.42.0-beta1", + "magento/module-core": "0.42.0-beta1", + "magento/module-catalog": "0.42.0-beta1", + "magento/module-sales": "0.42.0-beta1", + "magento/module-catalog-inventory": "0.42.0-beta1", + "magento/framework": "0.42.0-beta1", "lib-libxml": "*", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha108", + "version": "0.42.0-beta1", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/GiftMessage/composer.json b/app/code/Magento/GiftMessage/composer.json index 311cca96c393e..f3b13f068ee63 100644 --- a/app/code/Magento/GiftMessage/composer.json +++ b/app/code/Magento/GiftMessage/composer.json @@ -3,20 +3,20 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha108", - "magento/module-catalog": "0.1.0-alpha108", - "magento/module-checkout": "0.1.0-alpha108", - "magento/module-multishipping": "0.1.0-alpha108", - "magento/module-sales": "0.1.0-alpha108", - "magento/module-backend": "0.1.0-alpha108", - "magento/module-core": "0.1.0-alpha108", - "magento/module-customer": "0.1.0-alpha108", - "magento/module-eav": "0.1.0-alpha108", - "magento/framework": "0.1.0-alpha108", + "magento/module-store": "0.42.0-beta1", + "magento/module-catalog": "0.42.0-beta1", + "magento/module-checkout": "0.42.0-beta1", + "magento/module-multishipping": "0.42.0-beta1", + "magento/module-sales": "0.42.0-beta1", + "magento/module-backend": "0.42.0-beta1", + "magento/module-core": "0.42.0-beta1", + "magento/module-customer": "0.42.0-beta1", + "magento/module-eav": "0.42.0-beta1", + "magento/framework": "0.42.0-beta1", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha108", + "version": "0.42.0-beta1", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/GoogleAdwords/composer.json b/app/code/Magento/GoogleAdwords/composer.json index bee35a673bf7a..eb6306f9fc815 100644 --- a/app/code/Magento/GoogleAdwords/composer.json +++ b/app/code/Magento/GoogleAdwords/composer.json @@ -3,13 +3,13 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha108", - "magento/module-sales": "0.1.0-alpha108", - "magento/framework": "0.1.0-alpha108", + "magento/module-store": "0.42.0-beta1", + "magento/module-sales": "0.42.0-beta1", + "magento/framework": "0.42.0-beta1", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha108", + "version": "0.42.0-beta1", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/GoogleAnalytics/composer.json b/app/code/Magento/GoogleAnalytics/composer.json index ce8f12d6e4d82..49221bfc79871 100644 --- a/app/code/Magento/GoogleAnalytics/composer.json +++ b/app/code/Magento/GoogleAnalytics/composer.json @@ -3,13 +3,13 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha108", - "magento/module-sales": "0.1.0-alpha108", - "magento/framework": "0.1.0-alpha108", + "magento/module-store": "0.42.0-beta1", + "magento/module-sales": "0.42.0-beta1", + "magento/framework": "0.42.0-beta1", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha108", + "version": "0.42.0-beta1", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/GoogleOptimizer/composer.json b/app/code/Magento/GoogleOptimizer/composer.json index bfe88e67fba72..ebcb1ea65d36d 100644 --- a/app/code/Magento/GoogleOptimizer/composer.json +++ b/app/code/Magento/GoogleOptimizer/composer.json @@ -3,16 +3,16 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha108", - "magento/module-google-analytics": "0.1.0-alpha108", - "magento/module-catalog": "0.1.0-alpha108", - "magento/module-cms": "0.1.0-alpha108", - "magento/module-backend": "0.1.0-alpha108", - "magento/framework": "0.1.0-alpha108", + "magento/module-store": "0.42.0-beta1", + "magento/module-google-analytics": "0.42.0-beta1", + "magento/module-catalog": "0.42.0-beta1", + "magento/module-cms": "0.42.0-beta1", + "magento/module-backend": "0.42.0-beta1", + "magento/framework": "0.42.0-beta1", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha108", + "version": "0.42.0-beta1", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/GoogleOptimizer/view/adminhtml/layout/adminhtml_cms_page_edit.xml b/app/code/Magento/GoogleOptimizer/view/adminhtml/layout/cms_page_edit.xml similarity index 100% rename from app/code/Magento/GoogleOptimizer/view/adminhtml/layout/adminhtml_cms_page_edit.xml rename to app/code/Magento/GoogleOptimizer/view/adminhtml/layout/cms_page_edit.xml diff --git a/app/code/Magento/GoogleShopping/Controller/Adminhtml/Googleshopping/Items.php b/app/code/Magento/GoogleShopping/Controller/Adminhtml/Googleshopping/Items.php index fdb673823d877..32cd0e31bbadb 100644 --- a/app/code/Magento/GoogleShopping/Controller/Adminhtml/Googleshopping/Items.php +++ b/app/code/Magento/GoogleShopping/Controller/Adminhtml/Googleshopping/Items.php @@ -21,12 +21,22 @@ class Items extends \Magento\Backend\App\Action protected $notifier; /** - * @param \Magento\Backend\App\Action\Context $context + * @var \Magento\Framework\Url\EncoderInterface + */ + protected $urlEncoder; + + /** + * @param Action\Context $context * @param NotifierInterface $notifier + * @param \Magento\Framework\Url\EncoderInterface $urlEncoder */ - public function __construct(Action\Context $context, NotifierInterface $notifier) - { + public function __construct( + Action\Context $context, + NotifierInterface $notifier, + \Magento\Framework\Url\EncoderInterface $urlEncoder + ) { parent::__construct($context); + $this->urlEncoder = $urlEncoder; $this->notifier = $notifier; } @@ -52,12 +62,8 @@ protected function _redirectToCaptcha($e) '*/*/index', [ 'store' => $this->_getStore()->getId(), - 'captcha_token' => $this->_objectManager->get( - 'Magento\Core\Helper\Data' - )->urlEncode( - $e->getCaptchaToken() - ), - 'captcha_url' => $this->_objectManager->get('Magento\Core\Helper\Data')->urlEncode($e->getCaptchaUrl()) + 'captcha_token' => $this->urlEncoder->encode($e->getCaptchaToken()), + 'captcha_url' => $this->urlEncoder->encode($e->getCaptchaUrl()) ] ); if ($this->getRequest()->isAjax()) { diff --git a/app/code/Magento/GoogleShopping/Controller/Adminhtml/Googleshopping/Items/ConfirmCaptcha.php b/app/code/Magento/GoogleShopping/Controller/Adminhtml/Googleshopping/Items/ConfirmCaptcha.php index f1a1bece50558..ed8d3b3a98a69 100644 --- a/app/code/Magento/GoogleShopping/Controller/Adminhtml/Googleshopping/Items/ConfirmCaptcha.php +++ b/app/code/Magento/GoogleShopping/Controller/Adminhtml/Googleshopping/Items/ConfirmCaptcha.php @@ -5,8 +5,32 @@ */ namespace Magento\GoogleShopping\Controller\Adminhtml\Googleshopping\Items; +use Magento\Backend\App\Action; +use Magento\Framework\Notification\NotifierInterface; + class ConfirmCaptcha extends \Magento\GoogleShopping\Controller\Adminhtml\Googleshopping\Items { + /** + * @var \Magento\Framework\Url\DecoderInterface + */ + protected $urlDecoder; + + /** + * @param Action\Context $context + * @param NotifierInterface $notifier + * @param \Magento\Framework\Url\EncoderInterface $urlEncoder + * @param \Magento\Framework\Url\DecoderInterface $urlDecoder + */ + public function __construct( + Action\Context $context, + NotifierInterface $notifier, + \Magento\Framework\Url\EncoderInterface $urlEncoder, + \Magento\Framework\Url\DecoderInterface $urlDecoder + ) { + parent::__construct($context, $notifier, $urlEncoder); + $this->urlDecoder = $urlDecoder; + } + /** * Confirm CAPTCHA * @@ -20,9 +44,7 @@ public function execute() 'Magento\GoogleShopping\Model\Service' )->getClient( $storeId, - $this->_objectManager->get( - 'Magento\Core\Helper\Data' - )->urlDecode( + $this->urlDecoder->decode( $this->getRequest()->getParam('captcha_token') ), $this->getRequest()->getParam('user_confirm') diff --git a/app/code/Magento/GoogleShopping/Controller/Adminhtml/Googleshopping/Items/Index.php b/app/code/Magento/GoogleShopping/Controller/Adminhtml/Googleshopping/Items/Index.php index 7811da5e546a0..a4d0d85baec6e 100644 --- a/app/code/Magento/GoogleShopping/Controller/Adminhtml/Googleshopping/Items/Index.php +++ b/app/code/Magento/GoogleShopping/Controller/Adminhtml/Googleshopping/Items/Index.php @@ -5,8 +5,32 @@ */ namespace Magento\GoogleShopping\Controller\Adminhtml\Googleshopping\Items; +use Magento\Backend\App\Action; +use Magento\Framework\Notification\NotifierInterface; + class Index extends \Magento\GoogleShopping\Controller\Adminhtml\Googleshopping\Items { + /** + * @var \Magento\Framework\Url\DecoderInterface + */ + protected $urlDecoder; + + /** + * @param Action\Context $context + * @param NotifierInterface $notifier + * @param \Magento\Framework\Url\EncoderInterface $urlEncoder + * @param \Magento\Framework\Url\DecoderInterface $urlDecoder + */ + public function __construct( + Action\Context $context, + NotifierInterface $notifier, + \Magento\Framework\Url\EncoderInterface $urlEncoder, + \Magento\Framework\Url\DecoderInterface $urlDecoder + ) { + parent::__construct($context, $notifier, $urlEncoder); + $this->urlDecoder = $urlDecoder; + } + /** * Initialize general settings for action * @@ -58,16 +82,12 @@ public function execute() if ($this->getRequest()->getParam('captcha_token') && $this->getRequest()->getParam('captcha_url')) { $contentBlock->setGcontentCaptchaToken( - $this->_objectManager->get( - 'Magento\Core\Helper\Data' - )->urlDecode( + $this->urlDecoder->decode( $this->getRequest()->getParam('captcha_token') ) ); $contentBlock->setGcontentCaptchaUrl( - $this->_objectManager->get( - 'Magento\Core\Helper\Data' - )->urlDecode( + $this->urlDecoder->decode( $this->getRequest()->getParam('captcha_url') ) ); diff --git a/app/code/Magento/GoogleShopping/composer.json b/app/code/Magento/GoogleShopping/composer.json index b69240a10c610..f7a4d09d57066 100644 --- a/app/code/Magento/GoogleShopping/composer.json +++ b/app/code/Magento/GoogleShopping/composer.json @@ -3,19 +3,19 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha108", - "magento/module-core": "0.1.0-alpha108", - "magento/module-backend": "0.1.0-alpha108", - "magento/module-catalog": "0.1.0-alpha108", - "magento/module-customer": "0.1.0-alpha108", - "magento/module-directory": "0.1.0-alpha108", - "magento/module-eav": "0.1.0-alpha108", - "magento/module-tax": "0.1.0-alpha108", - "magento/framework": "0.1.0-alpha108", + "magento/module-store": "0.42.0-beta1", + "magento/module-core": "0.42.0-beta1", + "magento/module-backend": "0.42.0-beta1", + "magento/module-catalog": "0.42.0-beta1", + "magento/module-customer": "0.42.0-beta1", + "magento/module-directory": "0.42.0-beta1", + "magento/module-eav": "0.42.0-beta1", + "magento/module-tax": "0.42.0-beta1", + "magento/framework": "0.42.0-beta1", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha108", + "version": "0.42.0-beta1", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/GroupedImportExport/composer.json b/app/code/Magento/GroupedImportExport/composer.json index dcc7c763cc1df..283e65ae98a26 100644 --- a/app/code/Magento/GroupedImportExport/composer.json +++ b/app/code/Magento/GroupedImportExport/composer.json @@ -3,16 +3,16 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-catalog": "0.1.0-alpha108", - "magento/module-import-export": "0.1.0-alpha108", - "magento/module-catalog-import-export": "0.1.0-alpha108", - "magento/module-grouped-product": "0.1.0-alpha108", - "magento/module-eav": "0.1.0-alpha108", - "magento/framework": "0.1.0-alpha108", + "magento/module-catalog": "0.42.0-beta1", + "magento/module-import-export": "0.42.0-beta1", + "magento/module-catalog-import-export": "0.42.0-beta1", + "magento/module-grouped-product": "0.42.0-beta1", + "magento/module-eav": "0.42.0-beta1", + "magento/framework": "0.42.0-beta1", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha108", + "version": "0.42.0-beta1", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/GroupedProduct/Pricing/Price/FinalPrice.php b/app/code/Magento/GroupedProduct/Pricing/Price/FinalPrice.php index a634212946770..cc6cddecf5145 100644 --- a/app/code/Magento/GroupedProduct/Pricing/Price/FinalPrice.php +++ b/app/code/Magento/GroupedProduct/Pricing/Price/FinalPrice.php @@ -6,12 +6,12 @@ namespace Magento\GroupedProduct\Pricing\Price; use Magento\Catalog\Model\Product; -use Magento\Framework\Pricing\Price\AbstractPrice; +use Magento\Catalog\Pricing\Price\FinalPriceInterface; /** * Final price model */ -class FinalPrice extends AbstractPrice +class FinalPrice extends \Magento\Catalog\Pricing\Price\FinalPrice implements FinalPriceInterface { /** * Price type final diff --git a/app/code/Magento/GroupedProduct/composer.json b/app/code/Magento/GroupedProduct/composer.json index 9ad1453a1e382..781192913139b 100644 --- a/app/code/Magento/GroupedProduct/composer.json +++ b/app/code/Magento/GroupedProduct/composer.json @@ -3,21 +3,21 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha108", - "magento/module-catalog": "0.1.0-alpha108", - "magento/module-catalog-inventory": "0.1.0-alpha108", - "magento/module-sales": "0.1.0-alpha108", - "magento/module-core": "0.1.0-alpha108", - "magento/module-checkout": "0.1.0-alpha108", - "magento/module-backend": "0.1.0-alpha108", - "magento/module-eav": "0.1.0-alpha108", - "magento/module-customer": "0.1.0-alpha108", - "magento/module-msrp": "0.1.0-alpha108", - "magento/framework": "0.1.0-alpha108", + "magento/module-store": "0.42.0-beta1", + "magento/module-catalog": "0.42.0-beta1", + "magento/module-catalog-inventory": "0.42.0-beta1", + "magento/module-sales": "0.42.0-beta1", + "magento/module-core": "0.42.0-beta1", + "magento/module-checkout": "0.42.0-beta1", + "magento/module-backend": "0.42.0-beta1", + "magento/module-eav": "0.42.0-beta1", + "magento/module-customer": "0.42.0-beta1", + "magento/module-msrp": "0.42.0-beta1", + "magento/framework": "0.42.0-beta1", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha108", + "version": "0.42.0-beta1", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/ImportExport/composer.json b/app/code/Magento/ImportExport/composer.json index 3d9ad7513549e..51959b208707d 100644 --- a/app/code/Magento/ImportExport/composer.json +++ b/app/code/Magento/ImportExport/composer.json @@ -3,17 +3,17 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha108", - "magento/module-core": "0.1.0-alpha108", - "magento/module-backend": "0.1.0-alpha108", - "magento/module-eav": "0.1.0-alpha108", - "magento/module-indexer": "0.1.0-alpha108", - "magento/framework": "0.1.0-alpha108", + "magento/module-store": "0.42.0-beta1", + "magento/module-core": "0.42.0-beta1", + "magento/module-backend": "0.42.0-beta1", + "magento/module-eav": "0.42.0-beta1", + "magento/module-indexer": "0.42.0-beta1", + "magento/framework": "0.42.0-beta1", "ext-ctype": "*", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha108", + "version": "0.42.0-beta1", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Indexer/composer.json b/app/code/Magento/Indexer/composer.json index b825e659d83ee..16531f086231b 100644 --- a/app/code/Magento/Indexer/composer.json +++ b/app/code/Magento/Indexer/composer.json @@ -3,13 +3,13 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-backend": "0.1.0-alpha108", - "magento/module-page-cache": "0.1.0-alpha108", - "magento/framework": "0.1.0-alpha108", + "magento/module-backend": "0.42.0-beta1", + "magento/module-page-cache": "0.42.0-beta1", + "magento/framework": "0.42.0-beta1", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha108", + "version": "0.42.0-beta1", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Integration/composer.json b/app/code/Magento/Integration/composer.json index 2c296f9e50d6f..a519797a8eab0 100644 --- a/app/code/Magento/Integration/composer.json +++ b/app/code/Magento/Integration/composer.json @@ -3,17 +3,17 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha108", - "magento/module-core": "0.1.0-alpha108", - "magento/module-backend": "0.1.0-alpha108", - "magento/module-customer": "0.1.0-alpha108", - "magento/module-user": "0.1.0-alpha108", - "magento/framework": "0.1.0-alpha108", - "magento/module-authorization": "0.1.0-alpha108", + "magento/module-store": "0.42.0-beta1", + "magento/module-core": "0.42.0-beta1", + "magento/module-backend": "0.42.0-beta1", + "magento/module-customer": "0.42.0-beta1", + "magento/module-user": "0.42.0-beta1", + "magento/framework": "0.42.0-beta1", + "magento/module-authorization": "0.42.0-beta1", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha108", + "version": "0.42.0-beta1", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/LayeredNavigation/Model/Aggregation/Status.php b/app/code/Magento/LayeredNavigation/Model/Aggregation/Status.php new file mode 100644 index 0000000000000..ae847b418da39 --- /dev/null +++ b/app/code/Magento/LayeredNavigation/Model/Aggregation/Status.php @@ -0,0 +1,19 @@ + + + + + diff --git a/app/code/Magento/Log/composer.json b/app/code/Magento/Log/composer.json index e3c551d3ca470..baa3748cbdd0f 100644 --- a/app/code/Magento/Log/composer.json +++ b/app/code/Magento/Log/composer.json @@ -3,16 +3,16 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha108", - "magento/module-core": "0.1.0-alpha108", - "magento/module-customer": "0.1.0-alpha108", - "magento/module-eav": "0.1.0-alpha108", - "magento/module-backend": "0.1.0-alpha108", - "magento/framework": "0.1.0-alpha108", + "magento/module-store": "0.42.0-beta1", + "magento/module-core": "0.42.0-beta1", + "magento/module-customer": "0.42.0-beta1", + "magento/module-eav": "0.42.0-beta1", + "magento/module-backend": "0.42.0-beta1", + "magento/framework": "0.42.0-beta1", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha108", + "version": "0.42.0-beta1", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Msrp/composer.json b/app/code/Magento/Msrp/composer.json index 5ffc39216a8ff..7203cd93a371b 100644 --- a/app/code/Magento/Msrp/composer.json +++ b/app/code/Magento/Msrp/composer.json @@ -3,21 +3,20 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-bundle": "0.1.0-alpha108", - "magento/module-catalog": "0.1.0-alpha108", - "magento/module-configurable-product": "0.1.0-alpha108", - "magento/module-core": "0.1.0-alpha108", - "magento/module-downloadable": "0.1.0-alpha108", - "magento/module-eav": "0.1.0-alpha108", - "magento/module-grouped-product": "0.1.0-alpha108", - "magento/module-sales": "0.1.0-alpha108", - "magento/module-store": "0.1.0-alpha108", - "magento/module-tax": "0.1.0-alpha108", - "magento/framework": "0.1.0-alpha108", + "magento/module-bundle": "0.42.0-beta1", + "magento/module-catalog": "0.42.0-beta1", + "magento/module-core": "0.42.0-beta1", + "magento/module-downloadable": "0.42.0-beta1", + "magento/module-eav": "0.42.0-beta1", + "magento/module-grouped-product": "0.42.0-beta1", + "magento/module-sales": "0.42.0-beta1", + "magento/module-store": "0.42.0-beta1", + "magento/module-tax": "0.42.0-beta1", + "magento/framework": "0.42.0-beta1", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha108", + "version": "0.42.0-beta1", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Msrp/data/msrp_setup/data-install-2.0.0.php b/app/code/Magento/Msrp/data/msrp_setup/data-install-2.0.0.php index 3b6f61a1a4977..eadb58a9090a1 100644 --- a/app/code/Magento/Msrp/data/msrp_setup/data-install-2.0.0.php +++ b/app/code/Magento/Msrp/data/msrp_setup/data-install-2.0.0.php @@ -11,7 +11,6 @@ \Magento\Catalog\Model\Product\Type::TYPE_VIRTUAL, \Magento\Downloadable\Model\Product\Type::TYPE_DOWNLOADABLE, \Magento\Catalog\Model\Product\Type::TYPE_BUNDLE, - \Magento\ConfigurableProduct\Model\Product\Type\Configurable::TYPE_CODE, ]; $productTypes = join(',', $productTypes); diff --git a/app/code/Magento/Multishipping/Block/Checkout/Address/Select.php b/app/code/Magento/Multishipping/Block/Checkout/Address/Select.php index dbbac7f2881c7..8c7250a86e38f 100644 --- a/app/code/Magento/Multishipping/Block/Checkout/Address/Select.php +++ b/app/code/Magento/Multishipping/Block/Checkout/Address/Select.php @@ -4,8 +4,9 @@ */ namespace Magento\Multishipping\Block\Checkout\Address; -use Magento\Customer\Helper\Address as CustomerAddressHelper; use Magento\Framework\Exception\NoSuchEntityException; +use Magento\Customer\Helper\Address as CustomerAddressHelper; +use Magento\Customer\Api\AddressRepositoryInterface; /** * Class Select @@ -24,14 +25,24 @@ class Select extends \Magento\Multishipping\Block\Checkout\AbstractMultishipping protected $addressMapper; /** - * @var AddressConverter + * @var bool */ - protected $addressConverter; + protected $_isScopePrivate = true; /** - * @var bool + * @var \Magento\Framework\Api\FilterBuilder */ - protected $_isScopePrivate = true; + protected $filterBuilder; + + /** + * @var \Magento\Framework\Api\SearchCriteriaBuilder + */ + protected $searchCriteriaBuilder; + + /** + * @var AddressRepositoryInterface + */ + protected $addressRepository; /** * Initialize dependencies. @@ -40,6 +51,9 @@ class Select extends \Magento\Multishipping\Block\Checkout\AbstractMultishipping * @param \Magento\Multishipping\Model\Checkout\Type\Multishipping $multishipping * @param CustomerAddressHelper $customerAddressHelper * @param \Magento\Customer\Model\Address\Mapper $addressMapper + * @param AddressRepositoryInterface $addressRepository + * @param \Magento\Framework\Api\SearchCriteriaBuilder $searchCriteriaBuilder + * @param \Magento\Framework\Api\FilterBuilder $filterBuilder * @param array $data */ public function __construct( @@ -47,10 +61,16 @@ public function __construct( \Magento\Multishipping\Model\Checkout\Type\Multishipping $multishipping, CustomerAddressHelper $customerAddressHelper, \Magento\Customer\Model\Address\Mapper $addressMapper, + AddressRepositoryInterface $addressRepository, + \Magento\Framework\Api\SearchCriteriaBuilder $searchCriteriaBuilder, + \Magento\Framework\Api\FilterBuilder $filterBuilder, array $data = [] ) { $this->_customerAddressHelper = $customerAddressHelper; $this->addressMapper = $addressMapper; + $this->addressRepository = $addressRepository; + $this->searchCriteriaBuilder = $searchCriteriaBuilder; + $this->filterBuilder = $filterBuilder; parent::__construct($context, $multishipping, $data); } @@ -75,7 +95,13 @@ public function getAddress() $addresses = $this->getData('address_collection'); if (is_null($addresses)) { try { - $addresses = $this->_multishipping->getCustomer()->getAddresses(); + $filter = $this->filterBuilder->setField('parent_id') + ->setValue($this->_multishipping->getCustomer()->getId()) + ->setConditionType('eq') + ->create(); + $addresses = (array)($this->addressRepository->getList( + $this->searchCriteriaBuilder->addFilter([$filter])->create() + )->getItems()); } catch (NoSuchEntityException $e) { return []; } @@ -108,7 +134,7 @@ public function getAddressAsHtml(\Magento\Customer\Api\Data\AddressInterface $ad */ public function isAddressDefaultBilling(\Magento\Customer\Api\Data\AddressInterface $address) { - return $address->getId() == $this->_multishipping->getCustomer()->getDefaultBilling()->getId(); + return $address->getId() == $this->_multishipping->getCustomer()->getDefaultBilling(); } /** @@ -119,7 +145,7 @@ public function isAddressDefaultBilling(\Magento\Customer\Api\Data\AddressInterf */ public function isAddressDefaultShipping(\Magento\Customer\Api\Data\AddressInterface $address) { - return $address->getId() == $this->_multishipping->getCustomer()->getDefaultShipping()->getId(); + return $address->getId() == $this->_multishipping->getCustomer()->getDefaultShipping(); } /** diff --git a/app/code/Magento/Multishipping/Controller/Checkout/Address/EditAddress.php b/app/code/Magento/Multishipping/Controller/Checkout/Address/EditAddress.php index a880a4a525078..7fd0c139d5f7f 100644 --- a/app/code/Magento/Multishipping/Controller/Checkout/Address/EditAddress.php +++ b/app/code/Magento/Multishipping/Controller/Checkout/Address/EditAddress.php @@ -25,7 +25,7 @@ public function execute() $this->_url->getUrl('*/*/selectBilling') ); $this->_view->getPage()->getConfig()->getTitle()->set( - $addressForm->getTitle() . ' - ' . $this->_view->getPage()->getConfig()->getDefaultTitle() + $addressForm->getTitle() . ' - ' . $this->_view->getPage()->getConfig()->getTitle()->getDefault() ); } $this->_view->renderLayout(); diff --git a/app/code/Magento/Multishipping/Controller/Checkout/Address/EditBilling.php b/app/code/Magento/Multishipping/Controller/Checkout/Address/EditBilling.php index e3667e15877d3..a9058be4ffd9a 100644 --- a/app/code/Magento/Multishipping/Controller/Checkout/Address/EditBilling.php +++ b/app/code/Magento/Multishipping/Controller/Checkout/Address/EditBilling.php @@ -18,17 +18,18 @@ public function execute() $this->_view->loadLayout(); $this->_view->getLayout()->initMessages(); if ($addressForm = $this->_view->getLayout()->getBlock('customer_address_edit')) { + $id = $this->getRequest()->getParam('id'); $addressForm->setTitle( __('Edit Billing Address') )->setSuccessUrl( - $this->_url->getUrl('*/*/saveBilling', ['id' => $this->getRequest()->getParam('id')]) + $this->_url->getUrl('*/*/saveBilling', ['id' => $id]) )->setErrorUrl( - $this->_url->getUrl('*/*/*', ['id' => $this->getRequest()->getParam('id')]) + $this->_url->getUrl('*/*/*', ['id' => $id]) )->setBackUrl( $this->_url->getUrl('*/checkout/overview') ); $this->_view->getPage()->getConfig()->getTitle()->set( - $addressForm->getTitle() . ' - ' . $this->_view->getPage()->getConfig()->getDefaultTitle() + $addressForm->getTitle() . ' - ' . $this->_view->getPage()->getConfig()->getTitle()->getDefault() ); } $this->_view->renderLayout(); diff --git a/app/code/Magento/Multishipping/Controller/Checkout/Address/EditShipping.php b/app/code/Magento/Multishipping/Controller/Checkout/Address/EditShipping.php index ede47e3abb6aa..6a06c0e9697ba 100644 --- a/app/code/Magento/Multishipping/Controller/Checkout/Address/EditShipping.php +++ b/app/code/Magento/Multishipping/Controller/Checkout/Address/EditShipping.php @@ -27,7 +27,7 @@ public function execute() ); $this->_view->getPage()->getConfig()->getTitle()->set( - $addressForm->getTitle() . ' - ' . $this->_view->getPage()->getConfig()->getDefaultTitle() + $addressForm->getTitle() . ' - ' . $this->_view->getPage()->getConfig()->getTitle()->getDefault() ); if ($this->_getCheckout()->getCustomerDefaultShippingAddress()) { diff --git a/app/code/Magento/Multishipping/Controller/Checkout/Address/NewBilling.php b/app/code/Magento/Multishipping/Controller/Checkout/Address/NewBilling.php index f0a6a3f75d686..5a44b7897bb80 100644 --- a/app/code/Magento/Multishipping/Controller/Checkout/Address/NewBilling.php +++ b/app/code/Magento/Multishipping/Controller/Checkout/Address/NewBilling.php @@ -26,7 +26,7 @@ public function execute() ); $this->_view->getPage()->getConfig()->getTitle()->set( - $addressForm->getTitle() . ' - ' . $this->_view->getPage()->getConfig()->getDefaultTitle() + $addressForm->getTitle() . ' - ' . $this->_view->getPage()->getConfig()->getTitle()->getDefault() ); } $this->_view->renderLayout(); diff --git a/app/code/Magento/Multishipping/Controller/Checkout/Address/NewShipping.php b/app/code/Magento/Multishipping/Controller/Checkout/Address/NewShipping.php index fc10d4c715515..e14f4f7d671bc 100644 --- a/app/code/Magento/Multishipping/Controller/Checkout/Address/NewShipping.php +++ b/app/code/Magento/Multishipping/Controller/Checkout/Address/NewShipping.php @@ -29,7 +29,7 @@ public function execute() ); $this->_view->getPage()->getConfig()->getTitle()->set( - $addressForm->getTitle() . ' - ' . $this->_view->getPage()->getConfig()->getDefaultTitle() + $addressForm->getTitle() . ' - ' . $this->_view->getPage()->getConfig()->getTitle()->getDefault() ); if ($this->_getCheckout()->getCustomerDefaultShippingAddress()) { diff --git a/app/code/Magento/Multishipping/Controller/Checkout/Address/ShippingSaved.php b/app/code/Magento/Multishipping/Controller/Checkout/Address/ShippingSaved.php index 069f738c79e7c..91d62b2f3efbc 100644 --- a/app/code/Magento/Multishipping/Controller/Checkout/Address/ShippingSaved.php +++ b/app/code/Magento/Multishipping/Controller/Checkout/Address/ShippingSaved.php @@ -6,20 +6,50 @@ use Magento\Framework\App\Action\Context; use Magento\Multishipping\Controller\Checkout\Address; +use Magento\Customer\Api\AddressRepositoryInterface; +use Magento\Framework\Api\FilterBuilder; +use Magento\Framework\Api\SearchCriteriaBuilder; /** * Class ShippingSaved + * + * @SuppressWarnings(PHPMD.LongVariable) */ class ShippingSaved extends Address { + /** + * @var \Magento\Customer\Api\AddressRepositoryInterface + */ + private $addressRepository; + + /** + * @var \Magento\Framework\Api\FilterBuilder + */ + private $filterBuilder; + + /** + * @var \Magento\Framework\Api\SearchCriteriaBuilder + */ + private $searchCriteriaBuilder; + /** * Initialize dependencies. * * @param Context $context + * @param AddressRepositoryInterface $addressRepository + * @param FilterBuilder $filterBuilder + * @param SearchCriteriaBuilder $searchCriteriaBuilder */ - public function __construct(Context $context) - { + public function __construct( + Context $context, + AddressRepositoryInterface $addressRepository, + FilterBuilder $filterBuilder, + SearchCriteriaBuilder $searchCriteriaBuilder + ) { parent::__construct($context); + $this->addressRepository = $addressRepository; + $this->filterBuilder = $filterBuilder; + $this->searchCriteriaBuilder = $searchCriteriaBuilder; } /** @@ -27,10 +57,16 @@ public function __construct(Context $context) */ public function execute() { + $filter = $this->filterBuilder->setField('parent_id')->setValue($this->_getCheckout()->getCustomer()->getId()) + ->setConditionType('eq')->create(); + $addresses = (array)($this->addressRepository->getList( + $this->searchCriteriaBuilder->addFilter([$filter])->create() + )->getItems()); + /** * if we create first address we need reset emd init checkout */ - if (count($this->_getCheckout()->getCustomer()->getAddresses()) === 1) { + if (count($addresses) === 1) { $this->_getCheckout()->reset(); } $this->_redirect('*/checkout/addresses'); diff --git a/app/code/Magento/Multishipping/composer.json b/app/code/Magento/Multishipping/composer.json index c69cdb0d32d53..5ac026eaacb8e 100644 --- a/app/code/Magento/Multishipping/composer.json +++ b/app/code/Magento/Multishipping/composer.json @@ -3,19 +3,19 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha108", - "magento/module-core": "0.1.0-alpha108", - "magento/module-checkout": "0.1.0-alpha108", - "magento/module-sales": "0.1.0-alpha108", - "magento/module-payment": "0.1.0-alpha108", - "magento/module-tax": "0.1.0-alpha108", - "magento/module-customer": "0.1.0-alpha108", - "magento/module-theme": "0.1.0-alpha108", - "magento/framework": "0.1.0-alpha108", + "magento/module-store": "0.42.0-beta1", + "magento/module-core": "0.42.0-beta1", + "magento/module-checkout": "0.42.0-beta1", + "magento/module-sales": "0.42.0-beta1", + "magento/module-payment": "0.42.0-beta1", + "magento/module-tax": "0.42.0-beta1", + "magento/module-customer": "0.42.0-beta1", + "magento/module-theme": "0.42.0-beta1", + "magento/framework": "0.42.0-beta1", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha108", + "version": "0.42.0-beta1", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Newsletter/composer.json b/app/code/Magento/Newsletter/composer.json index a0d81c9588e9c..06d75d0352e70 100644 --- a/app/code/Magento/Newsletter/composer.json +++ b/app/code/Magento/Newsletter/composer.json @@ -3,20 +3,20 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha108", - "magento/module-core": "0.1.0-alpha108", - "magento/module-customer": "0.1.0-alpha108", - "magento/module-widget": "0.1.0-alpha108", - "magento/module-backend": "0.1.0-alpha108", - "magento/module-cms": "0.1.0-alpha108", - "magento/module-email": "0.1.0-alpha108", - "magento/module-cron": "0.1.0-alpha108", - "magento/module-eav": "0.1.0-alpha108", - "magento/framework": "0.1.0-alpha108", + "magento/module-store": "0.42.0-beta1", + "magento/module-core": "0.42.0-beta1", + "magento/module-customer": "0.42.0-beta1", + "magento/module-widget": "0.42.0-beta1", + "magento/module-backend": "0.42.0-beta1", + "magento/module-cms": "0.42.0-beta1", + "magento/module-email": "0.42.0-beta1", + "magento/module-cron": "0.42.0-beta1", + "magento/module-eav": "0.42.0-beta1", + "magento/framework": "0.42.0-beta1", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha108", + "version": "0.42.0-beta1", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/OfflinePayments/composer.json b/app/code/Magento/OfflinePayments/composer.json index d45c7212a27c9..42c64fde731c4 100644 --- a/app/code/Magento/OfflinePayments/composer.json +++ b/app/code/Magento/OfflinePayments/composer.json @@ -3,12 +3,12 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-payment": "0.1.0-alpha108", - "magento/framework": "0.1.0-alpha108", + "magento/module-payment": "0.42.0-beta1", + "magento/framework": "0.42.0-beta1", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha108", + "version": "0.42.0-beta1", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/OfflineShipping/composer.json b/app/code/Magento/OfflineShipping/composer.json index 5728f7e83a269..b48ea50cc45fc 100644 --- a/app/code/Magento/OfflineShipping/composer.json +++ b/app/code/Magento/OfflineShipping/composer.json @@ -3,19 +3,19 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha108", - "magento/module-backend": "0.1.0-alpha108", - "magento/module-shipping": "0.1.0-alpha108", - "magento/module-catalog": "0.1.0-alpha108", - "magento/module-sales": "0.1.0-alpha108", - "magento/module-sales-rule": "0.1.0-alpha108", - "magento/module-directory": "0.1.0-alpha108", - "magento/module-checkout": "0.1.0-alpha108", - "magento/framework": "0.1.0-alpha108", + "magento/module-store": "0.42.0-beta1", + "magento/module-backend": "0.42.0-beta1", + "magento/module-shipping": "0.42.0-beta1", + "magento/module-catalog": "0.42.0-beta1", + "magento/module-sales": "0.42.0-beta1", + "magento/module-sales-rule": "0.42.0-beta1", + "magento/module-directory": "0.42.0-beta1", + "magento/module-checkout": "0.42.0-beta1", + "magento/framework": "0.42.0-beta1", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha108", + "version": "0.42.0-beta1", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Ogone/Block/Form.php b/app/code/Magento/Ogone/Block/Form.php deleted file mode 100644 index add4883c4d63f..0000000000000 --- a/app/code/Magento/Ogone/Block/Form.php +++ /dev/null @@ -1,13 +0,0 @@ -_checkoutSession = $checkoutSession; - $this->_ogoneApi = $ogoneApi; - $this->_salesOrderFactory = $salesOrderFactory; - parent::__construct($context, $data); - $this->_isScopePrivate = true; - } - - /** - * Get checkout session namespace - * - * @return \Magento\Checkout\Model\Session - */ - public function getCheckout() - { - return $this->_checkoutSession; - } - - /** - * Return order instance with loaded information by increment id - * - * @return \Magento\Sales\Model\Order - */ - protected function _getOrder() - { - if ($this->getOrder()) { - $order = $this->getOrder(); - } elseif ($this->_checkoutSession->getLastRealOrderId()) { - $order = $this->_salesOrderFactory->create() - ->loadByIncrementId($this->_checkoutSession->getLastRealOrderId()); - } else { - return null; - } - return $order; - } - - /** - * Get Form data by using ogone payment api - * - * @return array - */ - public function getFormData() - { - return $this->_ogoneApi->getFormFields($this->_getOrder()); - } - - /** - * Getting gateway url - * - * @return string - */ - public function getFormAction() - { - return $this->_ogoneApi->getConfig()->getGatewayPath(); - } -} diff --git a/app/code/Magento/Ogone/Controller/Api.php b/app/code/Magento/Ogone/Controller/Api.php deleted file mode 100644 index e43f876721914..0000000000000 --- a/app/code/Magento/Ogone/Controller/Api.php +++ /dev/null @@ -1,418 +0,0 @@ -_transactionFactory = $transactionFactory; - $this->_salesOrderFactory = $salesOrderFactory; - $this->orderSender = $orderSender; - } - - /** - * Get checkout session namespace - * - * @return \Magento\Checkout\Model\Session - */ - protected function _getCheckout() - { - return $this->_objectManager->get('Magento\Checkout\Model\Session'); - } - - /** - * Get singleton with Checkout by Ogone Api - * - * @return \Magento\Ogone\Model\Api - */ - protected function _getApi() - { - return $this->_objectManager->get('Magento\Ogone\Model\Api'); - } - - /** - * Return order instance loaded by increment id - * - * @return Order - */ - protected function _getOrder() - { - if (empty($this->_order)) { - $orderId = $this->getRequest()->getParam('orderID'); - $this->_order = $this->_salesOrderFactory->create()->loadByIncrementId($orderId); - } - return $this->_order; - } - - /** - * Validation of incoming Ogone data - * - * @return bool - */ - protected function _validateOgoneData() - { - $params = $this->getRequest()->getParams(); - $api = $this->_getApi(); - $api->debugData(['result' => $params]); - - $hashValidationResult = false; - if ($api->getConfig()->getShaInCode()) { - $referenceHash = $api->getHash( - $params, - $api->getConfig()->getShaInCode(), - \Magento\Ogone\Model\Api::HASH_DIR_IN, - (int)$api->getConfig()->getConfigData('shamode'), - $api->getConfig()->getConfigData('hashing_algorithm') - ); - if ($params['SHASIGN'] == $referenceHash) { - $hashValidationResult = true; - } - } - - if (!$hashValidationResult) { - $this->messageManager->addError(__('The hash is not valid.')); - return false; - } - - $order = $this->_getOrder(); - if (!$order->getId()) { - $this->messageManager->addError(__('The order is not valid.')); - return false; - } - - return true; - } - - /** - * Made offline Ogone data processing, depending of incoming statuses - * - * @return void - */ - protected function _ogoneProcess() - { - $status = $this->getRequest()->getParam('STATUS'); - switch ($status) { - case \Magento\Ogone\Model\Api::OGONE_AUTHORIZED: - case \Magento\Ogone\Model\Api::OGONE_AUTH_PROCESSING: - case \Magento\Ogone\Model\Api::OGONE_PAYMENT_REQUESTED_STATUS: - $this->_acceptProcess(); - break; - case \Magento\Ogone\Model\Api::OGONE_AUTH_REFUZED: - case \Magento\Ogone\Model\Api::OGONE_PAYMENT_INCOMPLETE: - case \Magento\Ogone\Model\Api::OGONE_TECH_PROBLEM: - $this->_declineProcess(); - break; - case \Magento\Ogone\Model\Api::OGONE_AUTH_UKNKOWN_STATUS: - case \Magento\Ogone\Model\Api::OGONE_PAYMENT_UNCERTAIN_STATUS: - $this->_exceptionProcess(); - break; - default: - //all unknown transaction will accept as exceptional - $this->_exceptionProcess(); - break; - } - } - - /** - * Process success action by accept url - * - * @return void - */ - protected function _acceptProcess() - { - $params = $this->getRequest()->getParams(); - $order = $this->_getOrder(); - if (!$this->_isOrderValid($order)) { - return; - } - - $this->_getCheckout()->setLastSuccessQuoteId($order->getQuoteId()); - - $this->_prepareCCInfo($order, $params); - $order->getPayment()->setTransactionId($params['PAYID']); - $order->getPayment()->setLastTransId($params['PAYID']); - - try { - $status = $this->getRequest()->getParam('STATUS'); - switch ($status) { - case \Magento\Ogone\Model\Api::OGONE_AUTHORIZED: - case \Magento\Ogone\Model\Api::OGONE_AUTH_PROCESSING: - $this->_processAuthorize(); - break; - case \Magento\Ogone\Model\Api::OGONE_PAYMENT_REQUESTED_STATUS: - $this->_processDirectSale(); - break; - default: - throw new \Exception(__('Can\'t detect Ogone payment action')); - } - } catch (\Exception $e) { - $this->messageManager->addError(__('The order cannot be saved.')); - $this->_redirect('checkout/cart'); - return; - } - } - - /** - * Process Configured Payment Action: Direct Sale, create invoice if state is Pending - * - * @return void - */ - protected function _processDirectSale() - { - $order = $this->_getOrder(); - $status = $this->getRequest()->getParam('STATUS'); - try { - if ($status == \Magento\Ogone\Model\Api::OGONE_AUTH_PROCESSING) { - $order->setState( - \Magento\Sales\Model\Order::STATE_PROCESSING, - \Magento\Ogone\Model\Api::WAITING_AUTHORIZATION, - __('Authorization Waiting from Ogone') - ); - $order->save(); - } elseif ($order->getState() == \Magento\Sales\Model\Order::STATE_PENDING_PAYMENT) { - if ($status == \Magento\Ogone\Model\Api::OGONE_AUTHORIZED) { - if ($order->getStatus() != \Magento\Sales\Model\Order::STATE_PENDING_PAYMENT) { - $order->setState( - \Magento\Sales\Model\Order::STATE_PROCESSING, - \Magento\Ogone\Model\Api::PROCESSING_OGONE_STATUS, - __('Processed by Ogone') - ); - } - } else { - $order->setState( - \Magento\Sales\Model\Order::STATE_PROCESSING, - \Magento\Ogone\Model\Api::PROCESSED_OGONE_STATUS, - __('Processed by Ogone') - ); - } - - $order->getPayment()->addTransaction(PaymentTransaction::TYPE_CAPTURE); - - if (!$order->getInvoiceCollection()->getSize()) { - $invoice = $order->prepareInvoice(); - $invoice->register(); - $invoice->setState(\Magento\Sales\Model\Order\Invoice::STATE_PAID); - $invoice->getOrder()->setIsInProcess(true); - - $this->_transactionFactory->create()->addObject($invoice)->addObject($invoice->getOrder())->save(); - $this->orderSender->send($order); - } - } else { - $order->save(); - } - $this->_redirect('checkout/onepage/success'); - return; - } catch (\Exception $e) { - $this->messageManager->addError(__('Order can\'t save')); - $this->_redirect('checkout/cart'); - return; - } - } - - /** - * Process Configured Payment Actions: Authorized, Default operation - * just place order - * - * @return void - */ - protected function _processAuthorize() - { - $order = $this->_getOrder(); - $status = $this->getRequest()->getParam('STATUS'); - try { - if ($status == \Magento\Ogone\Model\Api::OGONE_AUTH_PROCESSING) { - $order->setState( - \Magento\Sales\Model\Order::STATE_PROCESSING, - \Magento\Ogone\Model\Api::WAITING_AUTHORIZATION, - __('Authorization Waiting from Ogone') - ); - } else { - //to send new order email only when state is pending payment - if ($order->getState() == \Magento\Sales\Model\Order::STATE_PENDING_PAYMENT) { - $this->orderSender->send($order); - } - $order->setState( - \Magento\Sales\Model\Order::STATE_PROCESSING, - \Magento\Ogone\Model\Api::PROCESSED_OGONE_STATUS, - __('Processed by Ogone') - ); - - $order->getPayment()->addTransaction(PaymentTransaction::TYPE_AUTH); - } - $order->save(); - $this->_redirect('checkout/onepage/success'); - return; - } catch (\Exception $e) { - $this->messageManager->addError(__('Order can\'t save')); - $this->_redirect('checkout/cart'); - return; - } - } - - /** - * We get some CC info from Ogone, so we must save it - * - * @param \Magento\Sales\Model\Order $order - * @param array $ccInfo - * - * @return $this - */ - protected function _prepareCCInfo($order, $ccInfo) - { - $order->getPayment()->setCcOwner($ccInfo['CN']); - $order->getPayment()->setCcNumberEnc($ccInfo['CARDNO']); - $order->getPayment()->setCcLast4(substr($ccInfo['CARDNO'], -4)); - $order->getPayment()->setCcExpMonth(substr($ccInfo['ED'], 0, 2)); - $order->getPayment()->setCcExpYear(substr($ccInfo['ED'], 2, 2)); - return $this; - } - - /** - * Process exception action by Ogone exception url - * - * @return void - */ - public function _exceptionProcess() - { - $params = $this->getRequest()->getParams(); - $order = $this->_getOrder(); - if (!$this->_isOrderValid($order)) { - return; - } - - switch ($params['STATUS']) { - case \Magento\Ogone\Model\Api::OGONE_PAYMENT_UNCERTAIN_STATUS: - $exception = __( - 'Something went wrong during the payment process, and so the result is unpredictable.' - ); - break; - case \Magento\Ogone\Model\Api::OGONE_AUTH_UKNKOWN_STATUS: - $exception = __( - 'Something went wrong during the authorization process, and so the result is unpredictable.' - ); - break; - default: - $exception = __('Unknown exception'); - break; - } - - if (!empty($exception)) { - try { - $this->_getCheckout()->setLastSuccessQuoteId($order->getQuoteId()); - $this->_prepareCCInfo($order, $params); - $order->getPayment()->setLastTransId($params['PAYID']); - //to send new order email only when state is pending payment - if ($order->getState() == \Magento\Sales\Model\Order::STATE_PENDING_PAYMENT) { - $this->orderSender->send($order); - $order->setState( - \Magento\Sales\Model\Order::STATE_PROCESSING, - \Magento\Ogone\Model\Api::PROCESSING_OGONE_STATUS, - $exception - ); - } else { - $order->addStatusToHistory(\Magento\Ogone\Model\Api::PROCESSING_OGONE_STATUS, $exception); - } - $order->save(); - } catch (\Exception $e) { - $this->messageManager->addError(__('Something went wrong while saving this order.')); - } - } else { - $this->messageManager->addError(__('Exception not defined')); - } - - $this->_redirect('checkout/onepage/success'); - } - - /** - * Process decline action by Ogone decline url - * - * @return void - */ - protected function _declineProcess() - { - $status = \Magento\Ogone\Model\Api::DECLINE_OGONE_STATUS; - $comment = __('Declined Order on Ogone side'); - $this->messageManager->addError(__('The payment transaction has been declined.')); - $this->_cancelOrder($status, $comment); - } - - /** - * Cancel action, used for decline and cancel processes - * - * @param string $status - * @param string $comment - * @return void|$this - */ - protected function _cancelOrder($status, $comment = '') - { - $order = $this->_getOrder(); - if (!$this->_isOrderValid($order)) { - return; - } - - try { - $order->cancel(); - $order->setState(\Magento\Sales\Model\Order::STATE_CANCELED, $status, $comment); - $order->save(); - } catch (\Exception $e) { - $this->messageManager->addError(__('Something went wrong while canceling this order.')); - } - - $this->_redirect('checkout/cart'); - return $this; - } - - /** - * Check order payment method - * - * @param \Magento\Sales\Model\Order $order - * @return bool - */ - protected function _isOrderValid($order) - { - return \Magento\Ogone\Model\Api::PAYMENT_CODE == $order->getPayment()->getMethodInstance()->getCode(); - } -} diff --git a/app/code/Magento/Ogone/Controller/Api/Accept.php b/app/code/Magento/Ogone/Controller/Api/Accept.php deleted file mode 100644 index 3adc34b3c83a9..0000000000000 --- a/app/code/Magento/Ogone/Controller/Api/Accept.php +++ /dev/null @@ -1,25 +0,0 @@ -_validateOgoneData()) { - $this->_redirect('checkout/cart'); - return; - } - $this->_ogoneProcess(); - } -} diff --git a/app/code/Magento/Ogone/Controller/Api/Cancel.php b/app/code/Magento/Ogone/Controller/Api/Cancel.php deleted file mode 100644 index 2417aee332ac6..0000000000000 --- a/app/code/Magento/Ogone/Controller/Api/Cancel.php +++ /dev/null @@ -1,39 +0,0 @@ -_cancelOrder($status, $comment); - return $this; - } - - /** - * When user cancel the payment - * change order status to cancelled - * need to redirect user to shopping cart - * - * @return void - */ - public function execute() - { - if (!$this->_validateOgoneData()) { - $this->_redirect('checkout/cart'); - return; - } - $this->_getCheckout()->setQuoteId($this->_getCheckout()->getOgoneQuoteId()); - $this->_cancelProcess(); - } -} diff --git a/app/code/Magento/Ogone/Controller/Api/Decline.php b/app/code/Magento/Ogone/Controller/Api/Decline.php deleted file mode 100644 index 6d7a7e36e2f77..0000000000000 --- a/app/code/Magento/Ogone/Controller/Api/Decline.php +++ /dev/null @@ -1,26 +0,0 @@ -_validateOgoneData()) { - $this->_redirect('checkout/cart'); - return; - } - $this->_getCheckout()->setQuoteId($this->_getCheckout()->getOgoneQuoteId()); - $this->_declineProcess(); - } -} diff --git a/app/code/Magento/Ogone/Controller/Api/Exception.php b/app/code/Magento/Ogone/Controller/Api/Exception.php deleted file mode 100644 index 21e9f9fdd783c..0000000000000 --- a/app/code/Magento/Ogone/Controller/Api/Exception.php +++ /dev/null @@ -1,26 +0,0 @@ -_validateOgoneData()) { - $this->_redirect('checkout/cart'); - return; - } - $this->_exceptionProcess(); - } -} diff --git a/app/code/Magento/Ogone/Controller/Api/OfflineProcess.php b/app/code/Magento/Ogone/Controller/Api/OfflineProcess.php deleted file mode 100644 index 112018f87f800..0000000000000 --- a/app/code/Magento/Ogone/Controller/Api/OfflineProcess.php +++ /dev/null @@ -1,22 +0,0 @@ -_validateOgoneData()) { - $this->getResponse()->setHeader("Status", "404 Not Found"); - return false; - } - $this->_ogoneProcess(); - } -} diff --git a/app/code/Magento/Ogone/Controller/Api/Paypage.php b/app/code/Magento/Ogone/Controller/Api/Paypage.php deleted file mode 100644 index f385065293576..0000000000000 --- a/app/code/Magento/Ogone/Controller/Api/Paypage.php +++ /dev/null @@ -1,20 +0,0 @@ -_view->loadLayout(); - $this->_view->renderLayout(); - } -} diff --git a/app/code/Magento/Ogone/Controller/Api/Placeform.php b/app/code/Magento/Ogone/Controller/Api/Placeform.php deleted file mode 100644 index ff752824696e2..0000000000000 --- a/app/code/Magento/Ogone/Controller/Api/Placeform.php +++ /dev/null @@ -1,72 +0,0 @@ -quoteRepository = $quoteRepository; - parent::__construct( - $context, - $transactionFactory, - $salesOrderFactory, - $orderSender - ); - } - - /** - * Load place from layout to make POST on Ogone - * - * @return void - */ - public function execute() - { - $lastIncrementId = $this->_getCheckout()->getLastRealOrderId(); - if ($lastIncrementId) { - $order = $this->_salesOrderFactory->create()->loadByIncrementId($lastIncrementId); - if ($order->getId()) { - $order->setState( - \Magento\Sales\Model\Order::STATE_PENDING_PAYMENT, - \Magento\Ogone\Model\Api::PENDING_OGONE_STATUS, - __('Start Ogone Processing') - ); - $order->save(); - - $this->_getApi()->debugOrder($order); - } - } - - $this->_getCheckout()->getQuote()->setIsActive(false); - $this->quoteRepository->save($this->_getCheckout()->getQuote()); - $this->_getCheckout()->setOgoneQuoteId($this->_getCheckout()->getQuoteId()); - $this->_getCheckout()->setOgoneLastSuccessQuoteId($this->_getCheckout()->getLastSuccessQuoteId()); - $this->_getCheckout()->clearQuote(); - - $this->_view->loadLayout(); - $this->_view->renderLayout(); - } -} diff --git a/app/code/Magento/Ogone/Controller/Api/PostBack.php b/app/code/Magento/Ogone/Controller/Api/PostBack.php deleted file mode 100644 index 61bc248d2799b..0000000000000 --- a/app/code/Magento/Ogone/Controller/Api/PostBack.php +++ /dev/null @@ -1,11 +0,0 @@ -" 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/Ogone/LICENSE_AFL.txt b/app/code/Magento/Ogone/LICENSE_AFL.txt deleted file mode 100644 index 87943b95d43a5..0000000000000 --- a/app/code/Magento/Ogone/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 " 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/Ogone/Model/Api.php b/app/code/Magento/Ogone/Model/Api.php deleted file mode 100644 index 49ef1de05d9f8..0000000000000 --- a/app/code/Magento/Ogone/Model/Api.php +++ /dev/null @@ -1,764 +0,0 @@ -_storeManager = $storeManager; - $this->_localeResolver = $localeResolver; - $this->_urlBuilder = $urlBuilder; - $this->string = $string; - $this->_config = $config; - parent::__construct($eventManager, $paymentData, $scopeConfig, $logAdapterFactory, $data); - } - - /** - * Return Ogone config instance - * - * @return \Magento\Ogone\Model\Config - */ - public function getConfig() - { - return $this->_config; - } - - /** - * Flag which prevent automatic invoice creation - * - * @return bool - */ - public function isInitializeNeeded() - { - return true; - } - - /** - * Redirect url to Ogone submit form - * - * @return string - */ - public function getOrderPlaceRedirectUrl() - { - return $this->_urlBuilder->getUrl('ogone/api/placeform', ['_secure' => true]); - } - - /** - * Return payment_action value from config area - * - * @return string - */ - public function getPaymentAction() - { - return $this->getConfig()->getConfigData('payment_action'); - } - - /** - * Prepare params array to send it to gateway page via POST - * - * @param \Magento\Sales\Model\Order $order - * @return array - */ - public function getFormFields($order) - { - if (empty($order)) { - if (!($order = $this->getOrder())) { - return []; - } - } - /** @var \Magento\Sales\Model\Quote\Address $billingAddress */ - $billingAddress = $order->getBillingAddress(); - $formFields = []; - $formFields['PSPID'] = $this->getConfig()->getPSPID(); - $formFields['orderID'] = $order->getIncrementId(); - $formFields['amount'] = round($order->getBaseGrandTotal() * 100); - $formFields['currency'] = $this->_storeManager->getStore()->getBaseCurrencyCode(); - $formFields['language'] = $this->_localeResolver->getLocaleCode(); - - $formFields['CN'] = $this->_translate($billingAddress->getFirstname() . ' ' . $billingAddress->getLastname()); - $formFields['EMAIL'] = $order->getCustomerEmail(); - $formFields['ownerZIP'] = $billingAddress->getPostcode(); - $formFields['ownercty'] = $billingAddress->getCountry(); - $formFields['ownertown'] = $this->_translate($billingAddress->getCity()); - $formFields['COM'] = $this->_translate($this->_getOrderDescription($order)); - $formFields['ownertelno'] = $billingAddress->getTelephone(); - $formFields['owneraddress'] = $this->_translate(implode(' ', $billingAddress->getStreet())); - - $paymentAction = $this->_getOgonePaymentOperation(); - if ($paymentAction) { - $formFields['operation'] = $paymentAction; - } - - $formFields['homeurl'] = $this->getConfig()->getHomeUrl(); - $formFields['catalogurl'] = $this->getConfig()->getHomeUrl(); - $formFields['accepturl'] = $this->getConfig()->getAcceptUrl(); - $formFields['declineurl'] = $this->getConfig()->getDeclineUrl(); - $formFields['exceptionurl'] = $this->getConfig()->getExceptionUrl(); - $formFields['cancelurl'] = $this->getConfig()->getCancelUrl(); - - if ($this->getConfig()->getConfigData('template') == 'ogone') { - $formFields['TP'] = ''; - $formFields['PMListType'] = $this->getConfig()->getConfigData('pmlist'); - } else { - $formFields['TP'] = $this->getConfig()->getPayPageTemplate(); - } - $formFields['TITLE'] = $this->_translate($this->getConfig()->getConfigData('html_title')); - $formFields['BGCOLOR'] = $this->getConfig()->getConfigData('bgcolor'); - $formFields['TXTCOLOR'] = $this->getConfig()->getConfigData('txtcolor'); - $formFields['TBLBGCOLOR'] = $this->getConfig()->getConfigData('tblbgcolor'); - $formFields['TBLTXTCOLOR'] = $this->getConfig()->getConfigData('tbltxtcolor'); - $formFields['BUTTONBGCOLOR'] = $this->getConfig()->getConfigData('buttonbgcolor'); - $formFields['BUTTONTXTCOLOR'] = $this->getConfig()->getConfigData('buttontxtcolor'); - $formFields['FONTTYPE'] = $this->getConfig()->getConfigData('fonttype'); - $formFields['LOGO'] = $this->getConfig()->getConfigData('logo'); - - $formFields['SHASign'] = $this->getHash( - $formFields, - $this->getConfig()->getShaOutCode(), - self::HASH_DIR_OUT, - (int)$this->getConfig()->getConfigData('shamode'), - $this->getConfig()->getConfigData('hashing_algorithm') - ); - - return $formFields; - } - - /** - * Debug specified order fields if needed - * - * @param \Magento\Sales\Model\Order $order - * @return void - */ - public function debugOrder(\Magento\Sales\Model\Order $order) - { - if ($this->getDebugFlag()) { - $this->debugData(['request' => $this->getFormFields($order)]); - } - } - - /** - * Create hash from provided data - * - * @param array $data - * @param string $passPhrase - * @param string $direction - * @param bool|int $mapAllParams - * @param null|string $algorithm - * @return string - * @throws \Exception - */ - public function getHash($data, $passPhrase, $direction, $mapAllParams = false, $algorithm = null) - { - // pick the right keys map depending on context - if (self::HASH_DIR_OUT === $direction) { - $hashMap = $mapAllParams ? '_outAllMap' : '_outShortMap'; - } elseif (self::HASH_DIR_IN === $direction) { - $hashMap = $mapAllParams ? '_inAllMap' : '_inShortMap'; - } else { - throw new \Exception(sprintf('Unknown hashing context "%s".', $direction)); - } - - // collect non-empty data that maps and sort it alphabetically by key (uppercase) - $collected = []; - foreach ($data as $key => $value) { - if (null !== $value && '' != $value) { - $key = strtoupper($key); - if (in_array($key, self::$$hashMap)) { - $collected[$key] = $value; - } - } - } - ksort($collected); - - if ($mapAllParams) { - $nonHashed = $this->_concatenateAdvanced($collected, $passPhrase); - if (empty($algorithm) || !in_array($algorithm, $this->getHashingAlgorithms(false))) { - $algorithm = self::HASH_SHA256; - } - } else { - $nonHashed = $this->_concatenateBasic($collected, $passPhrase, $hashMap); - $algorithm = self::HASH_SHA1; - } - return strtoupper(hash($algorithm, $nonHashed)); - } - - /** - * Get supported hashing algorithms as array - * - * @param bool $withLabels - * @return array - */ - public function getHashingAlgorithms($withLabels = true) - { - if ($withLabels) { - return [self::HASH_SHA1 => 'SHA-1', self::HASH_SHA256 => 'SHA-256', self::HASH_SHA512 => 'SHA-512']; - } - return [self::HASH_SHA1, self::HASH_SHA256, self::HASH_SHA512]; - } - - /** - * To translate UTF 8 to ISO 8859-1 - * Ogone system is only compatible with iso-8859-1 and does not (yet) fully support the utf-8 - * - * @param string $text - * @return string - */ - protected function _translate($text) - { - return htmlentities(iconv('UTF-8', 'ISO-8859-1', $text), ENT_COMPAT | ENT_HTML401, 'ISO-8859-1'); - } - - /** - * Get Ogone Payment Action value - * - * @return string - */ - protected function _getOgonePaymentOperation() - { - $value = $this->getPaymentAction(); - if ($value == \Magento\Payment\Model\Method\AbstractMethod::ACTION_AUTHORIZE) { - $value = \Magento\Ogone\Model\Api::OGONE_AUTHORIZE_ACTION; - } elseif ($value == \Magento\Payment\Model\Method\AbstractMethod::ACTION_AUTHORIZE_CAPTURE) { - $value = \Magento\Ogone\Model\Api::OGONE_AUTHORIZE_CAPTURE_ACTION; - } - return $value; - } - - /** - * Get formatted order description - * - * @param \Magento\Sales\Model\Order $order - * @return string - */ - protected function _getOrderDescription($order) - { - $invoiceDesc = ''; - foreach ($order->getAllItems() as $item) { - if ($item->getParentItem()) { - continue; - } - //COM filed can only handle max 100 - if ($this->string->strlen($invoiceDesc . $item->getName()) > 100) { - break; - } - $invoiceDesc .= $item->getName() . ', '; - } - return $this->string->substr($invoiceDesc, 0, -2); - } - - /** - * Define if debugging is enabled - * - * @return bool - */ - public function getDebugFlag() - { - return $this->getConfigData('debug_flag'); - } - - /** - * Transform collected data array to <...> according to the provided map - * - * @param array $data - * @param string $passPhrase - * @param string $hashMap - * @return string - */ - protected function _concatenateBasic($data, $passPhrase, $hashMap) - { - $result = ''; - foreach (self::$$hashMap as $key) { - if (isset($data[$key])) { - $result .= $data[$key]; - } - } - return $result . $passPhrase; - } - - /** - * Transform collected data array to = - * - * @param array $data - * @param string $passPhrase - * @return string - */ - protected function _concatenateAdvanced($data, $passPhrase) - { - $result = ''; - foreach ($data as $key => $value) { - $result .= "{$key}={$value}{$passPhrase}"; - } - return $result; - } -} diff --git a/app/code/Magento/Ogone/Model/Config.php b/app/code/Magento/Ogone/Model/Config.php deleted file mode 100644 index e09d04ad8e165..0000000000000 --- a/app/code/Magento/Ogone/Model/Config.php +++ /dev/null @@ -1,170 +0,0 @@ -_urlBuilder = $urlBuilder; - $this->_encryptor = $encryptor; - } - - /** - * Return Ogone payment config information - * - * @param string $path - * @param int|null $storeId - * @return bool|null|string - */ - public function getConfigData($path, $storeId = null) - { - if (!empty($path)) { - return $this->_scopeConfig->getValue( - self::OGONE_PAYMENT_PATH . $path, - ScopeInterface::SCOPE_STORE, - $storeId - ); - } - return false; - } - - /** - * Return SHA1-in crypt key from config. Setup on admin place. - * - * @param int|null $storeId - * @return string - */ - public function getShaInCode($storeId = null) - { - return $this->getConfigData('secret_key_in', $storeId); - } - - /** - * Return SHA1-out crypt key from config. Setup on admin place. - * @param int|null $storeId - * @return string - */ - public function getShaOutCode($storeId = null) - { - return $this->getConfigData('secret_key_out', $storeId); - } - - /** - * Return gateway path, get from config. Setup on admin place. - * - * @param int|null $storeId - * @return string - */ - public function getGatewayPath($storeId = null) - { - return $this->getConfigData('ogone_gateway', $storeId); - } - - /** - * Get PSPID, affiliation name in Ogone system - * - * @param int|null $storeId - * @return string - */ - public function getPSPID($storeId = null) - { - return $this->getConfigData('pspid', $storeId); - } - - /** - * Get paypage template for magento style templates using - * - * @return string - */ - public function getPayPageTemplate() - { - return $this->_urlBuilder->getUrl('ogone/api/paypage', ['_nosid' => true]); - } - - /** - * Return url which Ogone system will use as accept - * - * @return string - */ - public function getAcceptUrl() - { - return $this->_urlBuilder->getUrl('ogone/api/accept', ['_nosid' => true]); - } - - /** - * Return url which Ogone system will use as decline url - * - * @return string - */ - public function getDeclineUrl() - { - return $this->_urlBuilder->getUrl('ogone/api/decline', ['_nosid' => true]); - } - - /** - * Return url which ogone system will use as exception url - * - * @return string - */ - public function getExceptionUrl() - { - return $this->_urlBuilder->getUrl('ogone/api/exception', ['_nosid' => true]); - } - - /** - * Return url which Ogone system will use as cancel url - * - * @return string - */ - public function getCancelUrl() - { - return $this->_urlBuilder->getUrl('ogone/api/cancel', ['_nosid' => true]); - } - - /** - * Return url which Ogone system will use as our magento home url on Ogone success page - * - * @return string - */ - public function getHomeUrl() - { - return $this->_urlBuilder->getUrl('checkout/cart', ['_nosid' => true]); - } -} diff --git a/app/code/Magento/Ogone/Model/Source/PaymentAction.php b/app/code/Magento/Ogone/Model/Source/PaymentAction.php deleted file mode 100644 index fe35ea0151b28..0000000000000 --- a/app/code/Magento/Ogone/Model/Source/PaymentAction.php +++ /dev/null @@ -1,32 +0,0 @@ - '', 'label' => __('Ogone Default Operation')], - [ - 'value' => \Magento\Payment\Model\Method\AbstractMethod::ACTION_AUTHORIZE, - 'label' => __('Authorization') - ], - [ - 'value' => \Magento\Payment\Model\Method\AbstractMethod::ACTION_AUTHORIZE_CAPTURE, - 'label' => __('Direct Sale') - ] - ]; - } -} diff --git a/app/code/Magento/Ogone/Model/Source/Pmlist.php b/app/code/Magento/Ogone/Model/Source/Pmlist.php deleted file mode 100644 index c45a602c7ebd3..0000000000000 --- a/app/code/Magento/Ogone/Model/Source/Pmlist.php +++ /dev/null @@ -1,32 +0,0 @@ - \Magento\Ogone\Model\Api::PMLIST_HORISONTAL_LEFT, - 'label' => __('Horizontally grouped logo with group name on left'), - ], - [ - 'value' => \Magento\Ogone\Model\Api::PMLIST_HORISONTAL, - 'label' => __('Horizontally grouped logo with no group name') - ], - ['value' => \Magento\Ogone\Model\Api::PMLIST_VERTICAL, 'label' => __('Verical list')] - ]; - } -} diff --git a/app/code/Magento/Ogone/Model/Source/Template.php b/app/code/Magento/Ogone/Model/Source/Template.php deleted file mode 100644 index b95e06888388c..0000000000000 --- a/app/code/Magento/Ogone/Model/Source/Template.php +++ /dev/null @@ -1,25 +0,0 @@ - \Magento\Ogone\Model\Api::TEMPLATE_OGONE, 'label' => __('Ogone')], - ['value' => \Magento\Ogone\Model\Api::TEMPLATE_MAGENTO, 'label' => __('Magento')] - ]; - } -} diff --git a/app/code/Magento/Ogone/README.md b/app/code/Magento/Ogone/README.md deleted file mode 100644 index 8bfa7fde90c0f..0000000000000 --- a/app/code/Magento/Ogone/README.md +++ /dev/null @@ -1 +0,0 @@ -The Magento_Ogone module implements the integration with the Ogone payment service provider. diff --git a/app/code/Magento/Ogone/composer.json b/app/code/Magento/Ogone/composer.json deleted file mode 100644 index 3f2787cce5605..0000000000000 --- a/app/code/Magento/Ogone/composer.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "name": "magento/module-ogone", - "description": "N/A", - "require": { - "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha108", - "magento/module-sales": "0.1.0-alpha108", - "magento/module-payment": "0.1.0-alpha108", - "magento/module-checkout": "0.1.0-alpha108", - "magento/framework": "0.1.0-alpha108", - "magento/magento-composer-installer": "*" - }, - "type": "magento2-module", - "version": "0.1.0-alpha108", - "license": [ - "OSL-3.0", - "AFL-3.0" - ], - "extra": { - "map": [ - [ - "*", - "Magento/Ogone" - ] - ] - } -} diff --git a/app/code/Magento/Ogone/data/ogone_setup/data-install-2.0.0.php b/app/code/Magento/Ogone/data/ogone_setup/data-install-2.0.0.php deleted file mode 100644 index d4259150f6b9b..0000000000000 --- a/app/code/Magento/Ogone/data/ogone_setup/data-install-2.0.0.php +++ /dev/null @@ -1,44 +0,0 @@ - __('Pending Ogone'), - 'cancel_ogone' => __('Cancelled Ogone'), - 'decline_ogone' => __('Declined Ogone'), - 'processing_ogone' => __('Processing Ogone Payment'), - 'processed_ogone' => __('Processed Ogone Payment'), - 'waiting_authorozation' => __('Waiting Authorization'), -]; -foreach ($statuses as $code => $info) { - $data[] = ['status' => $code, 'label' => $info]; -} -$installer->getConnection()->insertArray($installer->getTable('sales_order_status'), ['status', 'label'], $data); - -$data = []; -$states = [ - 'pending_payment' => ['statuses' => ['pending_ogone' => []]], - 'processing' => ['statuses' => ['processed_ogone' => []]], -]; - -foreach ($states as $code => $info) { - if (isset($info['statuses'])) { - foreach ($info['statuses'] as $status => $statusInfo) { - $data[] = [ - 'status' => $status, - 'state' => $code, - 'is_default' => is_array($statusInfo) && isset($statusInfo['default']) ? 1 : 0, - ]; - } - } -} -$installer->getConnection()->insertArray( - $installer->getTable('sales_order_status_state'), - ['status', 'state', 'is_default'], - $data -); diff --git a/app/code/Magento/Ogone/etc/adminhtml/system.xml b/app/code/Magento/Ogone/etc/adminhtml/system.xml deleted file mode 100644 index dfad6bcbb0b2a..0000000000000 --- a/app/code/Magento/Ogone/etc/adminhtml/system.xml +++ /dev/null @@ -1,140 +0,0 @@ - - - - -
- - - - -
-
-


Signing up with Ogone

-

Please enter the correct post back url and offline processiong url in Ogone configuration

-

post back url example: http://myMagentoStore.com/ogone/api/postBack

-

offline processing url example: http://myMagentoStore.com/ogone/api/offlineProcess

-
-
- ]]> -
- - - Magento\Backend\Model\Config\Source\Yesno - - - - Magento\Backend\Model\Config\Source\Yesno - - - - - - - PSPID is a case sensitive field. - - - - - Use in data checking by Ogone before the payment.]]> - - Magento\Backend\Model\Config\Backend\Encrypted - - - - - Use in feedback data checking by Magento.]]> - - Magento\Backend\Model\Config\Backend\Encrypted - - - - - - - - all parameters, select the following options in the "Global security parameters" fieldset:
  • Each parameter followed by the pass phrase.
  • "Hash algorithm" same as "Hashing Algorithm" below
  • UTF-8
]]> -
- Magento\Backend\Model\Config\Source\Yesno -
- - - Magento\Ogone\Model\Api::getHashingAlgorithms - - 1 - - - - - For production, replace "test" with "prod". Example: https://secure.ogone.com/ncol/prod/orderstandard.asp - - - - Magento\Ogone\Model\Source\PaymentAction - If you choose "No Operation", Ogone will use the default payment procedure in your Ogone setup. - - - - Magento\Ogone\Model\Source\Template - If you choose "Ogone Template", you will need to fill in all the following fields. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Magento\Ogone\Model\Source\Pmlist - You can arrange the layout/list of the payment methods on Ogone payment page. - -
-
-
-
diff --git a/app/code/Magento/Ogone/etc/config.xml b/app/code/Magento/Ogone/etc/config.xml deleted file mode 100644 index 177a46c028b07..0000000000000 --- a/app/code/Magento/Ogone/etc/config.xml +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - - Magento\Ogone\Model\Api - Ogone - - - authorize - sha256 - - https://secure.ogone.com/ncol/test/orderstandard.asp - pending_ogone - cancel_ogone - decline_ogone - processing_ogone - processed_ogone - waiting_authorozation - - - - diff --git a/app/code/Magento/Ogone/etc/frontend/di.xml b/app/code/Magento/Ogone/etc/frontend/di.xml deleted file mode 100644 index 9af2f4b9fdd8b..0000000000000 --- a/app/code/Magento/Ogone/etc/frontend/di.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - /ogone/api - - - - diff --git a/app/code/Magento/Ogone/etc/frontend/page_types.xml b/app/code/Magento/Ogone/etc/frontend/page_types.xml deleted file mode 100644 index bc8fb84f84dbf..0000000000000 --- a/app/code/Magento/Ogone/etc/frontend/page_types.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - diff --git a/app/code/Magento/Ogone/etc/frontend/routes.xml b/app/code/Magento/Ogone/etc/frontend/routes.xml deleted file mode 100644 index 7558413abf787..0000000000000 --- a/app/code/Magento/Ogone/etc/frontend/routes.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/app/code/Magento/Ogone/etc/module.xml b/app/code/Magento/Ogone/etc/module.xml deleted file mode 100644 index 06000f285e800..0000000000000 --- a/app/code/Magento/Ogone/etc/module.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - diff --git a/app/code/Magento/Ogone/etc/resources.xml b/app/code/Magento/Ogone/etc/resources.xml deleted file mode 100644 index 5b216218b94ce..0000000000000 --- a/app/code/Magento/Ogone/etc/resources.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - diff --git a/app/code/Magento/Ogone/i18n/de_DE.csv b/app/code/Magento/Ogone/i18n/de_DE.csv deleted file mode 100644 index 97a08d942c6f1..0000000000000 --- a/app/code/Magento/Ogone/i18n/de_DE.csv +++ /dev/null @@ -1,122 +0,0 @@ -Enabled,Enabled -Title,Title -Magento,Magento -"The hash is not valid.","The hash is not valid." -"The order is not valid.","The order is not valid." -"Start Ogone Processing","Ogone-Bearbeitung starten" -"Can't detect Ogone payment action","Ogone Zahlungsvorgang konnte nicht erkannt werden" -"The order cannot be saved.","Die Bestellung kann nicht gespeichert werden." -"Authorization Waiting from Ogone","Warte auf Authorisierung von Ogone" -"Processed by Ogone","Durch Ogone bearbeitet" -"Order can't save","Bestellung kann/nicht gespeichert werden" -"Something went wrong during the payment process, and so the result is unpredictable.","Something went wrong during the payment process, and so the result is unpredictable." -"Something went wrong during the authorization process, and so the result is unpredictable.","Something went wrong during the authorization process, and so the result is unpredictable." -"Unknown exception","Unbekannte Ausnahme" -"Something went wrong while saving this order.","Something went wrong while saving this order." -"Exception not defined","Ausnahme ist nicht definiert" -"Declined Order on Ogone side","Declined Order on Ogone side" -"The payment transaction has been declined.","The payment transaction has been declined." -"The order was canceled on the Ogone side.","The order was canceled on the Ogone side." -"Something went wrong while canceling this order.","Something went wrong while canceling this order." -"Ogone Default Operation","Ogone Standard-Operation" -Authorization,Berechtigung -"Direct Sale",Direktverkauf -"Horizontally grouped logo with group name on left","horizontal angeordnetes Logo mit dem Gruppennamen links" -"Horizontally grouped logo with no group name","horizontal angeordnetes Logo ohne Gruppenname" -"Verical list","Vertikale Liste" -Ogone,Ogone -"Pending Ogone","Ogone in Bearbeitung" -"Cancelled Ogone","Ogone wurde abgebrochen" -"Declined Ogone","Ogone wurde abgelehnt" -"Processing Ogone Payment","Ogone-Zahlung in Bearbeitung" -"Processed Ogone Payment","Bearbeitete Ogone-Zahlung" -"Waiting Authorization","Erwarte Authorisierung" -"Payment ID: %1","Payment ID: %1" -"You will be redirected to Ogone website when you place an order.","Sie werden weitergeleitet zur Ogone-Webseite, wenn Sie eine Bestellung aufgeben." -"Please stand by. In a moment, this page will transfer your data to the Ogone payment gateway.","Please stand by. In a moment, this page will transfer your data to the Ogone payment gateway." -Debug,Debug -"Payment Action","Payment Action" -"Gateway URL","Gateway URL" -" -
-
-
-


Signing up with Ogone

-

Please enter the correct post back url and offline processiong url in Ogone configuration

-

post back url example: http://myMagentoStore.com/ogone/api/postBack

-

offline processing url example: http://myMagentoStore.com/ogone/api/offlineProcess

-
-
- - "," -
-
-
-


Signing up with Ogone

-

Please enter the correct post back url and offline processiong url in Ogone configuration

-

post back url example: http://myMagentoStore.com/ogone/api/postBack

-

offline processing url example: http://myMagentoStore.com/ogone/api/offlineProcess

-
-
- - " -PSPID,PSPID -"SHA-IN Pass Phrase","SHA-IN Pass Phrase" -" - Use in posting data from Magento to Ogone.
Use in data checking by Ogone before the payment. - "," - Use in posting data from Magento to Ogone.
Use in data checking by Ogone before the payment. - " -"SHA-OUT Pass Phrase","SHA-OUT Pass Phrase" -" - Use in posting data from Ogone to Magento.
Use in feedback data checking by Magento. - "," - Use in posting data from Ogone to Magento.
Use in feedback data checking by Magento. - " -"Hash All Parameters","Hash All Parameters" -" - To enable this feature, please edit your global security parameters. - "," - To enable this feature, please edit your global security parameters. - " -" - To hash all parameters, select the following options in the ""Global security parameters"" fieldset:
  • Each parameter followed by the pass phrase.
  • ""Hash algorithm"" same as ""Hashing Algorithm"" below
  • UTF-8
- "," - To hash all parameters, select the following options in the ""Global security parameters"" fieldset:
  • Each parameter followed by the pass phrase.
  • ""Hash algorithm"" same as ""Hashing Algorithm"" below
  • UTF-8
- " -"Hashing Algorithm","Hashing Algorithm" -"For production, replace ""test"" with ""prod"". Example: https://secure.ogone.com/ncol/prod/orderstandard.asp","For production, replace ""test"" with ""prod"". Example: https://secure.ogone.com/ncol/prod/orderstandard.asp" -"If you choose ""No Operation"", Ogone will use the default payment procedure in your Ogone setup.","If you choose ""No Operation"", Ogone will use the default payment procedure in your Ogone setup." -"Payment Template","Payment Template" -"If you choose ""Ogone Template"", you will need to fill in all the following fields.","If you choose ""Ogone Template"", you will need to fill in all the following fields." -"Title of the Ogone Template","Title of the Ogone Template" -"Background Color of Ogone Template","Background Color of Ogone Template" -" - E.g: ""white"" - "," - E.g: ""white"" - " -"Text Color of the Ogone Template","Text Color of the Ogone Template" -" - E.g: ""black"" - "," - E.g: ""black"" - " -"Table Background Color of the Ogone Template","Table Background Color of the Ogone Template" -"Table Text Color of the Ogone Template","Table Text Color of the Ogone Template" -"Button Background Color of the Ogone Template","Button Background Color of the Ogone Template" -"Button Text Color of the Ogone Template","Button Text Color of the Ogone Template" -"Font Family of the Ogone Template","Font Family of the Ogone Template" -" - E.g: ""Verdana"" - "," - E.g: ""Verdana"" - " -"Logo of the Ogone Template","Logo of the Ogone Template" -" - URL/filename of the logo.
The URL must be absolute and stored on a secure server. - "," - URL/filename of the logo.
The URL must be absolute and stored on a secure server. - " -"Layout of Payment Methods","Layout of Payment Methods" -"You can arrange the layout/list of the payment methods on Ogone payment page.","You can arrange the layout/list of the payment methods on Ogone payment page." diff --git a/app/code/Magento/Ogone/i18n/en_US.csv b/app/code/Magento/Ogone/i18n/en_US.csv deleted file mode 100644 index adbb9511a3969..0000000000000 --- a/app/code/Magento/Ogone/i18n/en_US.csv +++ /dev/null @@ -1,122 +0,0 @@ -Enabled,Enabled -Title,Title -Magento,Magento -"The hash is not valid.","The hash is not valid." -"The order is not valid.","The order is not valid." -"Start Ogone Processing","Start Ogone Processing" -"Can't detect Ogone payment action","Can't detect Ogone payment action" -"The order cannot be saved.","The order cannot be saved." -"Authorization Waiting from Ogone","Authorization Waiting from Ogone" -"Processed by Ogone","Processed by Ogone" -"Order can't save","Order can't save" -"Something went wrong during the payment process, and so the result is unpredictable.","Something went wrong during the payment process, and so the result is unpredictable." -"Something went wrong during the authorization process, and so the result is unpredictable.","Something went wrong during the authorization process, and so the result is unpredictable." -"Unknown exception","Unknown exception" -"Something went wrong while saving this order.","Something went wrong while saving this order." -"Exception not defined","Exception not defined" -"Declined Order on Ogone side","Declined Order on Ogone side" -"The payment transaction has been declined.","The payment transaction has been declined." -"The order was canceled on the Ogone side.","The order was canceled on the Ogone side." -"Something went wrong while canceling this order.","Something went wrong while canceling this order." -"Ogone Default Operation","Ogone Default Operation" -Authorization,Authorization -"Direct Sale","Direct Sale" -"Horizontally grouped logo with group name on left","Horizontally grouped logo with group name on left" -"Horizontally grouped logo with no group name","Horizontally grouped logo with no group name" -"Verical list","Verical list" -Ogone,Ogone -"Pending Ogone","Pending Ogone" -"Cancelled Ogone","Cancelled Ogone" -"Declined Ogone","Declined Ogone" -"Processing Ogone Payment","Processing Ogone Payment" -"Processed Ogone Payment","Processed Ogone Payment" -"Waiting Authorization","Waiting Authorization" -"Payment ID: %1","Payment ID: %1" -"You will be redirected to Ogone website when you place an order.","You will be redirected to Ogone website when you place an order." -"Please stand by. In a moment, this page will transfer your data to the Ogone payment gateway.","Please stand by. In a moment, this page will transfer your data to the Ogone payment gateway." -Debug,Debug -"Payment Action","Payment Action" -"Gateway URL","Gateway URL" -" -
-
-
-


Signing up with Ogone

-

Please enter the correct post back url and offline processiong url in Ogone configuration

-

post back url example: http://myMagentoStore.com/ogone/api/postBack

-

offline processing url example: http://myMagentoStore.com/ogone/api/offlineProcess

-
-
- - "," -
-
-
-


Signing up with Ogone

-

Please enter the correct post back url and offline processiong url in Ogone configuration

-

post back url example: http://myMagentoStore.com/ogone/api/postBack

-

offline processing url example: http://myMagentoStore.com/ogone/api/offlineProcess

-
-
- - " -PSPID,PSPID -"SHA-IN Pass Phrase","SHA-IN Pass Phrase" -" - Use in posting data from Magento to Ogone.
Use in data checking by Ogone before the payment. - "," - Use in posting data from Magento to Ogone.
Use in data checking by Ogone before the payment. - " -"SHA-OUT Pass Phrase","SHA-OUT Pass Phrase" -" - Use in posting data from Ogone to Magento.
Use in feedback data checking by Magento. - "," - Use in posting data from Ogone to Magento.
Use in feedback data checking by Magento. - " -"Hash All Parameters","Hash All Parameters" -" - To enable this feature, please edit your global security parameters. - "," - To enable this feature, please edit your global security parameters. - " -" - To hash all parameters, select the following options in the ""Global security parameters"" fieldset:
  • Each parameter followed by the pass phrase.
  • ""Hash algorithm"" same as ""Hashing Algorithm"" below
  • UTF-8
- "," - To hash all parameters, select the following options in the ""Global security parameters"" fieldset:
  • Each parameter followed by the pass phrase.
  • ""Hash algorithm"" same as ""Hashing Algorithm"" below
  • UTF-8
- " -"Hashing Algorithm","Hashing Algorithm" -"For production, replace ""test"" with ""prod"". Example: https://secure.ogone.com/ncol/prod/orderstandard.asp","For production, replace ""test"" with ""prod"". Example: https://secure.ogone.com/ncol/prod/orderstandard.asp" -"If you choose ""No Operation"", Ogone will use the default payment procedure in your Ogone setup.","If you choose ""No Operation"", Ogone will use the default payment procedure in your Ogone setup." -"Payment Template","Payment Template" -"If you choose ""Ogone Template"", you will need to fill in all the following fields.","If you choose ""Ogone Template"", you will need to fill in all the following fields." -"Title of the Ogone Template","Title of the Ogone Template" -"Background Color of Ogone Template","Background Color of Ogone Template" -" - E.g: ""white"" - "," - E.g: ""white"" - " -"Text Color of the Ogone Template","Text Color of the Ogone Template" -" - E.g: ""black"" - "," - E.g: ""black"" - " -"Table Background Color of the Ogone Template","Table Background Color of the Ogone Template" -"Table Text Color of the Ogone Template","Table Text Color of the Ogone Template" -"Button Background Color of the Ogone Template","Button Background Color of the Ogone Template" -"Button Text Color of the Ogone Template","Button Text Color of the Ogone Template" -"Font Family of the Ogone Template","Font Family of the Ogone Template" -" - E.g: ""Verdana"" - "," - E.g: ""Verdana"" - " -"Logo of the Ogone Template","Logo of the Ogone Template" -" - URL/filename of the logo.
The URL must be absolute and stored on a secure server. - "," - URL/filename of the logo.
The URL must be absolute and stored on a secure server. - " -"Layout of Payment Methods","Layout of Payment Methods" -"You can arrange the layout/list of the payment methods on Ogone payment page.","You can arrange the layout/list of the payment methods on Ogone payment page." diff --git a/app/code/Magento/Ogone/i18n/es_ES.csv b/app/code/Magento/Ogone/i18n/es_ES.csv deleted file mode 100644 index e4f027107903b..0000000000000 --- a/app/code/Magento/Ogone/i18n/es_ES.csv +++ /dev/null @@ -1,122 +0,0 @@ -Enabled,Enabled -Title,Title -Magento,Magento -"The hash is not valid.","The hash is not valid." -"The order is not valid.","The order is not valid." -"Start Ogone Processing","Iniciar Procesamiento Ogone" -"Can't detect Ogone payment action","No se puede detectar la acción de pago de Ogone" -"The order cannot be saved.","El pedido no puede ser guardado." -"Authorization Waiting from Ogone","Autorización en espera de Ogone" -"Processed by Ogone","Procesado por Ogone" -"Order can't save","La solicitud no se puede archivar" -"Something went wrong during the payment process, and so the result is unpredictable.","Something went wrong during the payment process, and so the result is unpredictable." -"Something went wrong during the authorization process, and so the result is unpredictable.","Something went wrong during the authorization process, and so the result is unpredictable." -"Unknown exception","Excepción desconocida" -"Something went wrong while saving this order.","Something went wrong while saving this order." -"Exception not defined","Excepción no definida." -"Declined Order on Ogone side","Declined Order on Ogone side" -"The payment transaction has been declined.","The payment transaction has been declined." -"The order was canceled on the Ogone side.","The order was canceled on the Ogone side." -"Something went wrong while canceling this order.","Something went wrong while canceling this order." -"Ogone Default Operation","Operación por Defecto de Ogone" -Authorization,Autorización -"Direct Sale","Venta directa" -"Horizontally grouped logo with group name on left","Logo agrupado horizontalmente con el nombre del grupo a la izquierda" -"Horizontally grouped logo with no group name","Logo agrupado horizontalmente sin nombre del grupo" -"Verical list","Lista vertical" -Ogone,Ogone -"Pending Ogone","Ogone pendiente" -"Cancelled Ogone","Ogone cancelado" -"Declined Ogone","Ogone rechazado" -"Processing Ogone Payment","Procesando Pago de Ogone" -"Processed Ogone Payment","Pago de Ogone procesado" -"Waiting Authorization","Esperando Autorización" -"Payment ID: %1","Payment ID: %1" -"You will be redirected to Ogone website when you place an order.","Serás redirigido/a a la página web de Ogone cuando hagas un pedido." -"Please stand by. In a moment, this page will transfer your data to the Ogone payment gateway.","Please stand by. In a moment, this page will transfer your data to the Ogone payment gateway." -Debug,Debug -"Payment Action","Payment Action" -"Gateway URL","Gateway URL" -" -
-
-
-


Signing up with Ogone

-

Please enter the correct post back url and offline processiong url in Ogone configuration

-

post back url example: http://myMagentoStore.com/ogone/api/postBack

-

offline processing url example: http://myMagentoStore.com/ogone/api/offlineProcess

-
-
- - "," -
-
-
-


Signing up with Ogone

-

Please enter the correct post back url and offline processiong url in Ogone configuration

-

post back url example: http://myMagentoStore.com/ogone/api/postBack

-

offline processing url example: http://myMagentoStore.com/ogone/api/offlineProcess

-
-
- - " -PSPID,PSPID -"SHA-IN Pass Phrase","SHA-IN Pass Phrase" -" - Use in posting data from Magento to Ogone.
Use in data checking by Ogone before the payment. - "," - Use in posting data from Magento to Ogone.
Use in data checking by Ogone before the payment. - " -"SHA-OUT Pass Phrase","SHA-OUT Pass Phrase" -" - Use in posting data from Ogone to Magento.
Use in feedback data checking by Magento. - "," - Use in posting data from Ogone to Magento.
Use in feedback data checking by Magento. - " -"Hash All Parameters","Hash All Parameters" -" - To enable this feature, please edit your global security parameters. - "," - To enable this feature, please edit your global security parameters. - " -" - To hash all parameters, select the following options in the ""Global security parameters"" fieldset:
  • Each parameter followed by the pass phrase.
  • ""Hash algorithm"" same as ""Hashing Algorithm"" below
  • UTF-8
- "," - To hash all parameters, select the following options in the ""Global security parameters"" fieldset:
  • Each parameter followed by the pass phrase.
  • ""Hash algorithm"" same as ""Hashing Algorithm"" below
  • UTF-8
- " -"Hashing Algorithm","Hashing Algorithm" -"For production, replace ""test"" with ""prod"". Example: https://secure.ogone.com/ncol/prod/orderstandard.asp","For production, replace ""test"" with ""prod"". Example: https://secure.ogone.com/ncol/prod/orderstandard.asp" -"If you choose ""No Operation"", Ogone will use the default payment procedure in your Ogone setup.","If you choose ""No Operation"", Ogone will use the default payment procedure in your Ogone setup." -"Payment Template","Payment Template" -"If you choose ""Ogone Template"", you will need to fill in all the following fields.","If you choose ""Ogone Template"", you will need to fill in all the following fields." -"Title of the Ogone Template","Title of the Ogone Template" -"Background Color of Ogone Template","Background Color of Ogone Template" -" - E.g: ""white"" - "," - E.g: ""white"" - " -"Text Color of the Ogone Template","Text Color of the Ogone Template" -" - E.g: ""black"" - "," - E.g: ""black"" - " -"Table Background Color of the Ogone Template","Table Background Color of the Ogone Template" -"Table Text Color of the Ogone Template","Table Text Color of the Ogone Template" -"Button Background Color of the Ogone Template","Button Background Color of the Ogone Template" -"Button Text Color of the Ogone Template","Button Text Color of the Ogone Template" -"Font Family of the Ogone Template","Font Family of the Ogone Template" -" - E.g: ""Verdana"" - "," - E.g: ""Verdana"" - " -"Logo of the Ogone Template","Logo of the Ogone Template" -" - URL/filename of the logo.
The URL must be absolute and stored on a secure server. - "," - URL/filename of the logo.
The URL must be absolute and stored on a secure server. - " -"Layout of Payment Methods","Layout of Payment Methods" -"You can arrange the layout/list of the payment methods on Ogone payment page.","You can arrange the layout/list of the payment methods on Ogone payment page." diff --git a/app/code/Magento/Ogone/i18n/fr_FR.csv b/app/code/Magento/Ogone/i18n/fr_FR.csv deleted file mode 100644 index a8276944ec8de..0000000000000 --- a/app/code/Magento/Ogone/i18n/fr_FR.csv +++ /dev/null @@ -1,122 +0,0 @@ -Enabled,Enabled -Title,Title -Magento,Magento -"The hash is not valid.","The hash is not valid." -"The order is not valid.","The order is not valid." -"Start Ogone Processing","Commencer traitement Ogone" -"Can't detect Ogone payment action","N'arrive pas à détecter le paiement par Ogone." -"The order cannot be saved.","La commande ne peut être sauvegardée." -"Authorization Waiting from Ogone","Autorisation en attente d'Ogone" -"Processed by Ogone","Traité par Ogone" -"Order can't save","Impossible de sauvegarder commande" -"Something went wrong during the payment process, and so the result is unpredictable.","Something went wrong during the payment process, and so the result is unpredictable." -"Something went wrong during the authorization process, and so the result is unpredictable.","Something went wrong during the authorization process, and so the result is unpredictable." -"Unknown exception","Exception inconnue" -"Something went wrong while saving this order.","Something went wrong while saving this order." -"Exception not defined","Exception non définie." -"Declined Order on Ogone side","Declined Order on Ogone side" -"The payment transaction has been declined.","The payment transaction has been declined." -"The order was canceled on the Ogone side.","The order was canceled on the Ogone side." -"Something went wrong while canceling this order.","Something went wrong while canceling this order." -"Ogone Default Operation","Opération par défaut Ogone" -Authorization,Autorisation -"Direct Sale","Vente directe" -"Horizontally grouped logo with group name on left","Logo regroupé horizontalement, avec le nom du groupe à gauche." -"Horizontally grouped logo with no group name","Logo regroupé horizontalement, sans nom de groupe." -"Verical list","Liste verticale" -Ogone,Ogone -"Pending Ogone","En attente Ogone" -"Cancelled Ogone","Ogone annulé." -"Declined Ogone","Ogone refusé." -"Processing Ogone Payment","Paiement Ogone en cours de traitement" -"Processed Ogone Payment","Paiement Ogone traité" -"Waiting Authorization","En attente d'autorisation" -"Payment ID: %1","Payment ID: %1" -"You will be redirected to Ogone website when you place an order.","Vous serez redirigé vers le site Internet d'Ogone lorsque vous aurez passé votre commande." -"Please stand by. In a moment, this page will transfer your data to the Ogone payment gateway.","Please stand by. In a moment, this page will transfer your data to the Ogone payment gateway." -Debug,Debug -"Payment Action","Payment Action" -"Gateway URL","Gateway URL" -" -
-
-
-


Signing up with Ogone

-

Please enter the correct post back url and offline processiong url in Ogone configuration

-

post back url example: http://myMagentoStore.com/ogone/api/postBack

-

offline processing url example: http://myMagentoStore.com/ogone/api/offlineProcess

-
-
- - "," -
-
-
-


Signing up with Ogone

-

Please enter the correct post back url and offline processiong url in Ogone configuration

-

post back url example: http://myMagentoStore.com/ogone/api/postBack

-

offline processing url example: http://myMagentoStore.com/ogone/api/offlineProcess

-
-
- - " -PSPID,PSPID -"SHA-IN Pass Phrase","SHA-IN Pass Phrase" -" - Use in posting data from Magento to Ogone.
Use in data checking by Ogone before the payment. - "," - Use in posting data from Magento to Ogone.
Use in data checking by Ogone before the payment. - " -"SHA-OUT Pass Phrase","SHA-OUT Pass Phrase" -" - Use in posting data from Ogone to Magento.
Use in feedback data checking by Magento. - "," - Use in posting data from Ogone to Magento.
Use in feedback data checking by Magento. - " -"Hash All Parameters","Hash All Parameters" -" - To enable this feature, please edit your global security parameters. - "," - To enable this feature, please edit your global security parameters. - " -" - To hash all parameters, select the following options in the ""Global security parameters"" fieldset:
  • Each parameter followed by the pass phrase.
  • ""Hash algorithm"" same as ""Hashing Algorithm"" below
  • UTF-8
- "," - To hash all parameters, select the following options in the ""Global security parameters"" fieldset:
  • Each parameter followed by the pass phrase.
  • ""Hash algorithm"" same as ""Hashing Algorithm"" below
  • UTF-8
- " -"Hashing Algorithm","Hashing Algorithm" -"For production, replace ""test"" with ""prod"". Example: https://secure.ogone.com/ncol/prod/orderstandard.asp","For production, replace ""test"" with ""prod"". Example: https://secure.ogone.com/ncol/prod/orderstandard.asp" -"If you choose ""No Operation"", Ogone will use the default payment procedure in your Ogone setup.","If you choose ""No Operation"", Ogone will use the default payment procedure in your Ogone setup." -"Payment Template","Payment Template" -"If you choose ""Ogone Template"", you will need to fill in all the following fields.","If you choose ""Ogone Template"", you will need to fill in all the following fields." -"Title of the Ogone Template","Title of the Ogone Template" -"Background Color of Ogone Template","Background Color of Ogone Template" -" - E.g: ""white"" - "," - E.g: ""white"" - " -"Text Color of the Ogone Template","Text Color of the Ogone Template" -" - E.g: ""black"" - "," - E.g: ""black"" - " -"Table Background Color of the Ogone Template","Table Background Color of the Ogone Template" -"Table Text Color of the Ogone Template","Table Text Color of the Ogone Template" -"Button Background Color of the Ogone Template","Button Background Color of the Ogone Template" -"Button Text Color of the Ogone Template","Button Text Color of the Ogone Template" -"Font Family of the Ogone Template","Font Family of the Ogone Template" -" - E.g: ""Verdana"" - "," - E.g: ""Verdana"" - " -"Logo of the Ogone Template","Logo of the Ogone Template" -" - URL/filename of the logo.
The URL must be absolute and stored on a secure server. - "," - URL/filename of the logo.
The URL must be absolute and stored on a secure server. - " -"Layout of Payment Methods","Layout of Payment Methods" -"You can arrange the layout/list of the payment methods on Ogone payment page.","You can arrange the layout/list of the payment methods on Ogone payment page." diff --git a/app/code/Magento/Ogone/i18n/nl_NL.csv b/app/code/Magento/Ogone/i18n/nl_NL.csv deleted file mode 100644 index 8b0617cd73fa8..0000000000000 --- a/app/code/Magento/Ogone/i18n/nl_NL.csv +++ /dev/null @@ -1,122 +0,0 @@ -Enabled,Enabled -Title,Title -Magento,Magento -"The hash is not valid.","The hash is not valid." -"The order is not valid.","The order is not valid." -"Start Ogone Processing","Begin Ogone Verwerking" -"Can't detect Ogone payment action","Kan Ogone Betalingsactie niet vinden" -"The order cannot be saved.","De bestelling kan niet worden opgeslagen." -"Authorization Waiting from Ogone","Wacht op autorisatie van Ogone" -"Processed by Ogone","Verwerkt door Ogone" -"Order can't save","Bestelling kan niet opgeslagen worden" -"Something went wrong during the payment process, and so the result is unpredictable.","Something went wrong during the payment process, and so the result is unpredictable." -"Something went wrong during the authorization process, and so the result is unpredictable.","Something went wrong during the authorization process, and so the result is unpredictable." -"Unknown exception","Onbekende uitzondering" -"Something went wrong while saving this order.","Something went wrong while saving this order." -"Exception not defined","Uitzondering niet gedefinieerd" -"Declined Order on Ogone side","Declined Order on Ogone side" -"The payment transaction has been declined.","The payment transaction has been declined." -"The order was canceled on the Ogone side.","The order was canceled on the Ogone side." -"Something went wrong while canceling this order.","Something went wrong while canceling this order." -"Ogone Default Operation","Ogone Standaard Operatie" -Authorization,Autorisatie -"Direct Sale","Rechtstreekse Verkoop" -"Horizontally grouped logo with group name on left","Horizontaal gegroepeerd logo met de groep naam links" -"Horizontally grouped logo with no group name","Horizontaal gegroepeerd logo zonder groepsnaam" -"Verical list","Vericale lijst" -Ogone,Ogone -"Pending Ogone","In afwachting van Ogone" -"Cancelled Ogone","Ogone Geannuleerd" -"Declined Ogone","Ogone Afgewezen" -"Processing Ogone Payment","Verwerking van de Ogone Betaling" -"Processed Ogone Payment","Verwerkte Ogone Betalingen" -"Waiting Authorization","Wachten op Authorisatie" -"Payment ID: %1","Payment ID: %1" -"You will be redirected to Ogone website when you place an order.","U wordt teruggeleid naar de Ogone website als u een bestelling plaatst." -"Please stand by. In a moment, this page will transfer your data to the Ogone payment gateway.","Please stand by. In a moment, this page will transfer your data to the Ogone payment gateway." -Debug,Debug -"Payment Action","Payment Action" -"Gateway URL","Gateway URL" -" -
-
-
-


Signing up with Ogone

-

Please enter the correct post back url and offline processiong url in Ogone configuration

-

post back url example: http://myMagentoStore.com/ogone/api/postBack

-

offline processing url example: http://myMagentoStore.com/ogone/api/offlineProcess

-
-
- - "," -
-
-
-


Signing up with Ogone

-

Please enter the correct post back url and offline processiong url in Ogone configuration

-

post back url example: http://myMagentoStore.com/ogone/api/postBack

-

offline processing url example: http://myMagentoStore.com/ogone/api/offlineProcess

-
-
- - " -PSPID,PSPID -"SHA-IN Pass Phrase","SHA-IN Pass Phrase" -" - Use in posting data from Magento to Ogone.
Use in data checking by Ogone before the payment. - "," - Use in posting data from Magento to Ogone.
Use in data checking by Ogone before the payment. - " -"SHA-OUT Pass Phrase","SHA-OUT Pass Phrase" -" - Use in posting data from Ogone to Magento.
Use in feedback data checking by Magento. - "," - Use in posting data from Ogone to Magento.
Use in feedback data checking by Magento. - " -"Hash All Parameters","Hash All Parameters" -" - To enable this feature, please edit your global security parameters. - "," - To enable this feature, please edit your global security parameters. - " -" - To hash all parameters, select the following options in the ""Global security parameters"" fieldset:
  • Each parameter followed by the pass phrase.
  • ""Hash algorithm"" same as ""Hashing Algorithm"" below
  • UTF-8
- "," - To hash all parameters, select the following options in the ""Global security parameters"" fieldset:
  • Each parameter followed by the pass phrase.
  • ""Hash algorithm"" same as ""Hashing Algorithm"" below
  • UTF-8
- " -"Hashing Algorithm","Hashing Algorithm" -"For production, replace ""test"" with ""prod"". Example: https://secure.ogone.com/ncol/prod/orderstandard.asp","For production, replace ""test"" with ""prod"". Example: https://secure.ogone.com/ncol/prod/orderstandard.asp" -"If you choose ""No Operation"", Ogone will use the default payment procedure in your Ogone setup.","If you choose ""No Operation"", Ogone will use the default payment procedure in your Ogone setup." -"Payment Template","Payment Template" -"If you choose ""Ogone Template"", you will need to fill in all the following fields.","If you choose ""Ogone Template"", you will need to fill in all the following fields." -"Title of the Ogone Template","Title of the Ogone Template" -"Background Color of Ogone Template","Background Color of Ogone Template" -" - E.g: ""white"" - "," - E.g: ""white"" - " -"Text Color of the Ogone Template","Text Color of the Ogone Template" -" - E.g: ""black"" - "," - E.g: ""black"" - " -"Table Background Color of the Ogone Template","Table Background Color of the Ogone Template" -"Table Text Color of the Ogone Template","Table Text Color of the Ogone Template" -"Button Background Color of the Ogone Template","Button Background Color of the Ogone Template" -"Button Text Color of the Ogone Template","Button Text Color of the Ogone Template" -"Font Family of the Ogone Template","Font Family of the Ogone Template" -" - E.g: ""Verdana"" - "," - E.g: ""Verdana"" - " -"Logo of the Ogone Template","Logo of the Ogone Template" -" - URL/filename of the logo.
The URL must be absolute and stored on a secure server. - "," - URL/filename of the logo.
The URL must be absolute and stored on a secure server. - " -"Layout of Payment Methods","Layout of Payment Methods" -"You can arrange the layout/list of the payment methods on Ogone payment page.","You can arrange the layout/list of the payment methods on Ogone payment page." diff --git a/app/code/Magento/Ogone/i18n/pt_BR.csv b/app/code/Magento/Ogone/i18n/pt_BR.csv deleted file mode 100644 index c29952565630c..0000000000000 --- a/app/code/Magento/Ogone/i18n/pt_BR.csv +++ /dev/null @@ -1,122 +0,0 @@ -Enabled,Enabled -Title,Title -Magento,Magento -"The hash is not valid.","The hash is not valid." -"The order is not valid.","The order is not valid." -"Start Ogone Processing","Iniciar Processamento Ogone" -"Can't detect Ogone payment action","Não é possível detetar a ação de pagamento Ogone" -"The order cannot be saved.","A ordem não pode ser salva." -"Authorization Waiting from Ogone","Esperando Autorização de Ogone" -"Processed by Ogone","Processado por Ogone" -"Order can't save","Não pode salvar ordem" -"Something went wrong during the payment process, and so the result is unpredictable.","Something went wrong during the payment process, and so the result is unpredictable." -"Something went wrong during the authorization process, and so the result is unpredictable.","Something went wrong during the authorization process, and so the result is unpredictable." -"Unknown exception","Exceção desconhecida" -"Something went wrong while saving this order.","Something went wrong while saving this order." -"Exception not defined","Exceção não definida" -"Declined Order on Ogone side","Declined Order on Ogone side" -"The payment transaction has been declined.","The payment transaction has been declined." -"The order was canceled on the Ogone side.","The order was canceled on the Ogone side." -"Something went wrong while canceling this order.","Something went wrong while canceling this order." -"Ogone Default Operation","Operação Predifinida Ogone" -Authorization,Autorização -"Direct Sale","Venda Direta" -"Horizontally grouped logo with group name on left","Logotipo horizontalmente agrupado com nome do grupo à esquerda" -"Horizontally grouped logo with no group name","Logotipo horizontalmente agrupado com nenhum nome de grupo" -"Verical list","Lista verical" -Ogone,Ogone -"Pending Ogone","Ogone Pendente" -"Cancelled Ogone","Ogone Cancelada" -"Declined Ogone","Ogone Recusada" -"Processing Ogone Payment","Processando Pagamento Ogone" -"Processed Ogone Payment","Pagamento Ogone Processado" -"Waiting Authorization","Esperando Autorização" -"Payment ID: %1","Payment ID: %1" -"You will be redirected to Ogone website when you place an order.","Você será redirecionado para o site Ogone quando você colocar uma ordem." -"Please stand by. In a moment, this page will transfer your data to the Ogone payment gateway.","Please stand by. In a moment, this page will transfer your data to the Ogone payment gateway." -Debug,Debug -"Payment Action","Payment Action" -"Gateway URL","Gateway URL" -" -
-
-
-


Signing up with Ogone

-

Please enter the correct post back url and offline processiong url in Ogone configuration

-

post back url example: http://myMagentoStore.com/ogone/api/postBack

-

offline processing url example: http://myMagentoStore.com/ogone/api/offlineProcess

-
-
- - "," -
-
-
-


Signing up with Ogone

-

Please enter the correct post back url and offline processiong url in Ogone configuration

-

post back url example: http://myMagentoStore.com/ogone/api/postBack

-

offline processing url example: http://myMagentoStore.com/ogone/api/offlineProcess

-
-
- - " -PSPID,PSPID -"SHA-IN Pass Phrase","SHA-IN Pass Phrase" -" - Use in posting data from Magento to Ogone.
Use in data checking by Ogone before the payment. - "," - Use in posting data from Magento to Ogone.
Use in data checking by Ogone before the payment. - " -"SHA-OUT Pass Phrase","SHA-OUT Pass Phrase" -" - Use in posting data from Ogone to Magento.
Use in feedback data checking by Magento. - "," - Use in posting data from Ogone to Magento.
Use in feedback data checking by Magento. - " -"Hash All Parameters","Hash All Parameters" -" - To enable this feature, please edit your global security parameters. - "," - To enable this feature, please edit your global security parameters. - " -" - To hash all parameters, select the following options in the ""Global security parameters"" fieldset:
  • Each parameter followed by the pass phrase.
  • ""Hash algorithm"" same as ""Hashing Algorithm"" below
  • UTF-8
- "," - To hash all parameters, select the following options in the ""Global security parameters"" fieldset:
  • Each parameter followed by the pass phrase.
  • ""Hash algorithm"" same as ""Hashing Algorithm"" below
  • UTF-8
- " -"Hashing Algorithm","Hashing Algorithm" -"For production, replace ""test"" with ""prod"". Example: https://secure.ogone.com/ncol/prod/orderstandard.asp","For production, replace ""test"" with ""prod"". Example: https://secure.ogone.com/ncol/prod/orderstandard.asp" -"If you choose ""No Operation"", Ogone will use the default payment procedure in your Ogone setup.","If you choose ""No Operation"", Ogone will use the default payment procedure in your Ogone setup." -"Payment Template","Payment Template" -"If you choose ""Ogone Template"", you will need to fill in all the following fields.","If you choose ""Ogone Template"", you will need to fill in all the following fields." -"Title of the Ogone Template","Title of the Ogone Template" -"Background Color of Ogone Template","Background Color of Ogone Template" -" - E.g: ""white"" - "," - E.g: ""white"" - " -"Text Color of the Ogone Template","Text Color of the Ogone Template" -" - E.g: ""black"" - "," - E.g: ""black"" - " -"Table Background Color of the Ogone Template","Table Background Color of the Ogone Template" -"Table Text Color of the Ogone Template","Table Text Color of the Ogone Template" -"Button Background Color of the Ogone Template","Button Background Color of the Ogone Template" -"Button Text Color of the Ogone Template","Button Text Color of the Ogone Template" -"Font Family of the Ogone Template","Font Family of the Ogone Template" -" - E.g: ""Verdana"" - "," - E.g: ""Verdana"" - " -"Logo of the Ogone Template","Logo of the Ogone Template" -" - URL/filename of the logo.
The URL must be absolute and stored on a secure server. - "," - URL/filename of the logo.
The URL must be absolute and stored on a secure server. - " -"Layout of Payment Methods","Layout of Payment Methods" -"You can arrange the layout/list of the payment methods on Ogone payment page.","You can arrange the layout/list of the payment methods on Ogone payment page." diff --git a/app/code/Magento/Ogone/i18n/zh_CN.csv b/app/code/Magento/Ogone/i18n/zh_CN.csv deleted file mode 100644 index 6d4b705815246..0000000000000 --- a/app/code/Magento/Ogone/i18n/zh_CN.csv +++ /dev/null @@ -1,122 +0,0 @@ -Enabled,Enabled -Title,Title -Magento,Magento -"The hash is not valid.","The hash is not valid." -"The order is not valid.","The order is not valid." -"Start Ogone Processing",开始Ogone处理 -"Can't detect Ogone payment action","无法检测 Ogone 支付操作" -"The order cannot be saved.",订单无法保存。 -"Authorization Waiting from Ogone","正在等待从 Ogone 的授权" -"Processed by Ogone",由Ogone处理 -"Order can't save",订单无法保存 -"Something went wrong during the payment process, and so the result is unpredictable.","Something went wrong during the payment process, and so the result is unpredictable." -"Something went wrong during the authorization process, and so the result is unpredictable.","Something went wrong during the authorization process, and so the result is unpredictable." -"Unknown exception",未知例外 -"Something went wrong while saving this order.","Something went wrong while saving this order." -"Exception not defined",异常未定义 -"Declined Order on Ogone side","Declined Order on Ogone side" -"The payment transaction has been declined.","The payment transaction has been declined." -"The order was canceled on the Ogone side.","The order was canceled on the Ogone side." -"Something went wrong while canceling this order.","Something went wrong while canceling this order." -"Ogone Default Operation",Ogone默认操作 -Authorization,授权 -"Direct Sale",直销 -"Horizontally grouped logo with group name on left",左侧带组名称的水平分组标志 -"Horizontally grouped logo with no group name",不带组名称的水平分组标志 -"Verical list",垂直列表 -Ogone,Ogone -"Pending Ogone",挂起的Ogone -"Cancelled Ogone","已取消 Ogone" -"Declined Ogone","已拒绝 Ogone" -"Processing Ogone Payment",正在处理Ogone支付 -"Processed Ogone Payment",已处理的Ogone支付 -"Waiting Authorization",等待身份验证 -"Payment ID: %1","Payment ID: %1" -"You will be redirected to Ogone website when you place an order.",在下单时,您会被重定向到Ogone的网站。 -"Please stand by. In a moment, this page will transfer your data to the Ogone payment gateway.","Please stand by. In a moment, this page will transfer your data to the Ogone payment gateway." -Debug,Debug -"Payment Action","Payment Action" -"Gateway URL","Gateway URL" -" -
-
-
-


Signing up with Ogone

-

Please enter the correct post back url and offline processiong url in Ogone configuration

-

post back url example: http://myMagentoStore.com/ogone/api/postBack

-

offline processing url example: http://myMagentoStore.com/ogone/api/offlineProcess

-
-
- - "," -
-
-
-


Signing up with Ogone

-

Please enter the correct post back url and offline processiong url in Ogone configuration

-

post back url example: http://myMagentoStore.com/ogone/api/postBack

-

offline processing url example: http://myMagentoStore.com/ogone/api/offlineProcess

-
-
- - " -PSPID,PSPID -"SHA-IN Pass Phrase","SHA-IN Pass Phrase" -" - Use in posting data from Magento to Ogone.
Use in data checking by Ogone before the payment. - "," - Use in posting data from Magento to Ogone.
Use in data checking by Ogone before the payment. - " -"SHA-OUT Pass Phrase","SHA-OUT Pass Phrase" -" - Use in posting data from Ogone to Magento.
Use in feedback data checking by Magento. - "," - Use in posting data from Ogone to Magento.
Use in feedback data checking by Magento. - " -"Hash All Parameters","Hash All Parameters" -" - To enable this feature, please edit your global security parameters. - "," - To enable this feature, please edit your global security parameters. - " -" - To hash all parameters, select the following options in the ""Global security parameters"" fieldset:
  • Each parameter followed by the pass phrase.
  • ""Hash algorithm"" same as ""Hashing Algorithm"" below
  • UTF-8
- "," - To hash all parameters, select the following options in the ""Global security parameters"" fieldset:
  • Each parameter followed by the pass phrase.
  • ""Hash algorithm"" same as ""Hashing Algorithm"" below
  • UTF-8
- " -"Hashing Algorithm","Hashing Algorithm" -"For production, replace ""test"" with ""prod"". Example: https://secure.ogone.com/ncol/prod/orderstandard.asp","For production, replace ""test"" with ""prod"". Example: https://secure.ogone.com/ncol/prod/orderstandard.asp" -"If you choose ""No Operation"", Ogone will use the default payment procedure in your Ogone setup.","If you choose ""No Operation"", Ogone will use the default payment procedure in your Ogone setup." -"Payment Template","Payment Template" -"If you choose ""Ogone Template"", you will need to fill in all the following fields.","If you choose ""Ogone Template"", you will need to fill in all the following fields." -"Title of the Ogone Template","Title of the Ogone Template" -"Background Color of Ogone Template","Background Color of Ogone Template" -" - E.g: ""white"" - "," - E.g: ""white"" - " -"Text Color of the Ogone Template","Text Color of the Ogone Template" -" - E.g: ""black"" - "," - E.g: ""black"" - " -"Table Background Color of the Ogone Template","Table Background Color of the Ogone Template" -"Table Text Color of the Ogone Template","Table Text Color of the Ogone Template" -"Button Background Color of the Ogone Template","Button Background Color of the Ogone Template" -"Button Text Color of the Ogone Template","Button Text Color of the Ogone Template" -"Font Family of the Ogone Template","Font Family of the Ogone Template" -" - E.g: ""Verdana"" - "," - E.g: ""Verdana"" - " -"Logo of the Ogone Template","Logo of the Ogone Template" -" - URL/filename of the logo.
The URL must be absolute and stored on a secure server. - "," - URL/filename of the logo.
The URL must be absolute and stored on a secure server. - " -"Layout of Payment Methods","Layout of Payment Methods" -"You can arrange the layout/list of the payment methods on Ogone payment page.","You can arrange the layout/list of the payment methods on Ogone payment page." diff --git a/app/code/Magento/Ogone/view/adminhtml/templates/info.phtml b/app/code/Magento/Ogone/view/adminhtml/templates/info.phtml deleted file mode 100644 index 65e35a2a6e83d..0000000000000 --- a/app/code/Magento/Ogone/view/adminhtml/templates/info.phtml +++ /dev/null @@ -1,8 +0,0 @@ - - -escapeHtml($this->getMethod()->getTitle()) ?>
-escapeHtml($this->getInfo()->getLastTransId())) ?>
diff --git a/app/code/Magento/Ogone/view/frontend/layout/ogone_api_paypage.xml b/app/code/Magento/Ogone/view/frontend/layout/ogone_api_paypage.xml deleted file mode 100644 index 7f317478094e9..0000000000000 --- a/app/code/Magento/Ogone/view/frontend/layout/ogone_api_paypage.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - - - - - - - - - - - diff --git a/app/code/Magento/Ogone/view/frontend/layout/ogone_api_placeform.xml b/app/code/Magento/Ogone/view/frontend/layout/ogone_api_placeform.xml deleted file mode 100644 index bc265a7cd7414..0000000000000 --- a/app/code/Magento/Ogone/view/frontend/layout/ogone_api_placeform.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - diff --git a/app/code/Magento/Ogone/view/frontend/templates/form.phtml b/app/code/Magento/Ogone/view/frontend/templates/form.phtml deleted file mode 100644 index 254c06b45a399..0000000000000 --- a/app/code/Magento/Ogone/view/frontend/templates/form.phtml +++ /dev/null @@ -1,10 +0,0 @@ - - -getMethodCode() ?> - diff --git a/app/code/Magento/Ogone/view/frontend/templates/info.phtml b/app/code/Magento/Ogone/view/frontend/templates/info.phtml deleted file mode 100644 index 70a932cd9ae15..0000000000000 --- a/app/code/Magento/Ogone/view/frontend/templates/info.phtml +++ /dev/null @@ -1,6 +0,0 @@ - -

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

diff --git a/app/code/Magento/Ogone/view/frontend/templates/paypage.phtml b/app/code/Magento/Ogone/view/frontend/templates/paypage.phtml deleted file mode 100644 index f517044c93925..0000000000000 --- a/app/code/Magento/Ogone/view/frontend/templates/paypage.phtml +++ /dev/null @@ -1,7 +0,0 @@ - - -$$$PAYMENT ZONE$$$ diff --git a/app/code/Magento/Ogone/view/frontend/templates/placeform.phtml b/app/code/Magento/Ogone/view/frontend/templates/placeform.phtml deleted file mode 100644 index 084dcc350166a..0000000000000 --- a/app/code/Magento/Ogone/view/frontend/templates/placeform.phtml +++ /dev/null @@ -1,30 +0,0 @@ - - -
-
- getFormData()): ?> -
- $value) { - ?> - - -
- -
- diff --git a/app/code/Magento/PageCache/Model/Observer/InvalidateCache.php b/app/code/Magento/PageCache/Model/Observer/InvalidateCache.php index df4b261363fce..3563eb35ec27f 100644 --- a/app/code/Magento/PageCache/Model/Observer/InvalidateCache.php +++ b/app/code/Magento/PageCache/Model/Observer/InvalidateCache.php @@ -41,6 +41,5 @@ public function execute() if ($this->_config->isEnabled()) { $this->_typeList->invalidate('full_page'); } - return $this; } } diff --git a/app/code/Magento/PageCache/composer.json b/app/code/Magento/PageCache/composer.json index 46db836900a14..d52cd8ccee9e4 100644 --- a/app/code/Magento/PageCache/composer.json +++ b/app/code/Magento/PageCache/composer.json @@ -3,13 +3,13 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha108", - "magento/module-backend": "0.1.0-alpha108", - "magento/framework": "0.1.0-alpha108", + "magento/module-store": "0.42.0-beta1", + "magento/module-backend": "0.42.0-beta1", + "magento/framework": "0.42.0-beta1", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha108", + "version": "0.42.0-beta1", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/PageCache/etc/varnish.vcl b/app/code/Magento/PageCache/etc/varnish.vcl index 294dd0ecaf30d..4b2a337ba321f 100644 --- a/app/code/Magento/PageCache/etc/varnish.vcl +++ b/app/code/Magento/PageCache/etc/varnish.vcl @@ -47,10 +47,6 @@ sub vcl_recv { return (pass); } - if (req.url ~ "\.(css|js|jpg|png|gif|tiff|bmp|gz|tgz|bz2|tbz|mp3|ogg|svg|swf|woff)(\?|$)") { - unset req.http.Cookie; - } - set req.grace = 1m; return (lookup); @@ -107,6 +103,7 @@ sub vcl_deliver { } else { unset resp.http.Age; } + unset resp.http.X-Magento-Debug; unset resp.http.X-Magento-Tags; unset resp.http.X-Powered-By; diff --git a/app/code/Magento/Payment/composer.json b/app/code/Magento/Payment/composer.json index d3aa20a10f0a8..65ad4e7e09d88 100644 --- a/app/code/Magento/Payment/composer.json +++ b/app/code/Magento/Payment/composer.json @@ -3,16 +3,16 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha108", - "magento/module-core": "0.1.0-alpha108", - "magento/module-sales": "0.1.0-alpha108", - "magento/module-centinel": "0.1.0-alpha108", - "magento/module-checkout": "0.1.0-alpha108", - "magento/framework": "0.1.0-alpha108", + "magento/module-store": "0.42.0-beta1", + "magento/module-core": "0.42.0-beta1", + "magento/module-sales": "0.42.0-beta1", + "magento/module-centinel": "0.42.0-beta1", + "magento/module-checkout": "0.42.0-beta1", + "magento/framework": "0.42.0-beta1", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha108", + "version": "0.42.0-beta1", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Paypal/Block/Adminhtml/Billing/Agreement.php b/app/code/Magento/Paypal/Block/Adminhtml/Billing/Agreement.php deleted file mode 100644 index a5d7d8f2d5242..0000000000000 --- a/app/code/Magento/Paypal/Block/Adminhtml/Billing/Agreement.php +++ /dev/null @@ -1,25 +0,0 @@ -_controller = 'adminhtml_billing_agreement'; - $this->_blockGroup = 'Magento_Paypal'; - $this->_headerText = __('Billing Agreements'); - parent::_construct(); - $this->buttonList->remove('add'); - } -} diff --git a/app/code/Magento/Paypal/Block/Adminhtml/Billing/Agreement/Grid.php b/app/code/Magento/Paypal/Block/Adminhtml/Billing/Agreement/Grid.php deleted file mode 100644 index 61d0b23032d74..0000000000000 --- a/app/code/Magento/Paypal/Block/Adminhtml/Billing/Agreement/Grid.php +++ /dev/null @@ -1,204 +0,0 @@ -_helper = $helper; - $this->_agreementFactory = $agreementFactory; - $this->_agreementModel = $agreementModel; - parent::__construct($context, $backendHelper, $data); - } - - /** - * Set grid params - * - * @return void - */ - protected function _construct() - { - parent::_construct(); - $this->setId('billing_agreements'); - $this->setUseAjax(true); - $this->setDefaultSort('agreement_id'); - $this->setDefaultDir('DESC'); - $this->setSaveParametersInSession(true); - } - - /** - * Retrieve grid url - * - * @return string - */ - public function getGridUrl() - { - return $this->getUrl('paypal/billing_agreement/grid', ['_current' => true]); - } - - /** - * Retrieve row url - * - * @param object $item - * @return string - */ - public function getRowUrl($item) - { - return $this->getUrl('paypal/billing_agreement/view', ['agreement' => $item->getAgreementId()]); - } - - /** - * Prepare collection for grid - * - * @return $this - */ - protected function _prepareCollection() - { - /** @var \Magento\Paypal\Model\Resource\Billing\Agreement\Collection $collection */ - $collection = $this->_agreementFactory->create()->addCustomerDetails(); - $this->setCollection($collection); - return parent::_prepareCollection(); - } - - /** - * Add columns to grid - * - * @return $this - */ - protected function _prepareColumns() - { - $this->addColumn( - 'agreement_id', - [ - 'header' => __('ID'), - 'index' => 'agreement_id', - 'type' => 'text', - 'header_css_class' => 'col-id', - 'column_css_class' => 'col-id' - ] - ); - - $this->addColumn( - 'customer_email', - [ - 'header' => __('Email'), - 'index' => 'customer_email', - 'type' => 'text', - 'header_css_class' => 'col-mail', - 'column_css_class' => 'col-mail' - ] - ); - - $this->addColumn( - 'customer_firstname', - [ - 'header' => __('First Name'), - 'index' => 'customer_firstname', - 'type' => 'text', - 'escape' => true, - 'header_css_class' => 'col-name', - 'column_css_class' => 'col-name' - ] - ); - - $this->addColumn( - 'customer_lastname', - [ - 'header' => __('Last Name'), - 'index' => 'customer_lastname', - 'type' => 'text', - 'escape' => true, - 'header_css_class' => 'col-last-name', - 'column_css_class' => 'col-last-name' - ] - ); - - $this->addColumn( - 'reference_id', - [ - 'header' => __('Reference ID'), - 'index' => 'reference_id', - 'type' => 'text', - 'header_css_class' => 'col-reference', - 'column_css_class' => 'col-reference' - ] - ); - - $this->addColumn( - 'status', - [ - 'header' => __('Status'), - 'index' => 'status', - 'type' => 'options', - 'options' => $this->_agreementModel->getStatusesArray(), - 'header_css_class' => 'col-status', - 'column_css_class' => 'col-status' - ] - ); - - $this->addColumn( - 'created_at', - [ - 'header' => __('Created'), - 'index' => 'created_at', - 'type' => 'datetime', - 'align' => 'center', - 'default' => __('N/A'), - 'html_decorators' => ['nobr'], - 'header_css_class' => 'col-period', - 'column_css_class' => 'col-period' - ] - ); - - $this->addColumn( - 'updated_at', - [ - 'header' => __('Updated'), - 'index' => 'updated_at', - 'type' => 'datetime', - 'align' => 'center', - 'default' => __('N/A'), - 'html_decorators' => ['nobr'], - 'header_css_class' => 'col-period', - 'column_css_class' => 'col-period' - ] - ); - - return parent::_prepareColumns(); - } -} diff --git a/app/code/Magento/Paypal/Block/Adminhtml/Billing/Agreement/View.php b/app/code/Magento/Paypal/Block/Adminhtml/Billing/Agreement/View.php deleted file mode 100644 index 1a0d8f542850a..0000000000000 --- a/app/code/Magento/Paypal/Block/Adminhtml/Billing/Agreement/View.php +++ /dev/null @@ -1,119 +0,0 @@ -_coreRegistry = $registry; - parent::__construct($context, $data); - } - - /** - * Initialize view container - * - * @return void - */ - protected function _construct() - { - $this->_objectId = 'agreement'; - $this->_controller = 'adminhtml_billing_agreement'; - $this->_mode = 'view'; - $this->_blockGroup = 'Magento_Paypal'; - - parent::_construct(); - - if (!$this->_isAllowed('Magento_Paypal::actions_manage')) { - $this->buttonList->remove('delete'); - } - $this->buttonList->remove('reset'); - $this->buttonList->remove('save'); - $this->setId('billing_agreement_view'); - - $this->buttonList->add( - 'back', - [ - 'label' => __('Back'), - 'onclick' => 'setLocation(\'' . $this->getBackUrl() . '\')', - 'class' => 'back' - ], - -1 - ); - - $agreement = $this->_getBillingAgreement(); - if ($agreement && $agreement->canCancel() && $this->_isAllowed('Magento_Paypal::actions_manage')) { - $confirmText = __('Are you sure you want to do this?'); - $this->buttonList->add( - 'cancel', - [ - 'label' => __('Cancel'), - 'onclick' => "confirmSetLocation(" . "'{$confirmText}', '{$this->_getCancelUrl()}'" . ")", - 'class' => 'cancel' - ], - -1 - ); - } - } - - /** - * Retrieve header text - * - * @return string - */ - public function getHeaderText() - { - return __('Billing Agreement #%1', $this->_getBillingAgreement()->getReferenceId()); - } - - /** - * Retrieve cancel billing agreement url - * - * @return string - */ - protected function _getCancelUrl() - { - return $this->getUrl('*/*/cancel', ['agreement' => $this->_getBillingAgreement()->getAgreementId()]); - } - - /** - * Retrieve billing agreement model - * - * @return \Magento\Paypal\Model\Billing\Agreement - */ - protected function _getBillingAgreement() - { - return $this->_coreRegistry->registry('current_billing_agreement'); - } - - /** - * Check current user permissions for specified action - * - * @param string $resourceId - * @return bool - */ - protected function _isAllowed($resourceId) - { - return $this->_authorization->isAllowed($resourceId); - } -} diff --git a/app/code/Magento/Paypal/Block/Adminhtml/Billing/Agreement/View/Form.php b/app/code/Magento/Paypal/Block/Adminhtml/Billing/Agreement/View/Form.php deleted file mode 100644 index 6f71523f73f91..0000000000000 --- a/app/code/Magento/Paypal/Block/Adminhtml/Billing/Agreement/View/Form.php +++ /dev/null @@ -1,16 +0,0 @@ -_coreRegistry = $registry; - $this->_customerRepository = $customerRepository; - parent::__construct($context, $data); - } - - /** - * {@inheritdoc} - */ - public function getTabLabel() - { - return __('General Information'); - } - - /** - * {@inheritdoc} - */ - public function getTabTitle() - { - return __('General Information'); - } - - /** - * {@inheritdoc} - */ - public function canShowTab() - { - return true; - } - - /** - * {@inheritdoc} - */ - public function isHidden() - { - return false; - } - - /** - * Retrieve billing agreement model - * - * @return \Magento\Paypal\Model\Billing\Agreement - */ - protected function _getBillingAgreement() - { - return $this->_coreRegistry->registry('current_billing_agreement'); - } - - /** - * Set data to block - * - * @return string - */ - protected function _toHtml() - { - $agreement = $this->_getBillingAgreement(); - $this->setReferenceId($agreement->getReferenceId()); - $customerId = $agreement->getCustomerId(); - $customer = $this->_customerRepository->getById($customerId); - $this->setCustomerEmail($customer->getEmail()); - $this->setCustomerUrl($this->getUrl('customer/index/edit', ['id' => $customerId])); - $this->setStatus($agreement->getStatusLabel()); - $this->setCreatedAt($this->formatDate($agreement->getCreatedAt(), 'short', true)); - $this->setUpdatedAt( - $agreement->getUpdatedAt() ? $this->formatDate($agreement->getUpdatedAt(), 'short', true) : __('N/A') - ); - return parent::_toHtml(); - } -} diff --git a/app/code/Magento/Paypal/Block/Adminhtml/Billing/Agreement/View/Tab/Orders.php b/app/code/Magento/Paypal/Block/Adminhtml/Billing/Agreement/View/Tab/Orders.php deleted file mode 100644 index 6b80e203f526d..0000000000000 --- a/app/code/Magento/Paypal/Block/Adminhtml/Billing/Agreement/View/Tab/Orders.php +++ /dev/null @@ -1,54 +0,0 @@ -setId('billing_agreement_orders'); - } - - /** - * {@inheritdoc} - */ - public function getTabLabel() - { - return __('Related Orders'); - } - - /** - * {@inheritdoc} - */ - public function getTabTitle() - { - return __('Related Orders'); - } - - /** - * {@inheritdoc} - */ - public function canShowTab() - { - return true; - } - - /** - * {@inheritdoc} - */ - public function isHidden() - { - return false; - } -} diff --git a/app/code/Magento/Paypal/Block/Adminhtml/Billing/Agreement/View/Tabs.php b/app/code/Magento/Paypal/Block/Adminhtml/Billing/Agreement/View/Tabs.php deleted file mode 100644 index d9d9c893079cf..0000000000000 --- a/app/code/Magento/Paypal/Block/Adminhtml/Billing/Agreement/View/Tabs.php +++ /dev/null @@ -1,25 +0,0 @@ -setId('billing_agreement_view_tabs'); - $this->setDestElementId('billing_agreement_view'); - $this->setTitle(__('Billing Agreement View')); - } -} diff --git a/app/code/Magento/Paypal/Block/Adminhtml/Customer/Edit/Tab/Agreement.php b/app/code/Magento/Paypal/Block/Adminhtml/Customer/Edit/Tab/Agreement.php deleted file mode 100644 index 80be0b198448e..0000000000000 --- a/app/code/Magento/Paypal/Block/Adminhtml/Customer/Edit/Tab/Agreement.php +++ /dev/null @@ -1,181 +0,0 @@ -_coreRegistry = $coreRegistry; - parent::__construct($context, $backendHelper, $helper, $agreementFactory, $agreementModel, $data); - } - - /** - * Disable filters and paging - * - * @return void - */ - protected function _construct() - { - parent::_construct(); - $this->setId('customer_edit_tab_agreements'); - } - - /** - * {@inheritdoc} - */ - public function getTabLabel() - { - return __('Billing Agreements'); - } - - /** - * {@inheritdoc} - */ - public function getTabTitle() - { - return __('Billing Agreements'); - } - - /** - * {@inheritdoc} - */ - public function canShowTab() - { - return !is_null($this->_coreRegistry->registry(RegistryConstants::CURRENT_CUSTOMER_ID)); - } - - /** - * {@inheritdoc} - */ - public function isHidden() - { - return false; - } - - /** - * Get grid url - * - * @return string - */ - public function getGridUrl() - { - return $this->getUrl('paypal/billing_agreement/customerGrid', ['_current' => true]); - } - - /** - * Tab class getter - * - * @return string - */ - public function getTabClass() - { - return ''; - } - - /** - * Return URL link to Tab content - * - * @return string - */ - public function getTabUrl() - { - return ''; - } - - /** - * Tab should be loaded trough Ajax call - * - * @return bool - */ - public function isAjaxLoaded() - { - return false; - } - - /** - * Defines after which tab, this tab should be rendered - * - * @return string - */ - public function getAfter() - { - return 'orders'; - } - - /** - * Prepare collection for grid - * - * @return $this - */ - protected function _prepareCollection() - { - $customerId = $this->_coreRegistry->registry('current_customer_id'); - if (!$customerId) { - $customerId = $this->_coreRegistry->registry('current_customer')->getId(); - } - $collection = $this->_agreementFactory->create()->addFieldToFilter( - 'customer_id', - $customerId - )->setOrder( - 'created_at' - ); - $this->setCollection($collection); - return \Magento\Backend\Block\Widget\Grid::_prepareCollection(); - } - - /** - * Remove some columns and make other not sortable - * - * @return \Magento\Backend\Block\Widget\Grid\Extended - */ - protected function _prepareColumns() - { - $result = parent::_prepareColumns(); - - foreach ($this->getColumns() as $key => $value) { - if (in_array($key, $this->_columnsToRemove)) { - $this->removeColumn($key); - } - } - return $result; - } -} diff --git a/app/code/Magento/Paypal/Block/Adminhtml/Settlement/Details.php b/app/code/Magento/Paypal/Block/Adminhtml/Settlement/Details.php deleted file mode 100644 index 41fd4c8c9ce49..0000000000000 --- a/app/code/Magento/Paypal/Block/Adminhtml/Settlement/Details.php +++ /dev/null @@ -1,41 +0,0 @@ - - */ -class Details extends \Magento\Backend\Block\Widget\Form\Container -{ - /** - * Block construction - * Initialize titles, buttons - * - * @return void - */ - protected function _construct() - { - parent::_construct(); - $this->_controller = ''; - $this->_headerText = __('View Transaction Details'); - $this->buttonList->remove('reset'); - $this->buttonList->remove('delete'); - $this->buttonList->remove('save'); - } - - /** - * Initialize form - * - * @return $this - */ - protected function _prepareLayout() - { - parent::_prepareLayout(); - $this->addChild('form', 'Magento\Paypal\Block\Adminhtml\Settlement\Details\Form'); - return $this; - } -} diff --git a/app/code/Magento/Paypal/Block/Adminhtml/Settlement/Details/Form.php b/app/code/Magento/Paypal/Block/Adminhtml/Settlement/Details/Form.php deleted file mode 100644 index 38c8fd16cbc29..0000000000000 --- a/app/code/Magento/Paypal/Block/Adminhtml/Settlement/Details/Form.php +++ /dev/null @@ -1,148 +0,0 @@ -_settlement = $settlement; - $this->_localeCurrency = $localeCurrency; - parent::__construct($context, $registry, $formFactory, $data); - } - - /** - * Prepare read-only data and group it by fieldsets - * - * @return $this - */ - protected function _prepareForm() - { - /* @var $model \Magento\Paypal\Model\Report\Settlement\Row */ - $model = $this->_coreRegistry->registry('current_transaction'); - $fieldsets = [ - 'reference_fieldset' => [ - 'fields' => [ - 'transaction_id' => ['label' => $this->_settlement->getFieldLabel('transaction_id')], - 'invoice_id' => ['label' => $this->_settlement->getFieldLabel('invoice_id')], - 'paypal_reference_id' => [ - 'label' => $this->_settlement->getFieldLabel('paypal_reference_id'), - ], - 'paypal_reference_id_type' => [ - 'label' => $this->_settlement->getFieldLabel('paypal_reference_id_type'), - 'value' => $model->getReferenceType($model->getData('paypal_reference_id_type')), - ], - 'custom_field' => ['label' => $this->_settlement->getFieldLabel('custom_field')], - ], - 'legend' => __('Reference Information'), - ], - 'transaction_fieldset' => [ - 'fields' => [ - 'transaction_event_code' => [ - 'label' => $this->_settlement->getFieldLabel('transaction_event_code'), - 'value' => sprintf( - '%s (%s)', - $model->getData('transaction_event_code'), - $model->getTransactionEvent($model->getData('transaction_event_code')) - ), - ], - 'transaction_initiation_date' => [ - 'label' => $this->_settlement->getFieldLabel('transaction_initiation_date'), - 'value' => $this->formatDate( - $model->getData('transaction_initiation_date'), - \Magento\Framework\Stdlib\DateTime\TimezoneInterface::FORMAT_TYPE_MEDIUM, - true - ), - ], - 'transaction_completion_date' => [ - 'label' => $this->_settlement->getFieldLabel('transaction_completion_date'), - 'value' => $this->formatDate( - $model->getData('transaction_completion_date'), - \Magento\Framework\Stdlib\DateTime\TimezoneInterface::FORMAT_TYPE_MEDIUM, - true - ), - ], - 'transaction_debit_or_credit' => [ - 'label' => $this->_settlement->getFieldLabel('transaction_debit_or_credit'), - 'value' => $model->getDebitCreditText($model->getData('transaction_debit_or_credit')), - ], - 'gross_transaction_amount' => [ - 'label' => $this->_settlement->getFieldLabel('gross_transaction_amount'), - 'value' => $this->_localeCurrency->getCurrency( - $model->getData('gross_transaction_currency') - )->toCurrency( - $model->getData('gross_transaction_amount') - ), - ], - ], - 'legend' => __('Transaction Information'), - ], - 'fee_fieldset' => [ - 'fields' => [ - 'fee_debit_or_credit' => [ - 'label' => $this->_settlement->getFieldLabel('fee_debit_or_credit'), - 'value' => $model->getDebitCreditText($model->getCastedAmount('fee_debit_or_credit')), - ], - 'fee_amount' => [ - 'label' => $this->_settlement->getFieldLabel('fee_amount'), - 'value' => $this->_localeCurrency->getCurrency( - $model->getData('fee_currency') - )->toCurrency( - $model->getCastedAmount('fee_amount') - ), - ], - ], - 'legend' => __('PayPal Fee Information'), - ], - ]; - - /** @var \Magento\Framework\Data\Form $form */ - $form = $this->_formFactory->create(); - foreach ($fieldsets as $key => $data) { - $fieldset = $form->addFieldset($key, ['legend' => $data['legend']]); - foreach ($data['fields'] as $id => $info) { - $fieldset->addField( - $id, - 'label', - [ - 'name' => $id, - 'label' => $info['label'], - 'title' => $info['label'], - 'value' => isset($info['value']) ? $info['value'] : $model->getData($id) - ] - ); - } - } - $this->setForm($form); - return parent::_prepareForm(); - } -} diff --git a/app/code/Magento/Paypal/Block/Adminhtml/Settlement/Report.php b/app/code/Magento/Paypal/Block/Adminhtml/Settlement/Report.php deleted file mode 100644 index 87e0d32b029b5..0000000000000 --- a/app/code/Magento/Paypal/Block/Adminhtml/Settlement/Report.php +++ /dev/null @@ -1,40 +0,0 @@ - - */ -class Report extends \Magento\Backend\Block\Widget\Grid\Container -{ - /** - * Prepare grid container, add additional buttons - * - * @return void - */ - protected function _construct() - { - $this->_blockGroup = 'Magento_Paypal'; - $this->_controller = 'adminhtml_settlement_report'; - $this->_headerText = __('PayPal Settlement Reports'); - parent::_construct(); - $this->buttonList->remove('add'); - $message = __( - 'We are connecting to the PayPal SFTP server to retrieve new reports. Are you sure you want to continue?' - ); - if (true == $this->_authorization->isAllowed('Magento_Paypal::fetch')) { - $this->buttonList->add( - 'fetch', - [ - 'label' => __('Fetch Updates'), - 'onclick' => "confirmSetLocation('{$message}', '{$this->getUrl('*/*/fetch')}')", - 'class' => 'task' - ] - ); - } - } -} diff --git a/app/code/Magento/Paypal/Block/Adminhtml/Store/SwitcherPlugin.php b/app/code/Magento/Paypal/Block/Adminhtml/Store/SwitcherPlugin.php deleted file mode 100644 index f060850691135..0000000000000 --- a/app/code/Magento/Paypal/Block/Adminhtml/Store/SwitcherPlugin.php +++ /dev/null @@ -1,29 +0,0 @@ -getRequest()->getParam(\Magento\Paypal\Model\Config\StructurePlugin::REQUEST_PARAM_COUNTRY)) { - $params[\Magento\Paypal\Model\Config\StructurePlugin::REQUEST_PARAM_COUNTRY] = null; - } - return $proceed($route, $params); - } -} diff --git a/app/code/Magento/Paypal/Block/Adminhtml/System/Config/ApiWizard.php b/app/code/Magento/Paypal/Block/Adminhtml/System/Config/ApiWizard.php deleted file mode 100644 index 2710a8a048563..0000000000000 --- a/app/code/Magento/Paypal/Block/Adminhtml/System/Config/ApiWizard.php +++ /dev/null @@ -1,64 +0,0 @@ -getTemplate()) { - $this->setTemplate(static::WIZARD_TEMPLATE); - } - return $this; - } - - /** - * Unset some non-related element parameters - * - * @param \Magento\Framework\Data\Form\Element\AbstractElement $element - * @return string - */ - public function render(\Magento\Framework\Data\Form\Element\AbstractElement $element) - { - $element->unsScope()->unsCanUseWebsiteValue()->unsCanUseDefaultValue(); - return parent::render($element); - } - - /** - * Get the button and scripts contents - * - * @param \Magento\Framework\Data\Form\Element\AbstractElement $element - * @return string - */ - protected function _getElementHtml(\Magento\Framework\Data\Form\Element\AbstractElement $element) - { - $originalData = $element->getOriginalData(); - $this->addData( - [ - 'button_label' => __($originalData['button_label']), - 'button_url' => $originalData['button_url'], - 'html_id' => $element->getHtmlId(), - 'sandbox_button_label' => __($originalData['sandbox_button_label']), - 'sandbox_button_url' => $originalData['sandbox_button_url'], - 'sandbox_html_id' => 'sandbox_' . $element->getHtmlId(), - ] - ); - return $this->_toHtml(); - } -} diff --git a/app/code/Magento/Paypal/Block/Adminhtml/System/Config/BmlApiWizard.php b/app/code/Magento/Paypal/Block/Adminhtml/System/Config/BmlApiWizard.php deleted file mode 100644 index fbce8bb160657..0000000000000 --- a/app/code/Magento/Paypal/Block/Adminhtml/System/Config/BmlApiWizard.php +++ /dev/null @@ -1,33 +0,0 @@ -getOriginalData(); - $this->addData( - [ - 'button_label' => __($originalData['button_label']), - 'button_url' => $originalData['button_url'], - 'html_id' => $element->getHtmlId(), - ] - ); - return $this->_toHtml(); - } -} diff --git a/app/code/Magento/Paypal/Block/Adminhtml/System/Config/Field/Country.php b/app/code/Magento/Paypal/Block/Adminhtml/System/Config/Field/Country.php deleted file mode 100644 index c77272d58ec0c..0000000000000 --- a/app/code/Magento/Paypal/Block/Adminhtml/System/Config/Field/Country.php +++ /dev/null @@ -1,137 +0,0 @@ -_url = $url; - $this->_jsHelper = $jsHelper; - $this->_coreHelper = $coreHelper; - } - - /** - * Render country field considering request parameter - * - * @param \Magento\Framework\Data\Form\Element\AbstractElement $element - * @return string - */ - public function render(\Magento\Framework\Data\Form\Element\AbstractElement $element) - { - $country = $this->getRequest()->getParam(StructurePlugin::REQUEST_PARAM_COUNTRY); - if ($country) { - $element->setValue($country); - } - - if ($element->getCanUseDefaultValue()) { - $this->_defaultCountry = $this->_scopeConfig->getValue(self::FIELD_CONFIG_PATH); - if (!$this->_defaultCountry) { - $this->_defaultCountry = $this->_coreHelper->getDefaultCountry(); - } - if ($country) { - $shouldInherit = $country == $this->_defaultCountry - && $this->getRequest()->getParam(self::REQUEST_PARAM_DEFAULT_COUNTRY); - $element->setInherit($shouldInherit); - } - if ($element->getInherit()) { - $this->_defaultCountry = null; - } - } - - return parent::render($element); - } - - /** - * Get country selector html - * - * @param \Magento\Framework\Data\Form\Element\AbstractElement $element - * @return string - */ - protected function _getElementHtml(\Magento\Framework\Data\Form\Element\AbstractElement $element) - { - $urlParams = [ - 'section' => $this->getRequest()->getParam('section'), - 'website' => $this->getRequest()->getParam('website'), - 'store' => $this->getRequest()->getParam('store'), - StructurePlugin::REQUEST_PARAM_COUNTRY => '__country__', - ]; - $urlString = $this->_escaper->escapeJsQuote($this->_url->getUrl('*/*/*', $urlParams)); - $jsString = ' - $("' . $element->getHtmlId() . '").observe("change", function () { - location.href = \'' . $urlString . '\'.replace("__country__", this.value); - }); - '; - - if ($this->_defaultCountry) { - $urlParams[self::REQUEST_PARAM_DEFAULT_COUNTRY] = '__default__'; - $urlString = $this->_escaper->escapeJsQuote($this->_url->getUrl('*/*/*', $urlParams)); - $jsParentCountry = $this->_escaper->escapeJsQuote($this->_defaultCountry); - $jsString .= ' - $("' . $element->getHtmlId() . '_inherit").observe("click", function () { - if (this.checked) { - location.href = \'' . $urlString . '\'.replace("__country__", \'' . $jsParentCountry . '\') - .replace("__default__", "1"); - } - }); - '; - } - - return parent::_getElementHtml($element) . $this->_jsHelper->getScript( - 'document.observe("dom:loaded", function() {' . $jsString . '});' - ); - } -} diff --git a/app/code/Magento/Paypal/Block/Adminhtml/System/Config/Field/Hidden.php b/app/code/Magento/Paypal/Block/Adminhtml/System/Config/Field/Hidden.php deleted file mode 100644 index 8c94d1351c196..0000000000000 --- a/app/code/Magento/Paypal/Block/Adminhtml/System/Config/Field/Hidden.php +++ /dev/null @@ -1,24 +0,0 @@ -getHtmlId() . '" style="display: none;">' . $html . ''; - } -} diff --git a/app/code/Magento/Paypal/Block/Adminhtml/System/Config/Fieldset/Expanded.php b/app/code/Magento/Paypal/Block/Adminhtml/System/Config/Fieldset/Expanded.php deleted file mode 100644 index 632cd900e0a72..0000000000000 --- a/app/code/Magento/Paypal/Block/Adminhtml/System/Config/Fieldset/Expanded.php +++ /dev/null @@ -1,44 +0,0 @@ -_authSession->getUser()->getExtra(); - if (isset($extra['configState'][$element->getId()])) { - return $extra['configState'][$element->getId()]; - } - - return true; - } -} diff --git a/app/code/Magento/Paypal/Block/Adminhtml/System/Config/Fieldset/Group.php b/app/code/Magento/Paypal/Block/Adminhtml/System/Config/Fieldset/Group.php deleted file mode 100644 index 233683f408bc7..0000000000000 --- a/app/code/Magento/Paypal/Block/Adminhtml/System/Config/Fieldset/Group.php +++ /dev/null @@ -1,74 +0,0 @@ -getGroup(); - - if (empty($groupConfig['help_url']) || !$element->getComment()) { - return parent::_getHeaderCommentHtml($element); - } - - $html = '
' . - $element->getComment() . - ' ' . - __( - 'Help' - ) . '
'; - - return $html; - } - - /** - * Return collapse state - * - * @param \Magento\Framework\Data\Form\Element\AbstractElement $element - * @return bool - */ - protected function _isCollapseState($element) - { - $extra = $this->_authSession->getUser()->getExtra(); - if (isset($extra['configState'][$element->getId()])) { - return $extra['configState'][$element->getId()]; - } - - $groupConfig = $element->getGroup(); - if (!empty($groupConfig['expanded'])) { - return true; - } - - return false; - } -} diff --git a/app/code/Magento/Paypal/Block/Adminhtml/System/Config/Fieldset/Hint.php b/app/code/Magento/Paypal/Block/Adminhtml/System/Config/Fieldset/Hint.php deleted file mode 100644 index e2be19910642c..0000000000000 --- a/app/code/Magento/Paypal/Block/Adminhtml/System/Config/Fieldset/Hint.php +++ /dev/null @@ -1,97 +0,0 @@ - - */ -class Hint extends \Magento\Backend\Block\Template implements \Magento\Framework\Data\Form\Element\Renderer\RendererInterface -{ - /** - * @var string - */ - protected $_template = 'Magento_Paypal::system/config/fieldset/hint.phtml'; - - /** - * @var \Magento\Framework\View\Helper\Js - */ - protected $_jsHelper; - - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Framework\View\Helper\Js $jsHelper - * @param array $data - */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Framework\View\Helper\Js $jsHelper, - array $data = [] - ) { - $this->_jsHelper = $jsHelper; - parent::__construct($context, $data); - } - - /** - * Render fieldset html - * - * @param \Magento\Framework\Data\Form\Element\AbstractElement $element - * @return string - */ - public function render(\Magento\Framework\Data\Form\Element\AbstractElement $element) - { - $elementOriginalData = $element->getOriginalData(); - if (isset($elementOriginalData['help_link'])) { - $this->setHelpLink($elementOriginalData['help_link']); - } - $js = ' - paypalToggleSolution = function(id, url) { - var doScroll = false; - Fieldset.toggleCollapse(id, url); - if ($(this).hasClassName("open")) { - $$(".with-button button.button").each(function(anotherButton) { - if (anotherButton != this && $(anotherButton).hasClassName("open")) { - $(anotherButton).click(); - doScroll = true; - } - }.bind(this)); - } - if (doScroll) { - var pos = Element.cumulativeOffset($(this)); - window.scrollTo(pos[0], pos[1] - 45); - } - } - - togglePaypalSolutionConfigureButton = function(button, enable) { - var $button = $(button); - $button.disabled = !enable; - if ($button.hasClassName("disabled") && enable) { - $button.removeClassName("disabled"); - } else if (!$button.hasClassName("disabled") && !enable) { - $button.addClassName("disabled"); - } - } - - // check store-view disabling Express Checkout - document.observe("dom:loaded", function() { - $$(".pp-method-express button.button").each(function(ecButton){ - var ecEnabler = $$(".paypal-ec-enabler")[0]; - if (typeof ecButton == "undefined" || typeof ecEnabler != "undefined") { - return; - } - var $ecButton = $(ecButton); - $$(".with-button button.button").each(function(configureButton) { - if (configureButton != ecButton && !configureButton.disabled - && !$(configureButton).hasClassName("paypal-ec-separate") - ) { - togglePaypalSolutionConfigureButton(ecButton, false); - } - }); - }); - }); - '; - return $this->toHtml() . $this->_jsHelper->getScript($js); - } -} diff --git a/app/code/Magento/Paypal/Block/Adminhtml/System/Config/Fieldset/Location.php b/app/code/Magento/Paypal/Block/Adminhtml/System/Config/Fieldset/Location.php deleted file mode 100644 index 88146eca8f7da..0000000000000 --- a/app/code/Magento/Paypal/Block/Adminhtml/System/Config/Fieldset/Location.php +++ /dev/null @@ -1,392 +0,0 @@ - - */ -namespace Magento\Paypal\Block\Adminhtml\System\Config\Fieldset; - -class Location extends \Magento\Paypal\Block\Adminhtml\System\Config\Fieldset\Expanded -{ - /** - * Render fieldset html - * - * @param \Magento\Framework\Data\Form\Element\AbstractElement $element - * @return string - */ - public function render(\Magento\Framework\Data\Form\Element\AbstractElement $element) - { - $this->setElement($element); - $js = ' - require(["jquery", "prototype"], function(jQuery){ - jQuery("body").on("adminConfigDefined", function() { - $$(".with-button button.button").each(function(configureButton) { - togglePaypalSolutionConfigureButton(configureButton, true); - }); - var paypalConflictsObject = { - "isConflict": false, - "ecMissed": false, - sharePayflowEnabling: function(enabler, isEvent) { - - var isPayflowLinkEnabled = !!$$(".paypal-payflowlink")[0], - isPayflowAdvancedEnabled = !!$$(".paypal-payflow-advanced")[0]; - var ecPayflowEnabler = $$(".paypal-ec-payflow-enabler")[+isPayflowLinkEnabled]; - if (typeof ecPayflowEnabler == "undefined") { - return; - } - var ecPayflowScopeElement = adminSystemConfig.getScopeElement(ecPayflowEnabler); - - if (!enabler.enablerObject.ecPayflow) { - if ((!ecPayflowScopeElement || !ecPayflowScopeElement.checked) && isEvent - && enabler.value == 1 - ) { - ecPayflowEnabler.value = 0; - fireEvent(ecPayflowEnabler, "change"); - } - return; - } - - var enablerScopeElement = adminSystemConfig.getScopeElement(enabler); - if (enablerScopeElement && ecPayflowScopeElement - && enablerScopeElement.checked != ecPayflowScopeElement.checked - && (isEvent || ecPayflowScopeElement.checked) - ) { - $(ecPayflowScopeElement).click(); - } - - var ecEnabler = $$(".paypal-ec-enabler")[0]; - if (ecPayflowEnabler.value != enabler.value - && (isEvent || enabler.value == 1 && !isPayflowLinkEnabled) - ) { - ecPayflowEnabler.value = enabler.value; - paypalConflictsObject.checklessEventAction(ecPayflowEnabler, true); - if (ecPayflowEnabler.value == 1) { - if (typeof ecEnabler != "undefined") { - var ecEnablerScopeElement = adminSystemConfig.getScopeElement(ecEnabler); - ecEnabler.value = 0; - if (ecEnablerScopeElement && ecEnablerScopeElement.checked) { - paypalConflictsObject.checklessEventAction(ecEnablerScopeElement, false); - } - paypalConflictsObject.checklessEventAction(ecEnabler, true); - } - } - } - if (!isEvent && ecPayflowEnabler.value == 1 && typeof ecEnabler != "undefined") { - var ecSolution = $$(".pp-method-express")[0]; - if (typeof ecSolution != "undefined" && !$(ecSolution).hasClassName("enabled")) { - ecSolution.addClassName("enabled"); - } - } - }, - onChangeEnabler: function(event) { - paypalConflictsObject.checkPaymentConflicts($(Event.element(event)), "change"); - }, - onClickEnablerScope: function(event) { - paypalConflictsObject.checkPaymentConflicts( - $(adminSystemConfig.getUpTr($(Event.element(event))).select(".paypal-enabler")[0]), - "click" - ); - }, - getSharedElements: function(element) { - var sharedElements = []; - adminSystemConfig.mapClasses(element, true, function(elementClassName) { - $$("." + elementClassName).each(function(sharedElement) { - if (sharedElements.indexOf(sharedElement) == -1) { - sharedElements.push(sharedElement); - } - }); - }); - if (sharedElements.length == 0) { - sharedElements.push(element); - } - return sharedElements; - }, - checklessEventAction: function(element, isChange) { - var action = isChange ? "change" : "click"; - var handler = isChange - ? paypalConflictsObject.onChangeEnabler - : paypalConflictsObject.onClickEnablerScope; - paypalConflictsObject.getSharedElements(element).each(function(sharedElement) { - Event.stopObserving(sharedElement, action, handler); - if (isChange) { - sharedElement.value = element.value; - if ($(sharedElement).requiresObj) { - $(sharedElement).requiresObj.indicateEnabled(); - } - } - }); - if (isChange) { - fireEvent(element, "change"); - } else { - $(element).click(); - } - paypalConflictsObject.getSharedElements(element).each(function(sharedElement) { - Event.observe(sharedElement, action, handler); - }); - }, - ecCheckAvailability: function() { - $$(".pp-method-express button.button").each(function(ecButton){ - if (typeof ecButton == "undefined") { - return; - } - var couldBeConfigured = true; - $$(".paypal-enabler").each(function(enabler) { - if (enabler.enablerObject.ecEnabler || enabler.enablerObject.ecConflicts - || enabler.enablerObject.ecSeparate - ) { - return; - } - if (enabler.value == 1) { - couldBeConfigured = false; - } - }); - if (couldBeConfigured) { - togglePaypalSolutionConfigureButton(ecButton, true); - } else { - togglePaypalSolutionConfigureButton(ecButton, false); - } - }); - }, - // type could be "initial", "change", "click" - checkPaymentConflicts: function(enabler, type) { - if (!enabler.enablerObject) { - return; - } - var isEvent = (type != "initial"); - var ecEnabler = $$(".paypal-ec-enabler")[0]; - - if (enabler.value == 0) { - if (!enabler.enablerObject.ecIndependent && type == "change") { - if (typeof ecEnabler != "undefined" && ecEnabler.value == 1) { - var ecEnablerScopeElement = adminSystemConfig.getScopeElement(ecEnabler); - if (!ecEnablerScopeElement || !ecEnablerScopeElement.checked) { - ecEnabler.value = 0; - paypalConflictsObject.checklessEventAction(ecEnabler, true); - } - } - } - paypalConflictsObject.ecCheckAvailability(); - paypalConflictsObject.sharePayflowEnabling(enabler, isEvent); - return; - } - - var confirmationApproved = isEvent; - var confirmationShowed = false; - // check other solutions - $$(".paypal-enabler").each(function(anotherEnabler) { - var anotherEnablerScopeElement = adminSystemConfig.getScopeElement(anotherEnabler); - if (!confirmationApproved && isEvent || $(anotherEnabler) == enabler - || anotherEnabler.value == 0 - && (!anotherEnablerScopeElement || !anotherEnablerScopeElement.checked) - ) { - return; - } - var conflict = enabler.enablerObject.ecConflicts && anotherEnabler.enablerObject.ecEnabler - || enabler.enablerObject.ecEnabler && anotherEnabler.enablerObject.ecConflicts - || !enabler.enablerObject.ecIndependent && anotherEnabler.enablerObject.ecConflicts - || !enabler.enablerObject.ecEnabler && !anotherEnabler.enablerObject.ecEnabler; - - if (conflict && !confirmationShowed && anotherEnabler.value == 1) { - if (isEvent) { - confirmationApproved = confirm(\'' . - $this->escapeJsQuote( - __('There is already another PayPal solution enabled. Enable this solution instead?') - ) . - '\'); - } else { - paypalConflictsObject.isConflict = true; - } - confirmationShowed = true; - } - if (conflict && confirmationApproved) { - anotherEnabler.value = 0; - if (anotherEnablerScopeElement && anotherEnablerScopeElement.checked && isEvent) { - paypalConflictsObject.checklessEventAction(anotherEnablerScopeElement, false); - } - paypalConflictsObject.checklessEventAction(anotherEnabler, true); - } - }); - - if (!enabler.enablerObject.ecIndependent) { - if (!isEvent && (typeof ecEnabler == "undefined" || ecEnabler.value == 0)) { - if (!enabler.enablerObject.ecPayflow) { - paypalConflictsObject.ecMissed = true; - } - } else if (isEvent && typeof ecEnabler != "undefined" && confirmationApproved) { - var ecEnablerScopeElement = adminSystemConfig.getScopeElement(ecEnabler); - if (ecEnablerScopeElement && ecEnablerScopeElement.checked) { - paypalConflictsObject.checklessEventAction(ecEnablerScopeElement, false); - } - if (ecEnabler.value == 0 && !enabler.enablerObject.ecPayflow) { - ecEnabler.value = 1; - paypalConflictsObject.checklessEventAction(ecEnabler, true); - } - } - } - - if (!confirmationApproved && isEvent) { - enabler.value = 0; - paypalConflictsObject.checklessEventAction(enabler, true); - } - paypalConflictsObject.ecCheckAvailability(); - paypalConflictsObject.sharePayflowEnabling(enabler, isEvent); - }, - handleBmlEnabler: function(event) { - required = Event.element(event); - var bml = $(required).bmlEnabler; - if (required.value == "1") { - bml.value = "1"; - } - paypalConflictsObject.toggleBmlEnabler(required); - }, - - toggleBmlEnabler: function(required) { - var bml = $(required).bmlEnabler; - if (!bml) { - return; - } - if (required.value != "1") { - bml.value = "0"; - $(bml).disable(); - } - $(bml).requiresObj.indicateEnabled(); - } - }; - - // fill enablers with conflict data - $$(".paypal-enabler").each(function(enablerElement) { - var enablerObj = { - ecIndependent: false, - ecConflicts: false, - ecEnabler: false, - ecSeparate: false, - ecPayflow: false - }; - $(enablerElement).classNames().each(function(className) { - switch (className) { - case "paypal-ec-conflicts": - enablerObj.ecConflicts = true; - case "paypal-ec-independent": - enablerObj.ecIndependent = true; - break; - case "paypal-ec-enabler": - enablerObj.ecEnabler = true; - enablerObj.ecIndependent = true; - break; - case "paypal-ec-separate": - enablerObj.ecSeparate = true; - enablerObj.ecIndependent = true; - break; - case "paypal-ec-pe": - enablerObj.ecPayflow = true; - break; - } - }); - enablerElement.enablerObject = enablerObj; - - Event.observe(enablerElement, "change", paypalConflictsObject.onChangeEnabler); - var enablerScopeElement = adminSystemConfig.getScopeElement(enablerElement); - if (enablerScopeElement) { - Event.observe(enablerScopeElement, "click", paypalConflictsObject.onClickEnablerScope); - } - }); - - // initially uncheck payflow - var isPayflowLinkEnabled = !!$$(".paypal-payflowlink")[0], - isPayflowAdvancedEnabled = !!$$(".paypal-payflow-advanced")[0]; - var ecPayflowEnabler = $$(".paypal-ec-payflow-enabler")[+isPayflowLinkEnabled]; - if (typeof ecPayflowEnabler != "undefined") { - if (ecPayflowEnabler.value == 1 && !isPayflowLinkEnabled) { - ecPayflowEnabler.value = 0; - fireEvent(ecPayflowEnabler, "change"); - } - - var ecPayflowScopeElement = adminSystemConfig.getScopeElement(ecPayflowEnabler); - if (ecPayflowScopeElement && !ecPayflowScopeElement.checked) { - $(ecPayflowScopeElement).click(); - } - } - $$(".paypal-bml").each(function(bmlEnabler) { - $(bmlEnabler).classNames().each(function(className) { - if (className.indexOf("requires-") !== -1) { - var required = $(className.replace("requires-", "")); - required.bmlEnabler = bmlEnabler; - Event.observe(required, "change", paypalConflictsObject.handleBmlEnabler); - } - }); - }); - - $$(".paypal-enabler").each(function(enablerElement) { - paypalConflictsObject.checkPaymentConflicts(enablerElement, "initial"); - paypalConflictsObject.toggleBmlEnabler(enablerElement); - }); - if (paypalConflictsObject.isConflict || paypalConflictsObject.ecMissed) { - var notification = \'' . - $this->escapeJsQuote( - __('The following error(s) occured:') - ) . - '\'; - if (paypalConflictsObject.isConflict) { - notification += "\\n " + \'' . - $this->escapeJsQuote( - __('Some PayPal solutions conflict.') - ) . - '\'; - } - if (paypalConflictsObject.ecMissed) { - notification += "\\n " + \'' . - $this->escapeJsQuote( - __('PayPal Express Checkout is not enabled.') - ) . '\'; - } - notification += "\\n" + \'' . - $this->escapeJsQuote( - __('Please re-enable the previously enabled payment solutions.') - ) . - '\'; - setTimeout(function() { - alert(notification); - }, 1); - } - - $$(".requires").each(function(dependent) { - var $dependent = $(dependent); - if ($dependent.hasClassName("paypal-ec-enabler") || $dependent.hasClassName("paypal-ec-payflow-enabler")) { - $dependent.requiresObj.callback = function(required) { - if ($(required).hasClassName("paypal-enabler") && required.value == 0) { - $dependent.disable(); - } - } - $dependent.requiresObj.requires.each(function(required) { - $dependent.requiresObj.callback(required); - }); - } - }); - - configForm.on(\'afterValidate\', function() { - var isPayflowLinkEnabled = !!$$(".paypal-payflowlink")[0], - isPayflowAdvancedEnabled = !!$$(".paypal-payflow-advanced")[0]; - var ecPayflowEnabler = $$(".paypal-ec-payflow-enabler")[+isPayflowLinkEnabled]; - if (typeof ecPayflowEnabler == "undefined") { - return; - } - var ecPayflowScopeElement = adminSystemConfig.getScopeElement(ecPayflowEnabler); - if ((typeof ecPayflowScopeElement == "undefined" || !ecPayflowScopeElement.checked) - && ecPayflowEnabler.value == 1 - ) { - $$(".paypal-ec-enabler").each(function(ecEnabler) { - ecEnabler.value = 0; - }); - } - }); - }); - - }); - '; - return parent::render($element) . $this->_jsHelper->getScript($js); - } -} diff --git a/app/code/Magento/Paypal/Block/Adminhtml/System/Config/Fieldset/Payment.php b/app/code/Magento/Paypal/Block/Adminhtml/System/Config/Fieldset/Payment.php deleted file mode 100644 index eb0d93cbb2d60..0000000000000 --- a/app/code/Magento/Paypal/Block/Adminhtml/System/Config/Fieldset/Payment.php +++ /dev/null @@ -1,148 +0,0 @@ -_backendConfig = $backendConfig; - parent::__construct($context, $authSession, $jsHelper, $data); - } - - /** - * Add custom css class - * - * @param \Magento\Framework\Data\Form\Element\AbstractElement $element - * @return string - */ - protected function _getFrontendClass($element) - { - $enabledString = $this->_isPaymentEnabled($element) ? ' enabled' : ''; - return parent::_getFrontendClass($element) . ' with-button' . $enabledString; - } - - /** - * Check whether current payment method is enabled - * - * @param \Magento\Framework\Data\Form\Element\AbstractElement $element - * @return bool - */ - protected function _isPaymentEnabled($element) - { - $groupConfig = $element->getGroup(); - $activityPaths = isset($groupConfig['activity_path']) ? $groupConfig['activity_path'] : []; - - if (!is_array($activityPaths)) { - $activityPaths = [$activityPaths]; - } - - $isPaymentEnabled = false; - foreach ($activityPaths as $activityPath) { - $isPaymentEnabled = $isPaymentEnabled - || (bool)(string)$this->_backendConfig->getConfigDataValue($activityPath); - } - - return $isPaymentEnabled; - } - - /** - * Return header title part of html for payment solution - * - * @param \Magento\Framework\Data\Form\Element\AbstractElement $element - * @return string - */ - protected function _getHeaderTitleHtml($element) - { - $html = '
' . $element->getLegend(); - - $groupConfig = $element->getGroup(); - - $html .= ''; - - if ($element->getComment()) { - $html .= '' . $element->getComment() . ''; - } - $html .= '
'; - - $disabledAttributeString = $this->_isPaymentEnabled($element) ? '' : ' disabled="disabled"'; - $disabledClassString = $this->_isPaymentEnabled($element) ? '' : ' disabled'; - $htmlId = $element->getHtmlId(); - $html .= '
'; - - if (!empty($groupConfig['more_url'])) { - $html .= '' . __( - 'Learn More' - ) . ''; - } - if (!empty($groupConfig['demo_url'])) { - $html .= '' . __( - 'View Demo' - ) . ''; - } - - $html .= '
'; - - return $html; - } - - /** - * Return header comment part of html for payment solution - * - * @param \Magento\Framework\Data\Form\Element\AbstractElement $element - * @return string - */ - protected function _getHeaderCommentHtml($element) - { - return ''; - } - - /** - * Get collapsed state on-load - * - * @param \Magento\Framework\Data\Form\Element\AbstractElement $element - * @return false - */ - protected function _isCollapseState($element) - { - return false; - } -} diff --git a/app/code/Magento/Paypal/Block/Adminhtml/System/Config/Payflowlink/Advanced.php b/app/code/Magento/Paypal/Block/Adminhtml/System/Config/Payflowlink/Advanced.php deleted file mode 100644 index 945e82a489d33..0000000000000 --- a/app/code/Magento/Paypal/Block/Adminhtml/System/Config/Payflowlink/Advanced.php +++ /dev/null @@ -1,19 +0,0 @@ -getRequest()->getParam('website') || $this->getRequest()->getParam('store') ? 5 : 4; - return $this->_decorateRowHtml($element, "" . $this->toHtml() . ''); - } -} diff --git a/app/code/Magento/Paypal/Block/Billing/Agreement/View.php b/app/code/Magento/Paypal/Block/Billing/Agreement/View.php deleted file mode 100644 index a6e0da3152ecf..0000000000000 --- a/app/code/Magento/Paypal/Block/Billing/Agreement/View.php +++ /dev/null @@ -1,248 +0,0 @@ -_helper = $helper; - $this->_orderCollectionFactory = $orderCollectionFactory; - $this->_customerSession = $customerSession; - $this->_orderConfig = $orderConfig; - $this->_coreRegistry = $registry; - $this->_agreementResource = $agreementResource; - parent::__construct($context, $data); - $this->_isScopePrivate = true; - } - - /** - * Retrieve related orders collection - * - * @return \Magento\Sales\Model\Resource\Order\Collection - */ - public function getRelatedOrders() - { - if (is_null($this->_relatedOrders)) { - $billingAgreement = $this->_getBillingAgreementInstance(); - $billingAgreementId = $billingAgreement ? $billingAgreement->getAgreementId() : 0; - $this->_relatedOrders = $this->_orderCollectionFactory->create()->addFieldToSelect( - '*' - )->addFieldToFilter( - 'customer_id', - (int)$this->_customerSession->getCustomerId() - )->addFieldToFilter( - 'status', - ['in' => $this->_orderConfig->getVisibleOnFrontStatuses()] - )->setOrder( - 'created_at', - 'desc' - ); - $this->_agreementResource->addOrdersFilter($this->_relatedOrders, $billingAgreementId); - } - return $this->_relatedOrders; - } - - /** - * Retrieve order item value by key - * - * @param \Magento\Sales\Model\Order $order - * @param string $key - * @return string - */ - public function getOrderItemValue(\Magento\Sales\Model\Order $order, $key) - { - $escape = true; - switch ($key) { - case 'order_increment_id': - $value = $order->getIncrementId(); - break; - case 'created_at': - $value = $this->formatDate($order->getCreatedAt(), 'short', true); - break; - case 'shipping_address': - $value = $order->getShippingAddress() ? $this->escapeHtml( - $order->getShippingAddress()->getName() - ) : __( - 'N/A' - ); - break; - case 'order_total': - $value = $order->formatPrice($order->getGrandTotal()); - $escape = false; - break; - case 'status_label': - $value = $order->getStatusLabel(); - break; - case 'view_url': - $value = $this->getUrl('sales/order/view', ['order_id' => $order->getId()]); - break; - default: - $value = $order->getData($key) ? $order->getData($key) : __('N/A'); - break; - } - return $escape ? $this->escapeHtml($value) : $value; - } - - /** - * Set pager - * - * @return $this - */ - protected function _prepareLayout() - { - parent::_prepareLayout(); - - $pager = $this->getLayout()->createBlock( - 'Magento\Theme\Block\Html\Pager' - )->setCollection( - $this->getRelatedOrders() - )->setIsOutputRequired( - false - ); - $this->setChild('pager', $pager); - $this->getRelatedOrders()->load(); - - return $this; - } - - /** - * Return current billing agreement. - * - * @return \Magento\Paypal\Model\Billing\Agreement|null - */ - protected function _getBillingAgreementInstance() - { - if (is_null($this->_billingAgreementInstance)) { - $this->_billingAgreementInstance = $this->_coreRegistry->registry('current_billing_agreement'); - } - return $this->_billingAgreementInstance; - } - - /** - * Load available billing agreement methods - * - * @return array - */ - protected function _loadPaymentMethods() - { - if (!$this->_paymentMethods) { - foreach ($this->_helper->getBillingAgreementMethods() as $paymentMethod) { - $this->_paymentMethods[$paymentMethod->getCode()] = $paymentMethod->getTitle(); - } - } - return $this->_paymentMethods; - } - - /** - * Set data to block - * - * @return string - */ - protected function _toHtml() - { - $this->_loadPaymentMethods(); - $this->setBackUrl($this->getUrl('*/billing_agreement/')); - $billingAgreement = $this->_getBillingAgreementInstance(); - if ($billingAgreement) { - $this->setReferenceId($billingAgreement->getReferenceId()); - - $this->setCanCancel($billingAgreement->canCancel()); - $this->setCancelUrl( - $this->getUrl( - '*/billing_agreement/cancel', - ['_current' => true, 'payment_method' => $billingAgreement->getMethodCode()] - ) - ); - - $paymentMethodTitle = $billingAgreement->getAgreementLabel(); - $this->setPaymentMethodTitle($paymentMethodTitle); - - $createdAt = $billingAgreement->getCreatedAt(); - $updatedAt = $billingAgreement->getUpdatedAt(); - $this->setAgreementCreatedAt($createdAt ? $this->formatDate($createdAt, 'short', true) : __('N/A')); - if ($updatedAt) { - $this->setAgreementUpdatedAt($this->formatDate($updatedAt, 'short', true)); - } - $this->setAgreementStatus($billingAgreement->getStatusLabel()); - } - - return parent::_toHtml(); - } -} diff --git a/app/code/Magento/Paypal/Block/Billing/Agreements.php b/app/code/Magento/Paypal/Block/Billing/Agreements.php deleted file mode 100644 index 3ae083ea39822..0000000000000 --- a/app/code/Magento/Paypal/Block/Billing/Agreements.php +++ /dev/null @@ -1,173 +0,0 @@ -_helper = $helper; - $this->_customerSession = $customerSession; - $this->_agreementCollection = $agreementCollection; - parent::__construct($context, $data); - $this->_isScopePrivate = true; - } - - /** - * Set Billing Agreement instance - * - * @return $this - */ - protected function _prepareLayout() - { - parent::_prepareLayout(); - $pager = $this->getLayout()->createBlock( - 'Magento\Theme\Block\Html\Pager' - )->setCollection( - $this->getBillingAgreements() - )->setIsOutputRequired( - false - ); - $this->setChild('pager', $pager)->setBackUrl($this->getUrl('customer/account/')); - $this->getBillingAgreements()->load(); - return $this; - } - - /** - * Retrieve billing agreements collection - * - * @return \Magento\Paypal\Model\Resource\Billing\Agreement\Collection - */ - public function getBillingAgreements() - { - if (is_null($this->_billingAgreements)) { - $this->_billingAgreements = $this->_agreementCollection->create()->addFieldToFilter( - 'customer_id', - $this->_customerSession->getCustomerId() - )->setOrder( - 'agreement_id', - 'desc' - ); - } - return $this->_billingAgreements; - } - - /** - * Retrieve item value by key - * - * @param \Magento\Framework\Object|\Magento\Paypal\Model\Billing\Agreement $item - * @param string $key - * @return string - */ - public function getItemValue(\Magento\Paypal\Model\Billing\Agreement $item, $key) - { - switch ($key) { - case 'created_at': - case 'updated_at': - $value = $item->getData($key) ? $this->formatDate($item->getData($key), 'short', true) : __('N/A'); - break; - case 'edit_url': - $value = $this->getUrl('*/billing_agreement/view', ['agreement' => $item->getAgreementId()]); - break; - case 'payment_method_label': - $label = $item->getAgreementLabel(); - $value = $label ? $label : __('N/A'); - break; - case 'status': - $value = $item->getStatusLabel(); - break; - default: - $value = $item->getData($key) ? $item->getData($key) : __('N/A'); - break; - } - return $this->escapeHtml($value); - } - - /** - * Load available billing agreement methods - * - * @return array - */ - protected function _loadPaymentMethods() - { - if (!$this->_paymentMethods) { - foreach ($this->_helper->getBillingAgreementMethods() as $paymentMethod) { - $this->_paymentMethods[$paymentMethod->getCode()] = $paymentMethod->getTitle(); - } - } - return $this->_paymentMethods; - } - - /** - * Retrieve wizard payment options array - * - * @return array - */ - public function getWizardPaymentMethodOptions() - { - $paymentMethodOptions = []; - foreach ($this->_helper->getBillingAgreementMethods() as $paymentMethod) { - if ($paymentMethod->getConfigData('allow_billing_agreement_wizard') == 1) { - $paymentMethodOptions[$paymentMethod->getCode()] = $paymentMethod->getTitle(); - } - } - return $paymentMethodOptions; - } - - /** - * Set data to block - * - * @return string - */ - protected function _toHtml() - { - $this->setCreateUrl($this->getUrl('*/billing_agreement/startWizard')); - return parent::_toHtml(); - } -} diff --git a/app/code/Magento/Paypal/Block/Bml/Banners.php b/app/code/Magento/Paypal/Block/Bml/Banners.php deleted file mode 100644 index 33b59da0a0afe..0000000000000 --- a/app/code/Magento/Paypal/Block/Bml/Banners.php +++ /dev/null @@ -1,61 +0,0 @@ -_section = isset($data['section']) ? (string)$data['section'] : ''; - $this->_position = isset($data['position']) ? (int)$data['position'] : 0; - $this->_paypalConfig = $paypalConfig; - parent::__construct($context, $data); - } - - /** - * Disable block output if banner turned off or PublisherId is miss - * - * @return string - */ - protected function _toHtml() - { - $publisherId = $this->_paypalConfig->getBmlPublisherId(); - $display = $this->_paypalConfig->getBmlDisplay($this->_section); - $position = $this->_paypalConfig->getBmlPosition($this->_section); - if (!$publisherId || $display == 0 || $this->_position != $position) { - return ''; - } - $this->setData('publisher_id', $publisherId); - $this->setData('size', $this->_paypalConfig->getBmlSize($this->_section)); - return parent::_toHtml(); - } -} diff --git a/app/code/Magento/Paypal/Block/Bml/Form.php b/app/code/Magento/Paypal/Block/Bml/Form.php deleted file mode 100644 index eeaa11d418958..0000000000000 --- a/app/code/Magento/Paypal/Block/Bml/Form.php +++ /dev/null @@ -1,37 +0,0 @@ -_config = $this->_paypalConfigFactory->create()->setMethod($this->getMethodCode()); - /** @var $mark \Magento\Framework\View\Element\Template */ - $mark = $this->_getMarkTemplate(); - $mark->setPaymentAcceptanceMarkHref( - 'https://www.securecheckout.billmelater.com/paycapture-content/' - . 'fetch?hash=AU826TU8&content=/bmlweb/ppwpsiw.html' - )->setPaymentAcceptanceMarkSrc('https://www.paypalobjects.com/en_US/i/logo/logo_BMLPP_90x34.gif') - ->setPaymentWhatIs(__('See terms')); - - $this->_initializeRedirectTemplateWithMark($mark); - } -} diff --git a/app/code/Magento/Paypal/Block/Bml/Shortcut.php b/app/code/Magento/Paypal/Block/Bml/Shortcut.php deleted file mode 100644 index d6cec550464f0..0000000000000 --- a/app/code/Magento/Paypal/Block/Bml/Shortcut.php +++ /dev/null @@ -1,179 +0,0 @@ -_paymentData = $paymentData; - $this->_mathRandom = $mathRandom; - $this->_shortcutValidator = $shortcutValidator; - - $this->_paymentMethodCode = $paymentMethodCode; - $this->_startAction = $startAction; - $this->_alias = $alias; - $this->setTemplate($shortcutTemplate); - $this->_bmlMethodCode = $bmlMethodCode; - parent::__construct($context, $data); - } - - /** - * @return \Magento\Framework\View\Element\AbstractBlock - */ - protected function _beforeToHtml() - { - $result = parent::_beforeToHtml(); - $isInCatalog = $this->getIsInCatalogProduct(); - if (!$this->_shortcutValidator->validate($this->_paymentMethodCode, $isInCatalog)) { - $this->_shouldRender = false; - return $result; - } - - /** @var \Magento\Paypal\Model\Express $method */ - $method = $this->_paymentData->getMethodInstance($this->_bmlMethodCode); - if (!$method->isAvailable()) { - $this->_shouldRender = false; - return $result; - } - - $this->setShortcutHtmlId($this->_mathRandom->getUniqueHash('ec_shortcut_bml_')) - ->setCheckoutUrl($this->getUrl($this->_startAction)) - ->setImageUrl(self::SHORTCUT_IMAGE) - ->setAdditionalLinkImage( - [ - 'href' => 'https://www.securecheckout.billmelater.com/paycapture-content/' - . 'fetch?hash=AU826TU8&content=/bmlweb/ppwpsiw.html', - 'src' => 'https://www.paypalobjects.com/webstatic/en_US/btn/btn_bml_text.png', - ] - ); - - return $result; - } - - /** - * Render the block if needed - * - * @return string - */ - protected function _toHtml() - { - if (!$this->_shouldRender) { - return ''; - } - return parent::_toHtml(); - } - - /** - * Check is "OR" label position before shortcut - * - * @return bool - */ - public function isOrPositionBefore() - { - return $this->getShowOrPosition() == CatalogBlock\ShortcutButtons::POSITION_BEFORE; - } - - /** - * Check is "OR" label position after shortcut - * - * @return bool - */ - public function isOrPositionAfter() - { - return $this->getShowOrPosition() == CatalogBlock\ShortcutButtons::POSITION_AFTER; - } - - /** - * Get shortcut alias - * - * @return string - */ - public function getAlias() - { - return $this->_alias; - } -} diff --git a/app/code/Magento/Paypal/Block/Checkout/Onepage/Success/BillingAgreement.php b/app/code/Magento/Paypal/Block/Checkout/Onepage/Success/BillingAgreement.php deleted file mode 100644 index cdb73a2ccbb27..0000000000000 --- a/app/code/Magento/Paypal/Block/Checkout/Onepage/Success/BillingAgreement.php +++ /dev/null @@ -1,74 +0,0 @@ -_checkoutSession = $checkoutSession; - $this->_customerSession = $customerSession; - $this->_agreementFactory = $agreementFactory; - parent::__construct($context, $data); - } - - /** - * Return billing agreement information - * - * @return string - */ - protected function _toHtml() - { - $agreementReferenceId = $this->_checkoutSession->getLastBillingAgreementReferenceId(); - $customerId = $this->_customerSession->getCustomerId(); - if (!$agreementReferenceId || !$customerId) { - return ''; - } - $agreement = $this->_agreementFactory->create()->load($agreementReferenceId, 'reference_id'); - if ($agreement->getId() && $customerId == $agreement->getCustomerId()) { - $this->addData( - [ - 'agreement_ref_id' => $agreement->getReferenceId(), - 'agreement_url' => $this->getUrl( - 'paypal/billing_agreement/view', - ['agreement' => $agreement->getId()] - ), - ] - ); - return parent::_toHtml(); - } - return ''; - } -} diff --git a/app/code/Magento/Paypal/Block/Express/Form.php b/app/code/Magento/Paypal/Block/Express/Form.php deleted file mode 100644 index bdc7f173eefad..0000000000000 --- a/app/code/Magento/Paypal/Block/Express/Form.php +++ /dev/null @@ -1,76 +0,0 @@ -_paypalData = $paypalData; - $this->currentCustomer = $currentCustomer; - parent::__construct($context, $paypalConfigFactory, $localeResolver, $data); - $this->_isScopePrivate = true; - } - - /** - * Set template and redirect message - * - * @return null - */ - protected function _construct() - { - $result = parent::_construct(); - $this->setRedirectMessage(__('You will be redirected to the PayPal website.')); - return $result; - } - - /** - * Get billing agreement code - * - * @return string|null - */ - public function getBillingAgreementCode() - { - $customerId = $this->currentCustomer->getCustomerId(); - return $this->_paypalData->shouldAskToCreateBillingAgreement($this->_config, $customerId) - ? \Magento\Paypal\Model\Express\Checkout::PAYMENT_INFO_TRANSPORT_BILLING_AGREEMENT : null; - } -} diff --git a/app/code/Magento/Paypal/Block/Express/Review.php b/app/code/Magento/Paypal/Block/Express/Review.php deleted file mode 100644 index f065f6fe116ea..0000000000000 --- a/app/code/Magento/Paypal/Block/Express/Review.php +++ /dev/null @@ -1,278 +0,0 @@ - - */ -class Review extends \Magento\Framework\View\Element\Template -{ - /** - * @var \Magento\Sales\Model\Quote - */ - protected $_quote; - - /** - * @var \Magento\Sales\Model\Quote\Address - */ - protected $_address; - - /** - * @var \Magento\Customer\Model\Address\Config - */ - protected $_addressConfig; - - /** - * Currently selected shipping rate - * - * @var \Magento\Sales\Model\Quote\Address\Rate - */ - protected $_currentShippingRate = null; - - /** - * Paypal controller path - * - * @var string - */ - protected $_controllerPath = 'paypal/express'; - - /** - * @var \Magento\Tax\Helper\Data - */ - protected $_taxHelper; - - /** - * @var PriceCurrencyInterface - */ - protected $priceCurrency; - - /** - * @param \Magento\Framework\View\Element\Template\Context $context - * @param \Magento\Tax\Helper\Data $taxHelper - * @param \Magento\Customer\Model\Address\Config $addressConfig - * @param PriceCurrencyInterface $priceCurrency - * @param array $data - */ - public function __construct( - \Magento\Framework\View\Element\Template\Context $context, - \Magento\Tax\Helper\Data $taxHelper, - \Magento\Customer\Model\Address\Config $addressConfig, - PriceCurrencyInterface $priceCurrency, - array $data = [] - ) { - $this->priceCurrency = $priceCurrency; - $this->_taxHelper = $taxHelper; - $this->_addressConfig = $addressConfig; - parent::__construct($context, $data); - } - - /** - * Quote object setter - * - * @param \Magento\Sales\Model\Quote $quote - * @return $this - */ - public function setQuote(\Magento\Sales\Model\Quote $quote) - { - $this->_quote = $quote; - return $this; - } - - /** - * Return quote billing address - * - * @return \Magento\Sales\Model\Quote\Address - */ - public function getBillingAddress() - { - return $this->_quote->getBillingAddress(); - } - - /** - * Return quote shipping address - * - * @return false|\Magento\Sales\Model\Quote\Address - */ - public function getShippingAddress() - { - if ($this->_quote->getIsVirtual()) { - return false; - } - return $this->_quote->getShippingAddress(); - } - - /** - * Get HTML output for specified address - * - * @param \Magento\Sales\Model\Quote\Address $address - * @return string - */ - public function renderAddress($address) - { - /** @var \Magento\Customer\Block\Address\Renderer\RendererInterface $renderer */ - $renderer = $this->_addressConfig->getFormatByCode('html')->getRenderer(); - $addressData = \Magento\Framework\Convert\ConvertArray::toFlatArray($address->getData()); - return $renderer->renderArray($addressData); - } - - /** - * Return carrier name from config, base on carrier code - * - * @param string $carrierCode - * @return string - */ - public function getCarrierName($carrierCode) - { - if ($name = $this->_scopeConfig->getValue("carriers/{$carrierCode}/title", \Magento\Store\Model\ScopeInterface::SCOPE_STORE)) { - return $name; - } - return $carrierCode; - } - - /** - * Get either shipping rate code or empty value on error - * - * @param \Magento\Framework\Object $rate - * @return string - */ - public function renderShippingRateValue(\Magento\Framework\Object $rate) - { - if ($rate->getErrorMessage()) { - return ''; - } - return $rate->getCode(); - } - - /** - * Get shipping rate code title and its price or error message - * - * @param \Magento\Framework\Object $rate - * @param string $format - * @param string $inclTaxFormat - * @return string - */ - public function renderShippingRateOption($rate, $format = '%s - %s%s', $inclTaxFormat = ' (%s %s)') - { - $renderedInclTax = ''; - if ($rate->getErrorMessage()) { - $price = $rate->getErrorMessage(); - } else { - $price = $this->_getShippingPrice( - $rate->getPrice(), - $this->_taxHelper->displayShippingPriceIncludingTax() - ); - - $incl = $this->_getShippingPrice($rate->getPrice(), true); - if ($incl != $price && $this->_taxHelper->displayShippingBothPrices()) { - $renderedInclTax = sprintf($inclTaxFormat, __('Incl. Tax'), $incl); - } - } - return sprintf($format, $this->escapeHtml($rate->getMethodTitle()), $price, $renderedInclTax); - } - - /** - * Getter for current shipping rate - * - * @return \Magento\Sales\Model\Quote\Address\Rate - */ - public function getCurrentShippingRate() - { - return $this->_currentShippingRate; - } - - /** - * Set controller path - * - * @param string $prefix - * @return void - */ - public function setControllerPath($prefix) - { - $this->_controllerPath = $prefix; - } - - /** - * Return formatted shipping price - * - * @param float $price - * @param bool $isInclTax - * @return string - */ - protected function _getShippingPrice($price, $isInclTax) - { - return $this->_formatPrice($this->_taxHelper->getShippingPrice($price, $isInclTax, $this->_address)); - } - - /** - * Format price base on store convert price method - * - * @param float $price - * @return string - */ - protected function _formatPrice($price) - { - return $this->priceCurrency->convertAndFormat( - $price, - true, - PriceCurrencyInterface::DEFAULT_PRECISION, - $this->_quote->getStore() - ); - } - - /** - * Retrieve payment method and assign additional template values - * - * @return $this - */ - protected function _beforeToHtml() - { - $methodInstance = $this->_quote->getPayment()->getMethodInstance(); - $this->setPaymentMethodTitle($methodInstance->getTitle()); - - $this->setShippingRateRequired(true); - if ($this->_quote->getIsVirtual()) { - $this->setShippingRateRequired(false); - } else { - // prepare shipping rates - $this->_address = $this->_quote->getShippingAddress(); - $groups = $this->_address->getGroupedAllShippingRates(); - if ($groups && $this->_address) { - $this->setShippingRateGroups($groups); - // determine current selected code & name - foreach ($groups as $code => $rates) { - foreach ($rates as $rate) { - if ($this->_address->getShippingMethod() == $rate->getCode()) { - $this->_currentShippingRate = $rate; - break 2; - } - } - } - } - - $canEditShippingAddress = $this->_quote->getMayEditShippingAddress() && $this->_quote->getPayment() - ->getAdditionalInformation(\Magento\Paypal\Model\Express\Checkout::PAYMENT_INFO_BUTTON) == 1; - // misc shipping parameters - $this->setShippingMethodSubmitUrl( - $this->getUrl("{$this->_controllerPath}/saveShippingMethod") - )->setCanEditShippingAddress( - $canEditShippingAddress - )->setCanEditShippingMethod( - $this->_quote->getMayEditShippingMethod() - ); - } - - $this->setEditUrl( - $this->getUrl("{$this->_controllerPath}/edit") - )->setPlaceOrderUrl( - $this->getUrl("{$this->_controllerPath}/placeOrder") - ); - - return parent::_beforeToHtml(); - } -} diff --git a/app/code/Magento/Paypal/Block/Express/Review/Billing.php b/app/code/Magento/Paypal/Block/Express/Review/Billing.php deleted file mode 100644 index 00a02a2a38ae3..0000000000000 --- a/app/code/Magento/Paypal/Block/Express/Review/Billing.php +++ /dev/null @@ -1,36 +0,0 @@ -_address)) { - if ($this->isCustomerLoggedIn() || $this->getQuote()->getBillingAddress()) { - $this->_address = $this->getQuote()->getBillingAddress(); - if (!$this->_address->getFirstname()) { - $this->_address->setFirstname($this->getQuote()->getCustomer()->getFirstname()); - } - if (!$this->_address->getLastname()) { - $this->_address->setLastname($this->getQuote()->getCustomer()->getLastname()); - } - } else { - $this->_address = $this->_addressFactory->create(); - } - } - - return $this->_address; - } -} diff --git a/app/code/Magento/Paypal/Block/Express/Review/Details.php b/app/code/Magento/Paypal/Block/Express/Review/Details.php deleted file mode 100644 index d35be1faeb07d..0000000000000 --- a/app/code/Magento/Paypal/Block/Express/Review/Details.php +++ /dev/null @@ -1,43 +0,0 @@ - - */ -class Details extends \Magento\Checkout\Block\Cart\Totals -{ - /** - * @var Address - */ - protected $_address; - - /** - * Return review shipping address - * - * @return Address - */ - public function getAddress() - { - if (empty($this->_address)) { - $this->_address = $this->getQuote()->getShippingAddress(); - } - return $this->_address; - } - - /** - * Return review quote totals - * - * @return array - */ - public function getTotals() - { - return $this->getQuote()->getTotals(); - } -} diff --git a/app/code/Magento/Paypal/Block/Express/Review/Shipping.php b/app/code/Magento/Paypal/Block/Express/Review/Shipping.php deleted file mode 100644 index d9e2ef804d073..0000000000000 --- a/app/code/Magento/Paypal/Block/Express/Review/Shipping.php +++ /dev/null @@ -1,30 +0,0 @@ -_address)) { - if ($this->isCustomerLoggedIn() || $this->getQuote()->getShippingAddress()) { - $this->_address = $this->getQuote()->getShippingAddress(); - } else { - $this->_address = $this->_addressFactory->create(); - } - } - - return $this->_address; - } -} diff --git a/app/code/Magento/Paypal/Block/Express/Shortcut.php b/app/code/Magento/Paypal/Block/Express/Shortcut.php deleted file mode 100644 index ec73f480ceed2..0000000000000 --- a/app/code/Magento/Paypal/Block/Express/Shortcut.php +++ /dev/null @@ -1,240 +0,0 @@ -_paypalData = $paypalData; - $this->_paypalConfigFactory = $paypalConfigFactory; - $this->_checkoutSession = $checkoutSession; - $this->_checkoutFactory = $checkoutFactory; - $this->_mathRandom = $mathRandom; - $this->_localeResolver = $localeResolver; - $this->_shortcutValidator = $shortcutValidator; - - $this->_paymentMethodCode = $paymentMethodCode; - $this->_startAction = $startAction; - $this->_checkoutType = $checkoutType; - $this->_alias = $alias; - $this->setTemplate($shortcutTemplate); - - parent::__construct($context, $data); - $this->_isScopePrivate = true; - $this->currentCustomer = $currentCustomer; - } - - /** - * @return \Magento\Framework\View\Element\AbstractBlock - */ - protected function _beforeToHtml() - { - $result = parent::_beforeToHtml(); - /** @var \Magento\Paypal\Model\Config $config */ - $config = $this->_paypalConfigFactory->create(); - $config->setMethod($this->_paymentMethodCode); - - $isInCatalog = $this->getIsInCatalogProduct(); - - if (!$this->_shortcutValidator->validate($this->_paymentMethodCode, $isInCatalog)) { - $this->_shouldRender = false; - return $result; - } - - $quote = $isInCatalog || !$this->_checkoutSession ? null : $this->_checkoutSession->getQuote(); - - // set misc data - $this->setShortcutHtmlId( - $this->_mathRandom->getUniqueHash('ec_shortcut_') - )->setCheckoutUrl( - $this->getUrl($this->_startAction) - ); - - // use static image if in catalog - if ($isInCatalog || null === $quote) { - $this->setImageUrl($config->getExpressCheckoutShortcutImageUrl($this->_localeResolver->getLocaleCode())); - } else { - /**@todo refactor checkout model. Move getCheckoutShortcutImageUrl to helper or separate model */ - $parameters = ['params' => ['quote' => $quote, 'config' => $config]]; - $checkoutModel = $this->_checkoutFactory->create($this->_checkoutType, $parameters); - $this->setImageUrl($checkoutModel->getCheckoutShortcutImageUrl()); - } - - // ask whether to create a billing agreement - $customerId = $this->currentCustomer->getCustomerId(); // potential issue for caching - if ($this->_paypalData->shouldAskToCreateBillingAgreement($config, $customerId)) { - $this->setConfirmationUrl( - $this->getUrl( - $this->_startAction, - [\Magento\Paypal\Model\Express\Checkout::PAYMENT_INFO_TRANSPORT_BILLING_AGREEMENT => 1] - ) - ); - $this->setConfirmationMessage( - __('Would you like to sign a billing agreement ' . 'to streamline further purchases with PayPal?') - ); - } - - return $result; - } - - /** - * Render the block if needed - * - * @return string - */ - protected function _toHtml() - { - if (!$this->_shouldRender) { - return ''; - } - return parent::_toHtml(); - } - - /** - * Check is "OR" label position before shortcut - * - * @return bool - */ - public function isOrPositionBefore() - { - return $this->getShowOrPosition() == CatalogBlock\ShortcutButtons::POSITION_BEFORE; - } - - /** - * Check is "OR" label position after shortcut - * - * @return bool - */ - public function isOrPositionAfter() - { - return $this->getShowOrPosition() == CatalogBlock\ShortcutButtons::POSITION_AFTER; - } - - /** - * Get shortcut alias - * - * @return string - */ - public function getAlias() - { - return $this->_alias; - } -} diff --git a/app/code/Magento/Paypal/Block/Hosted/Pro/Form.php b/app/code/Magento/Paypal/Block/Hosted/Pro/Form.php deleted file mode 100644 index 140655ea12a20..0000000000000 --- a/app/code/Magento/Paypal/Block/Hosted/Pro/Form.php +++ /dev/null @@ -1,18 +0,0 @@ - - */ -class Form extends \Magento\Payment\Block\Form -{ - /** - * @var string - */ - protected $_template = 'hss/info.phtml'; -} diff --git a/app/code/Magento/Paypal/Block/Hosted/Pro/Iframe.php b/app/code/Magento/Paypal/Block/Hosted/Pro/Iframe.php deleted file mode 100644 index f746ff60196c8..0000000000000 --- a/app/code/Magento/Paypal/Block/Hosted/Pro/Iframe.php +++ /dev/null @@ -1,35 +0,0 @@ - - */ -class Iframe extends \Magento\Paypal\Block\Iframe -{ - /** - * Internal constructor - * Set payment method code - * - * @return void - */ - protected function _construct() - { - parent::_construct(); - $this->_paymentMethodCode = \Magento\Paypal\Model\Config::METHOD_HOSTEDPRO; - } - - /** - * Get iframe action URL - * - * @return string - */ - public function getFrameActionUrl() - { - return $this->_getOrder()->getPayment()->getAdditionalInformation('secure_form_url'); - } -} diff --git a/app/code/Magento/Paypal/Block/Hosted/Pro/Info.php b/app/code/Magento/Paypal/Block/Hosted/Pro/Info.php deleted file mode 100644 index 588b5c57549f0..0000000000000 --- a/app/code/Magento/Paypal/Block/Hosted/Pro/Info.php +++ /dev/null @@ -1,24 +0,0 @@ - - */ -namespace Magento\Paypal\Block\Hosted\Pro; - -class Info extends \Magento\Paypal\Block\Payment\Info -{ - /** - * Don't show CC type - * - * @return false - */ - public function getCcTypeName() - { - return false; - } -} diff --git a/app/code/Magento/Paypal/Block/Iframe.php b/app/code/Magento/Paypal/Block/Iframe.php deleted file mode 100644 index e8b36d74092e2..0000000000000 --- a/app/code/Magento/Paypal/Block/Iframe.php +++ /dev/null @@ -1,261 +0,0 @@ -_hssHelper = $hssHelper; - $this->_orderFactory = $orderFactory; - $this->_checkoutSession = $checkoutSession; - parent::__construct($context, $data); - $this->_isScopePrivate = true; - } - - /** - * Internal constructor - * - * @return void - */ - protected function _construct() - { - parent::_construct(); - $paymentCode = $this->_getCheckout()->getQuote()->getPayment()->getMethod(); - if (in_array($paymentCode, $this->_hssHelper->getHssMethods())) { - $this->_paymentMethodCode = $paymentCode; - $templatePath = str_replace('_', '', $paymentCode); - $templateFile = "{$templatePath}/iframe.phtml"; - - $directory = $this->_filesystem->getDirectoryRead(DirectoryList::MODULES); - $file = $this->_viewFileSystem->getTemplateFileName($templateFile, ['module' => 'Magento_Paypal']); - if ($file && $directory->isExist($directory->getRelativePath($file))) { - $this->setTemplate($templateFile); - } else { - $this->setTemplate('hss/iframe.phtml'); - } - } - } - - /** - * Get current block instance - * - * @return \Magento\Payment\Block\Form - * @throws \Magento\Framework\Model\Exception - */ - protected function _getBlock() - { - if (!$this->_block) { - $this->_block = $this->getLayout()->createBlock( - 'Magento\\Paypal\\Block\\' . str_replace( - ' ', - '\\', - ucwords(str_replace('_', ' ', $this->_paymentMethodCode)) - ) . '\\Iframe' - ); - if (!$this->_block instanceof \Magento\Paypal\Block\Iframe) { - throw new \Magento\Framework\Model\Exception('Invalid block type'); - } - } - - return $this->_block; - } - - /** - * Get order object - * - * @return \Magento\Sales\Model\Order - */ - protected function _getOrder() - { - if (!$this->_order) { - $incrementId = $this->_getCheckout()->getLastRealOrderId(); - $this->_order = $this->_orderFactory->create()->loadByIncrementId($incrementId); - } - return $this->_order; - } - - /** - * Get frontend checkout session object - * - * @return \Magento\Checkout\Model\Session - */ - protected function _getCheckout() - { - return $this->_checkoutSession; - } - - /** - * Before rendering html, check if is block rendering needed - * - * @return \Magento\Framework\View\Element\AbstractBlock - */ - protected function _beforeToHtml() - { - if ($this->_getOrder()->getId() && - $this->_getOrder()->getQuoteId() == $this->_getCheckout()->getLastQuoteId() && - $this->_paymentMethodCode - ) { - $this->_shouldRender = true; - } - - if ($this->getGotoSection() || $this->getGotoSuccessPage()) { - $this->_shouldRender = true; - } - - return parent::_beforeToHtml(); - } - - /** - * Render the block if needed - * - * @return string - */ - protected function _toHtml() - { - if ($this->_isAfterPaymentSave()) { - $this->setTemplate('hss/js.phtml'); - return parent::_toHtml(); - } - if (!$this->_shouldRender) { - return ''; - } - return parent::_toHtml(); - } - - /** - * Check whether block is rendering after save payment - * - * @return bool - */ - protected function _isAfterPaymentSave() - { - $quote = $this->_getCheckout()->getQuote(); - if ($quote->getPayment()->getMethod() == $this->_paymentMethodCode && - $quote->getIsActive() && - $this->getTemplate() && - $this->getRequest()->getActionName() == 'savePayment' - ) { - return true; - } - - return false; - } - - /** - * Get iframe action URL - * - * @return string - */ - public function getFrameActionUrl() - { - return $this->_getBlock()->getFrameActionUrl(); - } - - /** - * Get secure token - * - * @return string - */ - public function getSecureToken() - { - return $this->_getBlock()->getSecureToken(); - } - - /** - * Get secure token ID - * - * @return string - */ - public function getSecureTokenId() - { - return $this->_getBlock()->getSecureTokenId(); - } - - /** - * Get payflow transaction URL - * - * @return string - */ - public function getTransactionUrl() - { - return $this->_getBlock()->getTransactionUrl(); - } - - /** - * Check sandbox mode - * - * @return bool - */ - public function isTestMode() - { - return $this->_getBlock()->isTestMode(); - } -} diff --git a/app/code/Magento/Paypal/Block/Logo.php b/app/code/Magento/Paypal/Block/Logo.php deleted file mode 100644 index 7c38d775b9a55..0000000000000 --- a/app/code/Magento/Paypal/Block/Logo.php +++ /dev/null @@ -1,76 +0,0 @@ -_paypalConfig = $paypalConfig; - $this->_localeResolver = $localeResolver; - parent::__construct($context, $data); - } - - /** - * Return URL for Paypal Landing page - * - * @return string - */ - public function getAboutPaypalPageUrl() - { - return $this->_getConfig()->getPaymentMarkWhatIsPaypalUrl($this->_localeResolver); - } - - /** - * Getter for paypal config - * - * @return \Magento\Paypal\Model\Config - */ - protected function _getConfig() - { - return $this->_paypalConfig; - } - - /** - * Disable block output if logo turned off - *M - * @return string - */ - protected function _toHtml() - { - $type = $this->getLogoType(); - // assigned in layout etc. - $logoUrl = $this->_getConfig()->getAdditionalOptionsLogoUrl($this->_localeResolver->getLocaleCode(), $type); - if (!$logoUrl) { - return ''; - } - $this->setLogoImageUrl($logoUrl); - return parent::_toHtml(); - } -} diff --git a/app/code/Magento/Paypal/Block/Payflow/Advanced/Form.php b/app/code/Magento/Paypal/Block/Payflow/Advanced/Form.php deleted file mode 100644 index 25109d08dfad8..0000000000000 --- a/app/code/Magento/Paypal/Block/Payflow/Advanced/Form.php +++ /dev/null @@ -1,28 +0,0 @@ - - */ -class Form extends \Magento\Paypal\Block\Payflow\Link\Form -{ - /** - * @var string - */ - protected $_template = 'payflowadvanced/info.phtml'; - - /** - * Get frame action URL - * - * @return string - */ - public function getFrameActionUrl() - { - return $this->getUrl('paypal/payflowadvanced/form', ['_secure' => true]); - } -} diff --git a/app/code/Magento/Paypal/Block/Payflow/Advanced/Iframe.php b/app/code/Magento/Paypal/Block/Payflow/Advanced/Iframe.php deleted file mode 100644 index b6d6a4b7f8f0a..0000000000000 --- a/app/code/Magento/Paypal/Block/Payflow/Advanced/Iframe.php +++ /dev/null @@ -1,69 +0,0 @@ - - */ -class Iframe extends \Magento\Paypal\Block\Payflow\Link\Iframe -{ - /** - * @param \Magento\Framework\View\Element\Template\Context $context - * @param \Magento\Sales\Model\OrderFactory $orderFactory - * @param \Magento\Checkout\Model\Session $checkoutSession - * @param \Magento\Paypal\Helper\Hss $hssHelper - * @param \Magento\Payment\Helper\Data $paymentData - * @param array $data - */ - public function __construct( - \Magento\Framework\View\Element\Template\Context $context, - \Magento\Sales\Model\OrderFactory $orderFactory, - \Magento\Checkout\Model\Session $checkoutSession, - \Magento\Paypal\Helper\Hss $hssHelper, - \Magento\Payment\Helper\Data $paymentData, - array $data = [] - ) { - parent::__construct($context, $orderFactory, $checkoutSession, $hssHelper, $paymentData, $data); - $this->_isScopePrivate = false; - } - - /** - * Set payment method code - * - * @return void - */ - protected function _construct() - { - parent::_construct(); - $this->_paymentMethodCode = \Magento\Paypal\Model\Config::METHOD_PAYFLOWADVANCED; - } - - /** - * Get frame action URL - * - * @return string - */ - public function getFrameActionUrl() - { - return $this->getUrl('paypal/payflowadvanced/form', ['_secure' => true]); - } - - /** - * Check sandbox mode - * - * @return bool - */ - public function isTestMode() - { - $mode = $this->_paymentData->getMethodInstance( - \Magento\Paypal\Model\Config::METHOD_PAYFLOWADVANCED - )->getConfigData( - 'sandbox_flag' - ); - return (bool)$mode; - } -} diff --git a/app/code/Magento/Paypal/Block/Payflow/Advanced/Info.php b/app/code/Magento/Paypal/Block/Payflow/Advanced/Info.php deleted file mode 100644 index def3203ba4ab9..0000000000000 --- a/app/code/Magento/Paypal/Block/Payflow/Advanced/Info.php +++ /dev/null @@ -1,15 +0,0 @@ - - */ -namespace Magento\Paypal\Block\Payflow\Advanced; - -class Info extends \Magento\Paypal\Block\Payflow\Link\Info -{ -} diff --git a/app/code/Magento/Paypal/Block/Payflow/Advanced/Review.php b/app/code/Magento/Paypal/Block/Payflow/Advanced/Review.php deleted file mode 100644 index cd5e45dfc924f..0000000000000 --- a/app/code/Magento/Paypal/Block/Payflow/Advanced/Review.php +++ /dev/null @@ -1,16 +0,0 @@ - - */ -namespace Magento\Paypal\Block\Payflow\Advanced; - -class Review extends \Magento\Paypal\Block\Payflow\Link\Review -{ -} diff --git a/app/code/Magento/Paypal/Block/Payflow/Bml/Form.php b/app/code/Magento/Paypal/Block/Payflow/Bml/Form.php deleted file mode 100644 index 11145c9956534..0000000000000 --- a/app/code/Magento/Paypal/Block/Payflow/Bml/Form.php +++ /dev/null @@ -1,18 +0,0 @@ - - */ -class Form extends \Magento\Payment\Block\Form -{ - /** - * @var string - */ - protected $_template = 'payflowlink/info.phtml'; - - /** - * Get frame action URL - * - * @return string - */ - public function getFrameActionUrl() - { - return $this->getUrl('paypal/payflow/form', ['_secure' => true]); - } -} diff --git a/app/code/Magento/Paypal/Block/Payflow/Link/Iframe.php b/app/code/Magento/Paypal/Block/Payflow/Link/Iframe.php deleted file mode 100644 index e1cf84e664bd7..0000000000000 --- a/app/code/Magento/Paypal/Block/Payflow/Link/Iframe.php +++ /dev/null @@ -1,100 +0,0 @@ -_paymentData = $paymentData; - parent::__construct($context, $orderFactory, $checkoutSession, $hssHelper, $data); - } - - /** - * Set payment method code - * - * @return void - */ - protected function _construct() - { - parent::_construct(); - $this->_paymentMethodCode = \Magento\Paypal\Model\Config::METHOD_PAYFLOWLINK; - } - - /** - * Get frame action URL - * - * @return string - */ - public function getFrameActionUrl() - { - return $this->getUrl('paypal/payflow/form', ['_secure' => true]); - } - - /** - * Get secure token - * - * @return string - */ - public function getSecureToken() - { - return $this->_getOrder()->getPayment()->getAdditionalInformation('secure_token'); - } - - /** - * Get secure token ID - * - * @return string - */ - public function getSecureTokenId() - { - return $this->_getOrder()->getPayment()->getAdditionalInformation('secure_token_id'); - } - - /** - * Get payflow transaction URL - * - * @return string - */ - public function getTransactionUrl() - { - return \Magento\Paypal\Model\Payflowlink::TRANSACTION_PAYFLOW_URL; - } - - /** - * Check sandbox mode - * - * @return bool - */ - public function isTestMode() - { - $mode = $this->_paymentData->getMethodInstance($this->_paymentMethodCode)->getConfigData('sandbox_flag'); - return (bool)$mode; - } -} diff --git a/app/code/Magento/Paypal/Block/Payflow/Link/Info.php b/app/code/Magento/Paypal/Block/Payflow/Link/Info.php deleted file mode 100644 index 598fdf2703240..0000000000000 --- a/app/code/Magento/Paypal/Block/Payflow/Link/Info.php +++ /dev/null @@ -1,24 +0,0 @@ - - */ -namespace Magento\Paypal\Block\Payflow\Link; - -class Info extends \Magento\Paypal\Block\Payment\Info -{ - /** - * Don't show CC type - * - * @return false - */ - public function getCcTypeName() - { - return false; - } -} diff --git a/app/code/Magento/Paypal/Block/Payflow/Link/Review.php b/app/code/Magento/Paypal/Block/Payflow/Link/Review.php deleted file mode 100644 index 09fb9fdbcc87c..0000000000000 --- a/app/code/Magento/Paypal/Block/Payflow/Link/Review.php +++ /dev/null @@ -1,25 +0,0 @@ - - */ -namespace Magento\Paypal\Block\Payflow\Link; - -class Review extends \Magento\Paypal\Block\Express\Review -{ - /** - * Retrieve payment method and assign additional template values - * - * @return \Magento\Paypal\Block\Express\Review - */ - protected function _beforeToHtml() - { - return parent::_beforeToHtml(); - } -} diff --git a/app/code/Magento/Paypal/Block/PayflowExpress/Form.php b/app/code/Magento/Paypal/Block/PayflowExpress/Form.php deleted file mode 100644 index dc860b9877805..0000000000000 --- a/app/code/Magento/Paypal/Block/PayflowExpress/Form.php +++ /dev/null @@ -1,24 +0,0 @@ -_agreementFactory = $agreementFactory; - parent::__construct($context, $data); - $this->_isScopePrivate = true; - } - - /** - * @return void - */ - protected function _construct() - { - parent::_construct(); - - $this->setTransportName( - \Magento\Paypal\Model\Payment\Method\Billing\AbstractAgreement::TRANSPORT_BILLING_AGREEMENT_ID - ); - } - - /** - * Retrieve available customer billing agreements - * - * @return array - */ - public function getBillingAgreements() - { - $data = []; - /** @var \Magento\Sales\Model\Quote $quote */ - $quote = $this->getParentBlock()->getQuote(); - if (!$quote || !$quote->getCustomerId()) { - return $data; - } - $collection = $this->_agreementFactory->create()->getAvailableCustomerBillingAgreements( - $quote->getCustomerId() - ); - - foreach ($collection as $item) { - $data[$item->getId()] = $item->getReferenceId(); - } - return $data; - } -} diff --git a/app/code/Magento/Paypal/Block/Payment/Info.php b/app/code/Magento/Paypal/Block/Payment/Info.php deleted file mode 100644 index 2cd1866ddae2d..0000000000000 --- a/app/code/Magento/Paypal/Block/Payment/Info.php +++ /dev/null @@ -1,64 +0,0 @@ -_paypalInfoFactory = $paypalInfoFactory; - parent::__construct($context, $paymentConfig, $data); - } - - /** - * Don't show CC type for non-CC methods - * - * @return string|null - */ - public function getCcTypeName() - { - if (\Magento\Paypal\Model\Config::getIsCreditCardMethod($this->getInfo()->getMethod())) { - return parent::getCcTypeName(); - } - } - - /** - * Prepare PayPal-specific payment information - * - * @param \Magento\Framework\Object|array|null $transport - * @return \Magento\Framework\Object - */ - protected function _prepareSpecificInformation($transport = null) - { - $transport = parent::_prepareSpecificInformation($transport); - $payment = $this->getInfo(); - $paypalInfo = $this->_paypalInfoFactory->create(); - if (!$this->getIsSecureMode()) { - $info = $paypalInfo->getPaymentInfo($payment, true); - } else { - $info = $paypalInfo->getPublicPaymentInfo($payment, true); - } - return $transport->addData($info); - } -} diff --git a/app/code/Magento/Paypal/Block/Payment/Info/Billing/Agreement.php b/app/code/Magento/Paypal/Block/Payment/Info/Billing/Agreement.php deleted file mode 100644 index 9bbbfcc87f27e..0000000000000 --- a/app/code/Magento/Paypal/Block/Payment/Info/Billing/Agreement.php +++ /dev/null @@ -1,32 +0,0 @@ -_paymentSpecificInformation) { - return $this->_paymentSpecificInformation; - } - $info = $this->getInfo(); - $referenceID = $info->getAdditionalInformation( - \Magento\Paypal\Model\Payment\Method\Billing\AbstractAgreement::PAYMENT_INFO_REFERENCE_ID - ); - $transport = new \Magento\Framework\Object([(string)__('Reference ID') => $referenceID]); - $transport = parent::_prepareSpecificInformation($transport); - - return $transport; - } -} diff --git a/app/code/Magento/Paypal/Block/Standard/Form.php b/app/code/Magento/Paypal/Block/Standard/Form.php deleted file mode 100644 index 997a2a2148038..0000000000000 --- a/app/code/Magento/Paypal/Block/Standard/Form.php +++ /dev/null @@ -1,116 +0,0 @@ -_paypalConfigFactory = $paypalConfigFactory; - $this->_localeResolver = $localeResolver; - parent::__construct($context, $data); - } - - /** - * Set template and redirect message - * - * @return null - */ - protected function _construct() - { - $this->_config = $this->_paypalConfigFactory->create()->setMethod($this->getMethodCode()); - $mark = $this->_getMarkTemplate(); - $mark->setPaymentAcceptanceMarkHref( - $this->_config->getPaymentMarkWhatIsPaypalUrl($this->_localeResolver) - )->setPaymentAcceptanceMarkSrc( - $this->_config->getPaymentMarkImageUrl($this->_localeResolver->getLocaleCode()) - ); - - // known issue: code above will render only static mark image - $this->_initializeRedirectTemplateWithMark($mark); - return parent::_construct(); - } - - /** - * Payment method code getter - * - * @return string - */ - public function getMethodCode() - { - return $this->_methodCode; - } - - /** - * Get initialized mark template - * - * @return \Magento\Framework\View\Element\Template - */ - protected function _getMarkTemplate() - { - /** @var $mark \Magento\Framework\View\Element\Template */ - $mark = $this->_layout->createBlock('Magento\Framework\View\Element\Template'); - $mark->setTemplate( - 'Magento_Paypal::payment/mark.phtml' - ); - return $mark; - } - - /** - * Initializes redirect template and set mark - * @param \Magento\Framework\View\Element\Template $mark - * - * @return void - */ - protected function _initializeRedirectTemplateWithMark(\Magento\Framework\View\Element\Template $mark) - { - $this->setTemplate( - 'Magento_Paypal::payment/redirect.phtml' - )->setRedirectMessage( - __('You will be redirected to the PayPal website when you place an order.') - )->setMethodTitle( - // Output PayPal mark, omit title - '' - )->setMethodLabelAfterHtml( - $mark->toHtml() - ); - } -} diff --git a/app/code/Magento/Paypal/Block/Standard/Redirect.php b/app/code/Magento/Paypal/Block/Standard/Redirect.php deleted file mode 100644 index 08911092c1cb0..0000000000000 --- a/app/code/Magento/Paypal/Block/Standard/Redirect.php +++ /dev/null @@ -1,90 +0,0 @@ -_formFactory = $formFactory; - $this->_elementFactory = $elementFactory; - $this->_paypalStandardFactory = $paypalStandardFactory; - $this->mathRandom = $mathRandom; - parent::__construct($context, $data); - } - - /** - * @return string - */ - protected function _toHtml() - { - $standard = $this->_paypalStandardFactory->create(); - - $form = $this->_formFactory->create(); - $form->setAction( - $standard->getConfig()->getPaypalUrl() - )->setId( - 'paypal_standard_checkout' - )->setName( - 'paypal_standard_checkout' - )->setMethod( - 'POST' - )->setUseContainer( - true - ); - foreach ($standard->getStandardCheckoutFormFields() as $field => $value) { - $form->addField($field, 'hidden', ['name' => $field, 'value' => $value]); - } - $idSuffix = $this->mathRandom->getUniqueHash(); - $submitButton = $this->_elementFactory->create( - 'submit', - ['data' => ['value' => __('Click here if you are not redirected within 10 seconds.')]] - ); - $id = "submit_to_paypal_button_{$idSuffix}"; - $submitButton->setId($id); - $form->addElement($submitButton); - $html = ''; - $html .= __('You will be redirected to the PayPal website in a few seconds.'); - $html .= $form->toHtml(); - $html .= ''; - - return $html; - } -} diff --git a/app/code/Magento/Paypal/Controller/Adminhtml/Billing/Agreement.php b/app/code/Magento/Paypal/Controller/Adminhtml/Billing/Agreement.php deleted file mode 100644 index a64521454695b..0000000000000 --- a/app/code/Magento/Paypal/Controller/Adminhtml/Billing/Agreement.php +++ /dev/null @@ -1,67 +0,0 @@ -_coreRegistry = $coreRegistry; - parent::__construct($context); - } - - /** - * Initialize billing agreement by ID specified in request - * - * @return \Magento\Paypal\Model\Billing\Agreement|false - */ - protected function _initBillingAgreement() - { - $agreementId = $this->getRequest()->getParam('agreement'); - $agreementModel = $this->_objectManager->create('Magento\Paypal\Model\Billing\Agreement')->load($agreementId); - - if (!$agreementModel->getId()) { - $this->messageManager->addError(__('Please specify the correct billing agreement ID and try again.')); - return false; - } - - $this->_coreRegistry->register('current_billing_agreement', $agreementModel); - return $agreementModel; - } - - /** - * Check currently called action by permissions for current user - * - * @return bool - */ - protected function _isAllowed() - { - switch ($this->getRequest()->getActionName()) { - case 'index': - case 'grid': - case 'view': - return $this->_authorization->isAllowed('Magento_Paypal::billing_agreement_actions_view'); - case 'cancel': - case 'delete': - return $this->_authorization->isAllowed('Magento_Paypal::actions_manage'); - default: - return $this->_authorization->isAllowed('Magento_Paypal::billing_agreement'); - } - } -} diff --git a/app/code/Magento/Paypal/Controller/Adminhtml/Billing/Agreement/Cancel.php b/app/code/Magento/Paypal/Controller/Adminhtml/Billing/Agreement/Cancel.php deleted file mode 100644 index ae36bdd5b1794..0000000000000 --- a/app/code/Magento/Paypal/Controller/Adminhtml/Billing/Agreement/Cancel.php +++ /dev/null @@ -1,35 +0,0 @@ -_initBillingAgreement(); - - if ($agreementModel && $agreementModel->canCancel()) { - try { - $agreementModel->cancel(); - $this->messageManager->addSuccess(__('You canceled the billing agreement.')); - $this->_redirect('paypal/*/view', ['_current' => true]); - return; - } catch (\Magento\Framework\Model\Exception $e) { - $this->messageManager->addError($e->getMessage()); - } catch (\Exception $e) { - $this->messageManager->addError(__('We could not cancel the billing agreement.')); - $this->_objectManager->get('Magento\Framework\Logger')->logException($e); - } - $this->_redirect('paypal/*/view', ['_current' => true]); - } - return $this->_redirect('paypal/*/'); - } -} diff --git a/app/code/Magento/Paypal/Controller/Adminhtml/Billing/Agreement/CustomerGrid.php b/app/code/Magento/Paypal/Controller/Adminhtml/Billing/Agreement/CustomerGrid.php deleted file mode 100644 index 823b8efb33dab..0000000000000 --- a/app/code/Magento/Paypal/Controller/Adminhtml/Billing/Agreement/CustomerGrid.php +++ /dev/null @@ -1,35 +0,0 @@ -getRequest()->getParam('id'); - if ($customerId) { - $this->_coreRegistry->register('current_customer_id', $customerId); - } - return $this; - } - - /** - * Customer billing agreements ajax action - * - * @return void - */ - public function execute() - { - $this->_initCustomer(); - $this->_view->loadLayout(false); - $this->_view->renderLayout(); - } -} diff --git a/app/code/Magento/Paypal/Controller/Adminhtml/Billing/Agreement/Delete.php b/app/code/Magento/Paypal/Controller/Adminhtml/Billing/Agreement/Delete.php deleted file mode 100644 index 3d1989a216201..0000000000000 --- a/app/code/Magento/Paypal/Controller/Adminhtml/Billing/Agreement/Delete.php +++ /dev/null @@ -1,35 +0,0 @@ -_initBillingAgreement(); - - if ($agreementModel) { - try { - $agreementModel->delete(); - $this->messageManager->addSuccess(__('You deleted the billing agreement.')); - $this->_redirect('paypal/*/'); - return; - } catch (\Magento\Framework\Model\Exception $e) { - $this->messageManager->addError($e->getMessage()); - } catch (\Exception $e) { - $this->messageManager->addError(__('We could not delete the billing agreement.')); - $this->_objectManager->get('Magento\Framework\Logger')->logException($e); - } - $this->_redirect('paypal/*/view', ['_current' => true]); - } - $this->_redirect('paypal/*/'); - } -} diff --git a/app/code/Magento/Paypal/Controller/Adminhtml/Billing/Agreement/Grid.php b/app/code/Magento/Paypal/Controller/Adminhtml/Billing/Agreement/Grid.php deleted file mode 100644 index 53bb395e4b5a7..0000000000000 --- a/app/code/Magento/Paypal/Controller/Adminhtml/Billing/Agreement/Grid.php +++ /dev/null @@ -1,20 +0,0 @@ -_view->loadLayout(false); - $this->_view->renderLayout(); - } -} diff --git a/app/code/Magento/Paypal/Controller/Adminhtml/Billing/Agreement/Index.php b/app/code/Magento/Paypal/Controller/Adminhtml/Billing/Agreement/Index.php deleted file mode 100644 index 6a8c05e0220da..0000000000000 --- a/app/code/Magento/Paypal/Controller/Adminhtml/Billing/Agreement/Index.php +++ /dev/null @@ -1,22 +0,0 @@ -_view->loadLayout(); - $this->_setActiveMenu('Magento_Paypal::paypal_billing_agreement'); - $this->_view->getPage()->getConfig()->getTitle()->prepend(__('Billing Agreements')); - $this->_view->renderLayout(); - } -} diff --git a/app/code/Magento/Paypal/Controller/Adminhtml/Billing/Agreement/OrdersGrid.php b/app/code/Magento/Paypal/Controller/Adminhtml/Billing/Agreement/OrdersGrid.php deleted file mode 100644 index d7074c0e489ca..0000000000000 --- a/app/code/Magento/Paypal/Controller/Adminhtml/Billing/Agreement/OrdersGrid.php +++ /dev/null @@ -1,21 +0,0 @@ -_initBillingAgreement(); - $this->_view->loadLayout(false); - $this->_view->renderLayout(); - } -} diff --git a/app/code/Magento/Paypal/Controller/Adminhtml/Billing/Agreement/View.php b/app/code/Magento/Paypal/Controller/Adminhtml/Billing/Agreement/View.php deleted file mode 100644 index 2021e89d8665d..0000000000000 --- a/app/code/Magento/Paypal/Controller/Adminhtml/Billing/Agreement/View.php +++ /dev/null @@ -1,33 +0,0 @@ -_initBillingAgreement(); - - if ($agreementModel) { - $this->_view->loadLayout(); - $this->_setActiveMenu('Magento_Paypal::paypal_billing_agreement'); - $this->_view->getPage()->getConfig()->getTitle()->prepend( - sprintf("#%s", $agreementModel->getReferenceId()) - ); - $this->_view->getPage()->getConfig()->getTitle()->prepend(__('Billing Agreements')); - $this->_view->renderLayout(); - return; - } - - $this->_redirect('paypal/*/'); - return; - } -} diff --git a/app/code/Magento/Paypal/Controller/Adminhtml/Paypal/Reports.php b/app/code/Magento/Paypal/Controller/Adminhtml/Paypal/Reports.php deleted file mode 100644 index e764c773c4a69..0000000000000 --- a/app/code/Magento/Paypal/Controller/Adminhtml/Paypal/Reports.php +++ /dev/null @@ -1,96 +0,0 @@ -_coreRegistry = $coreRegistry; - $this->_rowFactory = $rowFactory; - $this->_settlementFactory = $settlementFactory; - $this->_logger = $logger; - parent::__construct($context); - } - - /** - * Initialize titles, navigation - * - * @return $this - */ - protected function _initAction() - { - $this->_view->loadLayout(); - $this->_setActiveMenu( - 'Magento_Paypal::report_salesroot_paypal_settlement_reports' - )->_addBreadcrumb( - __('Reports'), - __('Reports') - )->_addBreadcrumb( - __('Sales'), - __('Sales') - )->_addBreadcrumb( - __('PayPal Settlement Reports'), - __('PayPal Settlement Reports') - ); - $this->_view->getPage()->getConfig()->getTitle()->prepend(__('PayPal Settlement Reports')); - return $this; - } - - /** - * ACL check - * - * @return bool - */ - protected function _isAllowed() - { - switch ($this->getRequest()->getActionName()) { - case 'index': - case 'details': - return $this->_authorization->isAllowed('Magento_Paypal::paypal_settlement_reports_view'); - case 'fetch': - return $this->_authorization->isAllowed('Magento_Paypal::fetch'); - default: - return $this->_authorization->isAllowed('Magento_Paypal::paypal_settlement_reports'); - } - } -} diff --git a/app/code/Magento/Paypal/Controller/Adminhtml/Paypal/Reports/Details.php b/app/code/Magento/Paypal/Controller/Adminhtml/Paypal/Reports/Details.php deleted file mode 100644 index a1025706e8b37..0000000000000 --- a/app/code/Magento/Paypal/Controller/Adminhtml/Paypal/Reports/Details.php +++ /dev/null @@ -1,34 +0,0 @@ -getRequest()->getParam('id'); - $row = $this->_rowFactory->create()->load($rowId); - if (!$row->getId()) { - $this->_redirect('adminhtml/*/'); - return; - } - $this->_coreRegistry->register('current_transaction', $row); - $this->_initAction(); - $this->_view->getPage()->getConfig()->getTitle()->prepend(__('View Transaction')); - $this->_addContent( - $this->_view->getLayout()->createBlock( - 'Magento\Paypal\Block\Adminhtml\Settlement\Details', - 'settlementDetails' - ) - ); - $this->_view->renderLayout(); - } -} diff --git a/app/code/Magento/Paypal/Controller/Adminhtml/Paypal/Reports/Fetch.php b/app/code/Magento/Paypal/Controller/Adminhtml/Paypal/Reports/Fetch.php deleted file mode 100644 index a89d4e5d01fff..0000000000000 --- a/app/code/Magento/Paypal/Controller/Adminhtml/Paypal/Reports/Fetch.php +++ /dev/null @@ -1,52 +0,0 @@ -_settlementFactory->create(); - /* @var $reports \Magento\Paypal\Model\Report\Settlement */ - $credentials = $reports->getSftpCredentials(); - if (empty($credentials)) { - throw new \Magento\Framework\Model\Exception(__('We found nothing to fetch because of an empty configuration.')); - } - foreach ($credentials as $config) { - try { - $fetched = $reports->fetchAndSave( - \Magento\Paypal\Model\Report\Settlement::createConnection($config) - ); - $this->messageManager->addSuccess( - __( - "We fetched %1 report rows from '%2@%3'.", - $fetched, - $config['username'], - $config['hostname'] - ) - ); - } catch (\Exception $e) { - $this->messageManager->addError( - __("We couldn't fetch reports from '%1@%2'.", $config['username'], $config['hostname']) - ); - $this->_logger->logException($e); - } - } - } catch (\Magento\Framework\Model\Exception $e) { - $this->messageManager->addError($e->getMessage()); - } catch (\Exception $e) { - $this->_logger->logException($e); - } - $this->_redirect('*/*/index'); - } -} diff --git a/app/code/Magento/Paypal/Controller/Adminhtml/Paypal/Reports/Grid.php b/app/code/Magento/Paypal/Controller/Adminhtml/Paypal/Reports/Grid.php deleted file mode 100644 index 9910b3e92f606..0000000000000 --- a/app/code/Magento/Paypal/Controller/Adminhtml/Paypal/Reports/Grid.php +++ /dev/null @@ -1,20 +0,0 @@ -_view->loadLayout(false); - $this->_view->renderLayout(); - } -} diff --git a/app/code/Magento/Paypal/Controller/Adminhtml/Paypal/Reports/Index.php b/app/code/Magento/Paypal/Controller/Adminhtml/Paypal/Reports/Index.php deleted file mode 100644 index c1b4e33bbe86d..0000000000000 --- a/app/code/Magento/Paypal/Controller/Adminhtml/Paypal/Reports/Index.php +++ /dev/null @@ -1,20 +0,0 @@ -_initAction(); - $this->_view->renderLayout(); - } -} diff --git a/app/code/Magento/Paypal/Controller/Billing/Agreement.php b/app/code/Magento/Paypal/Controller/Billing/Agreement.php deleted file mode 100644 index 853852173e3a4..0000000000000 --- a/app/code/Magento/Paypal/Controller/Billing/Agreement.php +++ /dev/null @@ -1,83 +0,0 @@ -_coreRegistry = $coreRegistry; - parent::__construct($context); - } - - /** - * Check customer authentication - * - * @param RequestInterface $request - * @return \Magento\Framework\App\ResponseInterface - */ - public function dispatch(RequestInterface $request) - { - if (!$request->isDispatched()) { - return parent::dispatch($request); - } - if (!$this->_getSession()->authenticate($this)) { - $this->_actionFlag->set('', 'no-dispatch', true); - } - return parent::dispatch($request); - } - - /** - * Init billing agreement model from request - * - * @return \Magento\Paypal\Model\Billing\Agreement|false - */ - protected function _initAgreement() - { - $agreementId = $this->getRequest()->getParam('agreement'); - if ($agreementId) { - /** @var \Magento\Paypal\Model\Billing\Agreement $billingAgreement */ - $billingAgreement = $this->_objectManager->create('Magento\Paypal\Model\Billing\Agreement') - ->load($agreementId); - $currentCustomerId = $this->_getSession()->getCustomerId(); - $agreementCustomerId = $billingAgreement->getCustomerId(); - if ($billingAgreement->getId() && $agreementCustomerId == $currentCustomerId) { - $this->_coreRegistry->register('current_billing_agreement', $billingAgreement); - return $billingAgreement; - } - } - $this->messageManager->addError(__('Please specify the correct billing agreement ID and try again.')); - $this->_redirect('*/*/'); - return false; - } - - /** - * Retrieve customer session model - * - * @return \Magento\Customer\Model\Session - */ - protected function _getSession() - { - return $this->_objectManager->get('Magento\Customer\Model\Session'); - } -} diff --git a/app/code/Magento/Paypal/Controller/Billing/Agreement/Cancel.php b/app/code/Magento/Paypal/Controller/Billing/Agreement/Cancel.php deleted file mode 100644 index 19498688c58bb..0000000000000 --- a/app/code/Magento/Paypal/Controller/Billing/Agreement/Cancel.php +++ /dev/null @@ -1,37 +0,0 @@ -_initAgreement(); - if (!$agreement) { - return; - } - if ($agreement->canCancel()) { - try { - $agreement->cancel(); - $this->messageManager->addNotice( - __('The billing agreement "%1" has been canceled.', $agreement->getReferenceId()) - ); - } catch (\Magento\Framework\Model\Exception $e) { - $this->messageManager->addError($e->getMessage()); - } catch (\Exception $e) { - $this->_objectManager->get('Magento\Framework\Logger')->logException($e); - $this->messageManager->addError(__('We couldn\'t cancel the billing agreement.')); - } - } - $this->_redirect('*/*/view', ['_current' => true]); - } -} diff --git a/app/code/Magento/Paypal/Controller/Billing/Agreement/CancelWizard.php b/app/code/Magento/Paypal/Controller/Billing/Agreement/CancelWizard.php deleted file mode 100644 index a0b720f16f8aa..0000000000000 --- a/app/code/Magento/Paypal/Controller/Billing/Agreement/CancelWizard.php +++ /dev/null @@ -1,19 +0,0 @@ -_redirect('*/*/index'); - } -} diff --git a/app/code/Magento/Paypal/Controller/Billing/Agreement/Index.php b/app/code/Magento/Paypal/Controller/Billing/Agreement/Index.php deleted file mode 100644 index efd63ffd6c9a7..0000000000000 --- a/app/code/Magento/Paypal/Controller/Billing/Agreement/Index.php +++ /dev/null @@ -1,22 +0,0 @@ -_view->loadLayout(); - $this->_view->getPage()->getConfig()->getTitle()->prepend(__('Billing Agreements')); - $this->_view->getLayout()->initMessages(); - $this->_view->renderLayout(); - } -} diff --git a/app/code/Magento/Paypal/Controller/Billing/Agreement/ReturnWizard.php b/app/code/Magento/Paypal/Controller/Billing/Agreement/ReturnWizard.php deleted file mode 100644 index a5dae10ca8ad5..0000000000000 --- a/app/code/Magento/Paypal/Controller/Billing/Agreement/ReturnWizard.php +++ /dev/null @@ -1,47 +0,0 @@ -_objectManager->create('Magento\Paypal\Model\Billing\Agreement'); - $paymentCode = $this->getRequest()->getParam('payment_method'); - $token = $this->getRequest()->getParam('token'); - if ($token && $paymentCode) { - try { - $agreement->setStoreId( - $this->_objectManager->get('Magento\Store\Model\StoreManager')->getStore()->getId() - )->setToken( - $token - )->setMethodCode( - $paymentCode - )->setCustomerId( - $this->_getSession()->getCustomerId() - )->place(); - - $this->messageManager->addSuccess( - __('The billing agreement "%1" has been created.', $agreement->getReferenceId()) - ); - $this->_redirect('*/*/view', ['agreement' => $agreement->getId()]); - return; - } catch (\Magento\Framework\Model\Exception $e) { - $this->messageManager->addError($e->getMessage()); - } catch (\Exception $e) { - $this->_objectManager->get('Magento\Framework\Logger')->logException($e); - $this->messageManager->addError(__('We couldn\'t finish the billing agreement wizard.')); - } - $this->_redirect('*/*/index'); - } - } -} diff --git a/app/code/Magento/Paypal/Controller/Billing/Agreement/StartWizard.php b/app/code/Magento/Paypal/Controller/Billing/Agreement/StartWizard.php deleted file mode 100644 index ed39ccf6763dd..0000000000000 --- a/app/code/Magento/Paypal/Controller/Billing/Agreement/StartWizard.php +++ /dev/null @@ -1,44 +0,0 @@ -_objectManager->create('Magento\Paypal\Model\Billing\Agreement'); - $paymentCode = $this->getRequest()->getParam('payment_method'); - if ($paymentCode) { - try { - $agreement->setStoreId( - $this->_objectManager->get('Magento\Store\Model\StoreManager')->getStore()->getId() - )->setMethodCode( - $paymentCode - )->setReturnUrl( - $this->_objectManager->create( - 'Magento\Framework\UrlInterface' - )->getUrl('*/*/returnWizard', ['payment_method' => $paymentCode]) - )->setCancelUrl( - $this->_objectManager->create('Magento\Framework\UrlInterface') - ->getUrl('*/*/cancelWizard', ['payment_method' => $paymentCode]) - ); - - return $this->getResponse()->setRedirect($agreement->initToken()); - } catch (\Magento\Framework\Model\Exception $e) { - $this->messageManager->addError($e->getMessage()); - } catch (\Exception $e) { - $this->_objectManager->get('Magento\Framework\Logger')->logException($e); - $this->messageManager->addError(__('We couldn\'t start the billing agreement wizard.')); - } - } - $this->_redirect('*/*/'); - } -} diff --git a/app/code/Magento/Paypal/Controller/Billing/Agreement/View.php b/app/code/Magento/Paypal/Controller/Billing/Agreement/View.php deleted file mode 100644 index 566d414c67963..0000000000000 --- a/app/code/Magento/Paypal/Controller/Billing/Agreement/View.php +++ /dev/null @@ -1,32 +0,0 @@ -_initAgreement())) { - return; - } - $this->_view->loadLayout(); - $this->_view->getPage()->getConfig()->getTitle()->prepend(__('Billing Agreements')); - $this->_view->getPage()->getConfig()->getTitle()->prepend( - __('Billing Agreement # %1', $agreement->getReferenceId()) - ); - $this->_view->getLayout()->initMessages(); - $navigationBlock = $this->_view->getLayout()->getBlock('customer_account_navigation'); - if ($navigationBlock) { - $navigationBlock->setActive('paypal/billing_agreement/'); - } - $this->_view->renderLayout(); - } -} diff --git a/app/code/Magento/Paypal/Controller/Bml/Start.php b/app/code/Magento/Paypal/Controller/Bml/Start.php deleted file mode 100644 index 4f41c8ec75c82..0000000000000 --- a/app/code/Magento/Paypal/Controller/Bml/Start.php +++ /dev/null @@ -1,27 +0,0 @@ -_forward( - 'start', - 'payflowexpress', - 'paypal', - [ - 'bml' => 1, - 'button' => $this->getRequest()->getParam('button') - ] - ); - } -} diff --git a/app/code/Magento/Paypal/Controller/Express/AbstractExpress.php b/app/code/Magento/Paypal/Controller/Express/AbstractExpress.php deleted file mode 100644 index d0e51d5cfd51f..0000000000000 --- a/app/code/Magento/Paypal/Controller/Express/AbstractExpress.php +++ /dev/null @@ -1,266 +0,0 @@ -_customerSession = $customerSession; - $this->_checkoutSession = $checkoutSession; - $this->_orderFactory = $orderFactory; - $this->_checkoutFactory = $checkoutFactory; - $this->_paypalSession = $paypalSession; - $this->_urlHelper = $urlHelper; - $this->_customerUrl = $customerUrl; - parent::__construct($context); - $parameters = ['params' => [$this->_configMethod]]; - $this->_config = $this->_objectManager->create($this->_configType, $parameters); - } - - /** - * Instantiate quote and checkout - * - * @return void - * @throws \Magento\Framework\Model\Exception - */ - protected function _initCheckout() - { - $quote = $this->_getQuote(); - if (!$quote->hasItems() || $quote->getHasError()) { - $this->getResponse()->setHeader('HTTP/1.1', '403 Forbidden'); - throw new \Magento\Framework\Model\Exception(__('We can\'t initialize Express Checkout.')); - } - if (!isset($this->_checkoutTypes[$this->_checkoutType])) { - $parameters = [ - 'params' => [ - 'quote' => $quote, - 'config' => $this->_config, - ], - ]; - $this->_checkoutTypes[$this->_checkoutType] = $this->_checkoutFactory - ->create($this->_checkoutType, $parameters); - } - $this->_checkout = $this->_checkoutTypes[$this->_checkoutType]; - } - - /** - * Search for proper checkout token in request or session or (un)set specified one - * Combined getter/setter - * - * @param string|null $setToken - * @return $this|string - * @throws \Magento\Framework\Model\Exception - */ - protected function _initToken($setToken = null) - { - if (null !== $setToken) { - if (false === $setToken) { - // security measure for avoid unsetting token twice - if (!$this->_getSession()->getExpressCheckoutToken()) { - throw new \Magento\Framework\Model\Exception(__('PayPal Express Checkout Token does not exist.')); - } - $this->_getSession()->unsExpressCheckoutToken(); - } else { - $this->_getSession()->setExpressCheckoutToken($setToken); - } - return $this; - } - $setToken = $this->getRequest()->getParam('token'); - if ($setToken) { - if ($setToken !== $this->_getSession()->getExpressCheckoutToken()) { - throw new \Magento\Framework\Model\Exception(__('A wrong PayPal Express Checkout Token is specified.')); - } - } else { - $setToken = $this->_getSession()->getExpressCheckoutToken(); - } - return $setToken; - } - - /** - * PayPal session instance getter - * - * @return \Magento\Framework\Session\Generic - */ - protected function _getSession() - { - return $this->_paypalSession; - } - - /** - * Return checkout session object - * - * @return \Magento\Checkout\Model\Session - */ - protected function _getCheckoutSession() - { - return $this->_checkoutSession; - } - - /** - * Return checkout quote object - * - * @return \Magento\Sales\Model\Quote - */ - protected function _getQuote() - { - if (!$this->_quote) { - $this->_quote = $this->_getCheckoutSession()->getQuote(); - } - return $this->_quote; - } - - /** - * Returns before_auth_url redirect parameter for customer session - * @return null - */ - public function getCustomerBeforeAuthUrl() - { - return; - } - - /** - * Returns a list of action flags [flag_key] => boolean - * @return array - */ - public function getActionFlagList() - { - return []; - } - - /** - * Returns login url parameter for redirect - * @return string - */ - public function getLoginUrl() - { - return $this->_customerUrl->getLoginUrl(); - } - - /** - * Returns action name which requires redirect - * @return string - */ - public function getRedirectActionName() - { - return 'start'; - } - - /** - * Redirect to login page - * - * @return void - */ - public function redirectLogin() - { - $this->_actionFlag->set('', 'no-dispatch', true); - $this->_customerSession->setBeforeAuthUrl($this->_redirect->getRefererUrl()); - $this->getResponse()->setRedirect( - $this->_urlHelper->addRequestParam($this->_customerUrl->getLoginUrl(), ['context' => 'checkout']) - ); - } -} diff --git a/app/code/Magento/Paypal/Controller/Express/AbstractExpress/Cancel.php b/app/code/Magento/Paypal/Controller/Express/AbstractExpress/Cancel.php deleted file mode 100644 index d6ca046590a6a..0000000000000 --- a/app/code/Magento/Paypal/Controller/Express/AbstractExpress/Cancel.php +++ /dev/null @@ -1,44 +0,0 @@ -_initToken(false); - // TODO verify if this logic of order cancellation is deprecated - // if there is an order - cancel it - $orderId = $this->_getCheckoutSession()->getLastOrderId(); - /** @var \Magento\Sales\Model\Order $order */ - $order = $orderId ? $this->_orderFactory->create()->load($orderId) : false; - if ($order && $order->getId() && $order->getQuoteId() == $this->_getCheckoutSession()->getQuoteId()) { - $order->cancel()->save(); - $this->_getCheckoutSession() - ->unsLastQuoteId() - ->unsLastSuccessQuoteId() - ->unsLastOrderId() - ->unsLastRealOrderId(); - $this->messageManager->addSuccess(__('Express Checkout and Order have been canceled.')); - } else { - $this->messageManager->addSuccess(__('Express Checkout has been canceled.')); - } - } catch (\Magento\Framework\Model\Exception $e) { - $this->messageManager->addError($e->getMessage()); - } catch (\Exception $e) { - $this->messageManager->addError(__('Unable to cancel Express Checkout')); - $this->_objectManager->get('Magento\Framework\Logger')->logException($e); - } - - $this->_redirect('checkout/cart'); - } -} diff --git a/app/code/Magento/Paypal/Controller/Express/AbstractExpress/Edit.php b/app/code/Magento/Paypal/Controller/Express/AbstractExpress/Edit.php deleted file mode 100644 index f3ca92eba6622..0000000000000 --- a/app/code/Magento/Paypal/Controller/Express/AbstractExpress/Edit.php +++ /dev/null @@ -1,24 +0,0 @@ -getResponse()->setRedirect($this->_config->getExpressCheckoutEditUrl($this->_initToken())); - } catch (\Magento\Framework\Model\Exception $e) { - $this->messageManager->addError($e->getMessage()); - $this->_redirect('*/*/review'); - } - } -} diff --git a/app/code/Magento/Paypal/Controller/Express/AbstractExpress/PlaceOrder.php b/app/code/Magento/Paypal/Controller/Express/AbstractExpress/PlaceOrder.php deleted file mode 100644 index a7e9070526777..0000000000000 --- a/app/code/Magento/Paypal/Controller/Express/AbstractExpress/PlaceOrder.php +++ /dev/null @@ -1,132 +0,0 @@ -_objectManager->get('Magento\Checkout\Model\Agreements\AgreementsValidator'); - if (!$agreementsValidator->isValid(array_keys($this->getRequest()->getPost('agreement', [])))) { - throw new \Magento\Framework\Model\Exception( - __('Please agree to all the terms and conditions before placing the order.') - ); - } - - $this->_initCheckout(); - $this->_checkout->place($this->_initToken()); - - // prepare session to success or cancellation page - $this->_getCheckoutSession()->clearHelperData(); - - // "last successful quote" - $quoteId = $this->_getQuote()->getId(); - $this->_getCheckoutSession()->setLastQuoteId($quoteId)->setLastSuccessQuoteId($quoteId); - - // an order may be created - $order = $this->_checkout->getOrder(); - if ($order) { - $this->_getCheckoutSession()->setLastOrderId($order->getId()) - ->setLastRealOrderId($order->getIncrementId()); - } - - $this->_eventManager->dispatch( - 'paypal_express_place_order_success', - [ - 'order' => $order, - 'quote' => $this->_getQuote() - ] - ); - - // redirect if PayPal specified some URL (for example, to Giropay bank) - $url = $this->_checkout->getRedirectUrl(); - if ($url) { - $this->getResponse()->setRedirect($url); - return; - } - $this->_initToken(false); // no need in token anymore - $this->_redirect('checkout/onepage/success'); - return; - } catch (ApiProcessableException $e) { - $this->_processPaypalApiError($e); - } catch (\Magento\Framework\Model\Exception $e) { - $this->messageManager->addError($e->getMessage()); - $this->_redirect('*/*/review'); - } catch (\Exception $e) { - $this->messageManager->addError(__('We can\'t place the order.')); - $this->_objectManager->get('Magento\Framework\Logger')->logException($e); - $this->_redirect('*/*/review'); - } - } - - /** - * Process PayPal API's processable errors - * - * @param \Magento\Paypal\Model\Api\ProcessableException $exception - * @return void - */ - protected function _processPaypalApiError($exception) - { - switch ($exception->getCode()) { - case ApiProcessableException::API_MAX_PAYMENT_ATTEMPTS_EXCEEDED: - case ApiProcessableException::API_TRANSACTION_EXPIRED: - $this->getResponse()->setRedirect( - $this->_getQuote()->getPayment()->getCheckoutRedirectUrl() - ); - break; - case ApiProcessableException::API_DO_EXPRESS_CHECKOUT_FAIL: - $this->_redirectSameToken(); - break; - case ApiProcessableException::API_UNABLE_TRANSACTION_COMPLETE: - if ($this->_config->getPaymentAction() == \Magento\Payment\Model\Method\AbstractMethod::ACTION_ORDER) { - $paypalTransactionData = $this->_getCheckoutSession()->getPaypalTransactionData(); - $this->getResponse()->setRedirect( - $this->_config->getExpressCheckoutOrderUrl($paypalTransactionData['transaction_id']) - ); - } else { - $this->_redirectSameToken(); - } - break; - default: - $this->_redirectToCartAndShowError($exception->getUserMessage()); - break; - } - } - - /** - * Redirect customer back to PayPal with the same token - * - * @return void - */ - protected function _redirectSameToken() - { - $token = $this->_initToken(); - $this->getResponse()->setRedirect( - $this->_config->getExpressCheckoutStartUrl($token) - ); - } - - /** - * Redirect customer to shopping cart and show error message - * - * @param string $errorMessage - * @return void - */ - protected function _redirectToCartAndShowError($errorMessage) - { - $this->messageManager->addError($errorMessage); - $this->_redirect('checkout/cart'); - } -} diff --git a/app/code/Magento/Paypal/Controller/Express/AbstractExpress/ReturnAction.php b/app/code/Magento/Paypal/Controller/Express/AbstractExpress/ReturnAction.php deleted file mode 100644 index 1fe28348bb392..0000000000000 --- a/app/code/Magento/Paypal/Controller/Express/AbstractExpress/ReturnAction.php +++ /dev/null @@ -1,41 +0,0 @@ -getRequest()->getParam('retry_authorization') == 'true' - && is_array($this->_getCheckoutSession()->getPaypalTransactionData()) - ) { - $this->_forward('placeOrder'); - return; - } - try { - $this->_getCheckoutSession()->unsPaypalTransactionData(); - $this->_initCheckout(); - $this->_checkout->returnFromPaypal($this->_initToken()); - if ($this->_checkout->canSkipOrderReviewStep()) { - $this->_forward('placeOrder'); - } else { - $this->_redirect('*/*/review'); - } - return; - } catch (\Magento\Framework\Model\Exception $e) { - $this->messageManager->addError($e->getMessage()); - } catch (\Exception $e) { - $this->messageManager->addError(__('We can\'t process Express Checkout approval.')); - $this->_objectManager->get('Magento\Framework\Logger')->logException($e); - } - $this->_redirect('checkout/cart'); - } -} diff --git a/app/code/Magento/Paypal/Controller/Express/AbstractExpress/Review.php b/app/code/Magento/Paypal/Controller/Express/AbstractExpress/Review.php deleted file mode 100644 index c12f7ad74866e..0000000000000 --- a/app/code/Magento/Paypal/Controller/Express/AbstractExpress/Review.php +++ /dev/null @@ -1,40 +0,0 @@ -_initCheckout(); - $this->_checkout->prepareOrderReview($this->_initToken()); - $this->_view->loadLayout(); - $this->_view->getLayout()->initMessages(); - $reviewBlock = $this->_view->getLayout()->getBlock('paypal.express.review'); - $reviewBlock->setQuote($this->_getQuote()); - $reviewBlock->getChildBlock('details')->setQuote($this->_getQuote()); - if ($reviewBlock->getChildBlock('shipping_method')) { - $reviewBlock->getChildBlock('shipping_method')->setQuote($this->_getQuote()); - } - $this->_view->renderLayout(); - return; - } catch (\Magento\Framework\Model\Exception $e) { - $this->messageManager->addError($e->getMessage()); - } catch (\Exception $e) { - $this->messageManager->addError( - __('We can\'t initialize Express Checkout review.') - ); - $this->_objectManager->get('Magento\Framework\Logger')->logException($e); - } - $this->_redirect('checkout/cart'); - } -} diff --git a/app/code/Magento/Paypal/Controller/Express/AbstractExpress/SaveShippingMethod.php b/app/code/Magento/Paypal/Controller/Express/AbstractExpress/SaveShippingMethod.php deleted file mode 100644 index 9d53989cb02ed..0000000000000 --- a/app/code/Magento/Paypal/Controller/Express/AbstractExpress/SaveShippingMethod.php +++ /dev/null @@ -1,44 +0,0 @@ -getRequest()->getParam('isAjax'); - $this->_initCheckout(); - $this->_checkout->updateShippingMethod($this->getRequest()->getParam('shipping_method')); - if ($isAjax) { - $this->_view->loadLayout('paypal_express_review_details', true, true, false); - $this->getResponse()->setBody( - $this->_view->getLayout()->getBlock('page.block')->setQuote($this->_getQuote())->toHtml() - ); - return; - } - } catch (\Magento\Framework\Model\Exception $e) { - $this->messageManager->addError($e->getMessage()); - } catch (\Exception $e) { - $this->messageManager->addError(__('We can\'t update shipping method.')); - $this->_objectManager->get('Magento\Framework\Logger')->logException($e); - } - if ($isAjax) { - $this->getResponse()->setBody( - '' - ); - } else { - $this->_redirect('*/*/review'); - } - } -} diff --git a/app/code/Magento/Paypal/Controller/Express/AbstractExpress/ShippingOptionsCallback.php b/app/code/Magento/Paypal/Controller/Express/AbstractExpress/ShippingOptionsCallback.php deleted file mode 100644 index 16fd60b63923e..0000000000000 --- a/app/code/Magento/Paypal/Controller/Express/AbstractExpress/ShippingOptionsCallback.php +++ /dev/null @@ -1,67 +0,0 @@ -quoteRepository = $quoteRepository; - parent::__construct( - $context, - $customerSession, - $checkoutSession, - $orderFactory, - $checkoutFactory, - $paypalSession, - $urlHelper, - $customerUrl - ); - } - - /** - * Return shipping options items for shipping address from request - * - * @return void - */ - public function execute() - { - try { - $quoteId = $this->getRequest()->getParam('quote_id'); - $this->_quote = $this->quoteRepository->get($quoteId); - $this->_initCheckout(); - $response = $this->_checkout->getShippingOptionsCallbackResponse($this->getRequest()->getParams()); - $this->getResponse()->setBody($response); - } catch (\Exception $e) { - $this->_objectManager->get('Magento\Framework\Logger')->logException($e); - } - } -} diff --git a/app/code/Magento/Paypal/Controller/Express/AbstractExpress/Start.php b/app/code/Magento/Paypal/Controller/Express/AbstractExpress/Start.php deleted file mode 100644 index a8f2082a89623..0000000000000 --- a/app/code/Magento/Paypal/Controller/Express/AbstractExpress/Start.php +++ /dev/null @@ -1,89 +0,0 @@ -_initCheckout(); - - if ($this->_getQuote()->getIsMultiShipping()) { - $this->_getQuote()->setIsMultiShipping(false); - $this->_getQuote()->removeAllAddresses(); - } - - $customerData = $this->_customerSession->getCustomerDataObject(); - $quoteCheckoutMethod = $this->_getQuote()->getCheckoutMethod(); - if ($customerData->getId()) { - $this->_checkout->setCustomerWithAddressChange( - $customerData, - $this->_getQuote()->getBillingAddress(), - $this->_getQuote()->getShippingAddress() - ); - } elseif ((!$quoteCheckoutMethod || $quoteCheckoutMethod != Onepage::METHOD_REGISTER) - && !$this->_objectManager->get('Magento\Checkout\Helper\Data')->isAllowedGuestCheckout( - $this->_getQuote(), - $this->_getQuote()->getStoreId() - ) - ) { - $this->messageManager->addNotice( - __('To proceed to Checkout, please log in using your email address.') - ); - - $this->_objectManager->get('Magento\Checkout\Helper\ExpressRedirect')->redirectLogin($this); - $this->_customerSession->setBeforeAuthUrl($this->_url->getUrl('*/*/*', ['_current' => true])); - - return; - } - - // billing agreement - $isBaRequested = (bool)$this->getRequest() - ->getParam(\Magento\Paypal\Model\Express\Checkout::PAYMENT_INFO_TRANSPORT_BILLING_AGREEMENT); - if ($customerData->getId()) { - $this->_checkout->setIsBillingAgreementRequested($isBaRequested); - } - - // Bill Me Later - $this->_checkout->setIsBml((bool)$this->getRequest()->getParam('bml')); - - // giropay - $this->_checkout->prepareGiropayUrls( - $this->_url->getUrl('checkout/onepage/success'), - $this->_url->getUrl('paypal/express/cancel'), - $this->_url->getUrl('checkout/onepage/success') - ); - - $button = (bool)$this->getRequest()->getParam(\Magento\Paypal\Model\Express\Checkout::PAYMENT_INFO_BUTTON); - $token = $this->_checkout->start( - $this->_url->getUrl('*/*/return'), - $this->_url->getUrl('*/*/cancel'), - $button - ); - $url = $this->_checkout->getRedirectUrl(); - if ($token && $url) { - $this->_initToken($token); - $this->getResponse()->setRedirect($url); - return; - } - } catch (\Magento\Framework\Model\Exception $e) { - $this->messageManager->addError($e->getMessage()); - } catch (\Exception $e) { - $this->messageManager->addError(__('We can\'t start Express Checkout.')); - $this->_objectManager->get('Magento\Framework\Logger')->logException($e); - } - - $this->_redirect('checkout/cart'); - } -} diff --git a/app/code/Magento/Paypal/Controller/Express/AbstractExpress/UpdateShippingMethods.php b/app/code/Magento/Paypal/Controller/Express/AbstractExpress/UpdateShippingMethods.php deleted file mode 100644 index cee6ddc1914de..0000000000000 --- a/app/code/Magento/Paypal/Controller/Express/AbstractExpress/UpdateShippingMethods.php +++ /dev/null @@ -1,40 +0,0 @@ -_initCheckout(); - $this->_checkout->prepareOrderReview($this->_initToken()); - $this->_view->loadLayout('paypal_express_review'); - - $this->getResponse()->setBody( - $this->_view - ->getLayout() - ->getBlock('express.review.shipping.method') - ->setQuote($this->_getQuote()) - ->toHtml() - ); - return; - } catch (\Magento\Framework\Model\Exception $e) { - $this->messageManager->addError($e->getMessage()); - } catch (\Exception $e) { - $this->messageManager->addError(__('We can\'t update shipping method.')); - $this->_objectManager->get('Magento\Framework\Logger')->logException($e); - } - $this->getResponse()->setBody( - '' - ); - } -} diff --git a/app/code/Magento/Paypal/Controller/Express/Cancel.php b/app/code/Magento/Paypal/Controller/Express/Cancel.php deleted file mode 100644 index 54102e3392707..0000000000000 --- a/app/code/Magento/Paypal/Controller/Express/Cancel.php +++ /dev/null @@ -1,30 +0,0 @@ -_session = $session; - } - - /** - * Cancel order, return quote to customer - * - * @param string $errorMsg - * @return false|string - */ - protected function _cancelPayment($errorMsg = '') - { - $gotoSection = false; - $helper = $this->_objectManager->get('Magento\Paypal\Helper\Checkout'); - $helper->cancelCurrentOrder($errorMsg); - if ($this->_session->restoreQuote()) { - $gotoSection = 'payment'; - } - - return $gotoSection; - } - - /** - * When a customer cancel payment from gateway. - * - * @return void - */ - public function execute() - { - $this->_view->loadLayout(false); - $gotoSection = $this->_cancelPayment(); - $redirectBlock = $this->_view->getLayout()->getBlock('hosted.pro.iframe'); - $redirectBlock->setGotoSection($gotoSection); - //TODO: clarify return logic whether customer will be returned in iframe or in parent window - $this->_view->renderLayout(); - } -} diff --git a/app/code/Magento/Paypal/Controller/Hostedpro/ReturnAction.php b/app/code/Magento/Paypal/Controller/Hostedpro/ReturnAction.php deleted file mode 100644 index 9f06716c41cf6..0000000000000 --- a/app/code/Magento/Paypal/Controller/Hostedpro/ReturnAction.php +++ /dev/null @@ -1,23 +0,0 @@ -_objectManager->get('Magento\Checkout\Model\Session'); - //TODO: some actions with order - if ($session->getLastRealOrderId()) { - $this->_redirect('checkout/onepage/success'); - } - } -} diff --git a/app/code/Magento/Paypal/Controller/Ipn/Index.php b/app/code/Magento/Paypal/Controller/Ipn/Index.php deleted file mode 100644 index 522a7a6fdeac2..0000000000000 --- a/app/code/Magento/Paypal/Controller/Ipn/Index.php +++ /dev/null @@ -1,65 +0,0 @@ -_logger = $logger; - $this->_ipnFactory = $ipnFactory; - parent::__construct($context); - } - - /** - * Instantiate IPN model and pass IPN request to it - * - * @return void - */ - public function execute() - { - if (!$this->getRequest()->isPost()) { - return; - } - - try { - $data = $this->getRequest()->getPost(); - $this->_ipnFactory->create(['data' => $data])->processIpnRequest(); - } catch (UnavailableException $e) { - $this->_logger->logException($e); - $this->getResponse()->setHeader('HTTP/1.1', '503 Service Unavailable')->sendResponse(); - /** @todo eliminate usage of exit statement */ - exit; - } catch (\Exception $e) { - $this->_logger->logException($e); - $this->getResponse()->setHttpResponseCode(500); - } - } -} diff --git a/app/code/Magento/Paypal/Controller/Payflow.php b/app/code/Magento/Paypal/Controller/Payflow.php deleted file mode 100644 index b63f9b0acda62..0000000000000 --- a/app/code/Magento/Paypal/Controller/Payflow.php +++ /dev/null @@ -1,84 +0,0 @@ -_checkoutSession = $checkoutSession; - $this->_orderFactory = $orderFactory; - $this->_logger = $logger; - $this->_payflowModelFactory = $payflowModelFactory; - $this->_checkoutHelper = $checkoutHelper; - parent::__construct($context); - } - - /** - * Cancel order, return quote to customer - * - * @param string $errorMsg - * @return false|string - */ - protected function _cancelPayment($errorMsg = '') - { - $gotoSection = false; - $this->_checkoutHelper->cancelCurrentOrder($errorMsg); - if ($this->_checkoutSession->restoreQuote()) { - //Redirect to payment step - $gotoSection = 'payment'; - } - - return $gotoSection; - } -} diff --git a/app/code/Magento/Paypal/Controller/Payflow/CancelPayment.php b/app/code/Magento/Paypal/Controller/Payflow/CancelPayment.php deleted file mode 100644 index ab80a2cf55210..0000000000000 --- a/app/code/Magento/Paypal/Controller/Payflow/CancelPayment.php +++ /dev/null @@ -1,23 +0,0 @@ -_view->loadLayout(false); - $gotoSection = $this->_cancelPayment(); - $redirectBlock = $this->_view->getLayout()->getBlock($this->_redirectBlockName); - $redirectBlock->setGotoSection($gotoSection); - $this->_view->renderLayout(); - } -} diff --git a/app/code/Magento/Paypal/Controller/Payflow/Form.php b/app/code/Magento/Paypal/Controller/Payflow/Form.php deleted file mode 100644 index 77fcb4202d127..0000000000000 --- a/app/code/Magento/Paypal/Controller/Payflow/Form.php +++ /dev/null @@ -1,21 +0,0 @@ -getResponse()->setHeader('P3P', 'CP="CAO PSA OUR"'); - $this->_view->loadLayout(false)->renderLayout(); - $layout = $this->_view->getLayout(); - } -} diff --git a/app/code/Magento/Paypal/Controller/Payflow/ReturnUrl.php b/app/code/Magento/Paypal/Controller/Payflow/ReturnUrl.php deleted file mode 100644 index 3114a6b25d5eb..0000000000000 --- a/app/code/Magento/Paypal/Controller/Payflow/ReturnUrl.php +++ /dev/null @@ -1,41 +0,0 @@ -_view->loadLayout(false); - $redirectBlock = $this->_view->getLayout()->getBlock($this->_redirectBlockName); - - if ($this->_checkoutSession->getLastRealOrderId()) { - $order = $this->_orderFactory->create()->loadByIncrementId($this->_checkoutSession->getLastRealOrderId()); - - if ($order && $order->getIncrementId() == $this->_checkoutSession->getLastRealOrderId()) { - $allowedOrderStates = [ - \Magento\Sales\Model\Order::STATE_PROCESSING, - \Magento\Sales\Model\Order::STATE_COMPLETE, - ]; - if (in_array($order->getState(), $allowedOrderStates)) { - $this->_checkoutSession->unsLastRealOrderId(); - $redirectBlock->setGotoSuccessPage(true); - } else { - $gotoSection = $this->_cancelPayment(strval($this->getRequest()->getParam('RESPMSG'))); - $redirectBlock->setGotoSection($gotoSection); - $redirectBlock->setErrorMsg(__('Your payment has been declined. Please try again.')); - } - } - } - - $this->_view->renderLayout(); - } -} diff --git a/app/code/Magento/Paypal/Controller/Payflow/SilentPost.php b/app/code/Magento/Paypal/Controller/Payflow/SilentPost.php deleted file mode 100644 index 3f93bd1e63ec6..0000000000000 --- a/app/code/Magento/Paypal/Controller/Payflow/SilentPost.php +++ /dev/null @@ -1,28 +0,0 @@ -getRequest()->getPost(); - if (isset($data['INVNUM'])) { - /** @var $paymentModel \Magento\Paypal\Model\Payflowlink */ - $paymentModel = $this->_payflowModelFactory->create(); - try { - $paymentModel->process($data); - } catch (\Exception $e) { - $this->_logger->logException($e); - } - } - } -} diff --git a/app/code/Magento/Paypal/Controller/Payflowadvanced/CancelPayment.php b/app/code/Magento/Paypal/Controller/Payflowadvanced/CancelPayment.php deleted file mode 100644 index 5e2cab4b0ff7e..0000000000000 --- a/app/code/Magento/Paypal/Controller/Payflowadvanced/CancelPayment.php +++ /dev/null @@ -1,15 +0,0 @@ -_forward( - 'start', - 'express', - 'paypal', - [ - 'bml' => 1, - 'button' => $this->getRequest()->getParam('button') - ] - ); - } -} diff --git a/app/code/Magento/Paypal/Controller/Payflowexpress/Cancel.php b/app/code/Magento/Paypal/Controller/Payflowexpress/Cancel.php deleted file mode 100644 index 17550e06cd41f..0000000000000 --- a/app/code/Magento/Paypal/Controller/Payflowexpress/Cancel.php +++ /dev/null @@ -1,30 +0,0 @@ -_objectManager->get('Magento\Checkout\Model\Session'); - $session->setQuoteId($session->getPaypalStandardQuoteId(true)); - - if ($session->getLastRealOrderId()) { - /** @var \Magento\Sales\Model\Order $order */ - $order = $this->_objectManager->create( - 'Magento\Sales\Model\Order' - )->loadByIncrementId( - $session->getLastRealOrderId() - ); - if ($order->getId()) { - $order->cancel()->save(); - } - $session->restoreQuote(); - } - $this->_redirect('checkout/cart'); - } -} diff --git a/app/code/Magento/Paypal/Controller/Standard/Redirect.php b/app/code/Magento/Paypal/Controller/Standard/Redirect.php deleted file mode 100644 index c43103c777179..0000000000000 --- a/app/code/Magento/Paypal/Controller/Standard/Redirect.php +++ /dev/null @@ -1,23 +0,0 @@ -_objectManager->get('Magento\Checkout\Model\Session'); - $session->setPaypalStandardQuoteId($session->getQuoteId()); - $this->_view->loadLayout(false)->renderLayout(); - $session->unsQuoteId(); - $session->unsRedirectUrl(); - } -} diff --git a/app/code/Magento/Paypal/Controller/Standard/Success.php b/app/code/Magento/Paypal/Controller/Standard/Success.php deleted file mode 100644 index f5fa17599b3c7..0000000000000 --- a/app/code/Magento/Paypal/Controller/Standard/Success.php +++ /dev/null @@ -1,25 +0,0 @@ -_objectManager->get('Magento\Checkout\Model\Session'); - $session->setQuoteId($session->getPaypalStandardQuoteId(true)); - $session->getQuote()->setIsActive(false)->save(); - $this->_redirect('checkout/onepage/success', ['_secure' => true]); - } -} diff --git a/app/code/Magento/Paypal/Exception.php b/app/code/Magento/Paypal/Exception.php deleted file mode 100644 index 425fa826e4ad1..0000000000000 --- a/app/code/Magento/Paypal/Exception.php +++ /dev/null @@ -1,9 +0,0 @@ -_coreHelper = $coreHelper; - $this->_backendConfig = $backendConfig; - } - - /** - * Get selected merchant country code in system configuration - * - * @return string - */ - public function getConfigurationCountryCode() - { - $countryCode = $this->_request->getParam(\Magento\Paypal\Model\Config\StructurePlugin::REQUEST_PARAM_COUNTRY); - if (is_null($countryCode) || preg_match('/^[a-zA-Z]{2}$/', $countryCode) == 0) { - $countryCode = $this->_backendConfig->getConfigDataValue( - \Magento\Paypal\Block\Adminhtml\System\Config\Field\Country::FIELD_CONFIG_PATH - ); - } - if (empty($countryCode)) { - $countryCode = $this->_coreHelper->getDefaultCountry(); - } - return $countryCode; - } -} diff --git a/app/code/Magento/Paypal/Helper/Checkout.php b/app/code/Magento/Paypal/Helper/Checkout.php deleted file mode 100644 index 4e8cae81f396a..0000000000000 --- a/app/code/Magento/Paypal/Helper/Checkout.php +++ /dev/null @@ -1,41 +0,0 @@ -_session = $session; - } - - /** - * Cancel last placed order with specified comment message - * - * @param string $comment Comment appended to order history - * @return bool True if order cancelled, false otherwise - */ - public function cancelCurrentOrder($comment) - { - $order = $this->_session->getLastRealOrder(); - if ($order->getId() && $order->getState() != \Magento\Sales\Model\Order::STATE_CANCELED) { - $order->registerCancellation($comment)->save(); - return true; - } - return false; - } -} diff --git a/app/code/Magento/Paypal/Helper/Data.php b/app/code/Magento/Paypal/Helper/Data.php deleted file mode 100644 index b157db91d7e04..0000000000000 --- a/app/code/Magento/Paypal/Helper/Data.php +++ /dev/null @@ -1,83 +0,0 @@ -_paymentData = $paymentData; - $this->_agreementFactory = $agreementFactory; - parent::__construct($context); - } - - /** - * Check whether customer should be asked confirmation whether to sign a billing agreement - * - * @param \Magento\Paypal\Model\Config $config - * @param int $customerId - * @return bool - */ - public function shouldAskToCreateBillingAgreement(\Magento\Paypal\Model\Config $config, $customerId) - { - if (null === self::$_shouldAskToCreateBillingAgreement) { - self::$_shouldAskToCreateBillingAgreement = false; - if ($customerId && $config->shouldAskToCreateBillingAgreement()) { - if ($this->_agreementFactory->create()->needToCreateForCustomer($customerId)) { - self::$_shouldAskToCreateBillingAgreement = true; - } - } - } - return self::$_shouldAskToCreateBillingAgreement; - } - - /** - * Retrieve available billing agreement methods - * - * @param null|string|bool|int|\Magento\Store\Model\Store $store - * @param \Magento\Sales\Model\Quote|null $quote - * @return MethodInterface[] - */ - public function getBillingAgreementMethods($store = null, $quote = null) - { - $result = []; - foreach ($this->_paymentData->getStoreMethods($store, $quote) as $method) { - if ($method instanceof MethodInterface) { - $result[] = $method; - } - } - return $result; - } -} diff --git a/app/code/Magento/Paypal/Helper/Hss.php b/app/code/Magento/Paypal/Helper/Hss.php deleted file mode 100644 index 9bc19e31ed624..0000000000000 --- a/app/code/Magento/Paypal/Helper/Hss.php +++ /dev/null @@ -1,69 +0,0 @@ -_checkoutSession = $checkoutSession; - parent::__construct($context); - } - - /** - * Get template for button in order review page if HSS method was selected - * - * @param string $name template name - * @return string - */ - public function getReviewButtonTemplate($name) - { - $quote = $this->_checkoutSession->getQuote(); - if ($quote) { - $payment = $quote->getPayment(); - if ($payment && in_array($payment->getMethod(), $this->_hssMethods)) { - return $name; - } - } - return ''; - } - - /** - * Get methods - * - * @return string[] - */ - public function getHssMethods() - { - return $this->_hssMethods; - } -} diff --git a/app/code/Magento/Paypal/Helper/Shortcut/CheckoutValidator.php b/app/code/Magento/Paypal/Helper/Shortcut/CheckoutValidator.php deleted file mode 100644 index 73488eddcea3d..0000000000000 --- a/app/code/Magento/Paypal/Helper/Shortcut/CheckoutValidator.php +++ /dev/null @@ -1,91 +0,0 @@ -_checkoutSession = $checkoutSession; - $this->_paymentData = $paymentData; - $this->_shortcutValidator = $shortcutValidator; - } - - /** - * Validates shortcut - * - * @param string $code - * @param bool $isInCatalog - * @return bool - */ - public function validate($code, $isInCatalog) - { - return $this->_shortcutValidator->isContextAvailable($code, $isInCatalog) - && $this->_shortcutValidator->isPriceOrSetAvailable($isInCatalog) - && $this->isMethodQuoteAvailable($code, $isInCatalog) - && $this->isQuoteSummaryValid($isInCatalog); - } - - /** - * Сhecks payment method and quote availability - * - * @param string $paymentCode - * @param bool $isInCatalog - * @return bool - */ - public function isMethodQuoteAvailable($paymentCode, $isInCatalog) - { - $quote = $isInCatalog ? null : $this->_checkoutSession->getQuote(); - // check payment method availability - /** @var \Magento\Payment\Model\Method\AbstractMethod $methodInstance */ - $methodInstance = $this->_paymentData->getMethodInstance($paymentCode); - if (!$methodInstance->isAvailable($quote)) { - return false; - } - return true; - } - - /** - * Validates minimum quote amount and zero grand total - * - * @param bool $isInCatalog - * @return bool - */ - public function isQuoteSummaryValid($isInCatalog) - { - $quote = $isInCatalog ? null : $this->_checkoutSession->getQuote(); - // validate minimum quote amount and validate quote for zero grandtotal - if (null !== $quote && (!$quote->validateMinimumAmount() || - !$quote->getGrandTotal() && !$quote->hasNominalItems()) - ) { - return false; - } - return true; - } -} diff --git a/app/code/Magento/Paypal/Helper/Shortcut/Factory.php b/app/code/Magento/Paypal/Helper/Shortcut/Factory.php deleted file mode 100644 index 60e958ae792ec..0000000000000 --- a/app/code/Magento/Paypal/Helper/Shortcut/Factory.php +++ /dev/null @@ -1,45 +0,0 @@ -_objectManager = $objectManager; - } - - /** - * @param mixed $parameter - * @return \Magento\Paypal\Helper\Shortcut\ValidatorInterface - */ - public function create($parameter = null) - { - $instanceName = self::DEFAULT_VALIDATOR; - if (is_object($parameter) && $parameter instanceof \Magento\Checkout\Model\Session) { - $instanceName = self::CHECKOUT_VALIDATOR; - } - return $this->_objectManager->create($instanceName); - } -} diff --git a/app/code/Magento/Paypal/Helper/Shortcut/Validator.php b/app/code/Magento/Paypal/Helper/Shortcut/Validator.php deleted file mode 100644 index 1916222829427..0000000000000 --- a/app/code/Magento/Paypal/Helper/Shortcut/Validator.php +++ /dev/null @@ -1,130 +0,0 @@ -_paypalConfigFactory = $paypalConfigFactory; - $this->_registry = $registry; - $this->_productTypeConfig = $productTypeConfig; - $this->_paymentData = $paymentData; - } - - /** - * Validates shortcut - * - * @param string $code - * @param bool $isInCatalog - * @return bool - */ - public function validate($code, $isInCatalog) - { - return $this->isContextAvailable($code, $isInCatalog) - && $this->isPriceOrSetAvailable($isInCatalog) - && $this->isMethodAvailable($code); - } - - /** - * Checks visibility of context (cart or product page) - * - * @param string $paymentCode Payment method code - * @param bool $isInCatalog - * @return bool - */ - public function isContextAvailable($paymentCode, $isInCatalog) - { - /** @var \Magento\Paypal\Model\Config $config */ - $config = $this->_paypalConfigFactory->create(); - $config->setMethod($paymentCode); - - // check visibility on cart or product page - $context = $isInCatalog ? 'visible_on_product' : 'visible_on_cart'; - if (!$config->getConfigValue($context)) { - return false; - } - return true; - } - - /** - * Check is product available depending on final price or type set(configurable) - * - * @param bool $isInCatalog - * @return bool - */ - public function isPriceOrSetAvailable($isInCatalog) - { - if ($isInCatalog) { - // Show PayPal shortcut on a product view page only if product has nonzero price - /** @var $currentProduct \Magento\Catalog\Model\Product */ - $currentProduct = $this->_registry->registry('current_product'); - if (!is_null($currentProduct)) { - $productPrice = (double)$currentProduct->getFinalPrice(); - $typeInstance = $currentProduct->getTypeInstance(); - if (empty($productPrice) - && !$this->_productTypeConfig->isProductSet($currentProduct->getTypeId()) - && !$typeInstance->canConfigure($currentProduct) - ) { - return false; - } - } - } - return true; - } - - /** - * Сhecks payment method and quote availability - * - * @param string $paymentCode - * @return bool - */ - public function isMethodAvailable($paymentCode) - { - // check payment method availability - /** @var \Magento\Payment\Model\Method\AbstractMethod $methodInstance */ - $methodInstance = $this->_paymentData->getMethodInstance($paymentCode); - if (!$methodInstance->isAvailable()) { - return false; - } - return true; - } -} diff --git a/app/code/Magento/Paypal/Helper/Shortcut/ValidatorInterface.php b/app/code/Magento/Paypal/Helper/Shortcut/ValidatorInterface.php deleted file mode 100644 index 34c8513e24bb7..0000000000000 --- a/app/code/Magento/Paypal/Helper/Shortcut/ValidatorInterface.php +++ /dev/null @@ -1,18 +0,0 @@ -" 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/Paypal/LICENSE_AFL.txt b/app/code/Magento/Paypal/LICENSE_AFL.txt deleted file mode 100644 index 87943b95d43a5..0000000000000 --- a/app/code/Magento/Paypal/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 " 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/Paypal/Model/AbstractIpn.php b/app/code/Magento/Paypal/Model/AbstractIpn.php deleted file mode 100644 index 72ce4efddd70a..0000000000000 --- a/app/code/Magento/Paypal/Model/AbstractIpn.php +++ /dev/null @@ -1,189 +0,0 @@ -_configFactory = $configFactory; - $this->_logAdapterFactory = $logAdapterFactory; - $this->_curlFactory = $curlFactory; - $this->_ipnRequest = $data; - } - - /** - * IPN request data getter - * - * @param string $key - * @return array|string - */ - public function getRequestData($key = null) - { - if (null === $key) { - return $this->_ipnRequest; - } - return isset($this->_ipnRequest[$key]) ? $this->_ipnRequest[$key] : null; - } - - /** - * Post back to PayPal to check whether this request is a valid one - * - * @return void - * @throws \Exception - */ - protected function _postBack() - { - $httpAdapter = $this->_curlFactory->create(); - $postbackQuery = http_build_query($this->getRequestData()) . '&cmd=_notify-validate'; - $postbackUrl = $this->_config->getPaypalUrl(); - $this->_addDebugData('postback_to', $postbackUrl); - - $httpAdapter->setConfig(['verifypeer' => $this->_config->getConfigValue('verifyPeer')]); - $httpAdapter->write(\Zend_Http_Client::POST, $postbackUrl, '1.1', ['Connection: close'], $postbackQuery); - try { - $postbackResult = $httpAdapter->read(); - } catch (\Exception $e) { - $this->_addDebugData('http_error', ['error' => $e->getMessage(), 'code' => $e->getCode()]); - throw $e; - } - - /* - * Handle errors on PayPal side. - */ - $responseCode = \Zend_Http_Response::extractCode($postbackResult); - if (empty($postbackResult) || in_array($responseCode, ['500', '502', '503'])) { - if (empty($postbackResult)) { - $reason = 'Empty response.'; - } else { - $reason = 'Response code: ' . $responseCode . '.'; - } - $this->_debugData['exception'] = 'PayPal IPN postback failure. ' . $reason; - throw new UnavailableException($reason); - } - - $response = preg_split('/^\r?$/m', $postbackResult, 2); - $response = trim($response[1]); - if ($response != 'VERIFIED') { - $this->_addDebugData('postback', $postbackQuery); - $this->_addDebugData('postback_result', $postbackResult); - throw new \Exception('PayPal IPN postback failure. See ' . self::DEFAULT_LOG_FILE . ' for details.'); - } - } - - /** - * Filter payment status from NVP into paypal/info format - * - * @param string $ipnPaymentStatus - * @return string - */ - protected function _filterPaymentStatus($ipnPaymentStatus) - { - switch ($ipnPaymentStatus) { - case 'Created': - // break is intentionally omitted - case 'Completed': - return Info::PAYMENTSTATUS_COMPLETED; - case 'Denied': - return Info::PAYMENTSTATUS_DENIED; - case 'Expired': - return Info::PAYMENTSTATUS_EXPIRED; - case 'Failed': - return Info::PAYMENTSTATUS_FAILED; - case 'Pending': - return Info::PAYMENTSTATUS_PENDING; - case 'Refunded': - return Info::PAYMENTSTATUS_REFUNDED; - case 'Reversed': - return Info::PAYMENTSTATUS_REVERSED; - case 'Canceled_Reversal': - return Info::PAYMENTSTATUS_UNREVERSED; - case 'Processed': - return Info::PAYMENTSTATUS_PROCESSED; - case 'Voided': - return Info::PAYMENTSTATUS_VOIDED; - default: - return ''; - } - // documented in NVP, but not documented in IPN: - //Info::PAYMENTSTATUS_NONE - //Info::PAYMENTSTATUS_INPROGRESS - //Info::PAYMENTSTATUS_REFUNDEDPART - } - - /** - * Log debug data to file - * - * @return void - */ - protected function _debug() - { - if ($this->_config && $this->_config->getConfigValue('debug')) { - $file = $this->_config - ->getMethodCode() ? "payment_{$this - ->_config - ->getMethodCode()}.log" : self::DEFAULT_LOG_FILE; - $this->_logAdapterFactory->create(['fileName' => $file])->log($this->_debugData); - } - } - - /** - * @param string $key - * @param array|string $value - * @return $this - */ - protected function _addDebugData($key, $value) - { - $this->_debugData[$key] = $value; - return $this; - } -} diff --git a/app/code/Magento/Paypal/Model/Api/AbstractApi.php b/app/code/Magento/Paypal/Model/Api/AbstractApi.php deleted file mode 100644 index 7266783031f26..0000000000000 --- a/app/code/Magento/Paypal/Model/Api/AbstractApi.php +++ /dev/null @@ -1,635 +0,0 @@ -_customerAddress = $customerAddress; - $this->_logger = $logger; - $this->_localeResolver = $localeResolver; - $this->_regionFactory = $regionFactory; - $this->_logAdapterFactory = $logAdapterFactory; - parent::__construct($data); - } - - /** - * Return Paypal Api user name based on config data - * - * @return string - */ - public function getApiUsername() - { - return $this->_config->getConfigValue('apiUsername'); - } - - /** - * Return Paypal Api password based on config data - * - * @return string - */ - public function getApiPassword() - { - return $this->_config->getConfigValue('apiPassword'); - } - - /** - * Return Paypal Api signature based on config data - * - * @return string - */ - public function getApiSignature() - { - return $this->_config->getConfigValue('apiSignature'); - } - - /** - * Return Paypal Api certificate based on config data - * - * @return string - */ - public function getApiCertificate() - { - return $this->_config->getApiCertificate(); - } - - /** - * BN code getter - * - * @return string - */ - public function getBuildNotationCode() - { - return $this->_config->getBuildNotationCode(); - } - - /** - * Return Paypal Api proxy status based on config data - * - * @return bool - */ - public function getUseProxy() - { - return $this->_getDataOrConfig('use_proxy', false); - } - - /** - * Return Paypal Api proxy host based on config data - * - * @return string - */ - public function getProxyHost() - { - return $this->_getDataOrConfig('proxy_host', '127.0.0.1'); - } - - /** - * Return Paypal Api proxy port based on config data - * - * @return string - */ - public function getProxyPort() - { - return $this->_getDataOrConfig('proxy_port', '808'); - } - - /** - * PayPal page CSS getter - * - * @return string - */ - public function getPageStyle() - { - return $this->_getDataOrConfig('page_style'); - } - - /** - * PayPal page header image URL getter - * - * @return string - */ - public function getHdrimg() - { - return $this->_getDataOrConfig('paypal_hdrimg'); - } - - /** - * PayPal page header border color getter - * - * @return string - */ - public function getHdrbordercolor() - { - return $this->_getDataOrConfig('paypal_hdrbordercolor'); - } - - /** - * PayPal page header background color getter - * - * @return string - */ - public function getHdrbackcolor() - { - return $this->_getDataOrConfig('paypal_hdrbackcolor'); - } - - /** - * PayPal page "payflow color" (?) getter - * - * @return string - */ - public function getPayflowcolor() - { - return $this->_getDataOrConfig('paypal_payflowcolor'); - } - - /** - * Payment action getter - * - * @return string - */ - public function getPaymentAction() - { - return $this->_getDataOrConfig('payment_action'); - } - - /** - * PayPal merchant email getter - * - * @return string - */ - public function getBusinessAccount() - { - return $this->_getDataOrConfig('business_account'); - } - - /** - * Import $this public data to specified object or array - * - * @param array|\Magento\Framework\Object $to - * @param array $publicMap - * @return array|\Magento\Framework\Object - */ - public function import($to, array $publicMap = []) - { - return \Magento\Framework\Object\Mapper::accumulateByMap([$this, 'getDataUsingMethod'], $to, $publicMap); - } - - /** - * Export $this public data from specified object or array - * - * @param array|\Magento\Framework\Object $from - * @param array $publicMap - * @return $this - */ - public function export($from, array $publicMap = []) - { - \Magento\Framework\Object\Mapper::accumulateByMap($from, [$this, 'setDataUsingMethod'], $publicMap); - return $this; - } - - /** - * Set PayPal cart instance - * - * @param \Magento\Paypal\Model\Cart $cart - * @return $this - */ - public function setPaypalCart(\Magento\Paypal\Model\Cart $cart) - { - $this->_cart = $cart; - return $this; - } - - /** - * Config instance setter - * - * @param \Magento\Paypal\Model\Config $config - * @return $this - */ - public function setConfigObject(\Magento\Paypal\Model\Config $config) - { - $this->_config = $config; - return $this; - } - - /** - * Current locale code getter - * - * @return string - */ - public function getLocaleCode() - { - return $this->_localeResolver->getLocaleCode(); - } - - /** - * Always take into account - * - * @return int - */ - public function getFraudManagementFiltersEnabled() - { - return 1; - } - - /** - * Export $this public data to private request array - * - * @param array $privateRequestMap - * @param array $request - * @return array - */ - protected function &_exportToRequest(array $privateRequestMap, array $request = []) - { - $map = []; - foreach ($privateRequestMap as $key) { - if (isset($this->_globalMap[$key])) { - $map[$this->_globalMap[$key]] = $key; - } - } - $result = \Magento\Framework\Object\Mapper::accumulateByMap([$this, 'getDataUsingMethod'], $request, $map); - foreach ($privateRequestMap as $key) { - if (isset($this->_exportToRequestFilters[$key]) && isset($result[$key])) { - $callback = $this->_exportToRequestFilters[$key]; - $privateKey = $result[$key]; - $publicKey = $map[$this->_globalMap[$key]]; - $result[$key] = call_user_func([$this, $callback], $privateKey, $publicKey); - } - } - return $result; - } - - /** - * Import $this public data from a private response array - * - * @param array $privateResponseMap - * @param array $response - * @return void - */ - protected function _importFromResponse(array $privateResponseMap, array $response) - { - $map = []; - foreach ($privateResponseMap as $key) { - if (isset($this->_globalMap[$key])) { - $map[$key] = $this->_globalMap[$key]; - } - if (isset($response[$key]) && isset($this->_importFromRequestFilters[$key])) { - $callback = $this->_importFromRequestFilters[$key]; - $response[$key] = call_user_func([$this, $callback], $response[$key], $key, $map[$key]); - } - } - \Magento\Framework\Object\Mapper::accumulateByMap($response, [$this, 'setDataUsingMethod'], $map); - } - - /** - * Prepare line items request - * - * Returns true if there were line items added - * - * @param array &$request - * @param int $i - * @return true|null - */ - protected function _exportLineItems(array &$request, $i = 0) - { - if (!$this->_cart) { - return; - } - - // always add cart totals, even if line items are not requested - if ($this->_lineItemTotalExportMap) { - foreach ($this->_cart->getAmounts() as $key => $total) { - if (isset($this->_lineItemTotalExportMap[$key])) { - // !empty($total) - $privateKey = $this->_lineItemTotalExportMap[$key]; - $request[$privateKey] = $this->_filterAmount($total); - } - } - } - - // add cart line items - $items = $this->_cart->getAllItems(); - if (empty($items) || !$this->getIsLineItemsEnabled()) { - return; - } - $result = null; - foreach ($items as $item) { - foreach ($this->_lineItemExportItemsFormat as $publicKey => $privateFormat) { - $result = true; - $value = $item->getDataUsingMethod($publicKey); - if (isset($this->_lineItemExportItemsFilters[$publicKey])) { - $callback = $this->_lineItemExportItemsFilters[$publicKey]; - $value = call_user_func([$this, $callback], $value); - } - if (is_float($value)) { - $value = $this->_filterAmount($value); - } - $request[sprintf($privateFormat, $i)] = $value; - } - $i++; - } - return $result; - } - - /** - * Prepare shipping options request - * Returns false if there are no shipping options - * - * @param array &$request - * @param int $i - * @return bool - */ - protected function _exportShippingOptions(array &$request, $i = 0) - { - $options = $this->getShippingOptions(); - if (empty($options)) { - return false; - } - foreach ($options as $option) { - foreach ($this->_shippingOptionsExportItemsFormat as $publicKey => $privateFormat) { - $value = $option->getDataUsingMethod($publicKey); - if (is_float($value)) { - $value = $this->_filterAmount($value); - } - if (is_bool($value)) { - $value = $this->_filterBool($value); - } - $request[sprintf($privateFormat, $i)] = $value; - } - $i++; - } - return true; - } - - /** - * Filter amounts in API calls - * - * @param float|string $value - * @return string - */ - protected function _filterAmount($value) - { - return sprintf('%.2F', $value); - } - - /** - * Filter boolean values in API calls - * - * @param mixed $value - * @return string - */ - protected function _filterBool($value) - { - return $value ? 'true' : 'false'; - } - - /** - * Filter int values in API calls - * - * @param mixed $value - * @return int - */ - protected function _filterInt($value) - { - return (int)$value; - } - - /** - * Unified getter that looks in data or falls back to config - * - * @param string $key - * @param mixed|null $default - * @return mixed - */ - protected function _getDataOrConfig($key, $default = null) - { - if ($this->hasData($key)) { - return $this->getData($key); - } - return $this->_config->getConfigValue($key) ? $this->_config->getConfigValue($key) : $default; - } - - /** - * region_id workaround: PayPal requires state code, try to find one in the address - * - * @param \Magento\Framework\Object $address - * @return string - */ - protected function _lookupRegionCodeFromAddress(\Magento\Framework\Object $address) - { - $regionId = $address->getData('region_id'); - if ($regionId) { - $region = $this->_regionFactory->create()->load($regionId); - if ($region->getId()) { - return $region->getCode(); - } - } - return ''; - } - - /** - * Street address workaround: divides address lines into parts by specified keys - * (keys should go as 3rd, 4th[...] parameters) - * - * @param \Magento\Framework\Object $address - * @param array $to - * @return void - */ - protected function _importStreetFromAddress(\Magento\Framework\Object $address, array &$to) - { - $keys = func_get_args(); - array_shift($keys); - array_shift($keys); - $street = $address->getStreet(); - if (!$keys || !$street || !is_array($street)) { - return; - } - - $street = $this->_customerAddress->convertStreetLines($address->getStreet(), count($keys)); - - $i = 0; - foreach ($keys as $key) { - $to[$key] = isset($street[$i]) ? $street[$i] : ''; - $i++; - } - } - - /** - * Build query string from request - * - * @param array $request - * @return string - */ - protected function _buildQuery($request) - { - return http_build_query($request); - } - - /** - * Filter qty in API calls - * Paypal note: The value for quantity must be a positive integer. Null, zero, or negative numbers are not allowed. - * - * @param float|string|int $value - * @return string - */ - protected function _filterQty($value) - { - return intval($value); - } - - /** - * Log debug data to file - * - * @param mixed $debugData - * @return void - */ - protected function _debug($debugData) - { - if ($this->getDebugFlag()) { - $this->_logAdapterFactory->create( - ['fileName' => 'payment_' . $this->_config->getMethodCode() . '.log'] - )->setFilterDataKeys( - $this->_debugReplacePrivateDataKeys - )->log( - $debugData - ); - } - } - - /** - * Define if debugging is enabled - * - * @return bool - */ - public function getDebugFlag() - { - return $this->_config->getConfigValue('debug'); - } - - /** - * Check whether API certificate authentication should be used - * - * @return bool - */ - public function getUseCertAuthentication() - { - return (bool)$this->_config->getConfigValue('apiAuthentication'); - } -} diff --git a/app/code/Magento/Paypal/Model/Api/Nvp.php b/app/code/Magento/Paypal/Model/Api/Nvp.php deleted file mode 100644 index e4b4cd53ddf1e..0000000000000 --- a/app/code/Magento/Paypal/Model/Api/Nvp.php +++ /dev/null @@ -1,1729 +0,0 @@ - 'version', - 'USER' => 'api_username', - 'PWD' => 'api_password', - 'SIGNATURE' => 'api_signature', - 'BUTTONSOURCE' => 'build_notation_code', - - // for Unilateral payments - 'SUBJECT' => 'business_account', - - // commands - 'PAYMENTACTION' => 'payment_action', - 'RETURNURL' => 'return_url', - 'CANCELURL' => 'cancel_url', - 'INVNUM' => 'inv_num', - 'TOKEN' => 'token', - 'CORRELATIONID' => 'correlation_id', - 'SOLUTIONTYPE' => 'solution_type', - 'GIROPAYCANCELURL' => 'giropay_cancel_url', - 'GIROPAYSUCCESSURL' => 'giropay_success_url', - 'BANKTXNPENDINGURL' => 'giropay_bank_txn_pending_url', - 'IPADDRESS' => 'ip_address', - 'NOTIFYURL' => 'notify_url', - 'RETURNFMFDETAILS' => 'fraud_management_filters_enabled', - 'NOTE' => 'note', - 'REFUNDTYPE' => 'refund_type', - 'ACTION' => 'action', - 'REDIRECTREQUIRED' => 'redirect_required', - 'SUCCESSPAGEREDIRECTREQUESTED' => 'redirect_requested', - 'REQBILLINGADDRESS' => 'require_billing_address', - // style settings - 'PAGESTYLE' => 'page_style', - 'HDRIMG' => 'hdrimg', - 'HDRBORDERCOLOR' => 'hdrbordercolor', - 'HDRBACKCOLOR' => 'hdrbackcolor', - 'PAYFLOWCOLOR' => 'payflowcolor', - 'LOCALECODE' => 'locale_code', - 'PAL' => 'pal', - 'USERSELECTEDFUNDINGSOURCE' => 'funding_source', - - // transaction info - 'TRANSACTIONID' => 'transaction_id', - 'AUTHORIZATIONID' => 'authorization_id', - 'REFUNDTRANSACTIONID' => 'refund_transaction_id', - 'COMPLETETYPE' => 'complete_type', - 'AMT' => 'amount', - 'ITEMAMT' => 'subtotal_amount', - 'GROSSREFUNDAMT' => 'refunded_amount', // possible mistake, check with API reference - - // payment/billing info - 'CURRENCYCODE' => 'currency_code', - 'PAYMENTSTATUS' => 'payment_status', - 'PENDINGREASON' => 'pending_reason', - 'PROTECTIONELIGIBILITY' => 'protection_eligibility', - 'PAYERID' => 'payer_id', - 'PAYERSTATUS' => 'payer_status', - 'ADDRESSID' => 'address_id', - 'ADDRESSSTATUS' => 'address_status', - 'EMAIL' => 'email', - - // backwards compatibility - 'FIRSTNAME' => 'firstname', - 'LASTNAME' => 'lastname', - - // shipping rate - 'SHIPPINGOPTIONNAME' => 'shipping_rate_code', - 'NOSHIPPING' => 'suppress_shipping', - - // paypal direct credit card information - 'CREDITCARDTYPE' => 'credit_card_type', - 'ACCT' => 'credit_card_number', - 'EXPDATE' => 'credit_card_expiration_date', - 'CVV2' => 'credit_card_cvv2', - 'STARTDATE' => 'maestro_solo_issue_date', - 'ISSUENUMBER' => 'maestro_solo_issue_number', - 'CVV2MATCH' => 'cvv2_check_result', - 'AVSCODE' => 'avs_result', - // cardinal centinel - 'AUTHSTATUS3DS' => 'centinel_authstatus', - 'MPIVENDOR3DS' => 'centinel_mpivendor', - 'CAVV' => 'centinel_cavv', - 'ECI3DS' => 'centinel_eci', - 'XID' => 'centinel_xid', - 'VPAS' => 'centinel_vpas_result', - 'ECISUBMITTED3DS' => 'centinel_eci_result', - - 'SHIPPINGAMT' => 'shipping_amount', - 'TAXAMT' => 'tax_amount', - 'INITAMT' => 'init_amount', - 'STATUS' => 'status', - - //Next two fields are used for Brazil only - 'TAXID' => 'buyer_tax_id', - 'TAXIDTYPE' => 'buyer_tax_id_type', - - 'BILLINGAGREEMENTID' => 'billing_agreement_id', - 'REFERENCEID' => 'reference_id', - 'BILLINGAGREEMENTSTATUS' => 'billing_agreement_status', - 'BILLINGTYPE' => 'billing_type', - 'SREET' => 'street', - 'CITY' => 'city', - 'STATE' => 'state', - 'COUNTRYCODE' => 'countrycode', - 'ZIP' => 'zip', - 'PAYERBUSINESS' => 'payer_business', - ]; - - /** - * Filter callback for preparing internal amounts to NVP request - * - * @var array - */ - protected $_exportToRequestFilters = [ - 'AMT' => '_filterAmount', - 'ITEMAMT' => '_filterAmount', - 'TRIALAMT' => '_filterAmount', - 'SHIPPINGAMT' => '_filterAmount', - 'TAXAMT' => '_filterAmount', - 'INITAMT' => '_filterAmount', - 'CREDITCARDTYPE' => '_filterCcType', - // 'PROFILESTARTDATE' => '_filterToPaypalDate', - 'AUTOBILLAMT' => '_filterBillFailedLater', - 'BILLINGPERIOD' => '_filterPeriodUnit', - 'TRIALBILLINGPERIOD' => '_filterPeriodUnit', - 'FAILEDINITAMTACTION' => '_filterInitialAmountMayFail', - 'BILLINGAGREEMENTSTATUS' => '_filterBillingAgreementStatus', - 'NOSHIPPING' => '_filterInt', - ]; - - /** - * Filter callback for preparing internal amounts to NVP request - * - * @var array - */ - protected $_importFromRequestFilters = [ - 'REDIRECTREQUIRED' => '_filterToBool', - 'SUCCESSPAGEREDIRECTREQUESTED' => '_filterToBool', - 'PAYMENTSTATUS' => '_filterPaymentStatusFromNvpToInfo', - ]; - - /** - * Request map for each API call - * - * @var string[] - */ - protected $_eachCallRequest = ['VERSION', 'USER', 'PWD', 'SIGNATURE', 'BUTTONSOURCE']; - - /** - * SetExpressCheckout request map - * - * @var string[] - */ - protected $_setExpressCheckoutRequest = [ - 'PAYMENTACTION', - 'AMT', - 'CURRENCYCODE', - 'RETURNURL', - 'CANCELURL', - 'INVNUM', - 'SOLUTIONTYPE', - 'NOSHIPPING', - 'GIROPAYCANCELURL', - 'GIROPAYSUCCESSURL', - 'BANKTXNPENDINGURL', - 'PAGESTYLE', - 'HDRIMG', - 'HDRBORDERCOLOR', - 'HDRBACKCOLOR', - 'PAYFLOWCOLOR', - 'LOCALECODE', - 'BILLINGTYPE', - 'SUBJECT', - 'ITEMAMT', - 'SHIPPINGAMT', - 'TAXAMT', - 'REQBILLINGADDRESS', - 'USERSELECTEDFUNDINGSOURCE', - ]; - - /** - * SetExpressCheckout response map - * - * @var string[] - */ - protected $_setExpressCheckoutResponse = ['TOKEN']; - - /** - * GetExpressCheckoutDetails request map - * - * @var string[] - */ - protected $_getExpressCheckoutDetailsRequest = ['TOKEN', 'SUBJECT']; - - /** - * DoExpressCheckoutPayment request map - * - * @var string[] - */ - protected $_doExpressCheckoutPaymentRequest = [ - 'TOKEN', - 'PAYERID', - 'PAYMENTACTION', - 'AMT', - 'CURRENCYCODE', - 'IPADDRESS', - 'BUTTONSOURCE', - 'NOTIFYURL', - 'RETURNFMFDETAILS', - 'SUBJECT', - 'ITEMAMT', - 'SHIPPINGAMT', - 'TAXAMT', - ]; - - /** - * DoExpressCheckoutPayment response map - * - * @var string[] - */ - protected $_doExpressCheckoutPaymentResponse = [ - 'TRANSACTIONID', - 'AMT', - 'PAYMENTSTATUS', - 'PENDINGREASON', - 'REDIRECTREQUIRED', - ]; - - /** - * DoDirectPayment request map - * - * @var string[] - */ - protected $_doDirectPaymentRequest = [ - 'PAYMENTACTION', - 'IPADDRESS', - 'RETURNFMFDETAILS', - 'AMT', - 'CURRENCYCODE', - 'INVNUM', - 'NOTIFYURL', - 'EMAIL', - 'ITEMAMT', - 'SHIPPINGAMT', - 'TAXAMT', - 'CREDITCARDTYPE', - 'ACCT', - 'EXPDATE', - 'CVV2', - 'STARTDATE', - 'ISSUENUMBER', - 'AUTHSTATUS3DS', - 'MPIVENDOR3DS', - 'CAVV', - 'ECI3DS', - 'XID', - ]; - - /** - * DoDirectPayment response map - * - * @var string[] - */ - protected $_doDirectPaymentResponse = [ - 'TRANSACTIONID', - 'AMT', - 'AVSCODE', - 'CVV2MATCH', - 'VPAS', - 'ECISUBMITTED3DS', - ]; - - /** - * DoReauthorization request map - * - * @var string[] - */ - protected $_doReauthorizationRequest = ['AUTHORIZATIONID', 'AMT', 'CURRENCYCODE']; - - /** - * DoReauthorization response map - * - * @var string[] - */ - protected $_doReauthorizationResponse = [ - 'AUTHORIZATIONID', - 'PAYMENTSTATUS', - 'PENDINGREASON', - 'PROTECTIONELIGIBILITY', - ]; - - /** - * DoCapture request map - * - * @var string[] - */ - protected $_doCaptureRequest = ['AUTHORIZATIONID', 'COMPLETETYPE', 'AMT', 'CURRENCYCODE', 'NOTE', 'INVNUM']; - - /** - * DoCapture response map - * - * @var string[] - */ - protected $_doCaptureResponse = ['TRANSACTIONID', 'CURRENCYCODE', 'AMT', 'PAYMENTSTATUS', 'PENDINGREASON']; - - /** - * DoAuthorization request map - * - * @var string[] - */ - protected $_doAuthorizationRequest = ['TRANSACTIONID', 'AMT', 'CURRENCYCODE']; - - /** - * DoAuthorization response map - * - * @var string[] - */ - protected $_doAuthorizationResponse = ['TRANSACTIONID', 'AMT']; - - /** - * DoVoid request map - * - * @var string[] - */ - protected $_doVoidRequest = ['AUTHORIZATIONID', 'NOTE']; - - /** - * GetTransactionDetailsRequest - * - * @var string[] - */ - protected $_getTransactionDetailsRequest = ['TRANSACTIONID']; - - /** - * GetTransactionDetailsResponse - * - * @var string[] - */ - protected $_getTransactionDetailsResponse = [ - 'PAYERID', - 'FIRSTNAME', - 'LASTNAME', - 'TRANSACTIONID', - 'PARENTTRANSACTIONID', - 'CURRENCYCODE', - 'AMT', - 'PAYMENTSTATUS', - 'PENDINGREASON', - ]; - - /** - * RefundTransaction request map - * - * @var string[] - */ - protected $_refundTransactionRequest = ['TRANSACTIONID', 'REFUNDTYPE', 'CURRENCYCODE', 'NOTE']; - - /** - * RefundTransaction response map - * - * @var string[] - */ - protected $_refundTransactionResponse = ['REFUNDTRANSACTIONID', 'GROSSREFUNDAMT']; - - /** - * ManagePendingTransactionStatus request map - * - * @var string[] - */ - protected $_managePendingTransactionStatusRequest = ['TRANSACTIONID', 'ACTION']; - - /** - * ManagePendingTransactionStatus response map - * - * @var string[] - */ - protected $_managePendingTransactionStatusResponse = ['TRANSACTIONID', 'STATUS']; - - /** - * GetPalDetails response map - * - * @var string[] - */ - protected $_getPalDetailsResponse = ['PAL']; - - /** - * Map for billing address import/export - * - * @var array - */ - protected $_billingAddressMap = [ - 'BUSINESS' => 'company', - 'NOTETEXT' => 'customer_notes', - 'EMAIL' => 'email', - 'FIRSTNAME' => 'firstname', - 'LASTNAME' => 'lastname', - 'MIDDLENAME' => 'middlename', - 'SALUTATION' => 'prefix', - 'SUFFIX' => 'suffix', - 'COUNTRYCODE' => 'country_id', // iso-3166 two-character code - 'STATE' => 'region', - 'CITY' => 'city', - 'STREET' => 'street', - 'STREET2' => 'street2', - 'ZIP' => 'postcode', - 'PHONENUM' => 'telephone', - ]; - - /** - * Map for billing address to do request (not response) - * Merging with $_billingAddressMap - * - * @var array - */ - protected $_billingAddressMapRequest = []; - - /** - * Map for shipping address import/export (extends billing address mapper) - * @var array - */ - protected $_shippingAddressMap = [ - 'SHIPTOCOUNTRYCODE' => 'country_id', - 'SHIPTOSTATE' => 'region', - 'SHIPTOCITY' => 'city', - 'SHIPTOSTREET' => 'street', - 'SHIPTOSTREET2' => 'street2', - 'SHIPTOZIP' => 'postcode', - 'SHIPTOPHONENUM' => 'telephone', - // 'SHIPTONAME' will be treated manually in address import/export methods - ]; - - /** - * Map for callback request - * @var array - */ - protected $_callbackRequestMap = [ - 'SHIPTOCOUNTRY' => 'country_id', - 'SHIPTOSTATE' => 'region', - 'SHIPTOCITY' => 'city', - 'SHIPTOSTREET' => 'street', - 'SHIPTOSTREET2' => 'street2', - 'SHIPTOZIP' => 'postcode', - ]; - - /** - * Payment information response specifically to be collected after some requests - * @var string[] - */ - protected $_paymentInformationResponse = [ - 'PAYERID', - 'PAYERSTATUS', - 'CORRELATIONID', - 'ADDRESSID', - 'ADDRESSSTATUS', - 'PAYMENTSTATUS', - 'PENDINGREASON', - 'PROTECTIONELIGIBILITY', - 'EMAIL', - 'SHIPPINGOPTIONNAME', - 'TAXID', - 'TAXIDTYPE', - ]; - - /** - * Line items export mapping settings - * @var array - */ - protected $_lineItemTotalExportMap = [ - Cart::AMOUNT_SUBTOTAL => 'ITEMAMT', - Cart::AMOUNT_TAX => 'TAXAMT', - Cart::AMOUNT_SHIPPING => 'SHIPPINGAMT', - ]; - - /** - * Line items export mapping settings - * @var array - */ - protected $_lineItemExportItemsFormat = [ - 'id' => 'L_NUMBER%d', - 'name' => 'L_NAME%d', - 'qty' => 'L_QTY%d', - 'amount' => 'L_AMT%d', - ]; - - /** - * Shipping options export to request mapping settings - * @var array - */ - protected $_shippingOptionsExportItemsFormat = [ - 'is_default' => 'L_SHIPPINGOPTIONISDEFAULT%d', - 'amount' => 'L_SHIPPINGOPTIONAMOUNT%d', - 'code' => 'L_SHIPPINGOPTIONNAME%d', - 'name' => 'L_SHIPPINGOPTIONLABEL%d', - 'tax_amount' => 'L_TAXAMT%d', - ]; - - /** - * init Billing Agreement request map - * - * @var string[] - */ - protected $_customerBillingAgreementRequest = ['RETURNURL', 'CANCELURL', 'BILLINGTYPE']; - - /** - * init Billing Agreement response map - * - * @var string[] - */ - protected $_customerBillingAgreementResponse = ['TOKEN']; - - /** - * Billing Agreement details request map - * - * @var string[] - */ - protected $_billingAgreementCustomerDetailsRequest = ['TOKEN']; - - /** - * Billing Agreement details response map - * - * @var string[] - */ - protected $_billingAgreementCustomerDetailsResponse = [ - 'EMAIL', - 'PAYERID', - 'PAYERSTATUS', - 'SHIPTOCOUNTRYCODE', - 'PAYERBUSINESS', - ]; - - /** - * Create Billing Agreement request map - * - * @var string[] - */ - protected $_createBillingAgreementRequest = ['TOKEN']; - - /** - * Create Billing Agreement response map - * - * @var string[] - */ - protected $_createBillingAgreementResponse = ['BILLINGAGREEMENTID']; - - /** - * Update Billing Agreement request map - * - * @var string[] - */ - protected $_updateBillingAgreementRequest = [ - 'REFERENCEID', - 'BILLINGAGREEMENTDESCRIPTION', - 'BILLINGAGREEMENTSTATUS', - 'BILLINGAGREEMENTCUSTOM', - ]; - - /** - * Update Billing Agreement response map - * - * @var string[] - */ - protected $_updateBillingAgreementResponse = [ - 'REFERENCEID', - 'BILLINGAGREEMENTDESCRIPTION', - 'BILLINGAGREEMENTSTATUS', - 'BILLINGAGREEMENTCUSTOM', - ]; - - /** - * Do Reference Transaction request map - * - * @var string[] - */ - protected $_doReferenceTransactionRequest = [ - 'REFERENCEID', - 'PAYMENTACTION', - 'AMT', - 'ITEMAMT', - 'SHIPPINGAMT', - 'TAXAMT', - 'INVNUM', - 'NOTIFYURL', - 'CURRENCYCODE', - ]; - - /** - * Do Reference Transaction response map - * - * @var string[] - */ - protected $_doReferenceTransactionResponse = ['BILLINGAGREEMENTID', 'TRANSACTIONID']; - - /** - * Fields that should be replaced in debug with '***' - * - * @var string[] - */ - protected $_debugReplacePrivateDataKeys = [ - 'ACCT', - 'EXPDATE', - 'CVV2', - 'CARDISSUE', - 'CARDSTART', - 'CREDITCARDTYPE', - 'USER', - 'PWD', - 'SIGNATURE', - ]; - - /** - * Map of credit card types supported by this API - * - * @var array - */ - protected $_supportedCcTypes = [ - 'VI' => 'Visa', - 'MC' => 'MasterCard', - 'DI' => 'Discover', - 'AE' => 'Amex', - 'SM' => 'Maestro', - 'SO' => 'Solo', - ]; - - /** - * Required fields in the response - * - * @var array - */ - protected $_requiredResponseParams = [self::DO_DIRECT_PAYMENT => ['ACK', 'CORRELATIONID', 'AMT']]; - - /** - * Warning codes recollected after each API call - * - * @var array - */ - protected $_callWarnings = []; - - /** - * Error codes recollected after each API call - * - * @var array - */ - protected $_callErrors = []; - - /** - * Whether to return raw response information after each call - * - * @var bool - */ - protected $_rawResponseNeeded = false; - - /** - * @var \Magento\Directory\Model\CountryFactory - */ - protected $_countryFactory; - - /** - * @var \Magento\Paypal\Model\Api\ProcessableExceptionFactory - */ - protected $_processableExceptionFactory; - - /** - * @var \Magento\Framework\Model\ExceptionFactory - */ - protected $_frameworkExceptionFactory; - - /** - * @var \Magento\Framework\HTTP\Adapter\CurlFactory - */ - protected $_curlFactory; - - /** - * API call HTTP headers - * - * @var array - */ - protected $_headers = []; - - /** - * @param \Magento\Customer\Helper\Address $customerAddress - * @param \Magento\Framework\Logger $logger - * @param \Magento\Framework\Locale\ResolverInterface $localeResolver - * @param \Magento\Directory\Model\RegionFactory $regionFactory - * @param \Magento\Framework\Logger\AdapterFactory $logAdapterFactory - * @param \Magento\Directory\Model\CountryFactory $countryFactory - * @param \Magento\Paypal\Model\Api\ProcessableExceptionFactory $processableExceptionFactory - * @param \Magento\Framework\Model\ExceptionFactory $frameworkExceptionFactory - * @param \Magento\Framework\HTTP\Adapter\CurlFactory $curlFactory - * @param array $data - */ - public function __construct( - \Magento\Customer\Helper\Address $customerAddress, - \Magento\Framework\Logger $logger, - \Magento\Framework\Locale\ResolverInterface $localeResolver, - \Magento\Directory\Model\RegionFactory $regionFactory, - \Magento\Framework\Logger\AdapterFactory $logAdapterFactory, - \Magento\Directory\Model\CountryFactory $countryFactory, - \Magento\Paypal\Model\Api\ProcessableExceptionFactory $processableExceptionFactory, - \Magento\Framework\Model\ExceptionFactory $frameworkExceptionFactory, - \Magento\Framework\HTTP\Adapter\CurlFactory $curlFactory, - array $data = [] - ) { - parent::__construct($customerAddress, $logger, $localeResolver, $regionFactory, $logAdapterFactory, $data); - $this->_countryFactory = $countryFactory; - $this->_processableExceptionFactory = $processableExceptionFactory; - $this->_frameworkExceptionFactory = $frameworkExceptionFactory; - $this->_curlFactory = $curlFactory; - } - - /** - * API endpoint getter - * - * @return string - */ - public function getApiEndpoint() - { - $url = $this->getUseCertAuthentication() ? 'https://api%s.paypal.com/nvp' : 'https://api-3t%s.paypal.com/nvp'; - return sprintf($url, $this->_config->getConfigValue('sandboxFlag') ? '.sandbox' : ''); - } - - /** - * Return Paypal Api version - * - * @return string - */ - public function getVersion() - { - return '72.0'; - } - - /** - * Retrieve billing agreement type - * - * @return string - */ - public function getBillingAgreementType() - { - return 'MerchantInitiatedBilling'; - } - - /** - * SetExpressCheckout call - * - * TODO: put together style and giropay settings - * - * @return void - * @link https://cms.paypal.com/us/cgi-bin/?&cmd=_render-content&content_ID=developer/e_howto_api_nvp_r_SetExpressCheckout - */ - public function callSetExpressCheckout() - { - $this->_prepareExpressCheckoutCallRequest($this->_setExpressCheckoutRequest); - $request = $this->_exportToRequest($this->_setExpressCheckoutRequest); - $this->_exportLineItems($request); - - // import/suppress shipping address, if any - $options = $this->getShippingOptions(); - if ($this->getAddress()) { - $request = $this->_importAddresses($request); - $request['ADDROVERRIDE'] = 1; - } elseif ($options && count($options) <= 10) { - // doesn't support more than 10 shipping options - $request['CALLBACK'] = $this->getShippingOptionsCallbackUrl(); - $request['CALLBACKTIMEOUT'] = 6; - // max value - $request['MAXAMT'] = $request['AMT'] + 999.00; - // it is impossible to calculate max amount - $this->_exportShippingOptions($request); - } - - $response = $this->call(self::SET_EXPRESS_CHECKOUT, $request); - $this->_importFromResponse($this->_setExpressCheckoutResponse, $response); - } - - /** - * GetExpressCheckoutDetails call - * - * @return void - * @link https://cms.paypal.com/us/cgi-bin/?&cmd=_render-content&content_ID=developer/e_howto_api_nvp_r_GetExpressCheckoutDetails - */ - public function callGetExpressCheckoutDetails() - { - $this->_prepareExpressCheckoutCallRequest($this->_getExpressCheckoutDetailsRequest); - $request = $this->_exportToRequest($this->_getExpressCheckoutDetailsRequest); - $response = $this->call(self::GET_EXPRESS_CHECKOUT_DETAILS, $request); - $this->_importFromResponse($this->_paymentInformationResponse, $response); - $this->_exportAddressses($response); - } - - /** - * DoExpressCheckout call - * - * @return void - * @link https://cms.paypal.com/us/cgi-bin/?&cmd=_render-content&content_ID=developer/e_howto_api_nvp_r_DoExpressCheckoutPayment - */ - public function callDoExpressCheckoutPayment() - { - $this->_prepareExpressCheckoutCallRequest($this->_doExpressCheckoutPaymentRequest); - $request = $this->_exportToRequest($this->_doExpressCheckoutPaymentRequest); - $this->_exportLineItems($request); - - if ($this->getAddress()) { - $request = $this->_importAddresses($request); - $request['ADDROVERRIDE'] = 1; - } - - $response = $this->call(self::DO_EXPRESS_CHECKOUT_PAYMENT, $request); - $this->_importFromResponse($this->_paymentInformationResponse, $response); - $this->_importFromResponse($this->_doExpressCheckoutPaymentResponse, $response); - $this->_importFromResponse($this->_createBillingAgreementResponse, $response); - } - - /** - * Process a credit card payment - * - * @return void - */ - public function callDoDirectPayment() - { - $request = $this->_exportToRequest($this->_doDirectPaymentRequest); - $this->_exportLineItems($request); - if ($this->getAddress()) { - $request = $this->_importAddresses($request); - } - $response = $this->call(self::DO_DIRECT_PAYMENT, $request); - $this->_importFromResponse($this->_doDirectPaymentResponse, $response); - } - - /** - * Do Reference Transaction call - * - * @return void - * @link https://cms.paypal.com/us/cgi-bin/?&cmd=_render-content&content_ID=developer/e_howto_api_nvp_r_DoReferenceTransaction - */ - public function callDoReferenceTransaction() - { - $request = $this->_exportToRequest($this->_doReferenceTransactionRequest); - $this->_exportLineItems($request); - $response = $this->call('DoReferenceTransaction', $request); - $this->_importFromResponse($this->_doReferenceTransactionResponse, $response); - } - - /** - * Check whether the last call was returned with fraud warning - * - * @return bool - */ - public function getIsFraudDetected() - { - return in_array(11610, $this->_callWarnings); - } - - /** - * Made additional request to paypal to get autharization id - * - * @return void - */ - public function callDoReauthorization() - { - $request = $this->_export($this->_doReauthorizationRequest); - $response = $this->call('DoReauthorization', $request); - $this->_import($response, $this->_doReauthorizationResponse); - } - - /** - * DoCapture call - * - * @return void - * @link https://cms.paypal.com/us/cgi-bin/?&cmd=_render-content&content_ID=developer/e_howto_api_nvp_r_DoCapture - */ - public function callDoCapture() - { - $this->setCompleteType($this->_getCaptureCompleteType()); - $request = $this->_exportToRequest($this->_doCaptureRequest); - $response = $this->call(self::DO_CAPTURE, $request); - $this->_importFromResponse($this->_paymentInformationResponse, $response); - $this->_importFromResponse($this->_doCaptureResponse, $response); - } - - /** - * DoAuthorization call - * - * @return $this - * @link https://cms.paypal.com/us/cgi-bin/?&cmd=_render-content&content_ID=developer/e_howto_api_nvp_r_DoAuthorization - */ - public function callDoAuthorization() - { - $request = $this->_exportToRequest($this->_doAuthorizationRequest); - $response = $this->call(self::DO_AUTHORIZATION, $request); - $this->_importFromResponse($this->_paymentInformationResponse, $response); - $this->_importFromResponse($this->_doAuthorizationResponse, $response); - - return $this; - } - - /** - * DoVoid call - * - * @return void - * @link https://cms.paypal.com/us/cgi-bin/?&cmd=_render-content&content_ID=developer/e_howto_api_nvp_r_DoVoid - */ - public function callDoVoid() - { - $request = $this->_exportToRequest($this->_doVoidRequest); - $this->call(self::DO_VOID, $request); - } - - /** - * GetTransactionDetails - * - * @return void - * @link https://cms.paypal.com/us/cgi-bin/?&cmd=_render-content&content_ID=developer/e_howto_api_nvp_r_GetTransactionDetails - */ - public function callGetTransactionDetails() - { - $request = $this->_exportToRequest($this->_getTransactionDetailsRequest); - $response = $this->call('GetTransactionDetails', $request); - $this->_importFromResponse($this->_getTransactionDetailsResponse, $response); - } - - /** - * RefundTransaction call - * - * @return void - * @link https://cms.paypal.com/us/cgi-bin/?&cmd=_render-content&content_ID=developer/e_howto_api_nvp_r_RefundTransaction - */ - public function callRefundTransaction() - { - $request = $this->_exportToRequest($this->_refundTransactionRequest); - if ($this->getRefundType() === \Magento\Paypal\Model\Config::REFUND_TYPE_PARTIAL) { - $request['AMT'] = $this->getAmount(); - } - $response = $this->call(self::REFUND_TRANSACTION, $request); - $this->_importFromResponse($this->_refundTransactionResponse, $response); - } - - /** - * ManagePendingTransactionStatus - * - * @return void - * @link https://cms.paypal.com/us/cgi-bin/?&cmd=_render-content&content_ID=developer/e_howto_api_nvp_r_ManagePendingTransactionStatus - */ - public function callManagePendingTransactionStatus() - { - $request = $this->_exportToRequest($this->_managePendingTransactionStatusRequest); - if (isset($request['ACTION'])) { - $request['ACTION'] = $this->_filterPaymentReviewAction($request['ACTION']); - } - $response = $this->call('ManagePendingTransactionStatus', $request); - $this->_importFromResponse($this->_managePendingTransactionStatusResponse, $response); - } - - /** - * GetPalDetails call - * - * @return void - * @link https://www.x.com/docs/DOC-1300 - * @link https://cms.paypal.com/us/cgi-bin/?cmd=_render-content&content_ID=developer/e_howto_api_ECButtonIntegration - */ - public function callGetPalDetails() - { - $response = $this->call('getPalDetails', []); - $this->_importFromResponse($this->_getPalDetailsResponse, $response); - } - - /** - * Set Customer BillingA greement call - * - * @return void - * @link https://cms.paypal.com/us/cgi-bin/?&cmd=_render-content&content_ID=developer/e_howto_api_nvp_r_SetCustomerBillingAgreement - */ - public function callSetCustomerBillingAgreement() - { - $request = $this->_exportToRequest($this->_customerBillingAgreementRequest); - $response = $this->call('SetCustomerBillingAgreement', $request); - $this->_importFromResponse($this->_customerBillingAgreementResponse, $response); - } - - /** - * Get Billing Agreement Customer Details call - * - * @return void - * @link https://cms.paypal.com/us/cgi-bin/?&cmd=_render-content&content_ID=developer/e_howto_api_nvp_r_GetBillingAgreementCustomerDetails - */ - public function callGetBillingAgreementCustomerDetails() - { - $request = $this->_exportToRequest($this->_billingAgreementCustomerDetailsRequest); - $response = $this->call('GetBillingAgreementCustomerDetails', $request); - $this->_importFromResponse($this->_billingAgreementCustomerDetailsResponse, $response); - } - - /** - * Create Billing Agreement call - * - * @return void - */ - public function callCreateBillingAgreement() - { - $request = $this->_exportToRequest($this->_createBillingAgreementRequest); - $response = $this->call('CreateBillingAgreement', $request); - $this->_importFromResponse($this->_createBillingAgreementResponse, $response); - } - - /** - * Billing Agreement Update call - * - * @return void - */ - public function callUpdateBillingAgreement() - { - $request = $this->_exportToRequest($this->_updateBillingAgreementRequest); - try { - $response = $this->call('BillAgreementUpdate', $request); - } catch (\Magento\Framework\Model\Exception $e) { - if (in_array(10201, $this->_callErrors)) { - $this->setIsBillingAgreementAlreadyCancelled(true); - } - throw $e; - } - $this->_importFromResponse($this->_updateBillingAgreementResponse, $response); - } - - /** - * Import callback request array into $this public data - * - * @param array $request - * @return \Magento\Framework\Object - */ - public function prepareShippingOptionsCallbackAddress(array $request) - { - $address = new \Magento\Framework\Object(); - \Magento\Framework\Object\Mapper::accumulateByMap($request, $address, $this->_callbackRequestMap); - $address->setExportedKeys(array_values($this->_callbackRequestMap)); - $this->_applyStreetAndRegionWorkarounds($address); - return $address; - } - - /** - * Prepare response for shipping options callback - * - * @return string - */ - public function formatShippingOptionsCallback() - { - $response = []; - if (!$this->_exportShippingOptions($response)) { - $response['NO_SHIPPING_OPTION_DETAILS'] = '1'; - } - $response = $this->_addMethodToRequest(self::CALLBACK_RESPONSE, $response); - return $this->_buildQuery($response); - } - - /** - * Add method to request array - * - * @param string $methodName - * @param array $request - * @return array - */ - protected function _addMethodToRequest($methodName, $request) - { - $request['METHOD'] = $methodName; - return $request; - } - - /** - * Additional response processing. - * Hack to cut off length from API type response params. - * - * @param array $response - * @return array - */ - protected function _postProcessResponse($response) - { - foreach ($response as $key => $value) { - $pos = strpos($key, '['); - - if ($pos === false) { - continue; - } - - unset($response[$key]); - - if ($pos !== 0) { - $modifiedKey = substr($key, 0, $pos); - $response[$modifiedKey] = $value; - } - } - - return $response; - } - - /** - * Do the API call - * - * @param string $methodName - * @param array $request - * @return array - * @throws \Magento\Framework\Model\Exception|\Exception - */ - public function call($methodName, array $request) - { - $request = $this->_addMethodToRequest($methodName, $request); - $eachCallRequest = $this->_prepareEachCallRequest($methodName); - if ($this->getUseCertAuthentication()) { - $key = array_search('SIGNATURE', $eachCallRequest); - if ($key) { - unset($eachCallRequest[$key]); - } - } - $request = $this->_exportToRequest($eachCallRequest, $request); - $debugData = ['url' => $this->getApiEndpoint(), $methodName => $request]; - - try { - $http = $this->_curlFactory->create(); - $config = ['timeout' => 60, 'verifypeer' => $this->_config->getConfigValue('verifyPeer')]; - if ($this->getUseProxy()) { - $config['proxy'] = $this->getProxyHost() . ':' . $this->getProxyPort(); - } - if ($this->getUseCertAuthentication()) { - $config['ssl_cert'] = $this->getApiCertificate(); - } - $http->setConfig($config); - $http->write( - \Zend_Http_Client::POST, - $this->getApiEndpoint(), - '1.1', - $this->_headers, - $this->_buildQuery($request) - ); - $response = $http->read(); - } catch (\Exception $e) { - $debugData['http_error'] = ['error' => $e->getMessage(), 'code' => $e->getCode()]; - $this->_debug($debugData); - throw $e; - } - - $response = preg_split('/^\r?$/m', $response, 2); - $response = trim($response[1]); - $response = $this->_deformatNVP($response); - - $debugData['response'] = $response; - $this->_debug($debugData); - - $response = $this->_postProcessResponse($response); - - // handle transport error - if ($http->getErrno()) { - $this->_logger->logException( - new \Exception( - sprintf('PayPal NVP CURL connection error #%s: %s', $http->getErrno(), $http->getError()) - ) - ); - $http->close(); - - throw new \Magento\Framework\Model\Exception(__('We can\'t contact the PayPal gateway.')); - } - - // cUrl resource must be closed after checking it for errors - $http->close(); - - if (!$this->_validateResponse($methodName, $response)) { - $this->_logger->logException(new \Exception(__("PayPal response hasn't required fields."))); - throw new \Magento\Framework\Model\Exception(__('Something went wrong while processing your order.')); - } - - $this->_callErrors = []; - if ($this->_isCallSuccessful($response)) { - if ($this->_rawResponseNeeded) { - $this->setRawSuccessResponseData($response); - } - return $response; - } - $this->_handleCallErrors($response); - return $response; - } - - /** - * Setter for 'raw response needed' flag - * - * @param bool $flag - * @return $this - */ - public function setRawResponseNeeded($flag) - { - $this->_rawResponseNeeded = $flag; - return $this; - } - - /** - * Handle logical errors - * - * @param array $response - * @return void - * @throws \Magento\Paypal\Model\Api\ProcessableException|\Magento\Framework\Model\Exception - */ - protected function _handleCallErrors($response) - { - $errors = $this->_extractErrorsFromResponse($response); - if (empty($errors)) { - return; - } - - $errorMessages = []; - foreach ($errors as $error) { - $errorMessages[] = $error['message']; - $this->_callErrors[] = $error['code']; - } - $errorMessages = implode(' ', $errorMessages); - - $exceptionLogMessage = sprintf( - 'PayPal NVP gateway errors: %s Correlation ID: %s. Version: %s.', - $errorMessages, - isset($response['CORRELATIONID']) ? $response['CORRELATIONID'] : '', - isset($response['VERSION']) ? $response['VERSION'] : '' - ); - - $exception = count($errors) == 1 && $this->_isProcessableError($errors[0]['code']) - ? $this->_processableExceptionFactory->create( - ['message' => $exceptionLogMessage, 'code' => $errors[0]['code']] - ) : $this->_frameworkExceptionFactory->create( - ['message' => $exceptionLogMessage, 'code' => 0] - ); - $this->_logger->logException($exception); - - $exception->setMessage(__('PayPal gateway has rejected request. %1', $errorMessages)); - - throw $exception; - } - - /** - * Format error message from error code, short error message and long error message - * - * @param string $errorCode - * @param string $shortErrorMessage - * @param string $longErrorMessage - * @return string - */ - protected function _formatErrorMessage($errorCode, $shortErrorMessage, $longErrorMessage) - { - $longErrorMessage = preg_replace('/\.$/', '', $longErrorMessage); - $shortErrorMessage = preg_replace('/\.$/', '', $shortErrorMessage); - - return $longErrorMessage ? sprintf('%s (#%s: %s).', $longErrorMessage, $errorCode, $shortErrorMessage) - : sprintf('#%s: %s.', $errorCode, $shortErrorMessage); - } - - /** - * Check whether PayPal error can be processed - * - * @param int $errorCode - * @return bool - */ - protected function _isProcessableError($errorCode) - { - $processableErrorsList = $this->getProcessableErrors(); - - if (!$processableErrorsList || !is_array($processableErrorsList)) { - return false; - } - - return in_array($errorCode, $processableErrorsList); - } - - /** - * Extract errors from PayPal's response and return them in array - * - * @param array $response - * @return array - */ - protected function _extractErrorsFromResponse($response) - { - $errors = []; - - for ($i = 0; isset($response["L_ERRORCODE{$i}"]); $i++) { - $errorCode = $response["L_ERRORCODE{$i}"]; - $errorMessage = $this->_formatErrorMessage( - $errorCode, - $response["L_SHORTMESSAGE{$i}"], - isset($response["L_LONGMESSAGE{$i}"]) ? $response["L_LONGMESSAGE{$i}"] : null - ); - $errors[] = [ - 'code' => $errorCode, - 'message' => $errorMessage, - ]; - } - - return $errors; - } - - /** - * Catch success calls and collect warnings - * - * @param array $response - * @return bool success flag - */ - protected function _isCallSuccessful($response) - { - if (!isset($response['ACK'])) { - return false; - } - - $ack = strtoupper($response['ACK']); - $this->_callWarnings = []; - if ($ack == 'SUCCESS' || $ack == 'SUCCESSWITHWARNING') { - // collect warnings - if ($ack == 'SUCCESSWITHWARNING') { - for ($i = 0; isset($response["L_ERRORCODE{$i}"]); $i++) { - $this->_callWarnings[] = $response["L_ERRORCODE{$i}"]; - } - } - return true; - } - return false; - } - - /** - * Validate response array. - * - * @param string $method - * @param array $response - * @return bool - */ - protected function _validateResponse($method, $response) - { - if (isset($this->_requiredResponseParams[$method])) { - foreach ($this->_requiredResponseParams[$method] as $param) { - if (!isset($response[$param])) { - return false; - } - } - } - return true; - } - - /** - * Parse an NVP response string into an associative array - * @param string $nvpstr - * @return array - */ - protected function _deformatNVP($nvpstr) - { - $intial = 0; - $nvpArray = []; - - $nvpstr = strpos($nvpstr, "\r\n\r\n") !== false ? substr($nvpstr, strpos($nvpstr, "\r\n\r\n") + 4) : $nvpstr; - - while (strlen($nvpstr)) { - //postion of Key - $keypos = strpos($nvpstr, '='); - //position of value - $valuepos = strpos($nvpstr, '&') ? strpos($nvpstr, '&') : strlen($nvpstr); - - /*getting the Key and Value values and storing in a Associative Array*/ - $keyval = substr($nvpstr, $intial, $keypos); - $valval = substr($nvpstr, $keypos + 1, $valuepos - $keypos - 1); - //decoding the respose - $nvpArray[urldecode($keyval)] = urldecode($valval); - $nvpstr = substr($nvpstr, $valuepos + 1, strlen($nvpstr)); - } - return $nvpArray; - } - - /** - * NVP doesn't support passing discount total as a separate amount - add it as a line item - * - * @param array $request - * @param int $i - * @return true|null - */ - protected function _exportLineItems(array &$request, $i = 0) - { - if (!$this->_cart) { - return; - } - $this->_cart->setTransferDiscountAsItem(); - return parent::_exportLineItems($request, $i); - } - - /** - * Create billing and shipping addresses basing on response data - * - * @param array $data - * @return void - */ - protected function _exportAddressses($data) - { - $address = new \Magento\Framework\Object(); - \Magento\Framework\Object\Mapper::accumulateByMap($data, $address, $this->_billingAddressMap); - $address->setExportedKeys(array_values($this->_billingAddressMap)); - $this->_applyStreetAndRegionWorkarounds($address); - $this->setExportedBillingAddress($address); - // assume there is shipping address if there is at least one field specific to shipping - if (isset($data['SHIPTONAME'])) { - $shippingAddress = clone $address; - \Magento\Framework\Object\Mapper::accumulateByMap($data, $shippingAddress, $this->_shippingAddressMap); - $this->_applyStreetAndRegionWorkarounds($shippingAddress); - // PayPal doesn't provide detailed shipping name fields, so the name will be overwritten - $shippingAddress->addData(['firstname' => $data['SHIPTONAME']]); - $this->setExportedShippingAddress($shippingAddress); - } - } - - /** - * Adopt specified address object to be compatible with Magento - * - * @param \Magento\Framework\Object $address - * @return void - */ - protected function _applyStreetAndRegionWorkarounds(\Magento\Framework\Object $address) - { - // merge street addresses into 1 - if ($address->hasStreet2()) { - $address->setStreet(implode("\n", [$address->getStreet(), $address->getStreetLine(2)])); - $address->unsStreet2(); - } - // attempt to fetch region_id from directory - if ($address->getCountryId() && $address->getRegion()) { - $regions = $this->_countryFactory->create()->loadByCode( - $address->getCountryId() - )->getRegionCollection()->addRegionCodeOrNameFilter( - $address->getRegion() - )->setPageSize( - 1 - ); - foreach ($regions as $region) { - $address->setRegionId($region->getId()); - $address->setExportedKeys(array_merge($address->getExportedKeys(), ['region_id'])); - break; - } - } - } - - /** - * Prepare request data basing on provided addresses - * - * @param array $to - * @return array - */ - protected function _importAddresses(array $to) - { - $billingAddress = $this->getBillingAddress() ? $this->getBillingAddress() : $this->getAddress(); - $shippingAddress = $this->getAddress(); - - $to = \Magento\Framework\Object\Mapper::accumulateByMap( - $billingAddress, - $to, - array_merge(array_flip($this->_billingAddressMap), $this->_billingAddressMapRequest) - ); - $regionCode = $this->_lookupRegionCodeFromAddress($billingAddress); - if ($regionCode) { - $to['STATE'] = $regionCode; - } - if (!$this->getSuppressShipping()) { - $to = \Magento\Framework\Object\Mapper::accumulateByMap( - $shippingAddress, - $to, - array_flip($this->_shippingAddressMap) - ); - $regionCode = $this->_lookupRegionCodeFromAddress($shippingAddress); - if ($regionCode) { - $to['SHIPTOSTATE'] = $regionCode; - } - $this->_importStreetFromAddress($shippingAddress, $to, 'SHIPTOSTREET', 'SHIPTOSTREET2'); - $this->_importStreetFromAddress($billingAddress, $to, 'STREET', 'STREET2'); - $to['SHIPTONAME'] = $shippingAddress->getName(); - } - return $to; - } - - /** - * Filter for credit card type - * - * @param string $value - * @return string - */ - protected function _filterCcType($value) - { - if (isset($this->_supportedCcTypes[$value])) { - return $this->_supportedCcTypes[$value]; - } - return ''; - } - - /** - * Filter for true/false values (converts to boolean) - * - * @param mixed $value - * @return bool|mixed - */ - protected function _filterToBool($value) - { - if ('false' === $value || '0' === $value) { - return false; - } elseif ('true' === $value || '1' === $value) { - return true; - } - return $value; - } - - /** - * Filter for 'AUTOBILLAMT' - * - * @param string $value - * @return string - */ - protected function _filterBillFailedLater($value) - { - return $value ? 'AddToNextBilling' : 'NoAutoBill'; - } - - /** - * Filter for 'BILLINGPERIOD' and 'TRIALBILLINGPERIOD' - * - * @param string $value - * @return string - */ - protected function _filterPeriodUnit($value) - { - switch ($value) { - case 'day': - return 'Day'; - case 'week': - return 'Week'; - case 'semi_month': - return 'SemiMonth'; - case 'month': - return 'Month'; - case 'year': - return 'Year'; - default: - break; - } - } - - /** - * Filter for 'FAILEDINITAMTACTION' - * - * @param string $value - * @return string - */ - protected function _filterInitialAmountMayFail($value) - { - return $value ? 'ContinueOnFailure' : 'CancelOnFailure'; - } - - /** - * Filter for billing agreement status - * - * @param string $value - * @return string - */ - protected function _filterBillingAgreementStatus($value) - { - switch ($value) { - case 'canceled': - return 'Canceled'; - case 'active': - return 'Active'; - default: - break; - } - } - - /** - * Convert payment status from NVP format to paypal/info model format - * - * @param string $value - * @return string|null - */ - protected function _filterPaymentStatusFromNvpToInfo($value) - { - switch ($value) { - case 'None': - return \Magento\Paypal\Model\Info::PAYMENTSTATUS_NONE; - case 'Completed': - return \Magento\Paypal\Model\Info::PAYMENTSTATUS_COMPLETED; - case 'Denied': - return \Magento\Paypal\Model\Info::PAYMENTSTATUS_DENIED; - case 'Expired': - return \Magento\Paypal\Model\Info::PAYMENTSTATUS_EXPIRED; - case 'Failed': - return \Magento\Paypal\Model\Info::PAYMENTSTATUS_FAILED; - case 'In-Progress': - return \Magento\Paypal\Model\Info::PAYMENTSTATUS_INPROGRESS; - case 'Pending': - return \Magento\Paypal\Model\Info::PAYMENTSTATUS_PENDING; - case 'Refunded': - return \Magento\Paypal\Model\Info::PAYMENTSTATUS_REFUNDED; - case 'Partially-Refunded': - return \Magento\Paypal\Model\Info::PAYMENTSTATUS_REFUNDEDPART; - case 'Reversed': - return \Magento\Paypal\Model\Info::PAYMENTSTATUS_REVERSED; - case 'Canceled-Reversal': - return \Magento\Paypal\Model\Info::PAYMENTSTATUS_UNREVERSED; - case 'Processed': - return \Magento\Paypal\Model\Info::PAYMENTSTATUS_PROCESSED; - case 'Voided': - return \Magento\Paypal\Model\Info::PAYMENTSTATUS_VOIDED; - default: - break; - } - } - - /** - * Convert payment review action to NVP-compatible value - * - * @param string $value - * @return string|null - */ - protected function _filterPaymentReviewAction($value) - { - switch ($value) { - case \Magento\Paypal\Model\Pro::PAYMENT_REVIEW_ACCEPT: - return 'Accept'; - case \Magento\Paypal\Model\Pro::PAYMENT_REVIEW_DENY: - return 'Deny'; - default: - break; - } - } - - /** - * Return capture type - * - * @return string - */ - protected function _getCaptureCompleteType() - { - return $this->getIsCaptureComplete() ? $this->_captureTypeComplete : $this->_captureTypeNotcomplete; - } - - /** - * Return each call request without unused fields in case of Express Checkout Unilateral payments - * - * @param string $methodName Current method name - * @return array - */ - protected function _prepareEachCallRequest($methodName) - { - $expressCheckoutMethods = [ - self::SET_EXPRESS_CHECKOUT, - self::GET_EXPRESS_CHECKOUT_DETAILS, - self::DO_EXPRESS_CHECKOUT_PAYMENT, - ]; - if (!in_array($methodName, $expressCheckoutMethods) || !$this->_config->shouldUseUnilateralPayments()) { - return $this->_eachCallRequest; - } - return array_diff($this->_eachCallRequest, ['USER', 'PWD', 'SIGNATURE']); - } - - /** - * Check the EC request against unilateral payments mode and remove the SUBJECT if needed - * - * @param &array $requestFields - * @return void - */ - protected function _prepareExpressCheckoutCallRequest(&$requestFields) - { - if (!$this->_config->shouldUseUnilateralPayments()) { - $key = array_search('SUBJECT', $requestFields); - if ($key) { - unset($requestFields[$key]); - } - } - } -} diff --git a/app/code/Magento/Paypal/Model/Api/PayflowNvp.php b/app/code/Magento/Paypal/Model/Api/PayflowNvp.php deleted file mode 100644 index c58fd46fdf434..0000000000000 --- a/app/code/Magento/Paypal/Model/Api/PayflowNvp.php +++ /dev/null @@ -1,810 +0,0 @@ - 'partner', - 'VENDOR' => 'vendor', - 'USER' => 'user', - 'PWD' => 'password', - 'BUTTONSOURCE' => 'build_notation_code', - 'TENDER' => 'tender', - - // commands - 'RETURNURL' => 'return_url', - 'CANCELURL' => 'cancel_url', - 'INVNUM' => 'inv_num', - 'TOKEN' => 'token', - 'CORRELATIONID' => 'correlation_id', - 'CUSTIP' => 'ip_address', - 'NOTIFYURL' => 'notify_url', - 'NOTE' => 'note', - - // style settings - 'PAGESTYLE' => 'page_style', - 'HDRIMG' => 'hdrimg', - 'HDRBORDERCOLOR' => 'hdrbordercolor', - 'HDRBACKCOLOR' => 'hdrbackcolor', - 'PAYFLOWCOLOR' => 'payflowcolor', - 'LOCALECODE' => 'locale_code', - - // transaction info - //We need to store paypal trx id for correct IPN working - 'PPREF' => 'paypal_transaction_id', - 'PAYMENTINFO_0_TRANSACTIONID' => 'paypal_transaction_id', - 'TRANSACTIONID' => 'paypal_transaction_id', - 'REFUNDTRANSACTIONID' => 'paypal_transaction_id', - - 'PNREF' => 'transaction_id', - 'ORIGID' => 'authorization_id', - 'CAPTURECOMPLETE' => 'complete_type', - 'AMT' => 'amount', - 'AVSADDR' => 'address_verification', - 'AVSZIP' => 'postcode_verification', - - // payment/billing info - 'CURRENCY' => 'currency_code', - 'PAYMENTSTATUS' => 'payment_status', - 'PENDINGREASON' => 'pending_reason', - 'PAYERID' => 'payer_id', - 'PAYERSTATUS' => 'payer_status', - 'EMAIL' => 'email', - - // backwards compatibility - 'FIRSTNAME' => 'firstname', - 'LASTNAME' => 'lastname', - - // paypal direct credit card information - 'ACCT' => 'credit_card_number', - 'EXPDATE' => 'credit_card_expiration_date', - 'CVV2' => 'credit_card_cvv2', - 'CARDSTART' => 'maestro_solo_issue_date', - 'CARDISSUE' => 'maestro_solo_issue_number', - 'CVV2MATCH' => 'cvv2_check_result', - - // cardinal centinel - 'AUTHSTATUS3DS' => 'centinel_authstatus', - 'MPIVENDOR3DS' => 'centinel_mpivendor', - 'CAVV' => 'centinel_cavv', - 'ECI' => 'centinel_eci', - 'XID' => 'centinel_xid', - 'VPAS' => 'centinel_vpas_result', - 'ECISUBMITTED3DS' => 'centinel_eci_result', - 'USERSELECTEDFUNDINGSOURCE' => 'funding_source', - ]; - - /** - * Fields that should be replaced in debug with '***' - * - * @var string[] - */ - protected $_debugReplacePrivateDataKeys = ['ACCT', 'EXPDATE', 'CVV2', 'PARTNER', 'USER', 'VENDOR', 'PWD']; - - /** - * DoDirectPayment request map - * - * @var string[] - */ - protected $_doDirectPaymentRequest = [ - 'ACCT', - 'EXPDATE', - 'CVV2', - 'CURRENCY', - 'EMAIL', - 'TENDER', - 'NOTIFYURL', - 'AMT', - 'CUSTIP', - 'INVNUM', - 'CARDISSUE', - 'CARDSTART', - 'AUTHSTATUS3DS', - 'MPIVENDOR3DS', - 'CAVV', - 'ECI', - 'XID', - 'TAXAMT', - 'FREIGHTAMT', - ]; - - /** - * DoDirectPayment response map - * - * @var string[] - */ - protected $_doDirectPaymentResponse = [ - 'PNREF', - 'PPREF', - 'CORRELATIONID', - 'CVV2MATCH', - 'AVSADDR', - 'AVSZIP', - 'PENDINGREASON', - ]; - - /** - * DoCapture request map - * - * @var string[] - */ - protected $_doCaptureRequest = ['ORIGID', 'CAPTURECOMPLETE', 'AMT', 'TENDER', 'NOTE', 'INVNUM']; - - /** - * DoCapture response map - * - * @var string[] - */ - protected $_doCaptureResponse = ['PNREF', 'PPREF']; - - /** - * DoVoid request map - * - * @var string[] - */ - protected $_doVoidRequest = ['ORIGID', 'NOTE', 'TENDER']; - - /** - * Request map for each API call - * - * @var string[] - */ - protected $_eachCallRequest = ['PARTNER', 'USER', 'VENDOR', 'PWD', 'BUTTONSOURCE']; - - /** - * RefundTransaction request map - * - * @var string[] - */ - protected $_refundTransactionRequest = ['ORIGID', 'TENDER']; - - /** - * RefundTransaction response map - * - * @var string[] - */ - protected $_refundTransactionResponse = ['PNREF', 'PPREF']; - - /** - * SetExpressCheckout request map - * - * @var string[] - */ - protected $_setExpressCheckoutRequest = [ - 'TENDER', - 'AMT', - 'CURRENCY', - 'RETURNURL', - 'CANCELURL', - 'INVNUM', - 'PAGESTYLE', - 'HDRIMG', - 'HDRBORDERCOLOR', - 'HDRBACKCOLOR', - 'PAYFLOWCOLOR', - 'LOCALECODE', - 'USERSELECTEDFUNDINGSOURCE', - ]; - - /** - * SetExpressCheckout response map - * - * @var string[] - */ - protected $_setExpressCheckoutResponse = ['REPMSG', 'TOKEN']; - - /** - * GetExpressCheckoutDetails request/response map - * - * @var string[] - */ - protected $_getExpressCheckoutDetailsRequest = ['TENDER', 'TOKEN']; - - /** - * DoExpressCheckoutPayment request map - * - * @var string[] - */ - protected $_doExpressCheckoutPaymentRequest = [ - 'TENDER', - 'TOKEN', - 'PAYERID', - 'AMT', - 'CURRENCY', - 'CUSTIP', - 'BUTTONSOURCE', - 'NOTIFYURL', - ]; - - /** - * DoExpressCheckoutPayment response map - * - * @var string[] - */ - protected $_doExpressCheckoutPaymentResponse = [ - 'PNREF', - 'PPREF', - 'REPMSG', - 'AMT', - 'PENDINGREASON', - 'CVV2MATCH', - 'AVSADDR', - 'AVSZIP', - 'CORRELATIONID', - ]; - - /** - * GetTransactionDetailsRequest - * - * @var string[] - */ - protected $_getTransactionDetailsRequest = ['ORIGID', 'TENDER']; - - /** - * GetTransactionDetailsResponse - * - * @var string[] - */ - protected $_getTransactionDetailsResponse = [ - 'PAYERID', - 'FIRSTNAME', - 'LASTNAME', - 'TRANSACTIONID', - 'PARENTTRANSACTIONID', - 'CURRENCYCODE', - 'AMT', - 'PAYMENTSTATUS', - ]; - - /** - * Map for shipping address import/export (extends billing address mapper) - * - * @var array - */ - protected $_shippingAddressMap = [ - 'SHIPTOCOUNTRY' => 'country_id', - 'SHIPTOSTATE' => 'region', - 'SHIPTOCITY' => 'city', - 'SHIPTOSTREET' => 'street', - 'SHIPTOSTREET2' => 'street2', - 'SHIPTOZIP' => 'postcode', - 'SHIPTOPHONENUM' => 'telephone', - ]; - - /** - * Map for billing address import/export - * - * @var array - */ - protected $_billingAddressMap = [ - 'BUSINESS' => 'company', - 'NOTETEXT' => 'customer_notes', - 'EMAIL' => 'email', - 'FIRSTNAME' => 'firstname', - 'LASTNAME' => 'lastname', - 'MIDDLENAME' => 'middlename', - 'SALUTATION' => 'prefix', - 'SUFFIX' => 'suffix', - 'COUNTRYCODE' => 'country_id', - 'STATE' => 'region', - 'CITY' => 'city', - 'STREET' => 'street', - 'STREET2' => 'street2', - 'ZIP' => 'postcode', - 'PHONENUM' => 'telephone', - ]; - - /** - * Map for billing address to do request to Payflow - * - * @var array - */ - protected $_billingAddressMapRequest = ['country_id' => 'COUNTRY']; - - /** - * Line items export mapping settings - * - * @var array - */ - protected $_lineItemTotalExportMap = [Cart::AMOUNT_TAX => 'TAXAMT', Cart::AMOUNT_SHIPPING => 'FREIGHTAMT']; - - /** - * Line items export request totals format - * - * @var array - */ - protected $_lineItemsExportRequestTotalsFormat = [ - 'amount' => 'PAYMENTREQUEST_%d_ITEMAMT', - Cart::AMOUNT_TAX => 'TAXAMT', - Cart::AMOUNT_SHIPPING => 'FREIGHTAMT', - ]; - - /** - * Line items export items format - * - * @var array - */ - protected $_lineItemExportItemsFormat = [ - 'name' => 'L_NAME%d', - 'qty' => 'L_QTY%d', - 'amount' => 'L_COST%d', - ]; - - /** - * Payment information response specifically to be collected after some requests - * - * @var string[] - */ - protected $_paymentInformationResponse = [ - 'PAYERID', - 'CORRELATIONID', - 'ADDRESSID', - 'ADDRESSSTATUS', - 'PAYMENTSTATUS', - 'PENDINGREASON', - 'PROTECTIONELIGIBILITY', - 'EMAIL', - ]; - - /** - * Required fields in the response - * - * @var array - */ - protected $_requiredResponseParams = [ - self::DO_DIRECT_PAYMENT => ['RESULT', 'PNREF', 'PPREF'], - ]; - - /** - * @var \Magento\Framework\Math\Random - */ - protected $mathRandom; - - /** - * @var NvpFactory - */ - protected $nvpFactory; - - /** - * @param \Magento\Customer\Helper\Address $customerAddress - * @param \Magento\Framework\Logger $logger - * @param \Magento\Framework\Locale\ResolverInterface $localeResolver - * @param \Magento\Directory\Model\RegionFactory $regionFactory - * @param \Magento\Framework\Logger\AdapterFactory $logAdapterFactory - * @param \Magento\Directory\Model\CountryFactory $countryFactory - * @param \Magento\Paypal\Model\Api\ProcessableExceptionFactory $processableExceptionFactory - * @param \Magento\Framework\Model\ExceptionFactory $frameworkExceptionFactory - * @param \Magento\Framework\HTTP\Adapter\CurlFactory $curlFactory - * @param \Magento\Framework\Math\Random $mathRandom - * @param NvpFactory $nvpFactory - * @param array $data - */ - public function __construct( - \Magento\Customer\Helper\Address $customerAddress, - \Magento\Framework\Logger $logger, - \Magento\Framework\Locale\ResolverInterface $localeResolver, - \Magento\Directory\Model\RegionFactory $regionFactory, - \Magento\Framework\Logger\AdapterFactory $logAdapterFactory, - \Magento\Directory\Model\CountryFactory $countryFactory, - \Magento\Paypal\Model\Api\ProcessableExceptionFactory $processableExceptionFactory, - \Magento\Framework\Model\ExceptionFactory $frameworkExceptionFactory, - \Magento\Framework\HTTP\Adapter\CurlFactory $curlFactory, - \Magento\Framework\Math\Random $mathRandom, - NvpFactory $nvpFactory, - array $data = [] - ) { - parent::__construct( - $customerAddress, - $logger, - $localeResolver, - $regionFactory, - $logAdapterFactory, - $countryFactory, - $processableExceptionFactory, - $frameworkExceptionFactory, - $curlFactory, - $data - ); - $this->mathRandom = $mathRandom; - $this->nvpFactory = $nvpFactory; - } - - /** - * API endpoint getter - * - * @return string - */ - public function getApiEndpoint() - { - return sprintf( - 'https://%spayflowpro.paypal.com/transaction', - $this->_config->getConfigValue('sandboxFlag') ? 'pilot-' : '' - ); - } - - /** - * Return Payflow partner based on config data - * - * @return string - */ - public function getPartner() - { - return $this->_getDataOrConfig('partner'); - } - - /** - * Return Payflow user based on config data - * - * @return string - */ - public function getUser() - { - return $this->_getDataOrConfig('user'); - } - - /** - * Return Payflow password based on config data - * - * @return string - */ - public function getPassword() - { - return $this->_getDataOrConfig('pwd'); - } - - /** - * Return Payflow vendor based on config data - * - * @return string - */ - public function getVendor() - { - return $this->_getDataOrConfig('vendor'); - } - - /** - * Return Payflow tender based on config data - * - * @return string - */ - public function getTender() - { - if ($this->_config->getMethodCode() == \Magento\Paypal\Model\Config::METHOD_WPP_PE_EXPRESS) { - return self::TENDER_PAYPAL; - } - return self::TENDER_CC; - } - - /** - * Override transaction id getting to process payflow accounts not assigned to paypal side - * - * @return string - */ - public function getPaypalTransactionId() - { - if ($this->getData('paypal_transaction_id')) { - return $this->getData('paypal_transaction_id'); - } - return $this->getTransactionId(); - } - - /** - * Add method to request array - * - * @param string $methodName - * @param array $request - * @return array - */ - protected function _addMethodToRequest($methodName, $request) - { - $request['TRXTYPE'] = $this->_mapPaypalMethodName($methodName); - if (!is_null($this->_getPayflowActionName($methodName))) { - $request['ACTION'] = $this->_getPayflowActionName($methodName); - } - return $request; - } - - /** - * Return Payflow Edition - * - * @param string $methodName - * @return string|null - */ - protected function _getPayflowActionName($methodName) - { - switch ($methodName) { - case \Magento\Paypal\Model\Api\Nvp::SET_EXPRESS_CHECKOUT: - return self::EXPRESS_SET; - case \Magento\Paypal\Model\Api\Nvp::GET_EXPRESS_CHECKOUT_DETAILS: - return self::EXPRESS_GET; - case \Magento\Paypal\Model\Api\Nvp::DO_EXPRESS_CHECKOUT_PAYMENT: - return self::EXPRESS_DO_PAYMENT; - } - return null; - } - - /** - * Map paypal method names - * - * @param string| $methodName - * @return string - */ - protected function _mapPaypalMethodName($methodName) - { - switch ($methodName) { - case \Magento\Paypal\Model\Api\Nvp::DO_EXPRESS_CHECKOUT_PAYMENT: - case \Magento\Paypal\Model\Api\Nvp::GET_EXPRESS_CHECKOUT_DETAILS: - case \Magento\Paypal\Model\Api\Nvp::SET_EXPRESS_CHECKOUT: - case \Magento\Paypal\Model\Api\Nvp::DO_DIRECT_PAYMENT: - return $this->_config->getConfigValue('payment_action') == - \Magento\Paypal\Model\Config::PAYMENT_ACTION_AUTH ? self::TRXTYPE_AUTH_ONLY : self::TRXTYPE_SALE; - case \Magento\Paypal\Model\Api\Nvp::DO_CAPTURE: - return self::TRXTYPE_DELAYED_CAPTURE; - case \Magento\Paypal\Model\Api\Nvp::DO_VOID: - return self::TRXTYPE_DELAYED_VOID; - case \Magento\Paypal\Model\Api\Nvp::REFUND_TRANSACTION: - return self::TRXTYPE_CREDIT; - } - } - - /** - * Catch success calls and collect warnings - * - * @param array $response - * @return bool success flag - */ - protected function _isCallSuccessful($response) - { - $this->_callWarnings = []; - if ($response['RESULT'] == self::RESPONSE_CODE_APPROVED) { - // collect warnings - if (!empty($response['RESPMSG']) && strtoupper($response['RESPMSG']) != 'APPROVED') { - $this->_callWarnings[] = $response['RESPMSG']; - } - return true; - } - return false; - } - - /** - * Handle logical errors - * - * @param array $response - * @return void - * @throws \Magento\Framework\Model\Exception - */ - protected function _handleCallErrors($response) - { - if ($response['RESULT'] != self::RESPONSE_CODE_APPROVED) { - $message = $response['RESPMSG']; - $e = new \Exception(sprintf('PayPal gateway errors: %s.', $message)); - $this->_logger->logException($e); - throw new \Magento\Framework\Model\Exception(__('PayPal gateway rejected the request. %1', $message)); - } - } - - /** - * Build query string without urlencoding from request - * - * @param array $request - * @return string - */ - protected function _buildQuery($request) - { - $result = ''; - foreach ($request as $k => $v) { - $result .= '&' . $k . '=' . $v; - } - return trim($result, '&'); - } - - /** - * Generate Request ID - * - * @return string - */ - protected function getRequestId() - { - return $this->mathRandom->getUniqueHash(); - } - - /** - * GetTransactionDetails method does not exists in Payflow - * - * @return void - */ - public function callGetTransactionDetails() - { - } - - /** - * Get FMF results from response, if any - * - * @param array $from - * @param array $collectedWarnings - * @return void - */ - protected function _importFraudFiltersResult(array $from, array $collectedWarnings) - { - if ($from['RESULT'] != self::RESPONSE_CODE_FRAUD) { - return; - } - $this->setIsPaymentPending(true); - } - - /** - * Return each call request fields - * (PayFlow edition doesn't support Unilateral payments) - * - * @param string $methodName Current method name - * @return string[] - */ - protected function _prepareEachCallRequest($methodName) - { - return $this->_eachCallRequest; - } - - /** - * Overwrite parent logic, simply return input data - * (PayFlow edition doesn't support Unilateral payments) - * - * @param array $requestFields Standard set of values - * @return array - */ - protected function _prepareExpressCheckoutCallRequest(&$requestFields) - { - return $requestFields; - } - - /** - * Additional response processing. - * Hack to cut off length from API type response params. - * - * @param array $response - * @return array - */ - protected function _postProcessResponse($response) - { - foreach ($response as $key => $value) { - $pos = strpos($key, '['); - - if ($pos === false) { - continue; - } - - unset($response[$key]); - - if ($pos !== 0) { - $modifiedKey = substr($key, 0, $pos); - $response[$modifiedKey] = $value; - } - } - - return $response; - } - - /** - * Checking negative line items - * - * @param array $request - * @param int $i - * @return null|true - */ - protected function _exportLineItems(array &$request, $i = 0) - { - $requestBefore = $request; - $result = parent::_exportLineItems($request, $i); - if ($this->getIsLineItemsEnabled() && $this->_cart->hasNegativeItemAmount()) { - $this->_lineItemTotalExportMap = [ - Cart::AMOUNT_TAX => 'TAXAMT', - Cart::AMOUNT_SHIPPING => 'FREIGHTAMT', - 'amount' => 'PAYMENTREQUEST_0_ITEMAMT', - ]; - $this->_lineItemExportItemsFormat = [ - 'name' => 'L_PAYMENTREQUEST_0_NAME%d', - 'qty' => 'L_PAYMENTREQUEST_0_QTY%d', - 'amount' => 'L_PAYMENTREQUEST_0_AMT%d', - ]; - $request = $requestBefore; - $result = parent::_exportLineItems($request, $i); - /** @var Nvp $paypalNvp */ - $paypalNvp = $this->nvpFactory->create(); - $this->_doCaptureResponse = $paypalNvp->_doCaptureResponse; - $this->_refundTransactionResponse = $paypalNvp->_refundTransactionResponse; - $this->_getTransactionDetailsResponse = $paypalNvp->_getTransactionDetailsResponse; - $this->_paymentInformationResponse = $paypalNvp->_paymentInformationResponse; - $this->_headers[] = 'PAYPAL-NVP: Y'; - $this->_setSpecificForNegativeLineItems(); - } - return $result; - } - - /** - * Set specific data when negative line item case - * @return void - */ - protected function _setSpecificForNegativeLineItems() - { - /** @var Nvp $paypalNvp */ - $paypalNvp = $this->nvpFactory->create(); - $this->_setExpressCheckoutResponse = $paypalNvp->_setExpressCheckoutResponse; - $index = array_search('PPREF', $this->_doExpressCheckoutPaymentResponse); - if (false !== $index) { - unset($this->_doExpressCheckoutPaymentResponse[$index]); - } - $this->_doExpressCheckoutPaymentResponse[] = 'PAYMENTINFO_0_TRANSACTIONID'; - $this->_requiredResponseParams[self::DO_EXPRESS_CHECKOUT_PAYMENT][] = 'PAYMENTINFO_0_TRANSACTIONID'; - } -} diff --git a/app/code/Magento/Paypal/Model/Api/ProcessableException.php b/app/code/Magento/Paypal/Model/Api/ProcessableException.php deleted file mode 100644 index 40628e02bd5c5..0000000000000 --- a/app/code/Magento/Paypal/Model/Api/ProcessableException.php +++ /dev/null @@ -1,45 +0,0 @@ -getCode()) { - case self::API_INTERNAL_ERROR: - case self::API_UNABLE_PROCESS_PAYMENT_ERROR_CODE: - $message = __("I'm sorry - but we were not able to process your payment. Please try another payment method or contact us so we can assist you."); - break; - case self::API_COUNTRY_FILTER_DECLINE: - case self::API_MAXIMUM_AMOUNT_FILTER_DECLINE: - case self::API_OTHER_FILTER_DECLINE: - $message = __("I'm sorry - but we are not able to complete your transaction. Please contact us so we can assist you."); - break; - default: - $message = $this->getMessage(); - } - return $message; - } -} diff --git a/app/code/Magento/Paypal/Model/Api/Standard.php b/app/code/Magento/Paypal/Model/Api/Standard.php deleted file mode 100644 index 9c36911fab32d..0000000000000 --- a/app/code/Magento/Paypal/Model/Api/Standard.php +++ /dev/null @@ -1,242 +0,0 @@ - 'business_account', - 'notify_url' => 'notify_url', - 'return' => 'return_url', - 'cancel_return' => 'cancel_url', - 'bn' => 'build_notation_code', - 'paymentaction' => 'payment_action', - // payment - 'invoice' => 'order_id', - 'currency_code' => 'currency_code', - 'amount' => 'amount', - 'shipping' => 'shipping_amount', - 'tax' => 'tax_amount', - 'discount_amount' => 'discount_amount', - // misc - 'item_name' => 'cart_summary', - // page design settings - 'page_style' => 'page_style', - 'cpp_header_image' => 'hdrimg', - 'cpp_headerback_color' => 'hdrbackcolor', - 'cpp_headerborder_color' => 'hdrbordercolor', - 'cpp_payflow_color' => 'payflowcolor', - // 'cs' => '', // TODO - 'lc' => 'locale', - ]; - - /** - * Export filters - * - * @var array - */ - protected $_exportToRequestFilters = [ - 'amount' => '_filterAmount', - 'shipping' => '_filterAmount', - 'tax' => '_filterAmount', - 'discount_amount' => '_filterAmount', - ]; - - /** - * Interface for common and "aggregated order" specific fields - * - * @var string[] - */ - protected $_commonRequestFields = [ - 'business', - 'invoice', - 'currency_code', - 'paymentaction', - 'return', - 'cancel_return', - 'notify_url', - 'bn', - 'page_style', - 'cpp_header_image', - 'cpp_headerback_color', - 'cpp_headerborder_color', - 'cpp_payflow_color', - 'amount', - 'shipping', - 'tax', - 'discount_amount', - 'item_name', - 'lc', - ]; - - /** - * Fields that should be replaced in debug with '***' - * - * @var string[] - */ - protected $_debugReplacePrivateDataKeys = ['business']; - - /** - * Line items export mapping settings - * - * @var array - */ - protected $_lineItemTotalExportMap = [ - Cart::AMOUNT_SUBTOTAL => 'amount', - Cart::AMOUNT_DISCOUNT => 'discount_amount', - Cart::AMOUNT_TAX => 'tax', - Cart::AMOUNT_SHIPPING => 'shipping', - ]; - - /** - * @var array - */ - protected $_lineItemExportItemsFormat = [ - 'id' => 'item_number_%d', - 'name' => 'item_name_%d', - 'qty' => 'quantity_%d', - 'amount' => 'amount_%d', - ]; - - /** - * @var array - */ - protected $_lineItemExportItemsFilters = ['qty' => '_filterQty']; - - /** - * Address export to request map - * - * @var array - */ - protected $_addressMap = [ - 'city' => 'city', - 'country' => 'country_id', - 'email' => 'email', - 'first_name' => 'firstname', - 'last_name' => 'lastname', - 'zip' => 'postcode', - 'state' => 'region', - 'address1' => 'street', - 'address2' => 'street2', - ]; - - /** - * Generate PayPal Standard checkout request fields - * Depending on whether there are cart line items set, will aggregate everything or display items specifically - * Shipping amount in cart line items is implemented as a separate "fake" line item - * - * @return array - */ - public function getStandardCheckoutRequest() - { - $request = $this->_exportToRequest($this->_commonRequestFields); - $request['charset'] = 'utf-8'; - - $isLineItems = $this->_exportLineItems($request); - if ($isLineItems) { - $request = array_merge($request, ['cmd' => '_cart', 'upload' => 1]); - if (isset($request['tax'])) { - $request['tax_cart'] = $request['tax']; - } - if (isset($request['discount_amount'])) { - $request['discount_amount_cart'] = $request['discount_amount']; - } - } else { - $request = array_merge($request, ['cmd' => '_ext-enter', 'redirect_cmd' => '_xclick']); - } - - // payer address - $this->_importAddress($request); - $this->_debug(['request' => $request]); - // TODO: this is not supposed to be called in getter - return $request; - } - - /** - * Merchant account email getter - * - * @return string - */ - public function getBusinessAccount() - { - return $this->_getDataOrConfig('business_account'); - } - - /** - * Payment action getter - * - * @return string - */ - public function getPaymentAction() - { - return strtolower(parent::getPaymentAction()); - } - - /** - * Add shipping total as a line item. - * For some reason PayPal ignores shipping total variables exactly when line items is enabled - * Note that $i = 1 - * - * @param array $request - * @param int $i - * @return true|null - */ - protected function _exportLineItems(array &$request, $i = 1) - { - if (!$this->_cart) { - return; - } - if ($this->getIsLineItemsEnabled()) { - $this->_cart->setTransferShippingAsItem(); - } - return parent::_exportLineItems($request, $i); - } - - /** - * Import address object, if set, to the request - * - * @param array $request - * @return void - */ - protected function _importAddress(&$request) - { - $address = $this->getAddress(); - if (!$address) { - if ($this->getNoShipping()) { - $request['no_shipping'] = 1; - } - return; - } - - $request = \Magento\Framework\Object\Mapper::accumulateByMap($address, $request, array_flip($this->_addressMap)); - - // Address may come without email info (user is not always required to enter it), so add email from order - if (!$request['email']) { - $order = $this->getOrder(); - if ($order) { - $request['email'] = $order->getCustomerEmail(); - } - } - - $regionCode = $this->_lookupRegionCodeFromAddress($address); - if ($regionCode) { - $request['state'] = $regionCode; - } - $this->_importStreetFromAddress($address, $request, 'address1', 'address2'); - - $request['address_override'] = 1; - } -} diff --git a/app/code/Magento/Paypal/Model/Api/Type/Factory.php b/app/code/Magento/Paypal/Model/Api/Type/Factory.php deleted file mode 100644 index cabf90f9fff00..0000000000000 --- a/app/code/Magento/Paypal/Model/Api/Type/Factory.php +++ /dev/null @@ -1,41 +0,0 @@ -_objectManager = $objectManager; - } - - /** - * Create class instance with specified parameters - * - * @param string $className - * @param array $data - * @return \Magento\Paypal\Model\Api\AbstractApi - */ - public function create($className, array $data = []) - { - return $this->_objectManager->create($className, $data); - } -} diff --git a/app/code/Magento/Paypal/Model/Billing/AbstractAgreement.php b/app/code/Magento/Paypal/Model/Billing/AbstractAgreement.php deleted file mode 100644 index 751ca502a708d..0000000000000 --- a/app/code/Magento/Paypal/Model/Billing/AbstractAgreement.php +++ /dev/null @@ -1,126 +0,0 @@ -_paymentData = $paymentData; - parent::__construct($context, $registry, $resource, $resourceCollection, $data); - } - - /** - * Retrieve payment method instance - * - * @return \Magento\Payment\Model\MethodInterface - */ - public function getPaymentMethodInstance() - { - if (is_null($this->_paymentMethodInstance)) { - $this->_paymentMethodInstance = $this->_paymentData->getMethodInstance($this->getMethodCode()); - $this->_paymentMethodInstance->setStore($this->getStoreId()); - } - return $this->_paymentMethodInstance; - } - - /** - * Validate data before save - * - * @return bool - */ - public function isValid() - { - $this->_errors = []; - if (is_null($this->getPaymentMethodInstance()) || !$this->getPaymentMethodInstance()->getCode()) { - $this->_errors[] = __('The payment method code is not set.'); - } - if (!$this->getReferenceId()) { - $this->_errors[] = __('The reference ID is not set.'); - } - return empty($this->_errors); - } - - /** - * Before save, it's overridden just to make data validation on before save event - * - * @throws \Magento\Framework\Model\Exception - * @return \Magento\Framework\Model\AbstractModel - */ - public function beforeSave() - { - if ($this->isValid()) { - return parent::beforeSave(); - } - array_unshift($this->_errors, __('Unable to save Billing Agreement:')); - throw new \Magento\Framework\Model\Exception(implode(' ', $this->_errors)); - } -} diff --git a/app/code/Magento/Paypal/Model/Billing/Agreement.php b/app/code/Magento/Paypal/Model/Billing/Agreement.php deleted file mode 100644 index de362a648d6d3..0000000000000 --- a/app/code/Magento/Paypal/Model/Billing/Agreement.php +++ /dev/null @@ -1,314 +0,0 @@ -_billingAgreementFactory = $billingAgreementFactory; - $this->_dateFactory = $dateFactory; - } - - /** - * Init model - * - * @return void - */ - protected function _construct() - { - $this->_init('Magento\Paypal\Model\Resource\Billing\Agreement'); - } - - /** - * Set created_at parameter - * - * @return \Magento\Framework\Model\AbstractModel - */ - public function beforeSave() - { - $date = $this->_dateFactory->create()->gmtDate(); - if ($this->isObjectNew() && !$this->getCreatedAt()) { - $this->setCreatedAt($date); - } else { - $this->setUpdatedAt($date); - } - return parent::beforeSave(); - } - - /** - * Save agreement order relations - * - * @return \Magento\Framework\Model\AbstractModel - */ - public function afterSave() - { - if (!empty($this->_relatedOrders)) { - $this->_saveOrderRelations(); - } - return parent::afterSave(); - } - - /** - * Retrieve billing agreement status label - * - * @return string - */ - public function getStatusLabel() - { - switch ($this->getStatus()) { - case self::STATUS_ACTIVE: - return __('Active'); - case self::STATUS_CANCELED: - return __('Canceled'); - default: - return ''; - } - } - - /** - * Initialize token - * - * @return string - */ - public function initToken() - { - $this->getPaymentMethodInstance() - ->initBillingAgreementToken($this); - - return $this->getRedirectUrl(); - } - - /** - * Get billing agreement details - * Data from response is inside this object - * - * @return $this - */ - public function verifyToken() - { - $this->getPaymentMethodInstance() - ->getBillingAgreementTokenInfo($this); - - return $this; - } - - /** - * Create billing agreement - * - * @return $this - */ - public function place() - { - $this->verifyToken(); - - $paymentMethodInstance = $this->getPaymentMethodInstance(); - $paymentMethodInstance->placeBillingAgreement($this); - - $this->setCustomerId($this->getCustomerId()) - ->setMethodCode($this->getMethodCode()) - ->setReferenceId($this->getBillingAgreementId()) - ->setStatus(self::STATUS_ACTIVE) - ->setAgreementLabel($paymentMethodInstance->getTitle()) - ->save(); - - return $this; - } - - /** - * Cancel billing agreement - * - * @return $this - */ - public function cancel() - { - $this->setStatus(self::STATUS_CANCELED); - $this->getPaymentMethodInstance()->updateBillingAgreementStatus($this); - return $this->save(); - } - - /** - * Check whether can cancel billing agreement - * - * @return bool - */ - public function canCancel() - { - return $this->getStatus() != self::STATUS_CANCELED; - } - - /** - * Retrieve billing agreement statuses array - * - * @return array - */ - public function getStatusesArray() - { - return [ - self::STATUS_ACTIVE => __('Active'), - self::STATUS_CANCELED => __('Canceled') - ]; - } - - /** - * Validate data - * - * @return bool - */ - public function isValid() - { - $result = parent::isValid(); - if (!$this->getCustomerId()) { - $this->_errors[] = __('The customer ID is not set.'); - } - if (!$this->getStatus()) { - $this->_errors[] = __('The Billing Agreement status is not set.'); - } - return $result && empty($this->_errors); - } - - /** - * Import payment data to billing agreement - * - * $payment->getBillingAgreementData() contains array with following structure : - * [billing_agreement_id] => string - * [method_code] => string - * - * @param Payment $payment - * @return $this - */ - public function importOrderPayment(Payment $payment) - { - $baData = $payment->getBillingAgreementData(); - - $this->_paymentMethodInstance = (isset($baData['method_code'])) - ? $this->_paymentData->getMethodInstance($baData['method_code']) - : $payment->getMethodInstance(); - - $this->_paymentMethodInstance->setStore($payment->getMethodInstance()->getStore()); - $this->setCustomerId($payment->getOrder()->getCustomerId()) - ->setMethodCode($this->_paymentMethodInstance->getCode()) - ->setReferenceId($baData['billing_agreement_id']) - ->setStatus(self::STATUS_ACTIVE) - ->setAgreementLabel($this->_paymentMethodInstance->getTitle()); - - return $this; - } - - /** - * Retrieve available customer Billing Agreements - * - * @param int $customerId - * @return \Magento\Paypal\Model\Resource\Billing\Agreement\Collection - */ - public function getAvailableCustomerBillingAgreements($customerId) - { - $collection = $this->_billingAgreementFactory->create(); - $collection->addFieldToFilter('customer_id', $customerId) - ->addFieldToFilter('status', self::STATUS_ACTIVE) - ->setOrder('agreement_id'); - return $collection; - } - - /** - * Check whether need to create billing agreement for customer - * - * @param int $customerId - * @return bool - */ - public function needToCreateForCustomer($customerId) - { - return $customerId ? count($this->getAvailableCustomerBillingAgreements($customerId)) == 0 : false; - } - - /** - * Add order relation to current billing agreement - * - * @param int|\Magento\Sales\Model\Order $orderId - * @return $this - */ - public function addOrderRelation($orderId) - { - $this->_relatedOrders[] = $orderId; - return $this; - } - - /** - * Save related orders - * - * @return void - */ - protected function _saveOrderRelations() - { - foreach ($this->_relatedOrders as $order) { - $orderId = $order instanceof \Magento\Sales\Model\Order ? $order->getId() : (int)$order; - $this->getResource()->addOrderRelation($this->getId(), $orderId); - } - } -} diff --git a/app/code/Magento/Paypal/Model/Billing/Agreement/MethodInterface.php b/app/code/Magento/Paypal/Model/Billing/Agreement/MethodInterface.php deleted file mode 100644 index 0afac2e715eaa..0000000000000 --- a/app/code/Magento/Paypal/Model/Billing/Agreement/MethodInterface.php +++ /dev/null @@ -1,43 +0,0 @@ -_registryManager = isset($data['registry']) ? $data['registry'] : $coreRegistry; - $this->_agreementResource = $agreementResource; - - if (false === $this->_registryManager instanceof \Magento\Framework\Registry) { - throw new \InvalidArgumentException('registry object has to be an instance of \Magento\Framework\Registry'); - } - } - - /** - * Add billing agreement filter - * - * @param mixed $argument - * @return mixed - * @throws \DomainException - */ - public function update($argument) - { - $billingAgreement = $this->_registryManager->registry('current_billing_agreement'); - - if (!$billingAgreement) { - throw new \DomainException('Undefined billing agreement object'); - } - - $this->_agreementResource->addOrdersFilter($argument, $billingAgreement->getId()); - return $argument; - } -} diff --git a/app/code/Magento/Paypal/Model/Bml.php b/app/code/Magento/Paypal/Model/Bml.php deleted file mode 100644 index 8c64e4299d7dc..0000000000000 --- a/app/code/Magento/Paypal/Model/Bml.php +++ /dev/null @@ -1,31 +0,0 @@ -_urlBuilder->getUrl('paypal/bml/start'); - } -} diff --git a/app/code/Magento/Paypal/Model/Cart.php b/app/code/Magento/Paypal/Model/Cart.php deleted file mode 100644 index 287d5aa676005..0000000000000 --- a/app/code/Magento/Paypal/Model/Cart.php +++ /dev/null @@ -1,196 +0,0 @@ -_collectItemsAndAmounts(); - - if (!$this->_areAmountsValid) { - $subtotal = $this->getSubtotal() + $this->getTax(); - - if (empty($this->_transferFlags[self::AMOUNT_SHIPPING])) { - $subtotal += $this->getShipping(); - } - - if (empty($this->_transferFlags[self::AMOUNT_DISCOUNT])) { - $subtotal -= $this->getDiscount(); - } - - return [self::AMOUNT_SUBTOTAL => $subtotal]; - } - - return $this->_amounts; - } - - /** - * Calculate subtotal from custom items - * - * @return void - */ - protected function _calculateCustomItemsSubtotal() - { - parent::_calculateCustomItemsSubtotal(); - $this->_applyHiddenTaxWorkaround($this->_salesModel); - - $this->_validate(); - } - - /** - * Check the line items and totals according to PayPal business logic limitations - * - * @return void - */ - protected function _validate() - { - $areItemsValid = false; - $this->_areAmountsValid = false; - - $referenceAmount = $this->_salesModel->getDataUsingMethod('base_grand_total'); - - $itemsSubtotal = 0; - foreach ($this->getAllItems() as $i) { - $itemsSubtotal = $itemsSubtotal + $i->getQty() * $i->getAmount(); - } - - $sum = $itemsSubtotal + $this->getTax(); - - if (empty($this->_transferFlags[self::AMOUNT_SHIPPING])) { - $sum += $this->getShipping(); - } - - if (empty($this->_transferFlags[self::AMOUNT_DISCOUNT])) { - $sum -= $this->getDiscount(); - // PayPal requires to have discount less than items subtotal - $this->_areAmountsValid = round($this->getDiscount(), 4) < round($itemsSubtotal, 4); - } else { - $this->_areAmountsValid = $itemsSubtotal > 0.00001; - } - - /** - * numbers are intentionally converted to strings because of possible comparison error - * see http://php.net/float - */ - // match sum of all the items and totals to the reference amount - if (sprintf('%.4F', $sum) == sprintf('%.4F', $referenceAmount)) { - $areItemsValid = true; - } - - $areItemsValid = $areItemsValid && $this->_areAmountsValid; - - if (!$areItemsValid) { - $this->_salesModelItems = []; - $this->_customItems = []; - } - } - - /** - * Import items from sales model with workarounds for PayPal - * - * @return void - */ - protected function _importItemsFromSalesModel() - { - $this->_salesModelItems = []; - - foreach ($this->_salesModel->getAllItems() as $item) { - if ($item->getParentItem()) { - continue; - } - - $amount = $item->getPrice(); - $qty = $item->getQty(); - - $subAggregatedLabel = ''; - - // workaround in case if item subtotal precision is not compatible with PayPal (.2) - if ($amount - round($amount, 2)) { - $amount = $amount * $qty; - $subAggregatedLabel = ' x' . $qty; - $qty = 1; - } - - // aggregate item price if item qty * price does not match row total - $itemBaseRowTotal = $item->getOriginalItem()->getBaseRowTotal(); - if ($amount * $qty != $itemBaseRowTotal) { - $amount = (double)$itemBaseRowTotal; - $subAggregatedLabel = ' x' . $qty; - $qty = 1; - } - - $this->_salesModelItems[] = $this->_createItemFromData( - $item->getName() . $subAggregatedLabel, - $qty, - $amount - ); - } - - $this->addSubtotal($this->_salesModel->getBaseSubtotal()); - $this->addTax($this->_salesModel->getBaseTaxAmount()); - $this->addShipping($this->_salesModel->getBaseShippingAmount()); - $this->addDiscount(abs($this->_salesModel->getBaseDiscountAmount())); - } - - /** - * Add "hidden" discount and shipping tax - * - * Go ahead, try to understand ]:-> - * - * Tax settings for getting "discount tax": - * - Catalog Prices = Including Tax - * - Apply Customer Tax = After Discount - * - Apply Discount on Prices = Including Tax - * - * Test case for getting "hidden shipping tax": - * - Make sure shipping is taxable (set shipping tax class) - * - Catalog Prices = Including Tax - * - Shipping Prices = Including Tax - * - Apply Customer Tax = After Discount - * - Create a shopping cart price rule with % discount applied to the Shipping Amount - * - run shopping cart and estimate shipping - * - go to PayPal - * - * @param \Magento\Payment\Model\Cart\SalesModel\SalesModelInterface $salesEntity - * @return void - */ - protected function _applyHiddenTaxWorkaround( - \Magento\Payment\Model\Cart\SalesModel\SalesModelInterface $salesEntity - ) { - $dataContainer = $salesEntity->getTaxContainer(); - $this->addTax((double)$dataContainer->getBaseHiddenTaxAmount()); - $this->addTax((double)$dataContainer->getBaseShippingHiddenTaxAmnt()); - } - - /** - * Check whether any item has negative amount - * - * @return bool - */ - public function hasNegativeItemAmount() - { - foreach ($this->_customItems as $item) { - if ($item->getAmount() < 0) { - return true; - } - } - return false; - } -} diff --git a/app/code/Magento/Paypal/Model/Cert.php b/app/code/Magento/Paypal/Model/Cert.php deleted file mode 100644 index c78b2c53a7a2d..0000000000000 --- a/app/code/Magento/Paypal/Model/Cert.php +++ /dev/null @@ -1,136 +0,0 @@ -varDirectory = $filesystem->getDirectoryWrite(DirectoryList::VAR_DIR); - $this->encryptor = $encryptor; - parent::__construct($context, $registry, $resource, $resourceCollection, $data); - } - - /** - * Initialize resource model - * - * @return void - */ - protected function _construct() - { - $this->_init('Magento\Paypal\Model\Resource\Cert'); - } - - /** - * Load model by website id - * - * @param int $websiteId - * @param bool $strictLoad - * @return $this - */ - public function loadByWebsite($websiteId, $strictLoad = true) - { - $this->setWebsiteId($websiteId); - $this->_getResource()->loadByWebsite($this, $strictLoad); - return $this; - } - - /** - * Get path to PayPal certificate file, if file does not exist try to create it - * - * @return string - * @throws \Magento\Framework\Model\Exception - */ - public function getCertPath() - { - if (!$this->getContent()) { - throw new \Magento\Framework\Model\Exception(__('The PayPal certificate does not exist.')); - } - - $certFileName = sprintf('cert_%s_%s.pem', $this->getWebsiteId(), strtotime($this->getUpdatedAt())); - $certFile = self::BASEPATH_PAYPAL_CERT . $certFileName; - - if (!$this->varDirectory->isExist($certFile)) { - $this->_createCertFile($certFile); - } - return $this->varDirectory->getAbsolutePath($certFile); - } - - /** - * Create physical certificate file based on DB data - * - * @param string $file - * @return void - */ - protected function _createCertFile($file) - { - if ($this->varDirectory->isDirectory(self::BASEPATH_PAYPAL_CERT)) { - $this->_removeOutdatedCertFile(); - } - $this->varDirectory->writeFile($file, $this->encryptor->decrypt($this->getContent())); - } - - /** - * Check and remove outdated certificate file by website - * - * @return void - */ - protected function _removeOutdatedCertFile() - { - $pattern = sprintf('cert_%s*' . $this->getWebsiteId()); - $entries = $this->varDirectory->search($pattern, self::BASEPATH_PAYPAL_CERT); - foreach ($entries as $entry) { - $this->varDirectory->delete($entry); - } - } - - /** - * Delete assigned certificate file after delete object - * - * @return $this - */ - public function afterDelete() - { - $this->_removeOutdatedCertFile(); - return $this; - } -} diff --git a/app/code/Magento/Paypal/Model/Config.php b/app/code/Magento/Paypal/Model/Config.php deleted file mode 100644 index 667f56a04d822..0000000000000 --- a/app/code/Magento/Paypal/Model/Config.php +++ /dev/null @@ -1,1954 +0,0 @@ - 'WPS', - 'paypal_express' => 'EC', - 'paypal_direct' => 'DP', - 'payflow_express' => 'EC', - ]; - - /** - * Style system config map (Express Checkout) - * - * @var array - */ - protected $_ecStyleConfigMap = [ - 'page_style' => 'page_style', - 'paypal_hdrimg' => 'hdrimg', - 'paypal_hdrbordercolor' => 'hdrbordercolor', - 'paypal_hdrbackcolor' => 'hdrbackcolor', - 'paypal_payflowcolor' => 'payflowcolor', - ]; - - /** - * Currency codes supported by PayPal methods - * - * @var string[] - */ - protected $_supportedCurrencyCodes = [ - 'AUD', - 'CAD', - 'CZK', - 'DKK', - 'EUR', - 'HKD', - 'HUF', - 'ILS', - 'JPY', - 'MXN', - 'NOK', - 'NZD', - 'PLN', - 'GBP', - 'SGD', - 'SEK', - 'CHF', - 'USD', - 'TWD', - 'THB', - ]; - - /** - * Merchant country supported by PayPal - * - * @var string[] - */ - protected $_supportedCountryCodes = [ - 'AE', - 'AR', - 'AT', - 'AU', - 'BE', - 'BG', - 'BR', - 'CA', - 'CH', - 'CL', - 'CR', - 'CY', - 'CZ', - 'DE', - 'DK', - 'DO', - 'EC', - 'EE', - 'ES', - 'FI', - 'FR', - 'GB', - 'GF', - 'GI', - 'GP', - 'GR', - 'HK', - 'HU', - 'ID', - 'IE', - 'IL', - 'IN', - 'IS', - 'IT', - 'JM', - 'JP', - 'KR', - 'LI', - 'LT', - 'LU', - 'LV', - 'MQ', - 'MT', - 'MX', - 'MY', - 'NL', - 'NO', - 'NZ', - 'PH', - 'PL', - 'PT', - 'RE', - 'RO', - 'SE', - 'SG', - 'SI', - 'SK', - 'SM', - 'TH', - 'TR', - 'TW', - 'US', - 'UY', - 'VE', - 'VN', - 'ZA', - ]; - - /** - * Buyer country supported by PayPal - * - * @var string[] - */ - protected $_supportedBuyerCountryCodes = [ - 'AF ', - 'AX ', - 'AL ', - 'DZ ', - 'AS ', - 'AD ', - 'AO ', - 'AI ', - 'AQ ', - 'AG ', - 'AR ', - 'AM ', - 'AW ', - 'AU ', - 'AT ', - 'AZ ', - 'BS ', - 'BH ', - 'BD ', - 'BB ', - 'BY ', - 'BE ', - 'BZ ', - 'BJ ', - 'BM ', - 'BT ', - 'BO ', - 'BA ', - 'BW ', - 'BV ', - 'BR ', - 'IO ', - 'BN ', - 'BG ', - 'BF ', - 'BI ', - 'KH ', - 'CM ', - 'CA ', - 'CV ', - 'KY ', - 'CF ', - 'TD ', - 'CL ', - 'CN ', - 'CX ', - 'CC ', - 'CO ', - 'KM ', - 'CG ', - 'CD ', - 'CK ', - 'CR ', - 'CI ', - 'HR ', - 'CU ', - 'CY ', - 'CZ ', - 'DK ', - 'DJ ', - 'DM ', - 'DO ', - 'EC ', - 'EG ', - 'SV ', - 'GQ ', - 'ER ', - 'EE ', - 'ET ', - 'FK ', - 'FO ', - 'FJ ', - 'FI ', - 'FR ', - 'GF ', - 'PF ', - 'TF ', - 'GA ', - 'GM ', - 'GE ', - 'DE ', - 'GH ', - 'GI ', - 'GR ', - 'GL ', - 'GD ', - 'GP ', - 'GU ', - 'GT ', - 'GG ', - 'GN ', - 'GW ', - 'GY ', - 'HT ', - 'HM ', - 'VA ', - 'HN ', - 'HK ', - 'HU ', - 'IS ', - 'IN ', - 'ID ', - 'IR ', - 'IQ ', - 'IE ', - 'IM ', - 'IL ', - 'IT ', - 'JM ', - 'JP ', - 'JE ', - 'JO ', - 'KZ ', - 'KE ', - 'KI ', - 'KP ', - 'KR ', - 'KW ', - 'KG ', - 'LA ', - 'LV ', - 'LB ', - 'LS ', - 'LR ', - 'LY ', - 'LI ', - 'LT ', - 'LU ', - 'MO ', - 'MK ', - 'MG ', - 'MW ', - 'MY ', - 'MV ', - 'ML ', - 'MT ', - 'MH ', - 'MQ ', - 'MR ', - 'MU ', - 'YT ', - 'MX ', - 'FM ', - 'MD ', - 'MC ', - 'MN ', - 'MS ', - 'MA ', - 'MZ ', - 'MM ', - 'NA ', - 'NR ', - 'NP ', - 'NL ', - 'AN ', - 'NC ', - 'NZ ', - 'NI ', - 'NE ', - 'NG ', - 'NU ', - 'NF ', - 'MP ', - 'NO ', - 'OM ', - 'PK ', - 'PW ', - 'PS ', - 'PA ', - 'PG ', - 'PY ', - 'PE ', - 'PH ', - 'PN ', - 'PL ', - 'PT ', - 'PR ', - 'QA ', - 'RE ', - 'RO ', - 'RU ', - 'RW ', - 'SH ', - 'KN ', - 'LC ', - 'PM ', - 'VC ', - 'WS ', - 'SM ', - 'ST ', - 'SA ', - 'SN ', - 'CS ', - 'SC ', - 'SL ', - 'SG ', - 'SK ', - 'SI ', - 'SB ', - 'SO ', - 'ZA ', - 'GS ', - 'ES ', - 'LK ', - 'SD ', - 'SR ', - 'SJ ', - 'SZ ', - 'SE ', - 'CH ', - 'SY ', - 'TW ', - 'TJ ', - 'TZ ', - 'TH ', - 'TL ', - 'TG ', - 'TK ', - 'TO ', - 'TT ', - 'TN ', - 'TR ', - 'TM ', - 'TC ', - 'TV ', - 'UG ', - 'UA ', - 'AE ', - 'GB ', - 'US ', - 'UM ', - 'UY ', - 'UZ ', - 'VU ', - 'VE ', - 'VN ', - 'VG ', - 'VI ', - 'WF ', - 'EH ', - 'YE ', - 'ZM ', - 'ZW', - ]; - - /** - * Locale codes supported by misc images (marks, shortcuts etc) - * - * @var string[] - * @link https://cms.paypal.com/us/cgi-bin/?cmd=_render-content&content_ID=developer/e_howto_api_ECButtonIntegration#id089QD0O0TX4__id08AH904I0YK - */ - protected $_supportedImageLocales = [ - 'de_DE', - 'en_AU', - 'en_GB', - 'en_US', - 'es_ES', - 'es_XC', - 'fr_FR', - 'fr_XC', - 'it_IT', - 'ja_JP', - 'nl_NL', - 'pl_PL', - 'zh_CN', - 'zh_XC', - ]; - - /** - * Core data - * - * @var \Magento\Core\Helper\Data - */ - protected $_coreData; - - /** - * Core store config - * - * @var \Magento\Framework\App\Config\ScopeConfigInterface - */ - protected $_scopeConfig; - - /** - * @var \Magento\Store\Model\StoreManagerInterface - */ - protected $_storeManager; - - /** - * @var \Magento\Payment\Model\Source\CctypeFactory - */ - protected $_cctypeFactory; - - /** - * @var \Magento\Paypal\Model\CertFactory - */ - protected $_certFactory; - - /** - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig - * @param \Magento\Store\Model\StoreManagerInterface $storeManager - * @param \Magento\Payment\Model\Source\CctypeFactory $cctypeFactory - * @param \Magento\Paypal\Model\CertFactory $certFactory - * @param array $params - */ - public function __construct( - \Magento\Core\Helper\Data $coreData, - \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, - \Magento\Store\Model\StoreManagerInterface $storeManager, - \Magento\Payment\Model\Source\CctypeFactory $cctypeFactory, - \Magento\Paypal\Model\CertFactory $certFactory, - $params = [] - ) { - $this->_scopeConfig = $scopeConfig; - $this->_coreData = $coreData; - $this->_storeManager = $storeManager; - $this->_cctypeFactory = $cctypeFactory; - $this->_certFactory = $certFactory; - if ($params) { - $method = array_shift($params); - $this->setMethod($method); - if ($params) { - $storeId = array_shift($params); - $this->setStoreId($storeId); - } - } - } - - /** - * Method code setter - * - * @param string|\Magento\Payment\Model\MethodInterface $method - * @return $this - */ - public function setMethod($method) - { - if ($method instanceof \Magento\Payment\Model\MethodInterface) { - $this->_methodCode = $method->getCode(); - } elseif (is_string($method)) { - $this->_methodCode = $method; - } - return $this; - } - - /** - * Payment method instance code getter - * - * @return string - */ - public function getMethodCode() - { - return $this->_methodCode; - } - - /** - * Store ID setter - * - * @param int $storeId - * @return $this - */ - public function setStoreId($storeId) - { - $this->_storeId = (int)$storeId; - return $this; - } - - /** - * Check whether method active in configuration and supported for merchant country or not - * - * @param string $method Method code - * @return bool - */ - public function isMethodActive($method) - { - return $this->isMethodSupportedForCountry( - $method - ) && $this->_scopeConfig->isSetFlag( - "payment/{$method}/active", - \Magento\Store\Model\ScopeInterface::SCOPE_STORE, - $this->_storeId - ); - } - - /** - * Check whether method available for checkout or not - * Logic based on merchant country, methods dependence - * - * @param string|null $methodCode - * @return bool - */ - public function isMethodAvailable($methodCode = null) - { - if ($methodCode === null) { - $methodCode = $this->getMethodCode(); - } - - $result = true; - - if (!$this->isMethodActive($methodCode)) { - $result = false; - } - - switch ($methodCode) { - case self::METHOD_WPS: - if (!$this->getConfigValue('businessAccount')) { - $result = false; - break; - } - // check for direct payments dependence - if ($this->isMethodActive(self::METHOD_WPP_DIRECT)) { - $result = false; - } - break; - case self::METHOD_WPP_EXPRESS: - if ($this->isMethodActive(self::METHOD_WPP_DIRECT)) { - $result = true; - } - break; - case self::METHOD_WPP_BML: - // check for express payments dependence - if (!$this->isMethodActive(self::METHOD_WPP_EXPRESS)) { - $result = false; - } - break; - case self::METHOD_WPP_PE_EXPRESS: - // check for direct payments dependence - if ($this->isMethodActive(self::METHOD_PAYFLOWLINK) - || $this->isMethodActive(self::METHOD_PAYFLOWADVANCED)) { - $result = true; - } elseif (!$this->isMethodActive(self::METHOD_PAYFLOWPRO)) { - $result = false; - } - break; - case self::METHOD_WPP_PE_BML: - // check for express payments dependence - if (!$this->isMethodActive(self::METHOD_WPP_PE_EXPRESS)) { - $result = false; - } - break; - case self::METHOD_BILLING_AGREEMENT: - $result = $this->isWppApiAvailabe(); - break; - case self::METHOD_WPP_DIRECT: - break; - } - return $result; - } - - /** - * Config field magic getter - * The specified key can be either in camelCase or under_score format - * Tries to map specified value according to set payment method code, into the configuration value - * Sets the values into public class parameters, to avoid redundant calls of this method - * - * @param string $key - * @return string|null - */ - public function getConfigValue($key) - { - $underscored = strtolower(preg_replace('/(.)([A-Z])/', "$1_$2", $key)); - $path = $this->_getSpecificConfigPath($underscored); - if ($path !== null) { - $value = $this->_scopeConfig->getValue( - $path, - \Magento\Store\Model\ScopeInterface::SCOPE_STORE, - $this->_storeId - ); - $value = $this->_prepareValue($underscored, $value); - return $value; - } - return null; - } - - /** - * Perform additional config value preparation and return new value if needed - * - * @param string $key Underscored key - * @param string $value Old value - * @return string Modified value or old value - */ - protected function _prepareValue($key, $value) - { - // Always set payment action as "Sale" for Unilateral payments in EC - if ($key == 'payment_action' && - $value != self::PAYMENT_ACTION_SALE && - $this->_methodCode == self::METHOD_WPP_EXPRESS && - $this->shouldUseUnilateralPayments() - ) { - return self::PAYMENT_ACTION_SALE; - } - return $value; - } - - /** - * Return merchant country codes supported by PayPal - * - * @return string[] - */ - public function getSupportedMerchantCountryCodes() - { - return $this->_supportedCountryCodes; - } - - /** - * Return buyer country codes supported by PayPal - * - * @return string[] - */ - public function getSupportedBuyerCountryCodes() - { - return $this->_supportedBuyerCountryCodes; - } - - /** - * Return merchant country code, use default country if it not specified in General settings - * - * @return string - */ - public function getMerchantCountry() - { - $countryCode = $this->_scopeConfig->getValue($this->_mapGeneralFieldset('merchant_country')); - if (!$countryCode) { - $countryCode = $this->_coreData->getDefaultCountry($this->_storeId); - } - return $countryCode; - } - - /** - * Check whether method supported for specified country or not - * Use $_methodCode and merchant country by default - * - * @param string|null $method - * @param string|null $countryCode - * @return bool - */ - public function isMethodSupportedForCountry($method = null, $countryCode = null) - { - if ($method === null) { - $method = $this->getMethodCode(); - } - if ($countryCode === null) { - $countryCode = $this->getMerchantCountry(); - } - return in_array($method, $this->getCountryMethods($countryCode)); - } - - /** - * Return list of allowed methods for specified country iso code - * - * @param string|null $countryCode 2-letters iso code - * @return array - */ - public function getCountryMethods($countryCode = null) - { - $countryMethods = [ - 'other' => [ - self::METHOD_WPS, - self::METHOD_WPP_EXPRESS, - self::METHOD_BILLING_AGREEMENT, - self::METHOD_WPP_BML, - ], - 'US' => [ - self::METHOD_PAYFLOWADVANCED, - self::METHOD_WPP_DIRECT, - self::METHOD_WPS, - self::METHOD_PAYFLOWPRO, - self::METHOD_PAYFLOWLINK, - self::METHOD_WPP_EXPRESS, - self::METHOD_WPP_BML, - self::METHOD_BILLING_AGREEMENT, - self::METHOD_WPP_PE_EXPRESS, - self::METHOD_WPP_PE_BML, - ], - 'CA' => [ - self::METHOD_WPP_DIRECT, - self::METHOD_WPS, - self::METHOD_PAYFLOWPRO, - self::METHOD_PAYFLOWLINK, - self::METHOD_WPP_EXPRESS, - self::METHOD_WPP_BML, - self::METHOD_BILLING_AGREEMENT, - self::METHOD_WPP_PE_EXPRESS, - self::METHOD_WPP_PE_BML, - ], - 'GB' => [ - self::METHOD_WPP_DIRECT, - self::METHOD_WPS, - self::METHOD_HOSTEDPRO, - self::METHOD_WPP_EXPRESS, - self::METHOD_WPP_BML, - self::METHOD_BILLING_AGREEMENT, - ], - 'AU' => [ - self::METHOD_WPS, - self::METHOD_PAYFLOWPRO, - self::METHOD_HOSTEDPRO, - self::METHOD_WPP_EXPRESS, - self::METHOD_WPP_BML, - self::METHOD_BILLING_AGREEMENT, - ], - 'NZ' => [ - self::METHOD_WPS, - self::METHOD_PAYFLOWPRO, - self::METHOD_WPP_EXPRESS, - self::METHOD_WPP_BML, - self::METHOD_BILLING_AGREEMENT, - ], - 'JP' => [ - self::METHOD_WPS, - self::METHOD_HOSTEDPRO, - self::METHOD_WPP_EXPRESS, - self::METHOD_WPP_BML, - self::METHOD_BILLING_AGREEMENT, - ], - 'FR' => [ - self::METHOD_WPS, - self::METHOD_HOSTEDPRO, - self::METHOD_WPP_EXPRESS, - self::METHOD_WPP_BML, - self::METHOD_BILLING_AGREEMENT, - ], - 'IT' => [ - self::METHOD_WPS, - self::METHOD_HOSTEDPRO, - self::METHOD_WPP_EXPRESS, - self::METHOD_WPP_BML, - self::METHOD_BILLING_AGREEMENT, - ], - 'ES' => [ - self::METHOD_WPS, - self::METHOD_HOSTEDPRO, - self::METHOD_WPP_EXPRESS, - self::METHOD_WPP_BML, - self::METHOD_BILLING_AGREEMENT, - ], - 'HK' => [ - self::METHOD_WPS, - self::METHOD_HOSTEDPRO, - self::METHOD_WPP_EXPRESS, - self::METHOD_WPP_BML, - self::METHOD_BILLING_AGREEMENT, - ], - 'DE' => [ - self::METHOD_WPP_EXPRESS, - self::METHOD_WPP_BML, - self::METHOD_BILLING_AGREEMENT, - ], - ]; - if ($countryCode === null) { - return $countryMethods; - } - return isset($countryMethods[$countryCode]) ? $countryMethods[$countryCode] : $countryMethods['other']; - } - - /** - * Return start url for PayPal Basic - * - * @param string $token - * @return string - */ - public function getPayPalBasicStartUrl($token) - { - $params = [ - 'cmd' => '_express-checkout', - 'token' => $token, - ]; - - if ($this->isOrderReviewStepDisabled()) { - $params['useraction'] = 'commit'; - } - - return $this->getPaypalUrl($params); - } - - /** - * Check whether order review step enabled in configuration - * - * @return bool - */ - public function isOrderReviewStepDisabled() - { - return $this->_scopeConfig->getValue( - self::XML_PATH_PAYPAL_EXPRESS_SKIP_ORDER_REVIEW_STEP_FLAG, - \Magento\Store\Model\ScopeInterface::SCOPE_STORE, - $this->_storeId - ); - } - - /** - * Get url for dispatching customer to express checkout start - * - * @param string $token - * @return string - */ - public function getExpressCheckoutStartUrl($token) - { - return $this->getPaypalUrl(['cmd' => '_express-checkout', 'token' => $token]); - } - - /** - * Get url for dispatching customer to checkout retrial - * - * @param string $orderId - * @return string - */ - public function getExpressCheckoutOrderUrl($orderId) - { - return $this->getPaypalUrl(['cmd' => '_express-checkout', 'order_id' => $orderId]); - } - - /** - * Get url that allows to edit checkout details on paypal side - * - * @param \Magento\Paypal\Controller\Express|string $token - * @return string - */ - public function getExpressCheckoutEditUrl($token) - { - return $this->getPaypalUrl(['cmd' => '_express-checkout', 'useraction' => 'continue', 'token' => $token]); - } - - /** - * Get url for additional actions that PayPal may require customer to do after placing the order. - * For instance, redirecting customer to bank for payment confirmation. - * - * @param string $token - * @return string - */ - public function getExpressCheckoutCompleteUrl($token) - { - return $this->getPaypalUrl(['cmd' => '_complete-express-checkout', 'token' => $token]); - } - - /** - * Retrieve url for initialization of billing agreement - * - * @param string $token - * @return string - */ - public function getStartBillingAgreementUrl($token) - { - return $this->getPaypalUrl(['cmd' => '_customer-billing-agreement', 'token' => $token]); - } - - /** - * PayPal web URL generic getter - * - * @param array $params - * @return string - */ - public function getPaypalUrl(array $params = []) - { - return sprintf( - 'https://www.%spaypal.com/cgi-bin/webscr%s', - $this->getConfigValue('sandboxFlag') ? 'sandbox.' : '', - $params ? '?' . http_build_query($params) : '' - ); - } - - /** - * Whether Express Checkout button should be rendered dynamically - * - * @return bool - */ - public function areButtonsDynamic() - { - return $this->getConfigValue('buttonFlavor') === self::EC_FLAVOR_DYNAMIC; - } - - /** - * Express checkout shortcut pic URL getter - * PayPal will ignore "pal", if there is no total amount specified - * - * @param string $localeCode - * @param float|null $orderTotal - * @param string|null $pal encrypted summary about merchant - * @return string - * @see Paypal_Model_Api_Nvp::callGetPalDetails() - */ - public function getExpressCheckoutShortcutImageUrl($localeCode, $orderTotal = null, $pal = null) - { - if ($this->areButtonsDynamic()) { - return $this->_getDynamicImageUrl(self::EC_BUTTON_TYPE_SHORTCUT, $localeCode, $orderTotal, $pal); - } - if ($this->getConfigValue('buttonType') === self::EC_BUTTON_TYPE_MARK) { - return $this->getPaymentMarkImageUrl($localeCode); - } - return sprintf( - 'https://www.paypal.com/%s/i/btn/btn_xpressCheckout.gif', - $this->_getSupportedLocaleCode($localeCode) - ); - } - - /** - * Get PayPal "mark" image URL - * Supposed to be used on payment methods selection - * $staticSize is applicable for static images only - * - * @param string $localeCode - * @param float|null $orderTotal - * @param string|null $pal - * @param string|null $staticSize - * @return string - */ - public function getPaymentMarkImageUrl($localeCode, $orderTotal = null, $pal = null, $staticSize = null) - { - if ($this->areButtonsDynamic()) { - return $this->_getDynamicImageUrl(self::EC_BUTTON_TYPE_MARK, $localeCode, $orderTotal, $pal); - } - - if (null === $staticSize) { - $staticSize = $this->getConfigValue('paymentMarkSize'); - } - switch ($staticSize) { - case self::PAYMENT_MARK_37X23: - case self::PAYMENT_MARK_50X34: - case self::PAYMENT_MARK_60X38: - case self::PAYMENT_MARK_180X113: - break; - default: - $staticSize = self::PAYMENT_MARK_37X23; - } - return sprintf( - 'https://www.paypal.com/%s/i/logo/PayPal_mark_%s.gif', - $this->_getSupportedLocaleCode($localeCode), - $staticSize - ); - } - - /** - * Get "What Is PayPal" localized URL - * Supposed to be used with "mark" as popup window - * - * @param \Magento\Framework\Locale\ResolverInterface $locale - * @return string - */ - public function getPaymentMarkWhatIsPaypalUrl(\Magento\Framework\Locale\ResolverInterface $locale = null) - { - $countryCode = 'US'; - if (null !== $locale) { - $shouldEmulate = null !== $this->_storeId && $this->_storeManager->getStore()->getId() != $this->_storeId; - if ($shouldEmulate) { - $locale->emulate($this->_storeId); - } - $countryCode = $locale->getLocale()->getRegion(); - if ($shouldEmulate) { - $locale->revert(); - } - } - return sprintf( - 'https://www.paypal.com/%s/cgi-bin/webscr?cmd=xpt/Marketing/popup/OLCWhatIsPayPal-outside', - strtolower($countryCode) - ); - } - - /** - * Getter for Solution banner images - * - * @param string $localeCode - * @param bool $isVertical - * @param bool $isEcheck - * @return string - */ - public function getSolutionImageUrl($localeCode, $isVertical = false, $isEcheck = false) - { - return sprintf( - 'https://www.paypal.com/%s/i/bnr/%s_solution_PP%s.gif', - $this->_getSupportedLocaleCode($localeCode), - $isVertical ? 'vertical' : 'horizontal', - $isEcheck ? 'eCheck' : '' - ); - } - - /** - * Getter for Payment form logo images - * - * @param string $localeCode - * @return string - */ - public function getPaymentFormLogoUrl($localeCode) - { - $locale = $this->_getSupportedLocaleCode($localeCode); - - $imageType = 'logo'; - $domain = 'paypal.com'; - list(, $country) = explode('_', $locale); - $countryPrefix = $country . '/'; - - switch ($locale) { - case 'en_GB': - $imageName = 'horizontal_solution_PP'; - $imageType = 'bnr'; - $countryPrefix = ''; - break; - case 'de_DE': - $imageName = 'lockbox_150x47'; - break; - case 'fr_FR': - $imageName = 'bnr_horizontal_solution_PP_327wx80h'; - $imageType = 'bnr'; - $locale = 'en_US'; - $domain = 'paypalobjects.com'; - break; - case 'it_IT': - $imageName = 'bnr_horizontal_solution_PP_178wx80h'; - $imageType = 'bnr'; - $domain = 'paypalobjects.com'; - break; - default: - $imageName = 'PayPal_mark_60x38'; - $countryPrefix = ''; - break; - } - return sprintf('https://www.%s/%s/%si/%s/%s.gif', $domain, $locale, $countryPrefix, $imageType, $imageName); - } - - /** - * Return supported types for PayPal logo - * - * @return array - */ - public function getAdditionalOptionsLogoTypes() - { - return [ - 'wePrefer_150x60' => __('We prefer PayPal (150 X 60)'), - 'wePrefer_150x40' => __('We prefer PayPal (150 X 40)'), - 'nowAccepting_150x60' => __('Now accepting PayPal (150 X 60)'), - 'nowAccepting_150x40' => __('Now accepting PayPal (150 X 40)'), - 'paymentsBy_150x60' => __('Payments by PayPal (150 X 60)'), - 'paymentsBy_150x40' => __('Payments by PayPal (150 X 40)'), - 'shopNowUsing_150x60' => __('Shop now using (150 X 60)'), - 'shopNowUsing_150x40' => __('Shop now using (150 X 40)') - ]; - } - - /** - * Return PayPal logo URL with additional options - * - * @param string $localeCode Supported locale code - * @param bool|string $type One of supported logo types - * @return string|bool Logo Image URL or false if logo disabled in configuration - */ - public function getAdditionalOptionsLogoUrl($localeCode, $type = false) - { - $configType = $this->_scopeConfig->getValue( - $this->_mapGenericStyleFieldset('logo'), - \Magento\Store\Model\ScopeInterface::SCOPE_STORE, - $this->_storeId - ); - if (!$configType) { - return false; - } - $type = $type ? $type : $configType; - $locale = $this->_getSupportedLocaleCode($localeCode); - $supportedTypes = array_keys($this->getAdditionalOptionsLogoTypes()); - if (!in_array($type, $supportedTypes)) { - $type = self::DEFAULT_LOGO_TYPE; - } - return sprintf('https://www.paypalobjects.com/%s/i/bnr/bnr_%s.gif', $locale, $type); - } - - /** - * BN code getter - * - * @return string - */ - public function getBuildNotationCode() - { - return $this->_scopeConfig->getValue( - 'paypal/bncode', - \Magento\Store\Model\ScopeInterface::SCOPE_STORE, - $this->_storeId - ); - } - - /** - * Express Checkout button "flavors" source getter - * - * @return array - */ - public function getExpressCheckoutButtonFlavors() - { - return [self::EC_FLAVOR_DYNAMIC => __('Dynamic'), self::EC_FLAVOR_STATIC => __('Static')]; - } - - /** - * Express Checkout button types source getter - * - * @return array - */ - public function getExpressCheckoutButtonTypes() - { - return [ - self::EC_BUTTON_TYPE_SHORTCUT => __('Shortcut'), - self::EC_BUTTON_TYPE_MARK => __('Acceptance Mark Image') - ]; - } - - /** - * Payment actions source getter - * - * @return array - */ - public function getPaymentActions() - { - $paymentActions = [ - self::PAYMENT_ACTION_AUTH => __('Authorization'), - self::PAYMENT_ACTION_SALE => __('Sale'), - ]; - if (!is_null($this->_methodCode) && $this->_methodCode == self::METHOD_WPP_EXPRESS) { - $paymentActions[self::PAYMENT_ACTION_ORDER] = __('Order'); - } - return $paymentActions; - } - - /** - * Require Billing Address source getter - * - * @return array - */ - public function getRequireBillingAddressOptions() - { - return [ - self::REQUIRE_BILLING_ADDRESS_ALL => __('Yes'), - self::REQUIRE_BILLING_ADDRESS_NO => __('No'), - self::REQUIRE_BILLING_ADDRESS_VIRTUAL => __('For Virtual Quotes Only') - ]; - } - - /** - * Mapper from PayPal-specific payment actions to Magento payment actions - * - * @return string|null - */ - public function getPaymentAction() - { - switch ($this->getConfigValue('paymentAction')) { - case self::PAYMENT_ACTION_AUTH: - return \Magento\Payment\Model\Method\AbstractMethod::ACTION_AUTHORIZE; - case self::PAYMENT_ACTION_SALE: - return \Magento\Payment\Model\Method\AbstractMethod::ACTION_AUTHORIZE_CAPTURE; - case self::PAYMENT_ACTION_ORDER: - return \Magento\Payment\Model\Method\AbstractMethod::ACTION_ORDER; - } - } - - /** - * Returns array of possible Authorization Amounts for Account Verification - * - * @deprecated since 1.6.2.0 - * @return array - */ - public function getAuthorizationAmounts() - { - return []; - } - - /** - * Express Checkout "solution types" source getter - * "sole" = "Express Checkout for Auctions" - PayPal allows guest checkout - * "mark" = "Normal Express Checkout" - PayPal requires to checkout with PayPal buyer account only - * - * @return array - */ - public function getExpressCheckoutSolutionTypes() - { - return [self::EC_SOLUTION_TYPE_SOLE => __('Yes'), self::EC_SOLUTION_TYPE_MARK => __('No')]; - } - - /** - * Retrieve express checkout billing agreement signup options - * - * @return array - */ - public function getExpressCheckoutBASignupOptions() - { - return [ - self::EC_BA_SIGNUP_AUTO => __('Auto'), - self::EC_BA_SIGNUP_ASK => __('Ask Customer'), - self::EC_BA_SIGNUP_NEVER => __('Never') - ]; - } - - /** - * Whether to ask customer to create billing agreements - * Unilateral payments are incompatible with the billing agreements - * - * @return bool - */ - public function shouldAskToCreateBillingAgreement() - { - return $this->getConfigValue('allow_ba_signup') === self::EC_BA_SIGNUP_ASK - && !$this->shouldUseUnilateralPayments(); - } - - /** - * Check whether only Unilateral payments (Accelerated Boarding) possible for Express method or not - * - * @return bool - */ - public function shouldUseUnilateralPayments() - { - return $this->getConfigValue('business_account') && !$this->isWppApiAvailabe(); - } - - /** - * Check whether WPP API credentials are available for this method - * - * @return bool - */ - public function isWppApiAvailabe() - { - return $this->getConfigValue('api_username') - && $this->getConfigValue('api_password') - && ($this->getConfigValue('api_signature') - || $this->getConfigValue('api_cert')); - } - - /** - * Payment data delivery methods getter for PayPal Standard - * - * @return array - */ - public function getWpsPaymentDeliveryMethods() - { - return [self::WPS_TRANSPORT_IPN => __('IPN (Instant Payment Notification) Only')]; - } - - /** - * Return list of supported credit card types by Paypal Direct gateway - * - * @return array - */ - public function getWppCcTypesAsOptionArray() - { - return $this->_cctypeFactory->create()->setAllowedTypes( - ['AE', 'VI', 'MC', 'SM', 'SO', 'DI'] - )->toOptionArray(); - } - - /** - * Return list of supported credit card types by Paypal Direct (Payflow Edition) gateway - * - * @return array - */ - public function getWppPeCcTypesAsOptionArray() - { - return $this->_cctypeFactory->create()->setAllowedTypes( - ['VI', 'MC', 'SM', 'SO', 'OT', 'AE'] - )->toOptionArray(); - } - - /** - * Return list of supported credit card types by Payflow Pro gateway - * - * @return array - */ - public function getPayflowproCcTypesAsOptionArray() - { - return $this->_cctypeFactory->create()->setAllowedTypes(['AE', 'VI', 'MC', 'JCB', 'DI'])->toOptionArray(); - } - - /** - * Check whether the specified payment method is a CC-based one - * - * @param string $code - * @return bool - */ - public static function getIsCreditCardMethod($code) - { - switch ($code) { - case self::METHOD_WPP_DIRECT: - case self::METHOD_PAYFLOWPRO: - case self::METHOD_PAYFLOWLINK: - case self::METHOD_PAYFLOWADVANCED: - case self::METHOD_HOSTEDPRO: - return true; - } - return false; - } - - /** - * Check whether specified currency code is supported - * - * @param string $code - * @return bool - */ - public function isCurrencyCodeSupported($code) - { - if (in_array($code, $this->_supportedCurrencyCodes)) { - return true; - } - if ($this->getMerchantCountry() == 'BR' && $code == 'BRL') { - return true; - } - if ($this->getMerchantCountry() == 'MY' && $code == 'MYR') { - return true; - } - if ($this->getMerchantCountry() == 'TR' && $code == 'TRY') { - return true; - } - return false; - } - - /** - * Export page style current settings to specified object - * - * @param \Magento\Framework\Object $to - * @return void - */ - public function exportExpressCheckoutStyleSettings(\Magento\Framework\Object $to) - { - foreach ($this->_ecStyleConfigMap as $key => $exportKey) { - $configValue = $this->getConfigValue($key); - if ($configValue) { - $to->setData($exportKey, $configValue); - } - } - } - - /** - * Dynamic PayPal image URL getter - * Also can render dynamic Acceptance Mark - * - * @param string $type - * @param string $localeCode - * @param float $orderTotal - * @param string $pal - * @return string - */ - protected function _getDynamicImageUrl($type, $localeCode, $orderTotal, $pal) - { - $params = [ - 'cmd' => '_dynamic-image', - 'buttontype' => $type, - 'locale' => $this->_getSupportedLocaleCode($localeCode), - ]; - if ($orderTotal) { - $params['ordertotal'] = sprintf('%.2F', $orderTotal); - if ($pal) { - $params['pal'] = $pal; - } - } - return sprintf( - 'https://fpdbs%s.paypal.com/dynamicimageweb?%s', - $this->getConfigValue('sandboxFlag') ? '.sandbox' : '', - http_build_query($params) - ); - } - - /** - * Check whether specified locale code is supported. Fallback to en_US - * - * @param string|null $localeCode - * @return string - */ - protected function _getSupportedLocaleCode($localeCode = null) - { - if (!$localeCode || !in_array($localeCode, $this->_supportedImageLocales)) { - return 'en_US'; - } - return $localeCode; - } - - /** - * Map any supported payment method into a config path by specified field name - * - * @param string $fieldName - * @return string|null - */ - protected function _getSpecificConfigPath($fieldName) - { - $path = null; - switch ($this->_methodCode) { - case self::METHOD_WPS: - $path = $this->_mapStandardFieldset($fieldName); - break; - case self::METHOD_WPP_BML: - $path = $this->_mapBmlFieldset($fieldName); - break; - case self::METHOD_WPP_PE_BML: - $path = $this->_mapBmlPayflowFieldset($fieldName); - break; - case self::METHOD_WPP_EXPRESS: - case self::METHOD_WPP_PE_EXPRESS: - $path = $this->_mapExpressFieldset($fieldName); - break; - case self::METHOD_WPP_DIRECT: - $path = $this->_mapDirectFieldset($fieldName); - break; - case self::METHOD_BILLING_AGREEMENT: - case self::METHOD_HOSTEDPRO: - $path = $this->_mapMethodFieldset($fieldName); - break; - } - - if ($path === null) { - switch ($this->_methodCode) { - case self::METHOD_WPP_EXPRESS: - case self::METHOD_WPP_BML: - case self::METHOD_WPP_DIRECT: - case self::METHOD_BILLING_AGREEMENT: - case self::METHOD_HOSTEDPRO: - $path = $this->_mapWppFieldset($fieldName); - break; - case self::METHOD_WPP_PE_EXPRESS: - case self::METHOD_PAYFLOWADVANCED: - case self::METHOD_PAYFLOWLINK: - $path = $this->_mapWpukFieldset($fieldName); - break; - } - } - - if ($path === null) { - $path = $this->_mapGeneralFieldset($fieldName); - } - if ($path === null) { - $path = $this->_mapGenericStyleFieldset($fieldName); - } - return $path; - } - - /** - * Map PayPal Standard config fields - * - * @param string $fieldName - * @return string|null - */ - protected function _mapStandardFieldset($fieldName) - { - switch ($fieldName) { - case 'line_items_summary': - case 'sandbox_flag': - return 'payment/' . self::METHOD_WPS . "/{$fieldName}"; - default: - return $this->_mapMethodFieldset($fieldName); - } - } - - /** - * Map PayPal Express config fields - * - * @param string $fieldName - * @return string|null - */ - protected function _mapExpressFieldset($fieldName) - { - switch ($fieldName) { - case 'transfer_shipping_options': - case 'solution_type': - case 'visible_on_cart': - case 'visible_on_product': - case 'require_billing_address': - case 'authorization_honor_period': - case 'order_valid_period': - case 'child_authorization_number': - case 'allow_ba_signup': - return "payment/{$this->_methodCode}/{$fieldName}"; - default: - return $this->_mapMethodFieldset($fieldName); - } - } - - /** - * Map PayPal Express Bill Me Later config fields - * - * @param string $fieldName - * @return string|null - */ - protected function _mapBmlFieldset($fieldName) - { - switch ($fieldName) { - case 'allow_ba_signup': - return "payment/" . self::METHOD_WPP_EXPRESS . "/{$fieldName}"; - default: - return $this->_mapExpressFieldset($fieldName); - } - } - - /** - * Map PayPal Express Bill Me Later config fields (Payflow Edition) - * - * @param string $fieldName - * @return string|null - */ - protected function _mapBmlPayflowFieldset($fieldName) - { - switch ($fieldName) { - case 'allow_ba_signup': - return "payment/" . self::METHOD_WPP_PE_EXPRESS . "/{$fieldName}"; - default: - return $this->_mapExpressFieldset($fieldName); - } - } - - /** - * Map PayPal Direct config fields - * - * @param string $fieldName - * @return string|null - */ - protected function _mapDirectFieldset($fieldName) - { - switch ($fieldName) { - case 'useccv': - case 'centinel': - case 'centinel_is_mode_strict': - case 'centinel_api_url': - return "payment/{$this->_methodCode}/{$fieldName}"; - default: - return $this->_mapMethodFieldset($fieldName); - } - } - - /** - * Map PayPal Website Payments Pro common config fields - * - * @param string $fieldName - * @return string|null - */ - protected function _mapWppFieldset($fieldName) - { - switch ($fieldName) { - case 'api_authentication': - case 'api_username': - case 'api_password': - case 'api_signature': - case 'api_cert': - case 'sandbox_flag': - case 'use_proxy': - case 'proxy_host': - case 'proxy_port': - case 'button_flavor': - return "paypal/wpp/{$fieldName}"; - default: - return null; - } - } - - /** - * Map PayPal Website Payments Pro common config fields - * - * @param string $fieldName - * @return string|null - */ - protected function _mapWpukFieldset($fieldName) - { - $pathPrefix = 'paypal/wpuk'; - if ($this->_methodCode == self::METHOD_WPP_PE_EXPRESS && $this->isMethodAvailable(self::METHOD_PAYFLOWLINK)) { - $pathPrefix = 'payment/payflow_link'; - } elseif ($this->_methodCode == self::METHOD_WPP_PE_EXPRESS && $this->isMethodAvailable( - self::METHOD_PAYFLOWADVANCED - ) - ) { - $pathPrefix = 'payment/payflow_advanced'; - } elseif ($this->_methodCode == self::METHOD_WPP_PE_EXPRESS) { - $pathPrefix = 'payment/payflowpro'; - } elseif ($this->_methodCode == self::METHOD_PAYFLOWADVANCED || $this->_methodCode == self::METHOD_PAYFLOWLINK - ) { - $pathPrefix = 'payment/' . $this->_methodCode; - } - switch ($fieldName) { - case 'partner': - case 'user': - case 'vendor': - case 'pwd': - case 'sandbox_flag': - case 'use_proxy': - case 'proxy_host': - case 'proxy_port': - return $pathPrefix . '/' . $fieldName; - default: - return null; - } - } - - /** - * Map PayPal common style config fields - * - * @param string $fieldName - * @return string|null - */ - protected function _mapGenericStyleFieldset($fieldName) - { - switch ($fieldName) { - case 'logo': - case 'page_style': - case 'paypal_hdrimg': - case 'paypal_hdrbackcolor': - case 'paypal_hdrbordercolor': - case 'paypal_payflowcolor': - return "paypal/style/{$fieldName}"; - default: - return null; - } - } - - /** - * Map PayPal General Settings - * - * @param string $fieldName - * @return string|null - */ - protected function _mapGeneralFieldset($fieldName) - { - switch ($fieldName) { - case 'business_account': - case 'merchant_country': - return "paypal/general/{$fieldName}"; - default: - return null; - } - } - - /** - * Map PayPal General Settings - * - * @param string $fieldName - * @return string|null - */ - protected function _mapMethodFieldset($fieldName) - { - if (!$this->_methodCode) { - return null; - } - switch ($fieldName) { - case 'active': - case 'title': - case 'payment_action': - case 'allowspecific': - case 'specificcountry': - case 'line_items_enabled': - case 'cctypes': - case 'sort_order': - case 'debug': - case 'verify_peer': - return "payment/{$this->_methodCode}/{$fieldName}"; - default: - return null; - } - } - - /** - * Payment API authentication methods source getter - * - * @return array - */ - public function getApiAuthenticationMethods() - { - return ['0' => __('API Signature'), '1' => __('API Certificate')]; - } - - /** - * Api certificate getter - * - * @return string - */ - public function getApiCertificate() - { - $websiteId = $this->_storeManager->getStore($this->_storeId)->getWebsiteId(); - return $this->_certFactory->create()->loadByWebsite($websiteId, false)->getCertPath(); - } - - /** - * Get PublisherId from stored config - * - * @return mixed - */ - public function getBmlPublisherId() - { - return $this->_scopeConfig->getValue( - 'payment/' . self::METHOD_WPP_BML . '/publisher_id', - \Magento\Store\Model\ScopeInterface::SCOPE_STORE, - $this->_storeId - ); - } - - /** - * Get Display option from stored config - * @param string $section - * - * @return mixed - */ - public function getBmlDisplay($section) - { - $display = $this->_scopeConfig->getValue( - 'payment/' . self::METHOD_WPP_BML . '/' . $section . '_display', - \Magento\Store\Model\ScopeInterface::SCOPE_STORE, - $this->_storeId - ); - $bmlActive = $this->_scopeConfig->getValue( - 'payment/' . self::METHOD_WPP_BML . '/active', - \Magento\Store\Model\ScopeInterface::SCOPE_STORE, - $this->_storeId - ); - $bmlUkActive = $this->_scopeConfig->getValue( - 'payment/' . self::METHOD_WPP_PE_BML . '/active', - \Magento\Store\Model\ScopeInterface::SCOPE_STORE, - $this->_storeId - ); - return (($bmlActive && $this->isMethodActive(self::METHOD_WPP_EXPRESS)) - || ($bmlUkActive && $this->isMethodActive(self::METHOD_WPP_PE_EXPRESS))) ? $display : 0; - } - - /** - * Get Position option from stored config - * @param string $section - * - * @return mixed - */ - public function getBmlPosition($section) - { - return $this->_scopeConfig->getValue( - 'payment/' . self::METHOD_WPP_BML . '/' . $section . '_position', - \Magento\Store\Model\ScopeInterface::SCOPE_STORE, - $this->_storeId - ); - } - - /** - * Get Size option from stored config - * @param string $section - * - * @return mixed - */ - public function getBmlSize($section) - { - return $this->_scopeConfig->getValue( - 'payment/' . self::METHOD_WPP_BML . '/' . $section . '_size', - \Magento\Store\Model\ScopeInterface::SCOPE_STORE, - $this->_storeId - ); - } -} diff --git a/app/code/Magento/Paypal/Model/Config/Factory.php b/app/code/Magento/Paypal/Model/Config/Factory.php deleted file mode 100644 index ff4a210bf6eef..0000000000000 --- a/app/code/Magento/Paypal/Model/Config/Factory.php +++ /dev/null @@ -1,40 +0,0 @@ -_objectManager = $objectManager; - } - - /** - * Create class instance with specified parameters - * - * @param string $className - * @param array $data - * @return object - */ - public function create($className, array $data = []) - { - return $this->_objectManager->create($className, $data); - } -} diff --git a/app/code/Magento/Paypal/Model/Config/Structure/Element/FieldPlugin.php b/app/code/Magento/Paypal/Model/Config/Structure/Element/FieldPlugin.php deleted file mode 100644 index 7352ebc61d458..0000000000000 --- a/app/code/Magento/Paypal/Model/Config/Structure/Element/FieldPlugin.php +++ /dev/null @@ -1,42 +0,0 @@ -_request = $request; - } - - /** - * Get original configPath (not changed by PayPal configuration inheritance) - * - * @param \Magento\Backend\Model\Config\Structure\Element\Field $subject - * @param \Closure $proceed - * @return string|null - */ - public function aroundGetConfigPath( - \Magento\Backend\Model\Config\Structure\Element\Field $subject, - \Closure $proceed - ) { - $configPath = $proceed(); - if (!isset($configPath) && $this->_request->getParam('section') == 'payment') { - $configPath = preg_replace('@^(' . implode( - '|', - \Magento\Paypal\Model\Config\StructurePlugin::getPaypalConfigCountries(true) - ) . ')/@', 'payment/', $subject->getPath()); - } - return $configPath; - } -} diff --git a/app/code/Magento/Paypal/Model/Config/StructurePlugin.php b/app/code/Magento/Paypal/Model/Config/StructurePlugin.php deleted file mode 100644 index 4a863bba8f0f3..0000000000000 --- a/app/code/Magento/Paypal/Model/Config/StructurePlugin.php +++ /dev/null @@ -1,103 +0,0 @@ -_scopeDefiner = $scopeDefiner; - $this->_helper = $helper; - } - - /** - * Get paypal configuration countries - * - * @param bool $addOther - * @return string[] - */ - public static function getPaypalConfigCountries($addOther = false) - { - $countries = self::$_paypalConfigCountries; - if ($addOther) { - $countries[] = 'payment_other'; - } - return $countries; - } - - /** - * Substitute payment section with PayPal configs - * - * @param \Magento\Backend\Model\Config\Structure $subject - * @param \Closure $proceed - * @param array $pathParts - * @return \Magento\Backend\Model\Config\Structure\ElementInterface - * @SuppressWarnings(PHPMD.UnusedFormalParameter) - */ - public function aroundGetElementByPathParts( - \Magento\Backend\Model\Config\Structure $subject, - \Closure $proceed, - array $pathParts - ) { - $isSectionChanged = $pathParts[0] == 'payment'; - if ($isSectionChanged) { - $requestedCountrySection = 'payment_' . strtolower($this->_helper->getConfigurationCountryCode()); - if (in_array($requestedCountrySection, self::getPaypalConfigCountries())) { - $pathParts[0] = $requestedCountrySection; - } else { - $pathParts[0] = 'payment_other'; - } - } - /** @var \Magento\Backend\Model\Config\Structure\ElementInterface $result */ - $result = $proceed($pathParts); - if ($isSectionChanged && isset($result)) { - if ($result instanceof \Magento\Backend\Model\Config\Structure\Element\Section) { - $result->setData(array_merge( - $result->getData(), - ['showInDefault' => true, 'showInWebsite' => true, 'showInStore' => true] - ), $this->_scopeDefiner->getScope()); - } - } - return $result; - } -} diff --git a/app/code/Magento/Paypal/Model/Direct.php b/app/code/Magento/Paypal/Model/Direct.php deleted file mode 100644 index 499839cea42f0..0000000000000 --- a/app/code/Magento/Paypal/Model/Direct.php +++ /dev/null @@ -1,522 +0,0 @@ -_storeManager = $storeManager; - $this->_urlBuilder = $urlBuilder; - $this->_requestHttp = $requestHttp; - $this->_cartFactory = $cartFactory; - - $proInstance = array_shift($data); - if ($proInstance && $proInstance instanceof \Magento\Paypal\Model\Pro) { - $this->_pro = $proInstance; - } else { - $this->_pro = $proFactory->create(); - } - $this->_pro->setMethod($this->_code); - } - - /** - * Store setter - * Also updates store ID in config object - * - * @param \Magento\Store\Model\Store|int $store - * @return $this - */ - public function setStore($store) - { - $this->setData('store', $store); - if (null === $store) { - $store = $this->_storeManager->getStore()->getId(); - } - $this->_pro->getConfig()->setStoreId(is_object($store) ? $store->getId() : $store); - return $this; - } - - /** - * Whether method is available for specified currency - * - * @param string $currencyCode - * @return bool - */ - public function canUseForCurrency($currencyCode) - { - return $this->_pro->getConfig()->isCurrencyCodeSupported($currencyCode); - } - - /** - * Payment action getter compatible with payment model - * - * @see \Magento\Sales\Model\Payment::place() - * @return string - */ - public function getConfigPaymentAction() - { - return $this->_pro->getConfig()->getPaymentAction(); - } - - /** - * Return available CC types for gateway based on merchant country - * - * @return string - */ - public function getAllowedCcTypes() - { - $ccTypes = explode(',', $this->_pro->getConfig()->getConfigValue('cctypes')); - $country = $this->_pro->getConfig()->getMerchantCountry(); - - if ($country == 'GB') { - $ccTypes = array_intersect(['SM', 'SO', 'MC', 'DI', 'VI'], $ccTypes); - } elseif ($country == 'CA') { - $ccTypes = array_intersect(['MC', 'VI'], $ccTypes); - } - return implode(',', $ccTypes); - } - - /** - * Check whether payment method can be used - * - * @param \Magento\Sales\Model\Quote|null $quote - * @return bool - */ - public function isAvailable($quote = null) - { - if (parent::isAvailable($quote) && $this->_pro->getConfig()->isMethodAvailable()) { - return true; - } - return false; - } - - /** - * Custom getter for payment configuration - * - * @param string $field - * @param int|null $storeId - * @return null|string - */ - public function getConfigData($field, $storeId = null) - { - $value = null; - switch ($field) { - case 'cctypes': - $value = $this->getAllowedCcTypes(); - break; - default: - $value = $this->_pro->getConfig()->getConfigValue($field); - } - return $value; - } - - /** - * Authorize payment - * - * @param \Magento\Framework\Object|Payment $payment - * @param float $amount - * @return $this - */ - public function authorize(\Magento\Framework\Object $payment, $amount) - { - return $this->_placeOrder($payment, $amount); - } - - /** - * Void payment - * - * @param \Magento\Framework\Object|Payment $payment - * @return $this - */ - public function void(\Magento\Framework\Object $payment) - { - $this->_pro->void($payment); - return $this; - } - - /** - * Capture payment - * - * @param \Magento\Framework\Object|Payment $payment - * @param float $amount - * @return $this - */ - public function capture(\Magento\Framework\Object $payment, $amount) - { - if (false === $this->_pro->capture($payment, $amount)) { - $this->_placeOrder($payment, $amount); - } - return $this; - } - - /** - * Refund capture - * - * @param \Magento\Framework\Object|Payment $payment - * @param float $amount - * @return $this - */ - public function refund(\Magento\Framework\Object $payment, $amount) - { - $this->_pro->refund($payment, $amount); - return $this; - } - - /** - * Cancel payment - * - * @param \Magento\Framework\Object|Payment $payment - * @return $this - */ - public function cancel(\Magento\Framework\Object $payment) - { - $this->void($payment); - - return $this; - } - - /** - * Whether payment can be reviewed - * - * @param \Magento\Payment\Model\Info|Payment $payment - * @return bool - */ - public function canReviewPayment(\Magento\Payment\Model\Info $payment) - { - return parent::canReviewPayment($payment) && $this->_pro->canReviewPayment($payment); - } - - /** - * Attempt to accept a pending payment - * - * @param \Magento\Payment\Model\Info|Payment $payment - * @return bool - */ - public function acceptPayment(\Magento\Payment\Model\Info $payment) - { - parent::acceptPayment($payment); - return $this->_pro->reviewPayment($payment, \Magento\Paypal\Model\Pro::PAYMENT_REVIEW_ACCEPT); - } - - /** - * Attempt to deny a pending payment - * - * @param \Magento\Payment\Model\Info|Payment $payment - * @return bool - */ - public function denyPayment(\Magento\Payment\Model\Info $payment) - { - parent::denyPayment($payment); - return $this->_pro->reviewPayment($payment, \Magento\Paypal\Model\Pro::PAYMENT_REVIEW_DENY); - } - - /** - * Set fallback API URL if not defined in configuration - * - * @return \Magento\Centinel\Model\Service - */ - public function getCentinelValidator() - { - $validator = parent::getCentinelValidator(); - if (!$validator->getCustomApiEndpointUrl()) { - $validator->setCustomApiEndpointUrl($this->_pro->getConfig()->getConfigValue('centinelDefaultApiUrl')); - } - return $validator; - } - - /** - * Fetch transaction details info - * - * @param \Magento\Payment\Model\Info $payment - * @param string $transactionId - * @return array - */ - public function fetchTransactionInfo(\Magento\Payment\Model\Info $payment, $transactionId) - { - return $this->_pro->fetchTransactionInfo($payment, $transactionId); - } - - /** - * Place an order with authorization or capture action - * - * @param Payment $payment - * @param float $amount - * @return $this - */ - protected function _placeOrder(Payment $payment, $amount) - { - $order = $payment->getOrder(); - $api = $this->_pro->getApi()->setPaymentAction( - $this->_pro->getConfig()->getConfigValue('paymentAction') - )->setIpAddress( - $this->_requestHttp->getClientIp(false) - )->setAmount( - $amount - )->setCurrencyCode( - $order->getBaseCurrencyCode() - )->setInvNum( - $order->getIncrementId() - )->setEmail( - $order->getCustomerEmail() - )->setNotifyUrl( - $this->_urlBuilder->getUrl('paypal/ipn/') - )->setCreditCardType( - $payment->getCcType() - )->setCreditCardNumber( - $payment->getCcNumber() - )->setCreditCardExpirationDate( - $this->_getFormattedCcExpirationDate($payment->getCcExpMonth(), $payment->getCcExpYear()) - )->setCreditCardCvv2( - $payment->getCcCid() - )->setMaestroSoloIssueNumber( - $payment->getCcSsIssue() - ); - - if ($payment->getCcSsStartMonth() && $payment->getCcSsStartYear()) { - $year = sprintf('%02d', substr($payment->getCcSsStartYear(), -2, 2)); - $api->setMaestroSoloIssueDate($this->_getFormattedCcExpirationDate($payment->getCcSsStartMonth(), $year)); - } - if ($this->getIsCentinelValidationEnabled()) { - $this->getCentinelValidator()->exportCmpiData($api); - } - - // add shipping and billing addresses - if ($order->getIsVirtual()) { - $api->setAddress($order->getBillingAddress())->setSuppressShipping(true); - } else { - $api->setAddress($order->getShippingAddress()); - $api->setBillingAddress($order->getBillingAddress()); - } - - // add line items - $cart = $this->_cartFactory->create(['salesModel' => $order]); - - $api->setPaypalCart($cart)->setIsLineItemsEnabled($this->_pro->getConfig()->getConfigValue('lineItemsEnabled')); - - // call api and import transaction and other payment information - $api->callDoDirectPayment(); - $this->_importResultToPayment($api, $payment); - - try { - $api->callGetTransactionDetails(); - } catch (\Magento\Framework\Model\Exception $e) { - // if we receive errors, but DoDirectPayment response is Success, then set Pending status for transaction - $payment->setIsTransactionPending(true); - } - $this->_importResultToPayment($api, $payment); - return $this; - } - - /** - * Format credit card expiration date based on month and year values - * Format: mmyyyy - * - * @param string|int $month - * @param string|int $year - * @return string - */ - protected function _getFormattedCcExpirationDate($month, $year) - { - return sprintf('%02d%02d', $month, $year); - } - - /** - * Import direct payment results to payment - * - * @param \Magento\Paypal\Model\Api\Nvp $api - * @param Payment $payment - * @return void - */ - protected function _importResultToPayment($api, $payment) - { - $payment->setTransactionId($api->getTransactionId())->setIsTransactionClosed(0); - $this->_pro->importPaymentInfo($api, $payment); - } - - /** - * Check void availability - * - * @param \Magento\Framework\Object $payment - * @return bool - */ - public function canVoid(\Magento\Framework\Object $payment) - { - if ($payment instanceof \Magento\Sales\Model\Order\Invoice || - $payment instanceof \Magento\Sales\Model\Order\Creditmemo - ) { - return false; - } - - return $this->_canVoid; - } -} diff --git a/app/code/Magento/Paypal/Model/Express.php b/app/code/Magento/Paypal/Model/Express.php deleted file mode 100644 index 4fab1d56be396..0000000000000 --- a/app/code/Magento/Paypal/Model/Express.php +++ /dev/null @@ -1,811 +0,0 @@ -_storeManager = $storeManager; - $this->_urlBuilder = $urlBuilder; - $this->_cartFactory = $cartFactory; - $this->_checkoutSession = $checkoutSession; - $this->_exception = $exception; - - $proInstance = array_shift($data); - if ($proInstance && $proInstance instanceof \Magento\Paypal\Model\Pro) { - $this->_pro = $proInstance; - } else { - $this->_pro = $proFactory->create(); - } - $this->_pro->setMethod($this->_code); - $this->_setApiProcessableErrors(); - } - - /** - * Set processable error codes to API model - * - * @return \Magento\Paypal\Model\Api\Nvp - */ - protected function _setApiProcessableErrors() - { - return $this->_pro->getApi()->setProcessableErrors( - [ - ApiProcessableException::API_INTERNAL_ERROR, - ApiProcessableException::API_UNABLE_PROCESS_PAYMENT_ERROR_CODE, - ApiProcessableException::API_DO_EXPRESS_CHECKOUT_FAIL, - ApiProcessableException::API_UNABLE_TRANSACTION_COMPLETE, - ApiProcessableException::API_TRANSACTION_EXPIRED, - ApiProcessableException::API_MAX_PAYMENT_ATTEMPTS_EXCEEDED, - ApiProcessableException::API_COUNTRY_FILTER_DECLINE, - ApiProcessableException::API_MAXIMUM_AMOUNT_FILTER_DECLINE, - ApiProcessableException::API_OTHER_FILTER_DECLINE, - ] - ); - } - - /** - * Store setter - * Also updates store ID in config object - * - * @param \Magento\Store\Model\Store|int $store - * @return $this - */ - public function setStore($store) - { - $this->setData('store', $store); - if (null === $store) { - $store = $this->_storeManager->getStore()->getId(); - } - $this->_pro->getConfig()->setStoreId(is_object($store) ? $store->getId() : $store); - return $this; - } - - /** - * Can be used in regular checkout - * - * @return bool - */ - public function canUseCheckout() - { - if ($this->_scopeConfig->isSetFlag( - 'payment/hosted_pro/active', - \Magento\Store\Model\ScopeInterface::SCOPE_STORE - ) && !$this->_scopeConfig->isSetFlag( - 'payment/hosted_pro/display_ec', - \Magento\Store\Model\ScopeInterface::SCOPE_STORE - ) - ) { - return false; - } - return parent::canUseCheckout(); - } - - /** - * Whether method is available for specified currency - * - * @param string $currencyCode - * @return bool - */ - public function canUseForCurrency($currencyCode) - { - return $this->_pro->getConfig()->isCurrencyCodeSupported($currencyCode); - } - - /** - * Payment action getter compatible with payment model - * - * @see \Magento\Sales\Model\Payment::place() - * @return string - */ - public function getConfigPaymentAction() - { - return $this->_pro->getConfig()->getPaymentAction(); - } - - /** - * Check whether payment method can be used - * @param Quote|null $quote - * @return bool - */ - public function isAvailable($quote = null) - { - if (parent::isAvailable($quote) && $this->_pro->getConfig()->isMethodAvailable()) { - return true; - } - return false; - } - - /** - * Custom getter for payment configuration - * - * @param string $field - * @param int|null $storeId - * @return mixed - */ - public function getConfigData($field, $storeId = null) - { - return $this->_pro->getConfig()->getConfigValue($field); - } - - /** - * Order payment - * - * @param \Magento\Framework\Object|Payment $payment - * @param float $amount - * @return $this - */ - public function order(\Magento\Framework\Object $payment, $amount) - { - $paypalTransactionData = $this->_checkoutSession->getPaypalTransactionData(); - if (!is_array($paypalTransactionData)) { - $this->_placeOrder($payment, $amount); - } else { - $this->_importToPayment($this->_pro->getApi()->setData($paypalTransactionData), $payment); - } - - $payment->setAdditionalInformation($this->_isOrderPaymentActionKey, true); - - if ($payment->getIsFraudDetected()) { - return $this; - } - - $order = $payment->getOrder(); - $orderTransactionId = $payment->getTransactionId(); - - $api = $this->_callDoAuthorize($amount, $payment, $orderTransactionId); - - $state = \Magento\Sales\Model\Order::STATE_PROCESSING; - $status = true; - - $formattedPrice = $order->getBaseCurrency()->formatTxt($amount); - if ($payment->getIsTransactionPending()) { - $message = __('The ordering amount of %1 is pending approval on the payment gateway.', $formattedPrice); - $state = \Magento\Sales\Model\Order::STATE_PAYMENT_REVIEW; - } else { - $message = __('Ordered amount of %1', $formattedPrice); - } - - $payment->addTransaction(Transaction::TYPE_ORDER, null, false, $message); - - $this->_pro->importPaymentInfo($api, $payment); - - if ($payment->getIsTransactionPending()) { - $message = __( - 'We\'ll authorize the amount of %1 as soon as the payment gateway approves it.', - $formattedPrice - ); - $state = \Magento\Sales\Model\Order::STATE_PAYMENT_REVIEW; - if ($payment->getIsFraudDetected()) { - $status = \Magento\Sales\Model\Order::STATUS_FRAUD; - } - } else { - $message = __('The authorized amount is %1.', $formattedPrice); - } - - $payment->resetTransactionAdditionalInfo(); - - $payment->setTransactionId($api->getTransactionId()); - $payment->setParentTransactionId($orderTransactionId); - - $payment->addTransaction(Transaction::TYPE_AUTH, null, false, $message); - - $order->setState($state, $status); - - $payment->setSkipOrderProcessing(true); - return $this; - } - - /** - * Authorize payment - * - * @param \Magento\Framework\Object|Payment $payment - * @param float $amount - * @return $this - */ - public function authorize(\Magento\Framework\Object $payment, $amount) - { - return $this->_placeOrder($payment, $amount); - } - - /** - * Void payment - * - * @param \Magento\Framework\Object|Payment $payment - * @return $this - */ - public function void(\Magento\Framework\Object $payment) - { - //Switching to order transaction if needed - if ($payment->getAdditionalInformation( - $this->_isOrderPaymentActionKey - ) && !$payment->getVoidOnlyAuthorization() - ) { - $orderTransaction = $payment->lookupTransaction(false, Transaction::TYPE_ORDER); - if ($orderTransaction) { - $payment->setParentTransactionId($orderTransaction->getTxnId()); - $payment->setTransactionId($orderTransaction->getTxnId() . '-void'); - } - } - $this->_pro->void($payment); - return $this; - } - - /** - * Capture payment - * - * @param \Magento\Framework\Object|Payment $payment - * @param float $amount - * @throws \Magento\Framework\Model\Exception - * @return $this - */ - public function capture(\Magento\Framework\Object $payment, $amount) - { - $authorizationTransaction = $payment->getAuthorizationTransaction(); - $authorizationPeriod = abs(intval($this->getConfigData('authorization_honor_period'))); - $maxAuthorizationNumber = abs(intval($this->getConfigData('child_authorization_number'))); - $order = $payment->getOrder(); - $isAuthorizationCreated = false; - - if ($payment->getAdditionalInformation($this->_isOrderPaymentActionKey)) { - $voided = false; - if (!$authorizationTransaction->getIsClosed() && $this->_isTransactionExpired( - $authorizationTransaction, - $authorizationPeriod - ) - ) { - //Save payment state and configure payment object for voiding - $isCaptureFinal = $payment->getShouldCloseParentTransaction(); - $payment->setShouldCloseParentTransaction(false); - $payment->setParentTransactionId($authorizationTransaction->getTxnId()); - $payment->unsTransactionId(); - $payment->setVoidOnlyAuthorization(true); - $payment->void(new \Magento\Framework\Object()); - - //Revert payment state after voiding - $payment->unsAuthorizationTransaction(); - $payment->unsTransactionId(); - $payment->setShouldCloseParentTransaction($isCaptureFinal); - $voided = true; - } - - if ($authorizationTransaction->getIsClosed() || $voided) { - if ($payment->getAdditionalInformation($this->_authorizationCountKey) > $maxAuthorizationNumber - 1) { - $this->_exception->create( - ['message' => __('The maximum number of child authorizations is reached.')] - ); - } - $api = $this->_callDoAuthorize($amount, $payment, $authorizationTransaction->getParentTxnId()); - - //Adding authorization transaction - $this->_pro->importPaymentInfo($api, $payment); - $payment->setTransactionId($api->getTransactionId()); - $payment->setParentTransactionId($authorizationTransaction->getParentTxnId()); - $payment->setIsTransactionClosed(false); - - $formatedPrice = $order->getBaseCurrency()->formatTxt($amount); - - if ($payment->getIsTransactionPending()) { - $message = __( - 'We\'ll authorize the amount of %1 as soon as the payment gateway approves it.', - $formatedPrice - ); - } else { - $message = __('The authorized amount is %1.', $formatedPrice); - } - - $transaction = $payment->addTransaction(Transaction::TYPE_AUTH, null, true, $message); - - $payment->setParentTransactionId($api->getTransactionId()); - $isAuthorizationCreated = true; - } - //close order transaction if needed - if ($payment->getShouldCloseParentTransaction()) { - $orderTransaction = $payment->lookupTransaction(false, Transaction::TYPE_ORDER); - - if ($orderTransaction) { - $orderTransaction->setIsClosed(true); - $order->addRelatedObject($orderTransaction); - } - } - } - - if (false === $this->_pro->capture($payment, $amount)) { - $this->_placeOrder($payment, $amount); - } - - if ($isAuthorizationCreated && isset($transaction)) { - $transaction->setIsClosed(true); - } - - return $this; - } - - /** - * Refund capture - * - * @param \Magento\Framework\Object|Payment $payment - * @param float $amount - * @return $this - */ - public function refund(\Magento\Framework\Object $payment, $amount) - { - $this->_pro->refund($payment, $amount); - return $this; - } - - /** - * Cancel payment - * - * @param \Magento\Framework\Object|Payment $payment - * @return $this - */ - public function cancel(\Magento\Framework\Object $payment) - { - $this->void($payment); - - return $this; - } - - /** - * Whether payment can be reviewed - * - * @param \Magento\Payment\Model\Info|Payment $payment - * @return bool - */ - public function canReviewPayment(\Magento\Payment\Model\Info $payment) - { - return parent::canReviewPayment($payment) && $this->_pro->canReviewPayment($payment); - } - - /** - * Attempt to accept a pending payment - * - * @param \Magento\Payment\Model\Info|Payment $payment - * @return bool - */ - public function acceptPayment(\Magento\Payment\Model\Info $payment) - { - parent::acceptPayment($payment); - return $this->_pro->reviewPayment($payment, \Magento\Paypal\Model\Pro::PAYMENT_REVIEW_ACCEPT); - } - - /** - * Attempt to deny a pending payment - * - * @param \Magento\Payment\Model\Info|Payment $payment - * @return bool - */ - public function denyPayment(\Magento\Payment\Model\Info $payment) - { - parent::denyPayment($payment); - return $this->_pro->reviewPayment($payment, \Magento\Paypal\Model\Pro::PAYMENT_REVIEW_DENY); - } - - /** - * Checkout redirect URL getter for onepage checkout (hardcode) - * - * @see \Magento\Checkout\Controller\Onepage::savePaymentAction() - * @see Quote\Payment::getCheckoutRedirectUrl() - * @return string - */ - public function getCheckoutRedirectUrl() - { - return $this->_urlBuilder->getUrl('paypal/express/start'); - } - - /** - * Fetch transaction details info - * - * @param \Magento\Payment\Model\Info $payment - * @param string $transactionId - * @return array - */ - public function fetchTransactionInfo(\Magento\Payment\Model\Info $payment, $transactionId) - { - return $this->_pro->fetchTransactionInfo($payment, $transactionId); - } - - /** - * @return Api\Nvp - */ - public function getApi() - { - return $this->_pro->getApi(); - } - - /** - * Assign data to info model instance - * - * @param array|\Magento\Framework\Object $data - * @return \Magento\Payment\Model\Info - */ - public function assignData($data) - { - $result = parent::assignData($data); - $key = ExpressCheckout::PAYMENT_INFO_TRANSPORT_BILLING_AGREEMENT; - if (is_array($data)) { - $this->getInfoInstance()->setAdditionalInformation($key, isset($data[$key]) ? $data[$key] : null); - } elseif ($data instanceof \Magento\Framework\Object) { - $this->getInfoInstance()->setAdditionalInformation($key, $data->getData($key)); - } - return $result; - } - - /** - * Place an order with authorization or capture action - * - * @param Payment $payment - * @param float $amount - * @return $this - */ - protected function _placeOrder(Payment $payment, $amount) - { - $order = $payment->getOrder(); - - // prepare api call - $token = $payment->getAdditionalInformation(ExpressCheckout::PAYMENT_INFO_TRANSPORT_TOKEN); - - $cart = $this->_cartFactory->create(['salesModel' => $order]); - - $api = $this->getApi()->setToken( - $token - )->setPayerId( - $payment->getAdditionalInformation(ExpressCheckout::PAYMENT_INFO_TRANSPORT_PAYER_ID) - )->setAmount( - $amount - )->setPaymentAction( - $this->_pro->getConfig()->getConfigValue('paymentAction') - )->setNotifyUrl( - $this->_urlBuilder->getUrl('paypal/ipn/') - )->setInvNum( - $order->getIncrementId() - )->setCurrencyCode( - $order->getBaseCurrencyCode() - )->setPaypalCart( - $cart - )->setIsLineItemsEnabled( - $this->_pro->getConfig()->getConfigValue('lineItemsEnabled') - ); - if ($order->getIsVirtual()) { - $api->setAddress($order->getBillingAddress())->setSuppressShipping(true); - } else { - $api->setAddress($order->getShippingAddress()); - $api->setBillingAddress($order->getBillingAddress()); - } - - // call api and get details from it - $api->callDoExpressCheckoutPayment(); - - $this->_importToPayment($api, $payment); - return $this; - } - - /** - * Import payment info to payment - * - * @param Nvp $api - * @param Payment $payment - * @return void - */ - protected function _importToPayment($api, $payment) - { - $payment->setTransactionId( - $api->getTransactionId() - )->setIsTransactionClosed( - 0 - )->setAdditionalInformation( - ExpressCheckout::PAYMENT_INFO_TRANSPORT_REDIRECT, - $api->getRedirectRequired() - ); - - if ($api->getBillingAgreementId()) { - $payment->setBillingAgreementData( - [ - 'billing_agreement_id' => $api->getBillingAgreementId(), - 'method_code' => \Magento\Paypal\Model\Config::METHOD_BILLING_AGREEMENT, - ] - ); - } - - $this->_pro->importPaymentInfo($api, $payment); - } - - /** - * Check void availability - * - * @param \Magento\Framework\Object $payment - * @return bool - */ - public function canVoid(\Magento\Framework\Object $payment) - { - if ($payment instanceof \Magento\Sales\Model\Order\Invoice || - $payment instanceof \Magento\Sales\Model\Order\Creditmemo - ) { - return false; - } - $info = $this->getInfoInstance(); - if ($info->getAdditionalInformation($this->_isOrderPaymentActionKey)) { - $orderTransaction = $info->lookupTransaction(false, Transaction::TYPE_ORDER); - if ($orderTransaction) { - $info->setParentTransactionId($orderTransaction->getTxnId()); - } - } - - return $this->_canVoid; - } - - /** - * Check capture availability - * - * @return bool - */ - public function canCapture() - { - $payment = $this->getInfoInstance(); - $this->_pro->getConfig()->setStoreId($payment->getOrder()->getStore()->getId()); - - if ($payment->getAdditionalInformation($this->_isOrderPaymentActionKey)) { - $orderTransaction = $payment->lookupTransaction(false, Transaction::TYPE_ORDER); - if ($orderTransaction->getIsClosed()) { - return false; - } - - $orderValidPeriod = abs(intval($this->getConfigData('order_valid_period'))); - - $dateCompass = new \DateTime($orderTransaction->getCreatedAt()); - $dateCompass->modify('+' . $orderValidPeriod . ' days'); - $currentDate = new \DateTime(); - - if ($currentDate > $dateCompass || $orderValidPeriod == 0) { - return false; - } - } - return $this->_canCapture; - } - - /** - * Call DoAuthorize - * - * @param int $amount - * @param \Magento\Framework\Object $payment - * @param string $parentTransactionId - * @return \Magento\Paypal\Model\Api\AbstractApi - */ - protected function _callDoAuthorize($amount, $payment, $parentTransactionId) - { - $apiData = $this->_pro->getApi()->getData(); - foreach ($apiData as $k => $v) { - if (is_object($v)) { - unset($apiData[$k]); - } - } - $this->_checkoutSession->setPaypalTransactionData($apiData); - $this->_pro->resetApi(); - $api = $this->_setApiProcessableErrors() - ->setAmount($amount) - ->setCurrencyCode($payment->getOrder()->getBaseCurrencyCode()) - ->setTransactionId($parentTransactionId) - ->callDoAuthorization(); - - $payment->setAdditionalInformation( - $this->_authorizationCountKey, - $payment->getAdditionalInformation($this->_authorizationCountKey) + 1 - ); - - return $api; - } - - /** - * Check transaction for expiration in PST - * - * @param Transaction $transaction - * @param int $period - * @return bool - */ - protected function _isTransactionExpired(Transaction $transaction, $period) - { - $period = intval($period); - if (0 == $period) { - return true; - } - - $transactionClosingDate = new \DateTime($transaction->getCreatedAt(), new \DateTimeZone('GMT')); - $transactionClosingDate->setTimezone(new \DateTimeZone('US/Pacific')); - /** - * 11:49:00 PayPal transactions closing time - */ - $transactionClosingDate->setTime(11, 49, 00); - $transactionClosingDate->modify('+' . $period . ' days'); - - $currentTime = new \DateTime(null, new \DateTimeZone('US/Pacific')); - - if ($currentTime > $transactionClosingDate) { - return true; - } - - return false; - } -} diff --git a/app/code/Magento/Paypal/Model/Express/Checkout.php b/app/code/Magento/Paypal/Model/Express/Checkout.php deleted file mode 100644 index f9eff10bbdb2f..0000000000000 --- a/app/code/Magento/Paypal/Model/Express/Checkout.php +++ /dev/null @@ -1,1185 +0,0 @@ -_customerUrl = $customerUrl; - $this->_taxData = $taxData; - $this->_checkoutData = $checkoutData; - $this->_configCacheType = $configCacheType; - $this->_logger = $logger; - $this->_localeResolver = $localeResolver; - $this->_paypalInfo = $paypalInfo; - $this->_storeManager = $storeManager; - $this->_coreUrl = $coreUrl; - $this->_cartFactory = $cartFactory; - $this->_logFactory = $logFactory; - $this->_checkoutOnepageFactory = $onepageFactory; - $this->_serviceQuoteFactory = $serviceQuoteFactory; - $this->_agreementFactory = $agreementFactory; - $this->_apiTypeFactory = $apiTypeFactory; - $this->_objectCopyService = $objectCopyService; - $this->_checkoutSession = $checkoutSession; - $this->_customerRepository = $customerRepository; - $this->_encryptor = $encryptor; - $this->_messageManager = $messageManager; - $this->orderSender = $orderSender; - $this->_accountManagement = $accountManagement; - $this->paypalQuote = $paypalQuote; - $this->quoteRepository = $quoteRepository; - $this->_customerSession = isset($params['session']) - && $params['session'] instanceof \Magento\Customer\Model\Session ? $params['session'] : $customerSession; - - if (isset($params['config']) && $params['config'] instanceof PaypalConfig) { - $this->_config = $params['config']; - } else { - throw new \Exception('Config instance is required.'); - } - - if (isset($params['quote']) && $params['quote'] instanceof \Magento\Sales\Model\Quote) { - $this->_quote = $params['quote']; - } else { - throw new \Exception('Quote instance is required.'); - } - } - - /** - * Checkout with PayPal image URL getter - * Spares API calls of getting "pal" variable, by putting it into cache per store view - * - * @return string - */ - public function getCheckoutShortcutImageUrl() - { - // get "pal" thing from cache or lookup it via API - $pal = null; - if ($this->_config->areButtonsDynamic()) { - $cacheId = self::PAL_CACHE_ID . $this->_storeManager->getStore()->getId(); - $pal = $this->_configCacheType->load($cacheId); - if (self::PAL_CACHE_ID == $pal) { - $pal = null; - } elseif (!$pal) { - $pal = null; - $this->_getApi(); - try { - $this->_api->callGetPalDetails(); - $pal = $this->_api->getPal(); - $this->_configCacheType->save($pal, $cacheId); - } catch (\Exception $e) { - $this->_configCacheType->save(self::PAL_CACHE_ID, $cacheId); - $this->_logger->logException($e); - } - } - } - - return $this->_config->getExpressCheckoutShortcutImageUrl( - $this->_localeResolver->getLocaleCode(), - $this->_quote->getBaseGrandTotal(), - $pal - ); - } - - /** - * Setter that enables giropay redirects flow - * - * @param string $successUrl - payment success result - * @param string $cancelUrl - payment cancellation result - * @param string $pendingUrl - pending payment result - * @return $this - */ - public function prepareGiropayUrls($successUrl, $cancelUrl, $pendingUrl) - { - $this->_giropayUrls = [$successUrl, $cancelUrl, $pendingUrl]; - return $this; - } - - /** - * Set create billing agreement flag - * - * @param bool $flag - * @return $this - */ - public function setIsBillingAgreementRequested($flag) - { - $this->_isBARequested = $flag; - return $this; - } - - /** - * Set flag that forces to use BillMeLater - * - * @param bool $isBml - * @return $this - */ - public function setIsBml($isBml) - { - $this->_isBml = $isBml; - return $this; - } - - /** - * Setter for customer - * - * @param CustomerDataObject $customerData - * @return $this - */ - public function setCustomerData(CustomerDataObject $customerData) - { - $this->_quote->assignCustomer($customerData); - $this->_customerId = $customerData->getId(); - return $this; - } - - /** - * Setter for customer with billing and shipping address changing ability - * - * @param CustomerDataObject $customerData - * @param Address|null $billingAddress - * @param Address|null $shippingAddress - * @return $this - */ - public function setCustomerWithAddressChange( - CustomerDataObject $customerData, - $billingAddress = null, - $shippingAddress = null - ) { - $this->_quote->assignCustomerWithAddressChange($customerData, $billingAddress, $shippingAddress); - $this->_customerId = $customerData->getId(); - return $this; - } - - /** - * Reserve order ID for specified quote and start checkout on PayPal - * - * @param string $returnUrl - * @param string $cancelUrl - * @param bool|null $button - * @return string - * @throws \Magento\Framework\Model\Exception - */ - public function start($returnUrl, $cancelUrl, $button = null) - { - $this->_quote->collectTotals(); - - if (!$this->_quote->getGrandTotal() && !$this->_quote->hasNominalItems()) { - throw new \Magento\Framework\Model\Exception( - __( - 'PayPal can\'t process orders with a zero balance due. ' - . 'To finish your purchase, please go through the standard checkout process.' - ) - ); - } - - $this->_quote->reserveOrderId(); - $this->quoteRepository->save($this->_quote); - // prepare API - $this->_getApi(); - $solutionType = $this->_config->getMerchantCountry() == 'DE' - ? \Magento\Paypal\Model\Config::EC_SOLUTION_TYPE_MARK - : $this->_config->getConfigValue('solutionType'); - $this->_api->setAmount($this->_quote->getBaseGrandTotal()) - ->setCurrencyCode($this->_quote->getBaseCurrencyCode()) - ->setInvNum($this->_quote->getReservedOrderId()) - ->setReturnUrl($returnUrl) - ->setCancelUrl($cancelUrl) - ->setSolutionType($solutionType) - ->setPaymentAction($this->_config->getConfigValue('paymentAction')); - if ($this->_giropayUrls) { - list($successUrl, $cancelUrl, $pendingUrl) = $this->_giropayUrls; - $this->_api->addData( - [ - 'giropay_cancel_url' => $cancelUrl, - 'giropay_success_url' => $successUrl, - 'giropay_bank_txn_pending_url' => $pendingUrl, - ] - ); - } - - if ($this->_isBml) { - $this->_api->setFundingSource('BML'); - } - - $this->_setBillingAgreementRequest(); - - if ($this->_config->getConfigValue('requireBillingAddress') == PaypalConfig::REQUIRE_BILLING_ADDRESS_ALL) { - $this->_api->setRequireBillingAddress(1); - } - - // suppress or export shipping address - if ($this->_quote->getIsVirtual()) { - if ($this->_config->getConfigValue('requireBillingAddress') - == PaypalConfig::REQUIRE_BILLING_ADDRESS_VIRTUAL - ) { - $this->_api->setRequireBillingAddress(1); - } - $this->_api->setSuppressShipping(true); - } else { - $address = $this->_quote->getShippingAddress(); - $isOverridden = 0; - if (true === $address->validate()) { - $isOverridden = 1; - $this->_api->setAddress($address); - } - $this->_quote->getPayment()->setAdditionalInformation( - self::PAYMENT_INFO_TRANSPORT_SHIPPING_OVERRIDDEN, - $isOverridden - ); - $this->_quote->getPayment()->save(); - } - - // add line items - /** @var $cart \Magento\Payment\Model\Cart */ - $cart = $this->_cartFactory->create(['salesModel' => $this->_quote]); - $this->_api->setPaypalCart($cart) - ->setIsLineItemsEnabled($this->_config->getConfigValue('lineItemsEnabled')); - - // add shipping options if needed and line items are available - $cartItems = $cart->getAllItems(); - if ($this->_config->getConfigValue('lineItemsEnabled') - && $this->_config->getConfigValue('transferShippingOptions') - && !empty($cartItems) - ) { - if (!$this->_quote->getIsVirtual() && !$this->_quote->hasNominalItems()) { - $options = $this->_prepareShippingOptions($address, true); - if ($options) { - $this->_api->setShippingOptionsCallbackUrl( - $this->_coreUrl->getUrl( - '*/*/shippingOptionsCallback', - ['quote_id' => $this->_quote->getId()] - ) - )->setShippingOptions($options); - } - } - } - - $this->_config->exportExpressCheckoutStyleSettings($this->_api); - - /* Temporary solution. @TODO: do not pass quote into Nvp model */ - $this->_api->setQuote($this->_quote); - $this->_api->callSetExpressCheckout(); - - $token = $this->_api->getToken(); - $this->_redirectUrl = $button ? $this->_config->getExpressCheckoutStartUrl($token) - : $this->_config->getPayPalBasicStartUrl($token); - - $payment = $this->_quote->getPayment(); - $payment->unsAdditionalInformation(self::PAYMENT_INFO_TRANSPORT_BILLING_AGREEMENT); - // Set flag that we came from Express Checkout button - if (!empty($button)) { - $payment->setAdditionalInformation(self::PAYMENT_INFO_BUTTON, 1); - } elseif ($payment->hasAdditionalInformation(self::PAYMENT_INFO_BUTTON)) { - $payment->unsAdditionalInformation(self::PAYMENT_INFO_BUTTON); - } - $payment->save(); - - return $token; - } - - /** - * Check whether system can skip order review page before placing order - * - * @return bool - */ - public function canSkipOrderReviewStep() - { - $isOnepageCheckout = !$this->_quote->getPayment()->getAdditionalInformation(self::PAYMENT_INFO_BUTTON); - return $this->_config->isOrderReviewStepDisabled() && $isOnepageCheckout; - } - - /** - * Update quote when returned from PayPal - * rewrite billing address by paypal - * save old billing address for new customer - * export shipping address in case address absence - * - * @param string $token - * @return void - */ - public function returnFromPaypal($token) - { - $this->_getApi(); - $this->_api->setToken($token) - ->callGetExpressCheckoutDetails(); - $quote = $this->_quote; - - $this->_ignoreAddressValidation(); - - // import shipping address - $exportedShippingAddress = $this->_api->getExportedShippingAddress(); - if (!$quote->getIsVirtual()) { - $shippingAddress = $quote->getShippingAddress(); - if ($shippingAddress) { - if ($exportedShippingAddress - && $quote->getPayment()->getAdditionalInformation(self::PAYMENT_INFO_BUTTON) == 1 - ) { - $this->_setExportedAddressData($shippingAddress, $exportedShippingAddress); - // PayPal doesn't provide detailed shipping info: prefix, middlename, lastname, suffix - $shippingAddress->setPrefix(null); - $shippingAddress->setMiddlename(null); - $shippingAddress->setLastname(null); - $shippingAddress->setSuffix(null); - $shippingAddress->setCollectShippingRates(true); - $shippingAddress->setSameAsBilling(0); - } - - // import shipping method - $code = ''; - if ($this->_api->getShippingRateCode()) { - $code = $this->_matchShippingMethodCode($shippingAddress, $this->_api->getShippingRateCode()); - if ($code) { - // possible bug of double collecting rates :-/ - $shippingAddress->setShippingMethod($code)->setCollectShippingRates(true); - } - } - $quote->getPayment()->setAdditionalInformation( - self::PAYMENT_INFO_TRANSPORT_SHIPPING_METHOD, - $code - ); - } - } - - // import billing address - $portBillingFromShipping = $quote->getPayment()->getAdditionalInformation(self::PAYMENT_INFO_BUTTON) == 1 - && $this->_config->getConfigValue( - 'requireBillingAddress' - ) != \Magento\Paypal\Model\Config::REQUIRE_BILLING_ADDRESS_ALL - && !$quote->isVirtual(); - if ($portBillingFromShipping) { - $billingAddress = clone $shippingAddress; - $billingAddress->unsAddressId()->unsAddressType(); - $data = $billingAddress->getData(); - $data['save_in_address_book'] = 0; - $quote->getBillingAddress()->addData($data); - $quote->getShippingAddress()->setSameAsBilling(1); - } else { - $billingAddress = $quote->getBillingAddress(); - } - $exportedBillingAddress = $this->_api->getExportedBillingAddress(); - - $this->_setExportedAddressData($billingAddress, $exportedBillingAddress); - $billingAddress->setCustomerNote($exportedBillingAddress->getData('note')); - $quote->setBillingAddress($billingAddress); - - // import payment info - $payment = $quote->getPayment(); - $payment->setMethod($this->_methodType); - $this->_paypalInfo->importToPayment($this->_api, $payment); - $payment->setAdditionalInformation(self::PAYMENT_INFO_TRANSPORT_PAYER_ID, $this->_api->getPayerId()) - ->setAdditionalInformation(self::PAYMENT_INFO_TRANSPORT_TOKEN, $token); - $quote->collectTotals(); - $this->quoteRepository->save($quote); - } - - /** - * Check whether order review has enough data to initialize - * - * @param string|null $token - * @return void - * @throws \Magento\Framework\Model\Exception - */ - public function prepareOrderReview($token = null) - { - $payment = $this->_quote->getPayment(); - if (!$payment || !$payment->getAdditionalInformation(self::PAYMENT_INFO_TRANSPORT_PAYER_ID)) { - throw new \Magento\Framework\Model\Exception(__('Payer is not identified.')); - } - $this->_quote->setMayEditShippingAddress( - 1 != $this->_quote->getPayment()->getAdditionalInformation(self::PAYMENT_INFO_TRANSPORT_SHIPPING_OVERRIDDEN) - ); - $this->_quote->setMayEditShippingMethod( - '' == $this->_quote->getPayment()->getAdditionalInformation(self::PAYMENT_INFO_TRANSPORT_SHIPPING_METHOD) - ); - $this->_ignoreAddressValidation(); - $this->_quote->collectTotals(); - $this->quoteRepository->save($this->_quote); - } - - /** - * Return callback response with shipping options - * - * @param array $request - * @return string - * @throws \Exception - */ - public function getShippingOptionsCallbackResponse(array $request) - { - // prepare debug data - $logger = $this->_logFactory->create(['fileName' => 'payment_' . $this->_methodType . '.log']); - $debugData = ['request' => $request, 'response' => []]; - - try { - // obtain addresses - $this->_getApi(); - $address = $this->_api->prepareShippingOptionsCallbackAddress($request); - $quoteAddress = $this->_quote->getShippingAddress(); - - // compare addresses, calculate shipping rates and prepare response - $options = []; - if ($address && $quoteAddress && !$this->_quote->getIsVirtual()) { - foreach ($address->getExportedKeys() as $key) { - $quoteAddress->setDataUsingMethod($key, $address->getData($key)); - } - $quoteAddress->setCollectShippingRates(true)->collectTotals(); - $options = $this->_prepareShippingOptions($quoteAddress, false, true); - } - $response = $this->_api->setShippingOptions($options)->formatShippingOptionsCallback(); - - // log request and response - $debugData['response'] = $response; - $logger->log($debugData); - return $response; - } catch (\Exception $e) { - $logger->log($debugData); - throw $e; - } - } - - /** - * Set shipping method to quote, if needed - * - * @param string $methodCode - * @return void - */ - public function updateShippingMethod($methodCode) - { - $shippingAddress = $this->_quote->getShippingAddress(); - if (!$this->_quote->getIsVirtual() && $shippingAddress) { - if ($methodCode != $shippingAddress->getShippingMethod()) { - $this->_ignoreAddressValidation(); - $shippingAddress->setShippingMethod($methodCode)->setCollectShippingRates(true); - $this->_quote->collectTotals(); - $this->quoteRepository->save($this->_quote); - } - } - } - - /** - * Place the order when customer returned from PayPal until this moment all quote data must be valid. - * - * @param string $token - * @param string|null $shippingMethodCode - * @return void - */ - public function place($token, $shippingMethodCode = null) - { - if ($shippingMethodCode) { - $this->updateShippingMethod($shippingMethodCode); - } - - $isNewCustomer = false; - switch ($this->getCheckoutMethod()) { - case \Magento\Checkout\Model\Type\Onepage::METHOD_GUEST: - $this->_prepareGuestQuote(); - break; - case \Magento\Checkout\Model\Type\Onepage::METHOD_REGISTER: - $this->_prepareNewCustomerQuote(); - $isNewCustomer = true; - break; - default: - $this->_prepareCustomerQuote(); - break; - } - - $this->_ignoreAddressValidation(); - $this->_quote->collectTotals(); - $parameters = ['quote' => $this->_quote]; - $service = $this->_serviceQuoteFactory->create($parameters); - $service->submitAllWithDataObject(); - $this->quoteRepository->save($this->_quote); - - if ($isNewCustomer) { - try { - $this->_involveNewCustomer(); - } catch (\Exception $e) { - $this->_logger->logException($e); - } - } - - $order = $service->getOrder(); - if (!$order) { - return; - } - - // commence redirecting to finish payment, if paypal requires it - if ($order->getPayment()->getAdditionalInformation(self::PAYMENT_INFO_TRANSPORT_REDIRECT)) { - $this->_redirectUrl = $this->_config->getExpressCheckoutCompleteUrl($token); - } - - switch ($order->getState()) { - // even after placement paypal can disallow to authorize/capture, but will wait until bank transfers money - case \Magento\Sales\Model\Order::STATE_PENDING_PAYMENT: - // TODO - break; - // regular placement, when everything is ok - case \Magento\Sales\Model\Order::STATE_PROCESSING: - case \Magento\Sales\Model\Order::STATE_COMPLETE: - case \Magento\Sales\Model\Order::STATE_PAYMENT_REVIEW: - $this->orderSender->send($order); - break; - default: - break; - } - $this->_order = $order; - } - - /** - * 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->_config->getConfigValue('requireBillingAddress') - && !$this->_quote->getBillingAddress()->getEmail() - ) { - $this->_quote->getBillingAddress()->setSameAsBilling(1); - } - } - } - - /** - * Determine whether redirect somewhere specifically is required - * - * @return string - */ - public function getRedirectUrl() - { - return $this->_redirectUrl; - } - - /** - * Get created billing agreement - * - * @return \Magento\Paypal\Model\Billing\Agreement|null - */ - public function getBillingAgreement() - { - return $this->_billingAgreement; - } - - /** - * Return order - * - * @return \Magento\Sales\Model\Order - */ - public function getOrder() - { - return $this->_order; - } - - /** - * Get checkout method - * - * @return string - */ - public function getCheckoutMethod() - { - if ($this->getCustomerSession()->isLoggedIn()) { - return \Magento\Checkout\Model\Type\Onepage::METHOD_CUSTOMER; - } - if (!$this->_quote->getCheckoutMethod()) { - if ($this->_checkoutData->isAllowedGuestCheckout($this->_quote)) { - $this->_quote->setCheckoutMethod(\Magento\Checkout\Model\Type\Onepage::METHOD_GUEST); - } else { - $this->_quote->setCheckoutMethod(\Magento\Checkout\Model\Type\Onepage::METHOD_REGISTER); - } - } - return $this->_quote->getCheckoutMethod(); - } - - /** - * Sets address data from exported address - * - * @param Address $address - * @param array $exportedAddress - * @return void - */ - protected function _setExportedAddressData($address, $exportedAddress) - { - // Exported data is more priority if we came from Express Checkout button - $isButton = (bool)$this->_quote->getPayment()->getAdditionalInformation(self::PAYMENT_INFO_BUTTON); - if (!$isButton) { - foreach ($exportedAddress->getExportedKeys() as $key) { - $oldData = $address->getDataUsingMethod($key); - $isEmpty = null; - if (is_array($oldData)) { - foreach ($oldData as $val) { - if (!empty($val)) { - $isEmpty = false; - break; - } - $isEmpty = true; - } - } - if (empty($oldData) || $isEmpty === true) { - $address->setDataUsingMethod($key, $exportedAddress->getData($key)); - } - } - } else { - foreach ($exportedAddress->getExportedKeys() as $key) { - $data = $exportedAddress->getData($key); - if (!empty($data)) { - $address->setDataUsingMethod($key, $data); - } - } - } - } - - /** - * Set create billing agreement flag to api call - * - * @return $this - */ - protected function _setBillingAgreementRequest() - { - if (!$this->_customerId || $this->_quote->hasNominalItems()) { - return $this; - } - - $isRequested = $this->_isBARequested || $this->_quote->getPayment() - ->getAdditionalInformation(self::PAYMENT_INFO_TRANSPORT_BILLING_AGREEMENT); - - if (!($this->_config->getConfigValue('allow_ba_signup') == PaypalConfig::EC_BA_SIGNUP_AUTO - || $isRequested && $this->_config->shouldAskToCreateBillingAgreement()) - ) { - return $this; - } - - if (!$this->_agreementFactory->create()->needToCreateForCustomer($this->_customerId)) { - return $this; - } - $this->_api->setBillingType($this->_api->getBillingAgreementType()); - return $this; - } - - /** - * @return \Magento\Paypal\Model\Api\Nvp - */ - protected function _getApi() - { - if (null === $this->_api) { - $this->_api = $this->_apiTypeFactory->create($this->_apiType)->setConfigObject($this->_config); - } - return $this->_api; - } - - /** - * Attempt to collect address shipping rates and return them for further usage in instant update API - * Returns empty array if it was impossible to obtain any shipping rate - * If there are shipping rates obtained, the method must return one of them as default. - * - * @param Address $address - * @param bool $mayReturnEmpty - * @param bool $calculateTax - * @return array|false - */ - protected function _prepareShippingOptions(Address $address, $mayReturnEmpty = false, $calculateTax = false) - { - $options = []; - $i = 0; - $iMin = false; - $min = false; - $userSelectedOption = null; - - foreach ($address->getGroupedAllShippingRates() as $group) { - foreach ($group as $rate) { - $amount = (double)$rate->getPrice(); - if ($rate->getErrorMessage()) { - continue; - } - $isDefault = $address->getShippingMethod() === $rate->getCode(); - $amountExclTax = $this->_taxData->getShippingPrice($amount, false, $address); - $amountInclTax = $this->_taxData->getShippingPrice($amount, true, $address); - - $options[$i] = new \Magento\Framework\Object( - [ - 'is_default' => $isDefault, - 'name' => trim("{$rate->getCarrierTitle()} - {$rate->getMethodTitle()}", ' -'), - 'code' => $rate->getCode(), - 'amount' => $amountExclTax, - ] - ); - if ($calculateTax) { - $options[$i]->setTaxAmount( - $amountInclTax - $amountExclTax + $address->getTaxAmount() - $address->getShippingTaxAmount() - ); - } - if ($isDefault) { - $userSelectedOption = $options[$i]; - } - if (false === $min || $amountInclTax < $min) { - $min = $amountInclTax; - $iMin = $i; - } - $i++; - } - } - - if ($mayReturnEmpty && is_null($userSelectedOption)) { - $options[] = new \Magento\Framework\Object( - [ - 'is_default' => true, - 'name' => __('N/A'), - 'code' => 'no_rate', - 'amount' => 0.00, - ] - ); - if ($calculateTax) { - $options[$i]->setTaxAmount($address->getTaxAmount()); - } - } elseif (is_null($userSelectedOption) && isset($options[$iMin])) { - $options[$iMin]->setIsDefault(true); - } - - // Magento will transfer only first 10 cheapest shipping options if there are more than 10 available. - if (count($options) > 10) { - usort($options, [get_class($this), 'cmpShippingOptions']); - array_splice($options, 10); - // User selected option will be always included in options list - if (!is_null($userSelectedOption) && !in_array($userSelectedOption, $options)) { - $options[9] = $userSelectedOption; - } - } - - return $options; - } - - /** - * Compare two shipping options based on their amounts - * - * This function is used as a callback comparison function in shipping options sorting process - * @see self::_prepareShippingOptions() - * - * @param \Magento\Framework\Object $option1 - * @param \Magento\Framework\Object $option2 - * @return int - */ - protected static function cmpShippingOptions(\Magento\Framework\Object $option1, \Magento\Framework\Object $option2) - { - if ($option1->getAmount() == $option2->getAmount()) { - return 0; - } - return ($option1->getAmount() < $option2->getAmount()) ? -1 : 1; - } - - /** - * Try to find whether the code provided by PayPal corresponds to any of possible shipping rates - * This method was created only because PayPal has issues with returning the selected code. - * If in future the issue is fixed, we don't need to attempt to match it. It would be enough to set the method code - * before collecting shipping rates - * - * @param Address $address - * @param string $selectedCode - * @return string - */ - protected function _matchShippingMethodCode(Address $address, $selectedCode) - { - $options = $this->_prepareShippingOptions($address, false); - foreach ($options as $option) { - if ($selectedCode === $option['code'] // the proper case as outlined in documentation - || $selectedCode === $option['name'] // workaround: PayPal may return name instead of the code - // workaround: PayPal may concatenate code and name, and return it instead of the code: - || $selectedCode === "{$option['code']} {$option['name']}" - ) { - return $option['code']; - } - } - return ''; - } - - /** - * Prepare quote for guest checkout order submit - * - * @return $this - */ - protected function _prepareGuestQuote() - { - $quote = $this->_quote; - $quote->setCustomerId(null) - ->setCustomerEmail($quote->getBillingAddress()->getEmail()) - ->setCustomerIsGuest(true) - ->setCustomerGroupId(\Magento\Customer\Model\Group::NOT_LOGGED_IN_ID); - return $this; - } - - /** - * Prepare quote for customer registration and customer order submit - * and restore magento customer data from quote - * - * @return void - */ - protected function _prepareNewCustomerQuote() - { - $this->paypalQuote->prepareQuoteForNewCustomer($this->_quote); - } - - /** - * Prepare quote for customer order submit - * - * @return void - */ - protected function _prepareCustomerQuote() - { - $this->paypalQuote->prepareRegisteredCustomerQuote($this->_quote, $this->_customerSession->getCustomerId()); - } - - /** - * Involve new customer to system - * - * @return $this - */ - protected function _involveNewCustomer() - { - $customer = $this->_quote->getCustomer(); - $confirmationStatus = $this->_accountManagement->getConfirmationStatus($customer->getId()); - if ($confirmationStatus === AccountManagement::ACCOUNT_CONFIRMATION_REQUIRED) { - $url = $this->_customerUrl->getEmailConfirmationUrl($customer->getEmail()); - $this->_messageManager->addSuccess( - // @codingStandardsIgnoreStart - __('Account confirmation is required. Please, check your e-mail for confirmation link. To resend confirmation email please click here.', $url) - // @codingStandardsIgnoreEnd - ); - } else { - $this->getCustomerSession()->regenerateId(); - $this->getCustomerSession()->loginById($customer->getId()); - } - return $this; - } - - /** - * Get customer session object - * - * @return \Magento\Customer\Model\Session - */ - public function getCustomerSession() - { - return $this->_customerSession; - } -} diff --git a/app/code/Magento/Paypal/Model/Express/Checkout/Factory.php b/app/code/Magento/Paypal/Model/Express/Checkout/Factory.php deleted file mode 100644 index 3bc751e2fc49d..0000000000000 --- a/app/code/Magento/Paypal/Model/Express/Checkout/Factory.php +++ /dev/null @@ -1,40 +0,0 @@ -_objectManager = $objectManager; - } - - /** - * Create class instance with specified parameters - * - * @param string $className - * @param array $data - * @return \Magento\Paypal\Model\Express\Checkout - */ - public function create($className, array $data = []) - { - return $this->_objectManager->create($className, $data); - } -} diff --git a/app/code/Magento/Paypal/Model/Express/Checkout/Quote.php b/app/code/Magento/Paypal/Model/Express/Checkout/Quote.php deleted file mode 100644 index 55f39291c7109..0000000000000 --- a/app/code/Magento/Paypal/Model/Express/Checkout/Quote.php +++ /dev/null @@ -1,140 +0,0 @@ -addressBuilder = $addressBuilder; - $this->customerBuilder = $customerBuilder; - $this->customerRepository = $customerRepository; - $this->copyObject = $copyObject; - } - - /** - * @param \Magento\Sales\Model\Quote $quote - * @return \Magento\Sales\Model\Quote - */ - public function prepareQuoteForNewCustomer(\Magento\Sales\Model\Quote $quote) - { - $billing = $quote->getBillingAddress(); - $shipping = $quote->isVirtual() ? null : $quote->getShippingAddress(); - $billing->setDefaultBilling(true); - if ($shipping && !$shipping->getSameAsBilling()) { - $shipping->setDefaultShipping(true); - $shipping->setCustomerAddressData( - $this->addressBuilder->populateWithArray($shipping->getData())->create() - ); - } elseif ($shipping) { - $billing->setDefaultShipping(true); - } - $billing->setCustomerAddressData( - $this->addressBuilder->populateWithArray($shipping->getData())->create() - ); - foreach (['customer_dob', 'customer_taxvat', 'customer_gender'] as $attribute) { - if ($quote->getData($attribute) && !$billing->getData($attribute)) { - $billing->setData($attribute, $quote->getData($attribute)); - } - } - $this->customerBuilder->populateWithArray( - $this->copyObject->getDataFromFieldset( - 'checkout_onepage_billing', - 'to_customer', - $billing - ) - ); - $this->customerBuilder->setEmail($quote->getCustomerEmail()); - $this->customerBuilder->setPrefix($quote->getCustomerPrefix()); - $this->customerBuilder->setFirstname($quote->getCustomerFirstname()); - $this->customerBuilder->setMiddlename($quote->getCustomerMiddlename()); - $this->customerBuilder->setLastname($quote->getCustomerLastname()); - $this->customerBuilder->setSuffix($quote->getCustomerSuffix()); - $quote->setCustomer($this->customerBuilder->create()); - $quote->addCustomerAddress($billing->exportCustomerAddress()); - if ($shipping->hasCustomerAddress()) { - $quote->addCustomerAddress($shipping->exportCustomerAddress()); - } - return $quote; - } - - /** - * @param \Magento\Sales\Model\Quote $quote - * @param int|null $customerId - * @return \Magento\Sales\Model\Quote - */ - public function prepareRegisteredCustomerQuote(\Magento\Sales\Model\Quote $quote, $customerId) - { - $billing = $quote->getBillingAddress(); - $shipping = $quote->isVirtual() ? null : $quote->getShippingAddress(); - $customer = $this->customerRepository->getById($customerId); - if (!$billing->getCustomerId() || $billing->getSaveInAddressBook()) { - $billing->setCustomerAddressData( - $this->addressBuilder->populateWithArray($billing->getData())->create() - ); - } - if ($shipping && !$shipping->getSameAsBilling() - && (!$shipping->getCustomerId() || $shipping->getSaveInAddressBook()) - ) { - $shipping->setCustomerAddressData( - $this->addressBuilder->populateWithArray($shipping->getData())->create() - ); - } - $isBillingAddressDefaultBilling = !!$customer->getDefaultBilling(); - $isBillingAddressDefaultShipping = false; - if ($shipping && !$customer->getDefaultShipping()) { - $shipping->setDefaultBilling(false); - $shipping->setDefaultShipping(true); - $quote->addCustomerAddress($this->addressBuilder->populateWithArray($shipping->getData())->create()); - } elseif (!$customer->getDefaultShipping()) { - $isBillingAddressDefaultShipping = true; - } - if ($billing) { - $billing->setDefaultBilling($isBillingAddressDefaultBilling); - $billing->setDefaultShipping($isBillingAddressDefaultShipping); - $quote->addCustomerAddress($this->addressBuilder->populateWithArray($billing->getData())->create()); - } - $quote->setCustomer($customer); - return $quote; - } -} diff --git a/app/code/Magento/Paypal/Model/Hostedpro.php b/app/code/Magento/Paypal/Model/Hostedpro.php deleted file mode 100644 index 5363c71d8b183..0000000000000 --- a/app/code/Magento/Paypal/Model/Hostedpro.php +++ /dev/null @@ -1,300 +0,0 @@ -_hostedproRequestFactory = $hostedproRequestFactory; - parent::__construct( - $eventManager, - $paymentData, - $scopeConfig, - $logAdapterFactory, - $logger, - $moduleList, - $localeDate, - $centinelService, - $proFactory, - $storeManager, - $urlBuilder, - $requestHttp, - $cartFactory, - $data - ); - } - - /** - * Return available CC types for gateway based on merchant country. - * We do not have to check the availability of card types. - * - * @return true - */ - public function getAllowedCcTypes() - { - return true; - } - - /** - * Return merchant country code from config, - * use default country if it not specified in General settings - * - * @return string - */ - public function getMerchantCountry() - { - return $this->_pro->getConfig()->getMerchantCountry(); - } - - /** - * Do not validate payment form using server methods - * - * @return true - */ - public function validate() - { - return true; - } - - /** - * Instantiate state and set it to state object - * - * @param string $paymentAction - * @param \Magento\Framework\Object $stateObject - * @return void - */ - public function initialize($paymentAction, $stateObject) - { - switch ($paymentAction) { - case \Magento\Paypal\Model\Config::PAYMENT_ACTION_AUTH: - case \Magento\Paypal\Model\Config::PAYMENT_ACTION_SALE: - $payment = $this->getInfoInstance(); - $order = $payment->getOrder(); - $order->setCanSendNewEmailFlag(false); - $payment->setAmountAuthorized($order->getTotalDue()); - $payment->setBaseAmountAuthorized($order->getBaseTotalDue()); - - $this->_setPaymentFormUrl($payment); - - $stateObject->setState(\Magento\Sales\Model\Order::STATE_PENDING_PAYMENT); - $stateObject->setStatus('pending_payment'); - $stateObject->setIsNotified(false); - break; - default: - break; - } - } - - /** - * Sends API request to PayPal to get form URL, then sets this URL to $payment object. - * - * @param \Magento\Payment\Model\Info $payment - * @return void - * @throws \Magento\Framework\Model\Exception - */ - protected function _setPaymentFormUrl(\Magento\Payment\Model\Info $payment) - { - $request = $this->_buildFormUrlRequest($payment); - $response = $this->_sendFormUrlRequest($request); - if ($response) { - $payment->setAdditionalInformation('secure_form_url', $response); - } else { - throw new \Magento\Framework\Model\Exception('Cannot get secure form URL from PayPal'); - } - } - - /** - * Returns request object with needed data for API request to PayPal to get form URL. - * - * @param \Magento\Payment\Model\Info $payment - * @return \Magento\Paypal\Model\Hostedpro\Request - */ - protected function _buildFormUrlRequest(\Magento\Payment\Model\Info $payment) - { - $request = $this->_buildBasicRequest()->setOrder($payment->getOrder())->setPaymentMethod($this); - - return $request; - } - - /** - * Returns form URL from request to PayPal. - * - * @param \Magento\Paypal\Model\Hostedpro\Request $request - * @return string|false - */ - protected function _sendFormUrlRequest(\Magento\Paypal\Model\Hostedpro\Request $request) - { - $api = $this->_pro->getApi(); - $response = $api->call(self::BM_BUTTON_METHOD, $request->getRequestData()); - - if (!isset($response['EMAILLINK'])) { - return false; - } - return $response['EMAILLINK']; - } - - /** - * Return request object with basic information - * - * @return \Magento\Paypal\Model\Hostedpro\Request - */ - protected function _buildBasicRequest() - { - $request = $this->_hostedproRequestFactory->create()->setData( - [ - 'METHOD' => self::BM_BUTTON_METHOD, - 'BUTTONCODE' => self::BM_BUTTON_CODE, - 'BUTTONTYPE' => self::BM_BUTTON_TYPE, - ] - ); - return $request; - } - - /** - * Get return URL - * - * @param int|null $storeId - * @return string - */ - public function getReturnUrl($storeId = null) - { - return $this->_getUrl('paypal/hostedpro/return', $storeId); - } - - /** - * Get notify (IPN) URL - * - * @param int|null $storeId - * @return string - */ - public function getNotifyUrl($storeId = null) - { - return $this->_getUrl('paypal/ipn', $storeId, false); - } - - /** - * Get cancel URL - * - * @param int|null $storeId - * @return string - */ - public function getCancelUrl($storeId = null) - { - return $this->_getUrl('paypal/hostedpro/cancel', $storeId); - } - - /** - * Build URL for store - * - * @param string $path - * @param int $storeId - * @param bool|null $secure - * @return string - */ - protected function _getUrl($path, $storeId, $secure = null) - { - $store = $this->_storeManager->getStore($storeId); - return $this->_urlBuilder->getUrl( - $path, - ["_store" => $store, "_secure" => is_null($secure) ? $store->isCurrentlySecure() : $secure] - ); - } -} diff --git a/app/code/Magento/Paypal/Model/Hostedpro/Request.php b/app/code/Magento/Paypal/Model/Hostedpro/Request.php deleted file mode 100644 index 7d3feb6bd2398..0000000000000 --- a/app/code/Magento/Paypal/Model/Hostedpro/Request.php +++ /dev/null @@ -1,248 +0,0 @@ - - */ -class Request extends \Magento\Framework\Object -{ - /** - * Request's order model - * - * @var \Magento\Sales\Model\Order - */ - protected $_order; - - /** - * Request's Hosted Pro payment method model - * - * @var \Magento\Paypal\Model\Hostedpro - */ - protected $_paymentMethod; - - /** - * Name formate for button variables - * - * @var string - */ - protected $_buttonVarFormat = 'L_BUTTONVAR%d'; - - /** - * Request Parameters which dont have to wrap as button vars - * - * @var string[] - */ - protected $_notButtonVars = ['METHOD', 'BUTTONCODE', 'BUTTONTYPE']; - - /** - * Customer address - * - * @var \Magento\Customer\Helper\Address - */ - protected $_customerAddress = null; - - /** - * Constructor - * - * By default is looking for first argument as array and assigns it as object - * attributes This behavior may change in child classes - * - * @param \Magento\Customer\Helper\Address $customerAddress - */ - public function __construct(\Magento\Customer\Helper\Address $customerAddress) - { - $this->_customerAddress = $customerAddress; - } - - /** - * Build and return request array from object data - * - * @return array - */ - public function getRequestData() - { - $requestData = []; - if (!empty($this->_data)) { - // insert params to request as additional button variables, - // except special params from _notButtonVars list - $i = 0; - foreach ($this->_data as $key => $value) { - if (in_array($key, $this->_notButtonVars)) { - $requestData[$key] = $value; - } else { - $varKey = sprintf($this->_buttonVarFormat, $i); - $requestData[$varKey] = $key . '=' . $value; - $i++; - } - } - } - - return $requestData; - } - - /** - * Append payment data to request - * - * @param \Magento\Paypal\Model\Hostedpro $paymentMethod - * @return $this - */ - public function setPaymentMethod($paymentMethod) - { - $this->_paymentMethod = $paymentMethod; - $requestData = $this->_getPaymentData($paymentMethod); - $this->addData($requestData); - - return $this; - } - - /** - * Append order data to request - * - * @param \Magento\Sales\Model\Order $order - * @return $this - */ - public function setOrder($order) - { - $this->_order = $order; - $requestData = $this->_getOrderData($order); - $this->addData($requestData); - - return $this; - } - - /** - * Get peymet request data as array - * - * @param \Magento\Paypal\Model\Hostedpro $paymentMethod - * @return array - */ - protected function _getPaymentData(\Magento\Paypal\Model\Hostedpro $paymentMethod) - { - $request = [ - 'paymentaction' => strtolower($paymentMethod->getConfigData('payment_action')), - 'notify_url' => $paymentMethod->getNotifyUrl(), - 'cancel_return' => $paymentMethod->getCancelUrl(), - 'return' => $paymentMethod->getReturnUrl(), - 'lc' => $paymentMethod->getMerchantCountry(), - 'template' => 'templateD', - 'showBillingAddress' => 'false', - 'showShippingAddress' => 'true', - 'showBillingEmail' => 'false', - 'showBillingPhone' => 'false', - 'showCustomerName' => 'false', - 'showCardInfo' => 'true', - 'showHostedThankyouPage' => 'false', - ]; - - return $request; - } - - /** - * Get order request data as array - * - * @param \Magento\Sales\Model\Order $order - * @return array - */ - protected function _getOrderData(\Magento\Sales\Model\Order $order) - { - $request = [ - 'subtotal' => $this->_formatPrice( - $this->_formatPrice( - $order->getPayment()->getBaseAmountAuthorized() - ) - $this->_formatPrice( - $order->getBaseTaxAmount() - ) - $this->_formatPrice( - $order->getBaseShippingAmount() - ) - ), - 'tax' => $this->_formatPrice($order->getBaseTaxAmount()), - 'shipping' => $this->_formatPrice($order->getBaseShippingAmount()), - 'invoice' => $order->getIncrementId(), - 'address_override' => 'true', - 'currency_code' => $order->getBaseCurrencyCode(), - 'buyer_email' => $order->getCustomerEmail(), - ]; - - // append to request billing address data - if ($billingAddress = $order->getBillingAddress()) { - $request = array_merge($request, $this->_getBillingAddress($billingAddress)); - } - - // append to request shipping address data - if ($shippingAddress = $order->getShippingAddress()) { - $request = array_merge($request, $this->_getShippingAddress($shippingAddress)); - } - - return $request; - } - - /** - * Get shipping address request data - * - * @param \Magento\Framework\Object $address - * @return array - */ - protected function _getShippingAddress(\Magento\Framework\Object $address) - { - $region = $address->getRegionCode() ? $address->getRegionCode() : $address->getRegion(); - $request = [ - 'first_name' => $address->getFirstname(), - 'last_name' => $address->getLastname(), - 'city' => $address->getCity(), - 'state' => $region ? $region : $address->getCity(), - 'zip' => $address->getPostcode(), - 'country' => $address->getCountry(), - ]; - - // convert streets to tow lines format - $street = $this->_customerAddress->convertStreetLines($address->getStreet(), 2); - - $request['address1'] = isset($street[0]) ? $street[0] : ''; - $request['address2'] = isset($street[1]) ? $street[1] : ''; - - return $request; - } - - /** - * Get billing address request data - * - * @param \Magento\Framework\Object $address - * @return array - */ - protected function _getBillingAddress(\Magento\Framework\Object $address) - { - $region = $address->getRegionCode() ? $address->getRegionCode() : $address->getRegion(); - $request = [ - 'billing_first_name' => $address->getFirstname(), - 'billing_last_name' => $address->getLastname(), - 'billing_city' => $address->getCity(), - 'billing_state' => $region ? $region : $address->getCity(), - 'billing_zip' => $address->getPostcode(), - 'billing_country' => $address->getCountry(), - ]; - - // convert streets to tow lines format - $street = $this->_customerAddress->convertStreetLines($address->getStreet(), 2); - - $request['billing_address1'] = isset($street[0]) ? $street[0] : ''; - $request['billing_address2'] = isset($street[1]) ? $street[1] : ''; - - return $request; - } - - /** - * Format price string - * - * @param mixed $string - * @return string - */ - protected function _formatPrice($string) - { - return sprintf('%.2F', $string); - } -} diff --git a/app/code/Magento/Paypal/Model/Info.php b/app/code/Magento/Paypal/Model/Info.php deleted file mode 100644 index 6ba17ac8da075..0000000000000 --- a/app/code/Magento/Paypal/Model/Info.php +++ /dev/null @@ -1,780 +0,0 @@ - self::PAYPAL_PAYER_ID, - self::PAYER_EMAIL => self::PAYPAL_PAYER_EMAIL, - self::PAYER_STATUS => self::PAYPAL_PAYER_STATUS, - self::ADDRESS_ID => self::PAYPAL_ADDRESS_ID, - self::ADDRESS_STATUS => self::PAYPAL_ADDRESS_STATUS, - self::PROTECTION_EL => self::PAYPAL_PROTECTION_ELIGIBILITY, - self::FRAUD_FILTERS => self::PAYPAL_FRAUD_FILTERS, - self::CORRELATION_ID => self::PAYPAL_CORRELATION_ID, - self::AVS_CODE => self::PAYPAL_AVS_CODE, - self::CVV_2_MATCH => self::PAYPAL_CVV_2_MATCH, - self::CENTINEL_VPAS => self::CENTINEL_VPAS, - self::CENTINEL_ECI => self::CENTINEL_ECI, - self::BUYER_TAX_ID => self::BUYER_TAX_ID, - self::BUYER_TAX_ID_TYPE => self::BUYER_TAX_ID_TYPE, - ]; - - /** - * System information map - * - * @var array - */ - protected $_systemMap = [ - self::PAYMENT_STATUS => self::PAYMENT_STATUS_GLOBAL, - self::PENDING_REASON => self::PENDING_REASON_GLOBAL, - self::IS_FRAUD => self::IS_FRAUD_GLOBAL, - ]; - - /** - * PayPal payment status possible values - * - * @var string - */ - const PAYMENTSTATUS_NONE = 'none'; - - const PAYMENTSTATUS_COMPLETED = 'completed'; - - const PAYMENTSTATUS_DENIED = 'denied'; - - const PAYMENTSTATUS_EXPIRED = 'expired'; - - const PAYMENTSTATUS_FAILED = 'failed'; - - const PAYMENTSTATUS_INPROGRESS = 'in_progress'; - - const PAYMENTSTATUS_PENDING = 'pending'; - - const PAYMENTSTATUS_REFUNDED = 'refunded'; - - const PAYMENTSTATUS_REFUNDEDPART = 'partially_refunded'; - - const PAYMENTSTATUS_REVERSED = 'reversed'; - - const PAYMENTSTATUS_UNREVERSED = 'canceled_reversal'; - - const PAYMENTSTATUS_PROCESSED = 'processed'; - - const PAYMENTSTATUS_VOIDED = 'voided'; - - const PAYMENTSTATUS_REVIEW = 'paymentreview'; - - /** - * PayPal payment transaction type - */ - const TXN_TYPE_ADJUSTMENT = 'adjustment'; - - const TXN_TYPE_NEW_CASE = 'new_case'; - - /** - * PayPal payment reason code when payment_status is Reversed, Refunded, or Canceled_Reversal. - */ - const PAYMENT_REASON_CODE_REFUND = 'refund'; - - /** - * PayPal order status for Reverse payment status - */ - const ORDER_STATUS_REVERSED = 'paypal_reversed'; - - /** - * PayPal order status for Canceled Reversal payment status - */ - const ORDER_STATUS_CANCELED_REVERSAL = 'paypal_canceled_reversal'; - - /** - * Map of payment information available to customer - * - * @var string[] - */ - protected $_paymentPublicMap = ['paypal_payer_email', self::BUYER_TAX_ID, self::BUYER_TAX_ID_TYPE]; - - /** - * Rendered payment map cache - * - * @var array - */ - protected $_paymentMapFull = []; - - /** - * Cache for storing label translations - * - * @var array - */ - protected $_labelCodesCache = []; - - /** - * Paypal payer id code key - */ - const PAYPAL_PAYER_ID = 'paypal_payer_id'; - - /** - * Paypal payer email code key - */ - const PAYPAL_PAYER_EMAIL = 'paypal_payer_email'; - - /** - * Paypal payer status code key - */ - const PAYPAL_PAYER_STATUS = 'paypal_payer_status'; - - /** - * Paypal address id code key - */ - const PAYPAL_ADDRESS_ID = 'paypal_address_id'; - - /** - * Paypal address status code key - */ - const PAYPAL_ADDRESS_STATUS = 'paypal_address_status'; - - /** - * Paypal protection eligibility code key - */ - const PAYPAL_PROTECTION_ELIGIBILITY = 'paypal_protection_eligibility'; - - /** - * Paypal fraud filters code key - */ - const PAYPAL_FRAUD_FILTERS = 'paypal_fraud_filters'; - - /** - * Paypal correlation id code key - */ - const PAYPAL_CORRELATION_ID = 'paypal_correlation_id'; - - /** - * Paypal avs code key - */ - const PAYPAL_AVS_CODE = 'paypal_avs_code'; - - /** - * Paypal cvv2 code key - */ - const PAYPAL_CVV_2_MATCH = 'paypal_cvv_2_match'; - - /** - * Item labels key for label codes cache - */ - const ITEM_LABELS = 'item labels'; - - /** - * All available payment info getter - * - * @param \Magento\Payment\Model\Info $payment - * @param bool $labelValuesOnly - * @return array - */ - public function getPaymentInfo(\Magento\Payment\Model\Info $payment, $labelValuesOnly = false) - { - // collect paypal-specific info - $result = $this->_getFullInfo(array_values($this->_paymentMap), $payment, $labelValuesOnly); - - // add last_trans_id - $label = __('Last Transaction ID'); - $value = $payment->getLastTransId(); - if ($labelValuesOnly) { - $result[$label] = $value; - } else { - $result['last_trans_id'] = ['label' => $label, 'value' => $value]; - } - - return $result; - } - - /** - * Public payment info getter - * - * @param \Magento\Payment\Model\Info $payment - * @param bool $labelValuesOnly - * @return array - */ - public function getPublicPaymentInfo(\Magento\Payment\Model\Info $payment, $labelValuesOnly = false) - { - return $this->_getFullInfo($this->_paymentPublicMap, $payment, $labelValuesOnly); - } - - /** - * Grab data from source and map it into payment - * - * @param array|\Magento\Framework\Object|callback $from - * @param \Magento\Payment\Model\Info $payment - * @return void - */ - public function importToPayment($from, \Magento\Payment\Model\Info $payment) - { - $fullMap = array_merge($this->_paymentMap, $this->_systemMap); - if (is_object($from)) { - $from = [$from, 'getDataUsingMethod']; - } - \Magento\Framework\Object\Mapper::accumulateByMap($from, [$payment, 'setAdditionalInformation'], $fullMap); - } - - /** - * Grab data from payment and map it into target - * - * @param \Magento\Payment\Model\Info $payment - * @param array|\Magento\Framework\Object|callback $to - * @param array|null $map - * @return array|\Magento\Framework\Object - */ - public function &exportFromPayment(\Magento\Payment\Model\Info $payment, $to, array $map = null) - { - $fullMap = array_merge($this->_paymentMap, $this->_systemMap); - \Magento\Framework\Object\Mapper::accumulateByMap( - [$payment, 'getAdditionalInformation'], - $to, - $map ? $map : array_flip($fullMap) - ); - return $to; - } - - /** - * Check whether the payment is in review state - * - * @param \Magento\Payment\Model\Info $payment - * @return bool - */ - public static function isPaymentReviewRequired(\Magento\Payment\Model\Info $payment) - { - $paymentStatus = $payment->getAdditionalInformation(self::PAYMENT_STATUS_GLOBAL); - if (self::PAYMENTSTATUS_PENDING === $paymentStatus) { - $pendingReason = $payment->getAdditionalInformation(self::PENDING_REASON_GLOBAL); - return !in_array($pendingReason, ['authorization', 'order']); - } - return false; - } - - /** - * Check whether fraud order review detected and can be reviewed - * - * @param \Magento\Payment\Model\Info $payment - * @return bool - */ - public static function isFraudReviewAllowed(\Magento\Payment\Model\Info $payment) - { - return self::isPaymentReviewRequired( - $payment - ) && 1 == $payment->getAdditionalInformation( - self::IS_FRAUD_GLOBAL - ); - } - - /** - * Check whether the payment is completed - * - * @param \Magento\Payment\Model\Info $payment - * @return bool - */ - public static function isPaymentCompleted(\Magento\Payment\Model\Info $payment) - { - $paymentStatus = $payment->getAdditionalInformation(self::PAYMENT_STATUS_GLOBAL); - return self::PAYMENTSTATUS_COMPLETED === $paymentStatus; - } - - /** - * Check whether the payment was processed successfully - * - * @param \Magento\Payment\Model\Info $payment - * @return bool - */ - public static function isPaymentSuccessful(\Magento\Payment\Model\Info $payment) - { - $paymentStatus = $payment->getAdditionalInformation(self::PAYMENT_STATUS_GLOBAL); - if (in_array( - $paymentStatus, - [ - self::PAYMENTSTATUS_COMPLETED, - self::PAYMENTSTATUS_INPROGRESS, - self::PAYMENTSTATUS_REFUNDED, - self::PAYMENTSTATUS_REFUNDEDPART, - self::PAYMENTSTATUS_UNREVERSED, - self::PAYMENTSTATUS_PROCESSED - ] - ) - ) { - return true; - } - $pendingReason = $payment->getAdditionalInformation(self::PENDING_REASON_GLOBAL); - return self::PAYMENTSTATUS_PENDING === $paymentStatus && in_array( - $pendingReason, - ['authorization', 'order'] - ); - } - - /** - * Check whether the payment was processed unsuccessfully or failed - * - * @param \Magento\Payment\Model\Info $payment - * @return bool - */ - public static function isPaymentFailed(\Magento\Payment\Model\Info $payment) - { - $paymentStatus = $payment->getAdditionalInformation(self::PAYMENT_STATUS_GLOBAL); - return in_array( - $paymentStatus, - [ - self::PAYMENTSTATUS_DENIED, - self::PAYMENTSTATUS_EXPIRED, - self::PAYMENTSTATUS_FAILED, - self::PAYMENTSTATUS_REVERSED, - self::PAYMENTSTATUS_VOIDED - ] - ); - } - - /** - * Explain pending payment reason code - * - * @param string $code - * @return string - * @link https://cms.paypal.com/us/cgi-bin/?&cmd=_render-content&content_ID=developer/e_howto_html_IPNandPDTVariables - * @link https://cms.paypal.com/us/cgi-bin/?&cmd=_render-content&content_ID=developer/e_howto_api_nvp_r_GetTransactionDetails - */ - public static function explainPendingReason($code) - { - switch ($code) { - case 'address': - return __('This customer did not include a confirmed address.'); - case 'authorization': - case 'order': - return __('The payment is authorized but not settled.'); - case 'echeck': - return __('The payment eCheck is not yet cleared.'); - case 'intl': - return __('The merchant holds a non-U.S. account and does not have a withdrawal mechanism.'); - case 'multi-currency': - // break is intentionally omitted - case 'multi_currency': - // break is intentionally omitted - case 'multicurrency': - return __('The payment currency does not match any of the merchant\'s balances currency.'); - case 'paymentreview': - return __('The payment is pending while it is being reviewed by PayPal for risk.'); - case 'unilateral': - return __( - 'The payment is pending because it was made to an email address that is not yet registered or confirmed.' - ); - case 'verify': - return __('The merchant account is not yet verified.'); - case 'upgrade': - return __( - 'The payment was made via credit card. In order to receive funds merchant must upgrade account to Business or Premier status.' - ); - case 'none': - // break is intentionally omitted - case 'other': - // break is intentionally omitted - default: - return __('Sorry, but something went wrong. Please contact PayPal customer service.'); - } - } - - /** - * Explain the refund or chargeback reason code - * - * @param string $code - * @return string - * @link https://cms.paypal.com/us/cgi-bin/?&cmd=_render-content&content_ID=developer/e_howto_html_IPNandPDTVariables - * @link https://cms.paypal.com/us/cgi-bin/?&cmd=_render-content&content_ID=developer/e_howto_api_nvp_r_GetTransactionDetails - */ - public static function explainReasonCode($code) - { - $comments = [ - 'chargeback' => __('A reversal has occurred on this transaction due to a chargeback by your customer.'), - 'guarantee' => __( - 'A reversal has occurred on this transaction due to your customer triggering a money-back guarantee.' - ), - 'buyer-complaint' => __( - 'A reversal has occurred on this transaction due to a complaint about the transaction from your customer.' - ), - 'buyer_complaint' => __( - 'A reversal has occurred on this transaction due to a complaint about the transaction from your customer.' - ), - 'refund' => __( - 'A reversal has occurred on this transaction because you have given the customer a refund.' - ), - 'adjustment_reversal' => __('Reversal of an adjustment.'), - 'admin_fraud_reversal' => __('Transaction reversal due to fraud detected by PayPal administrators.'), - 'admin_reversal' => __('Transaction reversal by PayPal administrators.'), - 'chargeback_reimbursement' => __('Reimbursement for a chargeback.'), - 'chargeback_settlement' => __('Settlement of a chargeback.'), - 'unauthorized_spoof' => __( - 'A reversal has occurred on this transaction because of a customer dispute suspecting unauthorized spoof.' - ), - 'non_receipt' => __('Buyer claims that he did not receive goods or service.'), - 'not_as_described' => __( - 'Buyer claims that the goods or service received differ from merchant’s description of the goods or service.' - ), - 'unauthorized' => __('Buyer claims that he/she did not authorize transaction.'), - 'adjustment_reimburse' => __('A case that has been resolved and close requires a reimbursement.'), - 'duplicate' => __('Buyer claims that a possible duplicate payment was made to the merchant.'), - 'merchandise' => __('Buyer claims that the received merchandise is unsatisfactory, defective, or damaged.'), - ]; - return isset($comments[$code]) - ? $comments[$code] - : __('Unknown reason. Please contact PayPal customer service.'); - } - - /** - * Whether a reversal/refund can be disputed with PayPal - * - * @param string $code - * @return bool; - */ - public static function isReversalDisputable($code) - { - $listOfDisputeCodes = [ - 'none' => true, - 'other' => true, - 'chargeback' => true, - 'buyer-complaint' => true, - 'adjustment_reversal' => true, - 'guarantee' => false, - 'refund' => false, - 'chargeback_reimbursement' => false, - 'chargeback_settlement' => false, - ]; - return isset($listOfDisputeCodes[$code]) ? $listOfDisputeCodes[$code] : false; - } - - /** - * Render info item - * - * @param array $keys - * @param \Magento\Payment\Model\Info $payment - * @param bool $labelValuesOnly - * @return array - */ - protected function _getFullInfo(array $keys, \Magento\Payment\Model\Info $payment, $labelValuesOnly) - { - $result = []; - foreach ($keys as $key) { - if (!isset($this->_paymentMapFull[$key])) { - $this->_paymentMapFull[$key] = []; - } - if (!isset($this->_paymentMapFull[$key]['label'])) { - if (!$payment->hasAdditionalInformation($key)) { - $this->_paymentMapFull[$key]['label'] = false; - $this->_paymentMapFull[$key]['value'] = false; - } else { - $value = $payment->getAdditionalInformation($key); - $this->_paymentMapFull[$key]['label'] = $this->_getLabel($key); - $this->_paymentMapFull[$key]['value'] = $this->_getValue($value, $key); - } - } - if (!empty($this->_paymentMapFull[$key]['value'])) { - if ($labelValuesOnly) { - $result[$this->_paymentMapFull[$key]['label']] = $this->_paymentMapFull[$key]['value']; - } else { - $result[$key] = $this->_paymentMapFull[$key]; - } - } - } - return $result; - } - - /** - * Render info item labels - * - * @param string $key - * @return string - */ - protected function _getLabel($key) - { - if (!isset($this->_labelCodesCache[self::ITEM_LABELS])) { - $this->_labelCodesCache[self::ITEM_LABELS] = [ - self::PAYPAL_PAYER_ID => __('Payer ID'), - self::PAYPAL_PAYER_EMAIL => __('Payer Email'), - self::PAYPAL_PAYER_STATUS => __('Payer Status'), - self::PAYPAL_ADDRESS_ID => __('Payer Address ID'), - self::PAYPAL_ADDRESS_STATUS => __('Payer Address Status'), - self::PAYPAL_PROTECTION_ELIGIBILITY => __('Merchant Protection Eligibility'), - self::PAYPAL_FRAUD_FILTERS => __('Triggered Fraud Filters'), - self::PAYPAL_CORRELATION_ID => __('Last Correlation ID'), - self::PAYPAL_AVS_CODE => __('Address Verification System Response'), - self::PAYPAL_CVV_2_MATCH => __('CVV2 Check Result by PayPal'), - self::BUYER_TAX_ID => __('Buyer\'s Tax ID'), - self::BUYER_TAX_ID_TYPE => __('Buyer\'s Tax ID Type'), - self::CENTINEL_VPAS => __('PayPal/Centinel Visa Payer Authentication Service Result'), - self::CENTINEL_ECI => __('PayPal/Centinel Electronic Commerce Indicator'), - ]; - } - return isset($this->_labelCodesCache[self::ITEM_LABELS][$key]) - ? $this->_labelCodesCache[self::ITEM_LABELS][$key] - : ''; - } - - /** - * Get case type label - * - * @param string $key - * @return string - */ - public static function getCaseTypeLabel($key) - { - $labels = [ - 'chargeback' => __('Chargeback'), - 'complaint' => __('Complaint'), - 'dispute' => __('Dispute'), - ]; - $value = isset($labels[$key]) ? $labels[$key] : ''; - return $value; - } - - /** - * Apply a filter upon value getting - * - * @param string $value - * @param string $key - * @return string - */ - protected function _getValue($value, $key) - { - $label = ''; - switch ($key) { - case self::PAYPAL_AVS_CODE: - $label = $this->_getAvsLabel($value); - break; - case self::PAYPAL_CVV_2_MATCH: - $label = $this->_getCvv2Label($value); - break; - case self::CENTINEL_VPAS: - $label = $this->_getCentinelVpasLabel($value); - break; - case self::CENTINEL_ECI: - $label = $this->_getCentinelEciLabel($value); - break; - case self::BUYER_TAX_ID_TYPE: - $value = $this->_getBuyerIdTypeValue($value); - // fall-through intentional - default: - return $value; - } - return sprintf('#%s%s', $value, $value == $label ? '' : ': ' . $label); - } - - /** - * Attempt to convert AVS check result code into label - * - * @param string $value - * @return string - * @link https://cms.paypal.com/us/cgi-bin/?&cmd=_render-content&content_ID=developer/e_howto_api_nvp_AVSResponseCodes - */ - protected function _getAvsLabel($value) - { - if (!isset($this->_labelCodesCache[self::PAYPAL_AVS_CODE])) { - $this->_labelCodesCache[self::PAYPAL_AVS_CODE] = [ - // Visa, MasterCard, Discover and American Express - 'A' => __('Matched Address only (no ZIP)'), - // international "A" - 'B' => __('Matched Address only (no ZIP) International'), - 'N' => __('No Details matched'), - // international "N" - 'C' => __('No Details matched. International'), - 'X' => __('Exact Match. Address and nine-digit ZIP code'), - // international "X" - 'D' => __('Exact Match. Address and Postal Code. International'), - // UK-specific "X" - 'F' => __('Exact Match. Address and Postal Code. UK-specific'), - 'E' => __('N/A. Not allowed for MOTO (Internet/Phone) transactions'), - 'G' => __('N/A. Global Unavailable'), - 'I' => __('N/A. International Unavailable'), - 'Z' => __('Matched five-digit ZIP only (no Address)'), - // international "Z" - 'P' => __('Matched Postal Code only (no Address)'), - 'R' => __('N/A. Retry'), - 'S' => __('N/A. Service not Supported'), - 'U' => __('N/A. Unavailable'), - 'W' => __('Matched whole nine-didgit ZIP (no Address)'), - 'Y' => __('Yes. Matched Address and five-didgit ZIP'), - // Maestro and Solo - '0' => __('All the address information matched'), - '1' => __('None of the address information matched'), - '2' => __('Part of the address information matched'), - '3' => __('N/A. The merchant did not provide AVS information'), - '4' => __('N/A. Address not checked, or acquirer had no response. Service not available'), - ]; - } - return isset($this->_labelCodesCache[self::PAYPAL_AVS_CODE][$value]) - ? $this->_labelCodesCache[self::PAYPAL_AVS_CODE][$value] - : $value; - } - - /** - * Attempt to convert CVV2 check result code into label - * - * @param string $value - * @return string - * @link https://cms.paypal.com/us/cgi-bin/?&cmd=_render-content&content_ID=developer/e_howto_api_nvp_AVSResponseCodes - */ - protected function _getCvv2Label($value) - { - if (!isset($this->_labelCodesCache[self::PAYPAL_CVV_2_MATCH])) { - $this->_labelCodesCache[self::PAYPAL_CVV_2_MATCH] = [ - // Visa, MasterCard, Discover and American Express - 'M' => __('Matched (CVV2CSC)'), - 'N' => __('No match'), - 'P' => __('N/A. Not processed'), - 'S' => __('N/A. Service not supported'), - 'U' => __('N/A. Service not available'), - 'X' => __('N/A. No response'), - // Maestro and Solo - '0' => __('Matched (CVV2)'), - '1' => __('No match'), - '2' => __('N/A. The merchant has not implemented CVV2 code handling'), - '3' => __('N/A. Merchant has indicated that CVV2 is not present on card'), - '4' => __('N/A. Service not available'), - ]; - } - return isset($this->_labelCodesCache[self::PAYPAL_CVV_2_MATCH][$value]) - ? $this->_labelCodesCache[self::PAYPAL_CVV_2_MATCH][$value] - : $value; - } - - /** - * Attempt to convert centinel VPAS result into label - * - * @param string $value - * @return string - * @link https://cms.paypal.com/us/cgi-bin/?&cmd=_render-content&content_ID=developer/e_howto_api_nvp_r_DoDirectPayment - */ - private function _getCentinelVpasLabel($value) - { - if (!isset($this->_labelCodesCache[self::CENTINEL_VPAS])) { - $this->_labelCodesCache[self::CENTINEL_VPAS] = [ - '2' => __('Authenticated, Good Result'), - 'D' => __('Authenticated, Good Result'), - '1' => __('Authenticated, Bad Result'), - '3' => __('Attempted Authentication, Good Result'), - '6' => __('Attempted Authentication, Good Result'), - '8' => __('Attempted Authentication, Good Result'), - 'A' => __('Attempted Authentication, Good Result'), - 'C' => __('Attempted Authentication, Good Result'), - '4' => __('Attempted Authentication, Bad Result'), - '7' => __('Attempted Authentication, Bad Result'), - '9' => __('Attempted Authentication, Bad Result'), - '' => __('No Liability Shift'), - '0' => __('No Liability Shift'), - 'B' => __('No Liability Shift'), - ]; - } - return isset($this->_labelCodesCache[self::CENTINEL_VPAS][$value]) - ? $this->_labelCodesCache[self::CENTINEL_VPAS][$value] - : $value; - } - - /** - * Attempt to convert centinel ECI result into label - * - * @param string $value - * @return string - * @link https://cms.paypal.com/us/cgi-bin/?&cmd=_render-content&content_ID=developer/e_howto_api_nvp_r_DoDirectPayment - */ - private function _getCentinelEciLabel($value) - { - if (!isset($this->_labelCodesCache[self::CENTINEL_ECI])) { - $this->_labelCodesCache[self::CENTINEL_ECI] = [ - '01' => __('Merchant Liability'), - '07' => __('Merchant Liability'), - '02' => __('Issuer Liability'), - '05' => __('Issuer Liability'), - '06' => __('Issuer Liability'), - ]; - } - return isset($this->_labelCodesCache[self::CENTINEL_ECI][$value]) - ? $this->_labelCodesCache[self::CENTINEL_ECI][$value] - : $value; - } - - /** - * Retrieve buyer id type value based on code received from PayPal (Brazil only) - * - * @param string $code - * @return string - */ - protected function _getBuyerIdTypeValue($code) - { - if (!isset($this->_labelCodesCache[self::BUYER_TAX_ID_TYPE])) { - $this->_labelCodesCache[self::BUYER_TAX_ID_TYPE] = [ - self::BUYER_TAX_ID_TYPE_CNPJ => __('CNPJ'), - self::BUYER_TAX_ID_TYPE_CPF => __('CPF'), - ]; - } - return isset($this->_labelCodesCache[self::BUYER_TAX_ID_TYPE][$code]) - ? $this->_labelCodesCache[self::BUYER_TAX_ID_TYPE][$code] - : ''; - } -} diff --git a/app/code/Magento/Paypal/Model/Ipn.php b/app/code/Magento/Paypal/Model/Ipn.php deleted file mode 100644 index cf93bcb51fae5..0000000000000 --- a/app/code/Magento/Paypal/Model/Ipn.php +++ /dev/null @@ -1,613 +0,0 @@ -_orderFactory = $orderFactory; - $this->_paypalInfo = $paypalInfo; - $this->orderSender = $orderSender; - $this->creditmemoSender = $creditmemoSender; - } - - /** - * Get ipn data, send verification to PayPal, run corresponding handler - * - * @return void - * @throws Exception - */ - public function processIpnRequest() - { - $this->_addDebugData('ipn', $this->getRequestData()); - - try { - $this->_getConfig(); - $this->_postBack(); - $this->_processOrder(); - } catch (Exception $e) { - $this->_addDebugData('exception', $e->getMessage()); - $this->_debug(); - throw $e; - } - $this->_debug(); - } - - /** - * Get config with the method code and store id and validate - * - * @return \Magento\Paypal\Model\Config - * @throws Exception - */ - protected function _getConfig() - { - $order = $this->_getOrder(); - $methodCode = $order->getPayment()->getMethod(); - $parameters = ['params' => [$methodCode, $order->getStoreId()]]; - $this->_config = $this->_configFactory->create($parameters); - if (!$this->_config->isMethodActive($methodCode) || !$this->_config->isMethodAvailable()) { - throw new Exception(sprintf('Method "%s" is not available.', $methodCode)); - } - /** @link https://cms.paypal.com/cgi-bin/marketingweb?cmd=_render-content&content_ID=developer/e_howto_admin_IPNIntro */ - // verify merchant email intended to receive notification - $merchantEmail = $this->_config->getConfigValue('businessAccount'); - if (!$merchantEmail) { - return $this->_config; - } - $receiver = $this->getRequestData('business') ?: $this->getRequestData('receiver_email'); - if (strtolower($merchantEmail) != strtolower($receiver)) { - throw new Exception( - sprintf('The requested %s and configured %s merchant emails do not match.', $receiver, $merchantEmail) - ); - } - - return $this->_config; - } - - /** - * Load order - * - * @return \Magento\Sales\Model\Order - * @throws Exception - */ - protected function _getOrder() - { - $incrementId = $this->getRequestData('invoice'); - $this->_order = $this->_orderFactory->create()->loadByIncrementId($incrementId); - if (!$this->_order->getId()) { - throw new Exception(sprintf('Wrong order ID: "%s".', $incrementId)); - } - return $this->_order; - } - - /** - * IPN workflow implementation - * Everything should be added to order comments. In positive processing cases customer will get email notifications. - * Admin will be notified on errors. - * - * @return void - * @throws \Magento\Framework\Model\Exception - */ - protected function _processOrder() - { - $this->_getConfig(); - try { - // Handle payment_status - $transactionType = $this->getRequestData('txn_type'); - switch ($transactionType) { - // handle new case created - case Info::TXN_TYPE_NEW_CASE: - $this->_registerDispute(); - break; - // handle new adjustment is created - case Info::TXN_TYPE_ADJUSTMENT: - $this->_registerAdjustment(); - break; - //handle new transaction created - default: - $this->_registerTransaction(); - break; - } - } catch (\Magento\Framework\Model\Exception $e) { - $comment = $this->_createIpnComment(__('Note: %1', $e->getMessage()), true); - $comment->save(); - throw $e; - } - } - - /** - * Process dispute notification - * - * @return void - */ - protected function _registerDispute() - { - $reasonComment = $this->_paypalInfo->explainReasonCode($this->getRequestData('reason_code')); - $caseType = $this->getRequestData('case_type'); - $caseTypeLabel = $this->_paypalInfo->getCaseTypeLabel($caseType); - $caseId = $this->getRequestData('case_id'); - //Add IPN comment about registered dispute - $message = __( - 'IPN "%1". Case type "%2". Case ID "%3" %4', - ucfirst($caseType), - $caseTypeLabel, - $caseId, - $reasonComment - ); - $this->_order->addStatusHistoryComment($message)->setIsCustomerNotified(false)->save(); - } - - /** - * Process adjustment notification - * - * @return void - */ - protected function _registerAdjustment() - { - $reasonCode = $this->getRequestData('reason_code'); - $reasonComment = $this->_paypalInfo->explainReasonCode($reasonCode); - $notificationAmount = $this->_order->getBaseCurrency()->formatTxt($this->getRequestData('mc_gross')); - // Add IPN comment about registered dispute - $message = __( - 'IPN "%1". A dispute has been resolved and closed. %2 Transaction amount %3.', - ucfirst($reasonCode), - $notificationAmount, - $reasonComment - ); - $this->_order->addStatusHistoryComment($message)->setIsCustomerNotified(false)->save(); - } - - /** - * Process regular IPN notifications - * - * @return void - * @throws \Magento\Framework\Model\Exception - * @throws Exception - */ - protected function _registerTransaction() - { - try { - // Handle payment_status - $paymentStatus = $this->_filterPaymentStatus($this->getRequestData('payment_status')); - switch ($paymentStatus) { - // paid - case Info::PAYMENTSTATUS_COMPLETED: - $this->_registerPaymentCapture(true); - break; - // the holded payment was denied on paypal side - case Info::PAYMENTSTATUS_DENIED: - $this->_registerPaymentDenial(); - break; - // customer attempted to pay via bank account, but failed - case Info::PAYMENTSTATUS_FAILED: - // cancel order - $this->_registerPaymentFailure(); - break; - // payment was obtained, but money were not captured yet - case Info::PAYMENTSTATUS_PENDING: - $this->_registerPaymentPending(); - break; - case Info::PAYMENTSTATUS_PROCESSED: - $this->_registerMasspaymentsSuccess(); - break; - case Info::PAYMENTSTATUS_REVERSED: - //break is intentionally omitted - case Info::PAYMENTSTATUS_UNREVERSED: - $this->_registerPaymentReversal(); - break; - case Info::PAYMENTSTATUS_REFUNDED: - $this->_registerPaymentRefund(); - break; - // authorization expire/void - case Info::PAYMENTSTATUS_EXPIRED: - // break is intentionally omitted - case Info::PAYMENTSTATUS_VOIDED: - $this->_registerPaymentVoid(); - break; - default: - throw new Exception("Cannot handle payment status '{$paymentStatus}'."); - } - } catch (\Magento\Framework\Model\Exception $e) { - $comment = $this->_createIpnComment(__('Note: %1', $e->getMessage()), true); - $comment->save(); - throw $e; - } - } - - /** - * Process completed payment (either full or partial) - * - * @param bool $skipFraudDetection - * @return void - */ - protected function _registerPaymentCapture($skipFraudDetection = false) - { - if ($this->getRequestData('transaction_entity') == 'auth') { - return; - } - $parentTransactionId = $this->getRequestData('parent_txn_id'); - $this->_importPaymentInformation(); - $payment = $this->_order->getPayment(); - $payment->setTransactionId( - $this->getRequestData('txn_id') - ); - $payment->setCurrencyCode( - $this->getRequestData('mc_currency') - ); - $payment->setPreparedMessage( - $this->_createIpnComment('') - ); - $payment->setParentTransactionId( - $parentTransactionId - ); - $payment->setShouldCloseParentTransaction( - 'Completed' === $this->getRequestData('auth_status') - ); - $payment->setIsTransactionClosed( - 0 - ); - $payment->registerCaptureNotification( - $this->getRequestData('mc_gross'), - $skipFraudDetection && $parentTransactionId - ); - $this->_order->save(); - - // notify customer - $invoice = $payment->getCreatedInvoice(); - if ($invoice && !$this->_order->getEmailSent()) { - $this->orderSender->send($this->_order); - $this->_order->addStatusHistoryComment( - __('You notified customer about invoice #%1.', $invoice->getIncrementId()) - )->setIsCustomerNotified( - true - )->save(); - } - } - - /** - * Process denied payment notification - * - * @return void - */ - protected function _registerPaymentDenial() - { - $this->_importPaymentInformation(); - $this->_order->getPayment()->setTransactionId( - $this->getRequestData('txn_id') - )->setNotificationResult( - true - )->setIsTransactionClosed( - true - )->registerPaymentReviewAction( - \Magento\Sales\Model\Order\Payment::REVIEW_ACTION_DENY, - false - ); - $this->_order->save(); - } - - /** - * Treat failed payment as order cancellation - * - * @return void - */ - protected function _registerPaymentFailure() - { - $this->_importPaymentInformation(); - $this->_order->registerCancellation($this->_createIpnComment(''))->save(); - } - - /** - * Process payment pending notification - * - * @return void - * @throws Exception - */ - public function _registerPaymentPending() - { - $reason = $this->getRequestData('pending_reason'); - if ('authorization' === $reason) { - $this->_registerPaymentAuthorization(); - return; - } - if ('order' === $reason) { - throw new Exception('The "order" authorizations are not implemented.'); - } - // case when was placed using PayPal standard - if (\Magento\Sales\Model\Order::STATE_PENDING_PAYMENT == $this->_order->getState() - && !$this->getRequestData('transaction_entity') - ) { - $this->_registerPaymentCapture(); - return; - } - - $this->_importPaymentInformation(); - - $this->_order->getPayment()->setPreparedMessage( - $this->_createIpnComment($this->_paypalInfo->explainPendingReason($reason)) - )->setTransactionId( - $this->getRequestData('txn_id') - )->setIsTransactionClosed( - 0 - )->registerPaymentReviewAction( - \Magento\Sales\Model\Order\Payment::REVIEW_ACTION_UPDATE, - false - ); - $this->_order->save(); - } - - /** - * Register authorized payment - * - * @return void - */ - protected function _registerPaymentAuthorization() - { - /** @var $payment \Magento\Sales\Model\Order\Payment */ - $payment = $this->_order->getPayment(); - if ($this->_order->canFetchPaymentReviewUpdate()) { - $payment->registerPaymentReviewAction(\Magento\Sales\Model\Order\Payment::REVIEW_ACTION_UPDATE, true); - } else { - $this->_importPaymentInformation(); - $payment->setPreparedMessage( - $this->_createIpnComment('') - )->setTransactionId( - $this->getRequestData('txn_id') - )->setParentTransactionId( - $this->getRequestData('parent_txn_id') - )->setCurrencyCode( - $this->getRequestData('mc_currency') - )->setIsTransactionClosed( - 0 - )->registerAuthorizationNotification( - $this->getRequestData('mc_gross') - ); - } - if (!$this->_order->getEmailSent()) { - $this->orderSender->send($this->_order); - } - $this->_order->save(); - } - - /** - * The status "Processed" is used when all Masspayments are successful - * - * @return void - */ - protected function _registerMasspaymentsSuccess() - { - $comment = $this->_createIpnComment('', true); - $comment->save(); - } - - /** - * Process payment reversal and cancelled reversal notification - * - * @return void - */ - protected function _registerPaymentReversal() - { - $reasonCode = $this->getRequestData('reason_code'); - $reasonComment = $this->_paypalInfo->explainReasonCode($reasonCode); - $notificationAmount = $this->_order->getBaseCurrency()->formatTxt( - $this->getRequestData('mc_gross') + $this->getRequestData('mc_fee') - ); - $paymentStatus = $this->_filterPaymentStatus($this->getRequestData('payment_status')); - $orderStatus = $paymentStatus == - Info::PAYMENTSTATUS_REVERSED ? Info::ORDER_STATUS_REVERSED : Info::ORDER_STATUS_CANCELED_REVERSAL; - //Change order status to PayPal Reversed/PayPal Cancelled Reversal if it is possible. - $message = __( - 'IPN "%1". %2 Transaction amount %3. Transaction ID: "%4"', - $this->getRequestData('payment_status'), - $reasonComment, - $notificationAmount, - $this->getRequestData('txn_id') - ); - $this->_order->setStatus($orderStatus); - $this->_order->save(); - $this->_order->addStatusHistoryComment($message, $orderStatus)->setIsCustomerNotified(false)->save(); - } - - /** - * Process a refund - * - * @return void - */ - protected function _registerPaymentRefund() - { - $this->_importPaymentInformation(); - $reason = $this->getRequestData('reason_code'); - $isRefundFinal = !$this->_paypalInfo->isReversalDisputable($reason); - $payment = $this->_order->getPayment()->setPreparedMessage( - $this->_createIpnComment($this->_paypalInfo->explainReasonCode($reason)) - )->setTransactionId( - $this->getRequestData('txn_id') - )->setParentTransactionId( - $this->getRequestData('parent_txn_id') - )->setIsTransactionClosed( - $isRefundFinal - )->registerRefundNotification( - -1 * $this->getRequestData('mc_gross') - ); - $this->_order->save(); - - // TODO: there is no way to close a capture right now - - $creditMemo = $payment->getCreatedCreditmemo(); - if ($creditMemo) { - $this->creditmemoSender->send($creditMemo); - $this->_order->addStatusHistoryComment( - __('You notified customer about creditmemo #%1.', $creditMemo->getIncrementId()) - )->setIsCustomerNotified( - true - )->save(); - } - } - - /** - * Process voided authorization - * - * @return void - */ - protected function _registerPaymentVoid() - { - $this->_importPaymentInformation(); - - $parentTxnId = $this->getRequestData( - 'transaction_entity' - ) == 'auth' ? $this->getRequestData( - 'txn_id' - ) : $this->getRequestData( - 'parent_txn_id' - ); - - $this->_order->getPayment()->setPreparedMessage( - $this->_createIpnComment('') - )->setParentTransactionId( - $parentTxnId - )->registerVoidNotification(); - - $this->_order->save(); - } - - /** - * Map payment information from IPN to payment object - * Returns true if there were changes in information - * - * @return bool - */ - protected function _importPaymentInformation() - { - $payment = $this->_order->getPayment(); - $was = $payment->getAdditionalInformation(); - - // collect basic information - $from = []; - foreach ([ - Info::PAYER_ID, - 'payer_email' => Info::PAYER_EMAIL, - Info::PAYER_STATUS, - Info::ADDRESS_STATUS, - Info::PROTECTION_EL, - Info::PAYMENT_STATUS, - Info::PENDING_REASON, - ] as $privateKey => $publicKey) { - if (is_int($privateKey)) { - $privateKey = $publicKey; - } - $value = $this->getRequestData($privateKey); - if ($value) { - $from[$publicKey] = $value; - } - } - if (isset($from['payment_status'])) { - $from['payment_status'] = $this->_filterPaymentStatus($this->getRequestData('payment_status')); - } - - // collect fraud filters - $fraudFilters = []; - for ($i = 1; $value = $this->getRequestData("fraud_management_pending_filters_{$i}"); $i++) { - $fraudFilters[] = $value; - } - if ($fraudFilters) { - $from[Info::FRAUD_FILTERS] = $fraudFilters; - } - - $this->_paypalInfo->importToPayment($from, $payment); - - /** - * Detect pending payment, frauds - * TODO: implement logic in one place - * @see \Magento\Paypal\Model\Pro::importPaymentInfo() - */ - if ($this->_paypalInfo->isPaymentReviewRequired($payment)) { - $payment->setIsTransactionPending(true); - if ($fraudFilters) { - $payment->setIsFraudDetected(true); - } - } - if ($this->_paypalInfo->isPaymentSuccessful($payment)) { - $payment->setIsTransactionApproved(true); - } elseif ($this->_paypalInfo->isPaymentFailed($payment)) { - $payment->setIsTransactionDenied(true); - } - - return $was != $payment->getAdditionalInformation(); - } - - /** - * Generate an "IPN" comment with additional explanation. - * Returns the generated comment or order status history object - * - * @param string $comment - * @param bool $addToHistory - * @return string|\Magento\Sales\Model\Order\Status\History - */ - protected function _createIpnComment($comment = '', $addToHistory = false) - { - $message = __('IPN "%1"', $this->getRequestData('payment_status')); - if ($comment) { - $message .= ' ' . $comment; - } - if ($addToHistory) { - $message = $this->_order->addStatusHistoryComment($message); - $message->setIsCustomerNotified(null); - } - return $message; - } -} diff --git a/app/code/Magento/Paypal/Model/IpnFactory.php b/app/code/Magento/Paypal/Model/IpnFactory.php deleted file mode 100644 index bb884816d289e..0000000000000 --- a/app/code/Magento/Paypal/Model/IpnFactory.php +++ /dev/null @@ -1,45 +0,0 @@ -_objectManager = $objectManager; - $this->mapping = $mapping; - } - - /** - * Create class instance with specified parameters - * - * @param array $data - * @return \Magento\Paypal\Model\IpnInterface - */ - public function create(array $data = []) - { - $type = isset($data['data']['txn_type']) ? $data['data']['txn_type'] : ''; - $instanceType = isset($this->mapping[$type]) ? $this->mapping[$type] : 'Magento\Paypal\Model\Ipn'; - return $this->_objectManager->create($instanceType, $data); - } -} diff --git a/app/code/Magento/Paypal/Model/IpnInterface.php b/app/code/Magento/Paypal/Model/IpnInterface.php deleted file mode 100644 index 920d54d83bbac..0000000000000 --- a/app/code/Magento/Paypal/Model/IpnInterface.php +++ /dev/null @@ -1,16 +0,0 @@ -_storeManager = $storeManager; - $this->_urlBuilder = $urlBuilder; - $this->_cartFactory = $cartFactory; - parent::__construct( - $eventManager, - $paymentData, - $scopeConfig, - $logAdapterFactory, - $agreementFactory, - $data - ); - $proInstance = array_shift($data); - if ($proInstance && $proInstance instanceof \Magento\Paypal\Model\Pro) { - $this->_pro = $proInstance; - } else { - $this->_pro = $proFactory->create(); - } - $this->_pro->setMethod($this->_code); - } - - /** - * Store setter - * Also updates store ID in config object - * - * @param Store|int $store - * @return $this - */ - public function setStore($store) - { - $this->setData('store', $store); - if (null === $store) { - $store = $this->_storeManager->getStore()->getId(); - } - $this->_pro->getConfig()->setStoreId(is_object($store) ? $store->getId() : $store); - return $this; - } - - /** - * Init billing agreement - * - * @param \Magento\Paypal\Model\Billing\AbstractAgreement $agreement - * @return $this - */ - public function initBillingAgreementToken(\Magento\Paypal\Model\Billing\AbstractAgreement $agreement) - { - $api = $this->_pro->getApi()->setReturnUrl( - $agreement->getReturnUrl() - )->setCancelUrl( - $agreement->getCancelUrl() - )->setBillingType( - $this->_pro->getApi()->getBillingAgreementType() - ); - - $api->callSetCustomerBillingAgreement(); - $agreement->setRedirectUrl($this->_pro->getConfig()->getStartBillingAgreementUrl($api->getToken())); - return $this; - } - - /** - * Retrieve billing agreement customer details by token - * - * @param \Magento\Paypal\Model\Billing\AbstractAgreement $agreement - * @return array - */ - public function getBillingAgreementTokenInfo(\Magento\Paypal\Model\Billing\AbstractAgreement $agreement) - { - $api = $this->_pro->getApi()->setToken($agreement->getToken()); - $api->callGetBillingAgreementCustomerDetails(); - $responseData = [ - 'token' => $api->getData('token'), - 'email' => $api->getData('email'), - 'payer_id' => $api->getData('payer_id'), - 'payer_status' => $api->getData('payer_status'), - ]; - $agreement->addData($responseData); - return $responseData; - } - - /** - * Create billing agreement by token specified in request - * - * @param \Magento\Paypal\Model\Billing\AbstractAgreement $agreement - * @return $this - */ - public function placeBillingAgreement(\Magento\Paypal\Model\Billing\AbstractAgreement $agreement) - { - $api = $this->_pro->getApi()->setToken($agreement->getToken()); - $api->callCreateBillingAgreement(); - $agreement->setBillingAgreementId($api->getData('billing_agreement_id')); - return $this; - } - - /** - * Update billing agreement status - * - * @param \Magento\Paypal\Model\Billing\AbstractAgreement $agreement - * @return $this - * @throws \Exception|\Magento\Framework\Model\Exception - */ - public function updateBillingAgreementStatus(\Magento\Paypal\Model\Billing\AbstractAgreement $agreement) - { - $targetStatus = $agreement->getStatus(); - $api = $this->_pro->getApi()->setReferenceId( - $agreement->getReferenceId() - )->setBillingAgreementStatus( - $targetStatus - ); - try { - $api->callUpdateBillingAgreement(); - } catch (\Magento\Framework\Model\Exception $e) { - // when BA was already canceled, just pretend that the operation succeeded - if (!(\Magento\Paypal\Model\Billing\Agreement::STATUS_CANCELED == $targetStatus && - $api->getIsBillingAgreementAlreadyCancelled()) - ) { - throw $e; - } - } - return $this; - } - - /** - * Authorize payment - * - * @param \Magento\Framework\Object $payment - * @param float $amount - * @return $this - */ - public function authorize(\Magento\Framework\Object $payment, $amount) - { - return $this->_placeOrder($payment, $amount); - } - - /** - * Void payment - * - * @param \Magento\Framework\Object|Payment $payment - * @return $this - */ - public function void(\Magento\Framework\Object $payment) - { - $this->_pro->void($payment); - return $this; - } - - /** - * Capture payment - * - * @param \Magento\Framework\Object|Payment $payment - * @param float $amount - * @return $this - */ - public function capture(\Magento\Framework\Object $payment, $amount) - { - if (false === $this->_pro->capture($payment, $amount)) { - $this->_placeOrder($payment, $amount); - } - return $this; - } - - /** - * Refund capture - * - * @param \Magento\Framework\Object|Payment $payment - * @param float $amount - * @return $this - */ - public function refund(\Magento\Framework\Object $payment, $amount) - { - $this->_pro->refund($payment, $amount); - return $this; - } - - /** - * Cancel payment - * - * @param \Magento\Framework\Object|Payment $payment - * @return $this - */ - public function cancel(\Magento\Framework\Object $payment) - { - $this->_pro->cancel($payment); - return $this; - } - - /** - * Whether payment can be reviewed - * - * @param Info|Payment $payment - * @return bool - */ - public function canReviewPayment(Info $payment) - { - return parent::canReviewPayment($payment) && $this->_pro->canReviewPayment($payment); - } - - /** - * Attempt to accept a pending payment - * - * @param Info|Payment $payment - * @return bool - */ - public function acceptPayment(Info $payment) - { - parent::acceptPayment($payment); - return $this->_pro->reviewPayment($payment, \Magento\Paypal\Model\Pro::PAYMENT_REVIEW_ACCEPT); - } - - /** - * Attempt to deny a pending payment - * - * @param Info|Payment $payment - * @return bool - */ - public function denyPayment(Info $payment) - { - parent::denyPayment($payment); - return $this->_pro->reviewPayment($payment, \Magento\Paypal\Model\Pro::PAYMENT_REVIEW_DENY); - } - - /** - * Fetch transaction details info - * - * @param Info $payment - * @param string $transactionId - * @return array - */ - public function fetchTransactionInfo(Info $payment, $transactionId) - { - return $this->_pro->fetchTransactionInfo($payment, $transactionId); - } - - /** - * Place an order with authorization or capture action - * - * @param Payment $payment - * @param float $amount - * @return $this - */ - protected function _placeOrder(Payment $payment, $amount) - { - $order = $payment->getOrder(); - /** @var \Magento\Paypal\Model\Billing\Agreement $billingAgreement */ - $billingAgreement = $this->_agreementFactory->create()->load( - $payment->getAdditionalInformation( - \Magento\Paypal\Model\Payment\Method\Billing\AbstractAgreement::TRANSPORT_BILLING_AGREEMENT_ID - ) - ); - - $cart = $this->_cartFactory->create(['salesModel' => $order]); - - $proConfig = $this->_pro->getConfig(); - $api = $this->_pro->getApi()->setReferenceId( - $billingAgreement->getReferenceId() - )->setPaymentAction( - $proConfig->getConfigValue('paymentAction') - )->setAmount( - $amount - )->setCurrencyCode( - $payment->getOrder()->getBaseCurrencyCode() - )->setNotifyUrl( - $this->_urlBuilder->getUrl('paypal/ipn/') - )->setPaypalCart( - $cart - )->setIsLineItemsEnabled( - $proConfig->getConfigValue('lineItemsEnabled') - )->setInvNum( - $order->getIncrementId() - ); - - // call api and import transaction and other payment information - $api->callDoReferenceTransaction(); - $this->_pro->importPaymentInfo($api, $payment); - $api->callGetTransactionDetails(); - $this->_pro->importPaymentInfo($api, $payment); - - $payment->setTransactionId($api->getTransactionId())->setIsTransactionClosed(0); - - if ($api->getBillingAgreementId()) { - $order->addRelatedObject($billingAgreement); - $billingAgreement->setIsObjectChanged(true); - $billingAgreement->addOrderRelation($order); - } - - return $this; - } - - /** - * @param object $quote - * @return bool - */ - protected function _isAvailable($quote) - { - return $this->_pro->getConfig()->isMethodAvailable($this->_code); - } - - /** - * Payment action getter compatible with payment model - * - * @see \Magento\Sales\Model\Payment::place() - * @return string - */ - public function getConfigPaymentAction() - { - return $this->_pro->getConfig()->getPaymentAction(); - } -} diff --git a/app/code/Magento/Paypal/Model/Method/Checks/SpecificationPlugin.php b/app/code/Magento/Paypal/Model/Method/Checks/SpecificationPlugin.php deleted file mode 100644 index 9c08581d579ed..0000000000000 --- a/app/code/Magento/Paypal/Model/Method/Checks/SpecificationPlugin.php +++ /dev/null @@ -1,54 +0,0 @@ -_agreementFactory = $agreementFactory; - } - - /** - * Override check for Billing Agreements - * - * @param SpecificationInterface $specification - * @param \Closure $proceed - * @param PaymentMethodChecksInterface $paymentMethod - * @param Quote $quote - * @return bool - * @SuppressWarnings(PHPMD.UnusedFormalParameter) - */ - public function aroundIsApplicable( - SpecificationInterface $specification, - \Closure $proceed, - PaymentMethodChecksInterface $paymentMethod, - Quote $quote - ) { - $originallyIsApplicable = $proceed($paymentMethod, $quote); - if (!$originallyIsApplicable || $paymentMethod->getCode() != 'paypal_billing_agreement' - || !$quote->getCustomerId() - ) { - return $originallyIsApplicable; - } - $availableBA = $this->_agreementFactory->create()->getAvailableCustomerBillingAgreements( - $quote->getCustomerId() - ); - return count($availableBA) > 0; - } -} diff --git a/app/code/Magento/Paypal/Model/Observer.php b/app/code/Magento/Paypal/Model/Observer.php deleted file mode 100644 index 98b0435f5f265..0000000000000 --- a/app/code/Magento/Paypal/Model/Observer.php +++ /dev/null @@ -1,249 +0,0 @@ -_coreData = $coreData; - $this->_paypalHss = $paypalHss; - $this->_coreRegistry = $coreRegistry; - $this->_logger = $logger; - $this->_settlementFactory = $settlementFactory; - $this->_view = $view; - $this->_agreementFactory = $agreementFactory; - $this->_checkoutSession = $checkoutSession; - $this->_shortcutFactory = $shortcutFactory; - } - - /** - * Goes to reports.paypal.com and fetches Settlement reports. - * - * @return void - */ - public function fetchReports() - { - try { - /** @var \Magento\Paypal\Model\Report\Settlement $reports */ - $reports = $this->_settlementFactory->create(); - /* @var $reports \Magento\Paypal\Model\Report\Settlement */ - $credentials = $reports->getSftpCredentials(true); - foreach ($credentials as $config) { - try { - $reports->fetchAndSave(\Magento\Paypal\Model\Report\Settlement::createConnection($config)); - } catch (\Exception $e) { - $this->_logger->logException($e); - } - } - } catch (\Exception $e) { - $this->_logger->logException($e); - } - } - - /** - * Clean unfinished transaction - * - * @deprecated since 1.6.2.0 - * @return $this - */ - public function cleanTransactions() - { - return $this; - } - - /** - * Save order into registry to use it in the overloaded controller. - * - * @param EventObserver $observer - * @return $this - */ - public function saveOrderAfterSubmit(EventObserver $observer) - { - /* @var $order \Magento\Sales\Model\Order */ - $order = $observer->getEvent()->getData('order'); - $this->_coreRegistry->register('hss_order', $order, true); - - return $this; - } - - /** - * Set data for response of frontend saveOrder action - * - * @param EventObserver $observer - * @return $this - */ - public function setResponseAfterSaveOrder(EventObserver $observer) - { - /* @var $order \Magento\Sales\Model\Order */ - $order = $this->_coreRegistry->registry('hss_order'); - - if ($order && $order->getId()) { - $payment = $order->getPayment(); - if ($payment && in_array($payment->getMethod(), $this->_paypalHss->getHssMethods())) { - /* @var $controller \Magento\Framework\App\Action\Action */ - $controller = $observer->getEvent()->getData('controller_action'); - $result = $this->_coreData->jsonDecode($controller->getResponse()->getBody('default')); - - if (empty($result['error'])) { - $this->_view->loadLayout('checkout_onepage_review', true, true, false); - $html = $this->_view->getLayout()->getBlock('paypal.iframe')->toHtml(); - $result['update_section'] = ['name' => 'paypaliframe', 'html' => $html]; - $result['redirect'] = false; - $result['success'] = false; - $controller->getResponse()->clearHeader('Location'); - $controller->getResponse()->representJson($this->_coreData->jsonEncode($result)); - } - } - } - - return $this; - } - - /** - * @param EventObserver $observer - * @return void - */ - public function addBillingAgreementToSession(EventObserver $observer) - { - /** @var \Magento\Sales\Model\Order\Payment $orderPayment */ - $orderPayment = $observer->getEvent()->getPayment(); - $agreementCreated = false; - if ($orderPayment->getBillingAgreementData()) { - $order = $orderPayment->getOrder(); - /** @var \Magento\Paypal\Model\Billing\Agreement $agreement */ - $agreement = $this->_agreementFactory->create()->importOrderPayment($orderPayment); - if ($agreement->isValid()) { - $message = __('Created billing agreement #%1.', $agreement->getReferenceId()); - $order->addRelatedObject($agreement); - $this->_checkoutSession->setLastBillingAgreementReferenceId($agreement->getReferenceId()); - $agreementCreated = true; - } else { - $message = __('We couldn\'t create a billing agreement for this order.'); - } - $comment = $order->addStatusHistoryComment($message); - $order->addRelatedObject($comment); - } - if (!$agreementCreated) { - $this->_checkoutSession->unsLastBillingAgreementReferenceId(); - } - } - - /** - * Add PayPal shortcut buttons - * - * @param EventObserver $observer - * @return void - */ - public function addPaypalShortcuts(EventObserver $observer) - { - /** @var \Magento\Catalog\Block\ShortcutButtons $shortcutButtons */ - $shortcutButtons = $observer->getEvent()->getContainer(); - $blocks = [ - 'Magento\Paypal\Block\Express\ShortcutContainer', - 'Magento\Paypal\Block\Express\Shortcut', - 'Magento\Paypal\Block\PayflowExpress\Shortcut', - 'Magento\Paypal\Block\Bml\Shortcut', - 'Magento\Paypal\Block\Payflow\Bml\Shortcut', - ]; - foreach ($blocks as $blockInstanceName) { - $params = [ - 'shortcutValidator' => $this->_shortcutFactory->create($observer->getEvent()->getCheckoutSession()), - ]; - if (!in_array('Bml', explode('/', $blockInstanceName))) { - $params['checkoutSession'] = $observer->getEvent()->getCheckoutSession(); - } - - // we believe it's \Magento\Framework\View\Element\Template - $shortcut = $shortcutButtons->getLayout()->createBlock( - $blockInstanceName, - '', - $params - ); - $shortcut->setIsInCatalogProduct( - $observer->getEvent()->getIsCatalogProduct() - )->setShowOrPosition( - $observer->getEvent()->getOrPosition() - ); - $shortcutButtons->addShortcut($shortcut); - } - } -} diff --git a/app/code/Magento/Paypal/Model/Observer/RestrictAdminBillingAgreementUsage.php b/app/code/Magento/Paypal/Model/Observer/RestrictAdminBillingAgreementUsage.php deleted file mode 100644 index 1a4c494c5d1c2..0000000000000 --- a/app/code/Magento/Paypal/Model/Observer/RestrictAdminBillingAgreementUsage.php +++ /dev/null @@ -1,44 +0,0 @@ -_authorization = $authorization; - } - - /** - * Block admin ability to use customer billing agreements - * - * @param EventObserver $observer - * @return void - */ - public function execute($observer) - { - $event = $observer->getEvent(); - $methodInstance = $event->getMethodInstance(); - if ($methodInstance instanceof \Magento\Paypal\Model\Payment\Method\Billing\AbstractAgreement && - false == $this->_authorization->isAllowed( - 'Magento_Paypal::use' - ) - ) { - $event->getResult()->isAvailable = false; - } - } -} diff --git a/app/code/Magento/Paypal/Model/Payflow/Bml.php b/app/code/Magento/Paypal/Model/Payflow/Bml.php deleted file mode 100644 index 4916fb1a38737..0000000000000 --- a/app/code/Magento/Paypal/Model/Payflow/Bml.php +++ /dev/null @@ -1,33 +0,0 @@ -_urlBuilder->getUrl('paypal/payflowbml/start'); - } -} diff --git a/app/code/Magento/Paypal/Model/Payflow/Pro.php b/app/code/Magento/Paypal/Model/Payflow/Pro.php deleted file mode 100644 index 5d6ab9d93fc2b..0000000000000 --- a/app/code/Magento/Paypal/Model/Payflow/Pro.php +++ /dev/null @@ -1,135 +0,0 @@ -_getParentTransactionId($payment); - if ($captureTxnId) { - $api = $this->getApi(); - $api->setAuthorizationId($captureTxnId); - } - parent::refund($payment, $amount); - } - - /** - * Is capture request needed on this transaction - * - * @return true - */ - protected function _isCaptureNeeded() - { - return true; - } - - /** - * Get payflow transaction id from parent transaction - * - * @param \Magento\Framework\Object $payment - * @return string - */ - protected function _getParentTransactionId(\Magento\Framework\Object $payment) - { - if ($payment->getParentTransactionId()) { - return $payment->getTransaction( - $payment->getParentTransactionId() - )->getAdditionalInformation( - self::TRANSPORT_PAYFLOW_TXN_ID - ); - } - return $payment->getParentTransactionId(); - } - - /** - * Import capture results to payment - * - * @param \Magento\Paypal\Model\Api\Nvp $api - * @param \Magento\Sales\Model\Order\Payment $payment - * @return void - */ - protected function _importCaptureResultToPayment($api, $payment) - { - $payment->setTransactionId( - $api->getPaypalTransactionId() - )->setIsTransactionClosed( - false - )->setTransactionAdditionalInfo( - self::TRANSPORT_PAYFLOW_TXN_ID, - $api->getTransactionId() - ); - $payment->setPreparedMessage(__('Payflow PNREF: #%1.', $api->getTransactionId())); - $this->_infoFactory->create()->importToPayment($api, $payment); - } - - /** - * Fetch transaction details info method does not exists in Payflow - * - * @param \Magento\Payment\Model\Info $payment - * @param string $transactionId - * @throws \Magento\Framework\Model\Exception - * @return void - */ - public function fetchTransactionInfo(\Magento\Payment\Model\Info $payment, $transactionId) - { - throw new \Magento\Framework\Model\Exception(__('Fetch transaction details method does not exists in Payflow')); - } - - /** - * Import refund results to payment - * - * @param \Magento\Paypal\Model\Api\Nvp $api - * @param \Magento\Sales\Model\Order\Payment $payment - * @param bool $canRefundMore - * @return void - */ - protected function _importRefundResultToPayment($api, $payment, $canRefundMore) - { - $payment->setTransactionId( - $api->getPaypalTransactionId() - )->setIsTransactionClosed( - 1 // refund initiated by merchant - )->setShouldCloseParentTransaction( - !$canRefundMore - )->setTransactionAdditionalInfo( - self::TRANSPORT_PAYFLOW_TXN_ID, - $api->getTransactionId() - ); - $payment->setPreparedMessage(__('Payflow PNREF: #%1.', $api->getTransactionId())); - $this->_infoFactory->create()->importToPayment($api, $payment); - } -} diff --git a/app/code/Magento/Paypal/Model/Payflow/Request.php b/app/code/Magento/Paypal/Model/Payflow/Request.php deleted file mode 100644 index e92de24740a2b..0000000000000 --- a/app/code/Magento/Paypal/Model/Payflow/Request.php +++ /dev/null @@ -1,57 +0,0 @@ - - */ -class Request extends \Magento\Framework\Object -{ - /** - * Set/Get attribute wrapper - * Also add length path if key contains = or & - * - * @param string $method - * @param array $args - * @return mixed - * @throws \Magento\Framework\Exception - */ - public function __call($method, $args) - { - $key = $this->_underscore(substr($method, 3)); - if (isset($args[0]) && (strstr($args[0], '=') || strstr($args[0], '&'))) { - $key .= '[' . strlen($args[0]) . ']'; - } - switch (substr($method, 0, 3)) { - case 'get': - //\Magento\Framework\Profiler::start('GETTER: '.get_class($this).'::'.$method); - $data = $this->getData($key, isset($args[0]) ? $args[0] : null); - //\Magento\Framework\Profiler::stop('GETTER: '.get_class($this).'::'.$method); - return $data; - - case 'set': - //\Magento\Framework\Profiler::start('SETTER: '.get_class($this).'::'.$method); - $result = $this->setData($key, isset($args[0]) ? $args[0] : null); - //\Magento\Framework\Profiler::stop('SETTER: '.get_class($this).'::'.$method); - return $result; - - case 'uns': - //\Magento\Framework\Profiler::start('UNS: '.get_class($this).'::'.$method); - $result = $this->unsetData($key); - //\Magento\Framework\Profiler::stop('UNS: '.get_class($this).'::'.$method); - return $result; - - case 'has': - //\Magento\Framework\Profiler::start('HAS: '.get_class($this).'::'.$method); - //\Magento\Framework\Profiler::stop('HAS: '.get_class($this).'::'.$method); - return isset($this->_data[$key]); - } - throw new \Magento\Framework\Exception( - "Invalid method " . get_class($this) . "::" . $method . "(" . print_r($args, 1) . ")" - ); - } -} diff --git a/app/code/Magento/Paypal/Model/PayflowExpress.php b/app/code/Magento/Paypal/Model/PayflowExpress.php deleted file mode 100644 index e880fe8edbbaa..0000000000000 --- a/app/code/Magento/Paypal/Model/PayflowExpress.php +++ /dev/null @@ -1,155 +0,0 @@ -_paypalInfoFactory = $paypalInfoFactory; - } - - /** - * EC PE won't be available if the EC is available - * - * @param \Magento\Sales\Model\Quote|null $quote - * @return bool - */ - public function isAvailable($quote = null) - { - if (!parent::isAvailable($quote)) { - return false; - } - if (!$this->_ecInstance) { - $this->_ecInstance = $this->_paymentData->getMethodInstance( - Config::METHOD_WPP_EXPRESS - ); - } - if ($quote) { - $this->_ecInstance->setStore($quote->getStoreId()); - } - return !$this->_ecInstance->isAvailable(); - } - - /** - * Import payment info to payment - * - * @param Api\Nvp $api - * @param \Magento\Sales\Model\Order\Payment $payment - * @return void - */ - protected function _importToPayment($api, $payment) - { - $payment->setTransactionId( - $api->getPaypalTransactionId() - )->setIsTransactionClosed( - 0 - )->setAdditionalInformation( - Express\Checkout::PAYMENT_INFO_TRANSPORT_REDIRECT, - $api->getRedirectRequired() || $api->getRedirectRequested() - )->setIsTransactionPending( - $api->getIsPaymentPending() - )->setTransactionAdditionalInfo( - Payflow\Pro::TRANSPORT_PAYFLOW_TXN_ID, - $api->getTransactionId() - ); - $payment->setPreparedMessage(__('Payflow PNREF: #%1.', $api->getTransactionId())); - $this->_paypalInfoFactory->create()->importToPayment($api, $payment); - } - - /** - * Checkout redirect URL getter for onepage checkout (hardcode) - * - * @see \Magento\Checkout\Controller\Onepage::savePaymentAction() - * @see \Magento\Sales\Model\Quote\Payment::getCheckoutRedirectUrl() - * @return string - */ - public function getCheckoutRedirectUrl() - { - return $this->_urlBuilder->getUrl('paypal/payflowexpress/start'); - } - - /** - * Check refund availability. - * The main factor is that the last capture transaction exists and has an Payflow\Pro::TRANSPORT_PAYFLOW_TXN_ID in - * additional information(needed to perform online refund. Requirement of the Payflow gateway) - * - * @return bool - */ - public function canRefund() - { - /** @var \Magento\Sales\Model\Order\Payment $payment */ - $payment = $this->getInfoInstance(); - // we need the last capture transaction was made - $captureTransaction = $payment->lookupTransaction('', Transaction::TYPE_CAPTURE); - return $captureTransaction && $captureTransaction->getAdditionalInformation( - Payflow\Pro::TRANSPORT_PAYFLOW_TXN_ID - ) && $this->_canRefund; - } -} diff --git a/app/code/Magento/Paypal/Model/PayflowExpress/Checkout.php b/app/code/Magento/Paypal/Model/PayflowExpress/Checkout.php deleted file mode 100644 index 7abb18c830056..0000000000000 --- a/app/code/Magento/Paypal/Model/PayflowExpress/Checkout.php +++ /dev/null @@ -1,38 +0,0 @@ -quoteRepository->save($this->_quote); - } -} diff --git a/app/code/Magento/Paypal/Model/Payflowadvanced.php b/app/code/Magento/Paypal/Model/Payflowadvanced.php deleted file mode 100644 index da28b79edc7a3..0000000000000 --- a/app/code/Magento/Paypal/Model/Payflowadvanced.php +++ /dev/null @@ -1,40 +0,0 @@ - 'billtofirstname', - 'lastname' => 'billtolastname', - 'address' => 'billtostreet', - 'city' => 'billtocity', - 'state' => 'billtostate', - 'zip' => 'billtozip', - 'country' => 'billtocountry', - 'phone' => 'billtophone', - 'email' => 'billtoemail', - 'nametoship' => 'shiptofirstname', - 'addresstoship' => 'shiptostreet', - 'citytoship' => 'shiptocity', - 'statetoship' => 'shiptostate', - 'ziptoship' => 'shiptozip', - 'countrytoship' => 'shiptocountry', - 'phonetoship' => 'shiptophone', - 'emailtoship' => 'shiptoemail', - 'faxtoship' => 'shiptofax', - 'method' => 'tender', - 'cscmatch' => 'cvv2match', - 'type' => 'trxtype', - ]; - - /** - * Payment method code - * - * @var string - */ - protected $_code = \Magento\Paypal\Model\Config::METHOD_PAYFLOWLINK; - - /** - * @var string - */ - protected $_formBlockType = 'Magento\Paypal\Block\Payflow\Link\Form'; - - /** - * @var string - */ - protected $_infoBlockType = 'Magento\Paypal\Block\Payflow\Link\Info'; - - /** - * Availability option - * - * @var bool - */ - protected $_canUseInternal = false; - - /** - * Availability option - * - * @var bool - */ - protected $_isInitializeNeeded = true; - - /** - * Request & response model - * - * @var \Magento\Paypal\Model\Payflow\Request - */ - protected $_response; - - /** - * Gateway request URL - */ - const TRANSACTION_PAYFLOW_URL = 'https://payflowlink.paypal.com/'; - - /** - * Error message - */ - const RESPONSE_ERROR_MSG = 'Payment error. %s was not found.'; - - /** - * Key for storing secure hash in additional information of payment model - * - * @var string - */ - protected $_secureSilentPostHashKey = 'secure_silent_post_hash'; - - /** - * @var \Magento\Paypal\Model\Payflow\RequestFactory - */ - protected $_requestFactory; - - /** - * @var \Magento\Sales\Model\QuoteRepository - */ - protected $quoteRepository; - - /** - * @var \Magento\Sales\Model\OrderFactory - */ - protected $_orderFactory; - - /** - * @var \Magento\Store\Model\WebsiteFactory - */ - protected $_websiteFactory; - - /** - * @var OrderSender - */ - protected $orderSender; - - /** - * @param \Magento\Framework\Event\ManagerInterface $eventManager - * @param \Magento\Payment\Helper\Data $paymentData - * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig - * @param \Magento\Framework\Logger\AdapterFactory $logAdapterFactory - * @param \Magento\Framework\Logger $logger - * @param \Magento\Framework\Module\ModuleListInterface $moduleList - * @param \Magento\Framework\Stdlib\DateTime\TimezoneInterface $localeDate - * @param \Magento\Centinel\Model\Service $centinelService - * @param \Magento\Store\Model\StoreManagerInterface $storeManager - * @param \Magento\Paypal\Model\ConfigFactory $configFactory - * @param \Magento\Framework\Math\Random $mathRandom - * @param \Magento\Framework\HTTP\ZendClientFactory $httpClientFactory - * @param \Magento\Paypal\Model\Payflow\RequestFactory $requestFactory - * @param \Magento\Sales\Model\QuoteRepository $quoteRepository - * @param \Magento\Sales\Model\OrderFactory $orderFactory - * @param \Magento\Framework\App\RequestInterface $requestHttp - * @param \Magento\Store\Model\WebsiteFactory $websiteFactory - * @param OrderSender $orderSender - * @param array $data - * - * @SuppressWarnings(PHPMD.ExcessiveParameterList) - */ - public function __construct( - \Magento\Framework\Event\ManagerInterface $eventManager, - \Magento\Payment\Helper\Data $paymentData, - \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, - \Magento\Framework\Logger\AdapterFactory $logAdapterFactory, - \Magento\Framework\Logger $logger, - \Magento\Framework\Module\ModuleListInterface $moduleList, - \Magento\Framework\Stdlib\DateTime\TimezoneInterface $localeDate, - \Magento\Centinel\Model\Service $centinelService, - \Magento\Store\Model\StoreManagerInterface $storeManager, - \Magento\Paypal\Model\ConfigFactory $configFactory, - \Magento\Framework\Math\Random $mathRandom, - \Magento\Framework\HTTP\ZendClientFactory $httpClientFactory, - \Magento\Paypal\Model\Payflow\RequestFactory $requestFactory, - \Magento\Sales\Model\QuoteRepository $quoteRepository, - \Magento\Sales\Model\OrderFactory $orderFactory, - \Magento\Framework\App\RequestInterface $requestHttp, - \Magento\Store\Model\WebsiteFactory $websiteFactory, - OrderSender $orderSender, - array $data = [] - ) { - $this->_requestFactory = $requestFactory; - $this->quoteRepository = $quoteRepository; - $this->_orderFactory = $orderFactory; - $this->_requestHttp = $requestHttp; - $this->_websiteFactory = $websiteFactory; - $this->orderSender = $orderSender; - parent::__construct( - $eventManager, - $paymentData, - $scopeConfig, - $logAdapterFactory, - $logger, - $moduleList, - $localeDate, - $centinelService, - $storeManager, - $configFactory, - $mathRandom, - $httpClientFactory, - $data - ); - } - - /** - * Do not validate payment form using server methods - * - * @return true - */ - public function validate() - { - return true; - } - - /** - * Check whether payment method can be used - * - * @param \Magento\Sales\Model\Quote|null $quote - * @return bool - */ - public function isAvailable($quote = null) - { - $storeId = $this->_storeManager->getStore($this->getStore())->getId(); - /** @var \Magento\Paypal\Model\Config $config */ - $config = $this->_configFactory->create()->setStoreId($storeId); - if (\Magento\Payment\Model\Method\AbstractMethod::isAvailable( - $quote - ) && $config->isMethodAvailable( - $this->getCode() - ) - ) { - return true; - } - return false; - } - - /** - * Instantiate state and set it to state object - * - * @param string $paymentAction - * @param \Magento\Framework\Object $stateObject - * @return void - */ - public function initialize($paymentAction, $stateObject) - { - switch ($paymentAction) { - case \Magento\Paypal\Model\Config::PAYMENT_ACTION_AUTH: - case \Magento\Paypal\Model\Config::PAYMENT_ACTION_SALE: - $payment = $this->getInfoInstance(); - $order = $payment->getOrder(); - $order->setCanSendNewEmailFlag(false); - $payment->setAmountAuthorized($order->getTotalDue()); - $payment->setBaseAmountAuthorized($order->getBaseTotalDue()); - $this->_generateSecureSilentPostHash($payment); - $request = $this->_buildTokenRequest($payment); - $response = $this->_postRequest($request); - $this->_processTokenErrors($response, $payment); - - $order = $payment->getOrder(); - $order->setCanSendNewEmailFlag(false); - - $stateObject->setState(\Magento\Sales\Model\Order::STATE_PENDING_PAYMENT); - $stateObject->setStatus('pending_payment'); - $stateObject->setIsNotified(false); - break; - default: - break; - } - } - - /** - * Return response model. - * - * @return \Magento\Paypal\Model\Payflow\Request - */ - public function getResponse() - { - if (!$this->_response) { - $this->_response = $this->_requestFactory->create(); - } - - return $this->_response; - } - - /** - * Fill response with data. - * - * @param array $postData - * @return $this - */ - public function setResponseData(array $postData) - { - foreach ($postData as $key => $val) { - $this->getResponse()->setData(strtolower($key), $val); - } - foreach ($this->_responseParamsMappings as $originKey => $key) { - $data = $this->getResponse()->getData($key); - if (isset($data)) { - $this->getResponse()->setData($originKey, $data); - } - } - // process AVS data separately - $avsAddr = $this->getResponse()->getData('avsaddr'); - $avsZip = $this->getResponse()->getData('avszip'); - if (isset($avsAddr) && isset($avsZip)) { - $this->getResponse()->setData('avsdata', $avsAddr . $avsZip); - } - // process Name separately - $firstnameParameter = $this->getResponse()->getData('billtofirstname'); - $lastnameParameter = $this->getResponse()->getData('billtolastname'); - if (isset($firstnameParameter) && isset($lastnameParameter)) { - $this->getResponse()->setData('name', $firstnameParameter . ' ' . $lastnameParameter); - } - return $this; - } - - /** - * Operate with order using data from $_POST which came from Silent Post Url. - * - * @param array $responseData - * @return void - * @throws \Magento\Framework\Model\Exception In case of validation error or order creation error - */ - public function process($responseData) - { - $debugData = ['response' => $responseData]; - $this->_debug($debugData); - - $this->setResponseData($responseData); - $order = $this->_getOrderFromResponse(); - if ($order) { - $this->_processOrder($order); - } - } - - /** - * Operate with order using information from silent post - * - * @param \Magento\Sales\Model\Order $order - * @return void - * @throws \Magento\Framework\Model\Exception - */ - protected function _processOrder(\Magento\Sales\Model\Order $order) - { - $response = $this->getResponse(); - $payment = $order->getPayment(); - $payment->setTransactionId($response->getPnref())->setIsTransactionClosed(0); - $canSendNewOrderEmail = true; - - if ($response->getResult() == self::RESPONSE_CODE_FRAUDSERVICE_FILTER || - $response->getResult() == self::RESPONSE_CODE_DECLINED_BY_FILTER - ) { - $canSendNewOrderEmail = false; - $fraudMessage = $this->_getFraudMessage() ? $response->getFraudMessage() : $response->getRespmsg(); - $payment->setIsTransactionPending( - true - )->setIsFraudDetected( - true - )->setAdditionalInformation( - 'paypal_fraud_filters', - $fraudMessage - ); - } - - if ($response->getAvsdata() && strstr(substr($response->getAvsdata(), 0, 2), 'N')) { - $payment->setAdditionalInformation('paypal_avs_code', substr($response->getAvsdata(), 0, 2)); - } - if ($response->getCvv2match() && $response->getCvv2match() != 'Y') { - $payment->setAdditionalInformation('paypal_cvv2_match', $response->getCvv2match()); - } - - switch ($response->getType()) { - case self::TRXTYPE_AUTH_ONLY: - $payment->registerAuthorizationNotification($payment->getBaseAmountAuthorized()); - break; - case self::TRXTYPE_SALE: - $payment->registerCaptureNotification($payment->getBaseAmountAuthorized()); - break; - default: - break; - } - $order->save(); - - try { - if ($canSendNewOrderEmail) { - $this->orderSender->send($order); - } - $quote = $this->quoteRepository->get($order->getQuoteId())->setIsActive(false); - $this->quoteRepository->save($quote); - } catch (\Exception $e) { - throw new \Magento\Framework\Model\Exception(__('We cannot send the new order email.')); - } - } - - /** - * Get fraud message from response - * - * @return string|false - */ - protected function _getFraudMessage() - { - if ($this->getResponse()->getFpsPrexmldata()) { - $xml = new \SimpleXMLElement($this->getResponse()->getFpsPrexmldata()); - $this->getResponse()->setFraudMessage((string)$xml->rule->triggeredMessage); - return $this->getResponse()->getFraudMessage(); - } - - return false; - } - - /** - * Check response from Payflow gateway. - * - * @return false|\Magento\Sales\Model\Order in case of validation passed - * @throws \Magento\Framework\Model\Exception In other cases - */ - protected function _getOrderFromResponse() - { - $response = $this->getResponse(); - $order = $this->_orderFactory->create()->loadByIncrementId($response->getInvnum()); - - if ($this->_getSecureSilentPostHash( - $order->getPayment() - ) != $response->getUser2() || $this->_code != $order->getPayment()->getMethodInstance()->getCode() - ) { - return false; - } - - if ($response->getResult() != self::RESPONSE_CODE_FRAUDSERVICE_FILTER && - $response->getResult() != self::RESPONSE_CODE_DECLINED_BY_FILTER && - $response->getResult() != self::RESPONSE_CODE_APPROVED - ) { - if ($order->getState() != \Magento\Sales\Model\Order::STATE_CANCELED) { - $order->registerCancellation($response->getRespmsg())->save(); - } - throw new \Magento\Framework\Model\Exception($response->getRespmsg()); - } - - $amountCompared = $response->getAmt() == $order->getPayment()->getBaseAmountAuthorized() ? true : false; - if (!$order->getId() || - $order->getState() != \Magento\Sales\Model\Order::STATE_PENDING_PAYMENT || - !$amountCompared - ) { - throw new \Magento\Framework\Model\Exception(sprintf(self::RESPONSE_ERROR_MSG, 'Order')); - } - - $fetchData = $this->fetchTransactionInfo($order->getPayment(), $response->getPnref()); - if (!isset($fetchData['custref']) || $fetchData['custref'] != $order->getIncrementId()) { - throw new \Magento\Framework\Model\Exception(sprintf(self::RESPONSE_ERROR_MSG, 'Transaction')); - } - - return $order; - } - - /** - * Build request for getting token - * - * @param \Magento\Sales\Model\Order\Payment $payment - * @return \Magento\Framework\Object - */ - protected function _buildTokenRequest(\Magento\Sales\Model\Order\Payment $payment) - { - $request = $this->_buildBasicRequest($payment); - $request->setCreatesecuretoken( - 'Y' - )->setSecuretokenid( - $this->mathRandom->getUniqueHash() - )->setTrxtype( - $this->_getTrxTokenType() - )->setAmt( - sprintf('%.2F', $payment->getOrder()->getBaseTotalDue()) - )->setCurrency( - $payment->getOrder()->getBaseCurrencyCode() - )->setInvnum( - $payment->getOrder()->getIncrementId() - )->setCustref( - $payment->getOrder()->getIncrementId() - )->setPonum( - $payment->getOrder()->getId() - ); - - $order = $payment->getOrder(); - if (empty($order)) { - return $request; - } - - $billing = $order->getBillingAddress(); - if (!empty($billing)) { - $request->setFirstname( - $billing->getFirstname() - )->setLastname( - $billing->getLastname() - )->setStreet( - implode(' ', $billing->getStreet()) - )->setCity( - $billing->getCity() - )->setState( - $billing->getRegionCode() - )->setZip( - $billing->getPostcode() - )->setCountry( - $billing->getCountry() - )->setEmail( - $order->getCustomerEmail() - ); - } - $shipping = $order->getShippingAddress(); - if (!empty($shipping)) { - $request->setShiptofirstname( - $shipping->getFirstname() - )->setShiptolastname( - $shipping->getLastname() - )->setShiptostreet( - implode(' ', $shipping->getStreet()) - )->setShiptocity( - $shipping->getCity() - )->setShiptostate( - $shipping->getRegionCode() - )->setShiptozip( - $shipping->getPostcode() - )->setShiptocountry( - $shipping->getCountry() - ); - } - //pass store Id to request - $request->setUser1($order->getStoreId())->setUser2($this->_getSecureSilentPostHash($payment)); - - return $request; - } - - /** - * Get store id from response if exists - * or default - * - * @return int - */ - protected function _getStoreId() - { - $response = $this->getResponse(); - if ($response->getUser1()) { - return (int)$response->getUser1(); - } - return $this->_storeManager->getStore($this->getStore())->getId(); - } - - /** - * Return request object with basic information for gateway request - * - * @param \Magento\Framework\Object $payment - * @return \Magento\Paypal\Model\Payflow\Request - */ - protected function _buildBasicRequest(\Magento\Framework\Object $payment) - { - /** @var \Magento\Paypal\Model\Payflow\Request $request */ - $request = $this->_requestFactory->create(); - $cscEditable = $this->getConfigData('csc_editable'); - /** @var \Magento\Paypal\Model\Config $config */ - $config = $this->_configFactory->create(); - $request->setUser( - $this->getConfigData('user', $this->_getStoreId()) - )->setVendor( - $this->getConfigData('vendor', $this->_getStoreId()) - )->setPartner( - $this->getConfigData('partner', $this->_getStoreId()) - )->setPwd( - $this->getConfigData('pwd', $this->_getStoreId()) - )->setVerbosity( - $this->getConfigData('verbosity', $this->_getStoreId()) - )->setData( - 'BNCODE', - $config->getBuildNotationCode() - )->setTender( - self::TENDER_CC - )->setCancelurl( - $this->_getCallbackUrl('cancelPayment') - )->setErrorurl( - $this->_getCallbackUrl('returnUrl') - )->setSilentpost( - 'TRUE' - )->setSilentposturl( - $this->_getCallbackUrl('silentPost') - )->setReturnurl( - $this->_getCallbackUrl('returnUrl') - )->setTemplate( - self::LAYOUT_TEMPLATE - )->setDisablereceipt( - 'TRUE' - )->setCscrequired( - $cscEditable && $this->getConfigData('csc_required') ? 'TRUE' : 'FALSE' - )->setCscedit( - $cscEditable ? 'TRUE' : 'FALSE' - )->setEmailcustomer( - $this->getConfigData('email_confirmation') ? 'TRUE' : 'FALSE' - )->setUrlmethod( - $this->getConfigData('url_method') - ); - return $request; - } - - /** - * Get payment action code - * - * @return string - */ - protected function _getTrxTokenType() - { - switch ($this->getConfigData('payment_action')) { - case \Magento\Paypal\Model\Config::PAYMENT_ACTION_AUTH: - return self::TRXTYPE_AUTH_ONLY; - case \Magento\Paypal\Model\Config::PAYMENT_ACTION_SALE: - return self::TRXTYPE_SALE; - default: - break; - } - } - - /** - * If response is failed throw exception - * Set token data in payment object - * - * @param \Magento\Framework\Object $response - * @param \Magento\Sales\Model\Order\Payment $payment - * @return void - * @throws \Magento\Framework\Model\Exception - */ - protected function _processTokenErrors($response, $payment) - { - if (!$response->getSecuretoken() && - $response->getResult() != self::RESPONSE_CODE_APPROVED && - $response->getResult() != self::RESPONSE_CODE_FRAUDSERVICE_FILTER - ) { - throw new \Magento\Framework\Model\Exception($response->getRespmsg()); - } else { - $payment->setAdditionalInformation( - 'secure_token_id', - $response->getSecuretokenid() - )->setAdditionalInformation( - 'secure_token', - $response->getSecuretoken() - ); - } - } - - /** - * Return secure hash value for silent post request - * - * @param \Magento\Sales\Model\Order\Payment $payment - * @return string - */ - protected function _getSecureSilentPostHash($payment) - { - return $payment->getAdditionalInformation($this->_secureSilentPostHashKey); - } - - /** - * Generate end return new secure hash value - * - * @param \Magento\Sales\Model\Order\Payment $payment - * @return string - */ - protected function _generateSecureSilentPostHash($payment) - { - $secureHash = md5($this->mathRandom->getRandomString(10)); - $payment->setAdditionalInformation($this->_secureSilentPostHashKey, $secureHash); - return $secureHash; - } - - /** - * Get callback url - * - * @param string $actionName - * @return string - */ - protected function _getCallbackUrl($actionName) - { - if ($this->_requestHttp->getParam('website')) { - /** @var $website \Magento\Store\Model\Website */ - $website = $this->_websiteFactory->create()->load($this->_requestHttp->getParam('website')); - $secure = $this->_scopeConfig->isSetFlag( - \Magento\Store\Model\Store::XML_PATH_SECURE_IN_FRONTEND, - \Magento\Store\Model\ScopeInterface::SCOPE_STORE, - $website->getDefaultStore() - ); - $path = $secure ? \Magento\Store\Model\Store::XML_PATH_SECURE_BASE_LINK_URL : \Magento\Store\Model\Store::XML_PATH_UNSECURE_BASE_LINK_URL; - $websiteUrl = $this->_scopeConfig->getValue( - $path, - \Magento\Store\Model\ScopeInterface::SCOPE_STORE, - $website->getDefaultStore() - ); - } else { - $secure = $this->_scopeConfig->isSetFlag( - \Magento\Store\Model\Store::XML_PATH_SECURE_IN_FRONTEND, - \Magento\Store\Model\ScopeInterface::SCOPE_STORE - ); - $websiteUrl = $this->_storeManager->getStore()->getBaseUrl(\Magento\Framework\UrlInterface::URL_TYPE_LINK, $secure); - } - - return $websiteUrl . 'paypal/' . $this->_callbackController . '/' . $actionName; - } -} diff --git a/app/code/Magento/Paypal/Model/Payflowpro.php b/app/code/Magento/Paypal/Model/Payflowpro.php deleted file mode 100644 index 8709324a2cd27..0000000000000 --- a/app/code/Magento/Paypal/Model/Payflowpro.php +++ /dev/null @@ -1,813 +0,0 @@ - 'MPIVENDOR3DS', - 'centinel_authstatus' => 'AUTHSTATUS3DS', - 'centinel_cavv' => 'CAVV', - 'centinel_eci' => 'ECI', - 'centinel_xid' => 'XID', - ]; - - /** - * @var \Magento\Store\Model\StoreManagerInterface - */ - protected $_storeManager; - - /** - * @var \Magento\Paypal\Model\ConfigFactory - */ - protected $_configFactory; - - /** - * @var \Magento\Framework\Math\Random - */ - protected $mathRandom; - - /** - * @var \Magento\Framework\HTTP\ZendClientFactory - */ - protected $_httpClientFactory; - - /** - * @param \Magento\Framework\Event\ManagerInterface $eventManager - * @param \Magento\Payment\Helper\Data $paymentData - * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig - * @param \Magento\Framework\Logger\AdapterFactory $logAdapterFactory - * @param \Magento\Framework\Logger $logger - * @param \Magento\Framework\Module\ModuleListInterface $moduleList - * @param \Magento\Framework\Stdlib\DateTime\TimezoneInterface $localeDate - * @param \Magento\Centinel\Model\Service $centinelService - * @param \Magento\Store\Model\StoreManagerInterface $storeManager - * @param \Magento\Paypal\Model\ConfigFactory $configFactory - * @param \Magento\Framework\Math\Random $mathRandom - * @param \Magento\Framework\HTTP\ZendClientFactory $httpClientFactory - * @param array $data - * - * @SuppressWarnings(PHPMD.ExcessiveParameterList) - */ - public function __construct( - \Magento\Framework\Event\ManagerInterface $eventManager, - \Magento\Payment\Helper\Data $paymentData, - \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, - \Magento\Framework\Logger\AdapterFactory $logAdapterFactory, - \Magento\Framework\Logger $logger, - \Magento\Framework\Module\ModuleListInterface $moduleList, - \Magento\Framework\Stdlib\DateTime\TimezoneInterface $localeDate, - \Magento\Centinel\Model\Service $centinelService, - \Magento\Store\Model\StoreManagerInterface $storeManager, - \Magento\Paypal\Model\ConfigFactory $configFactory, - \Magento\Framework\Math\Random $mathRandom, - \Magento\Framework\HTTP\ZendClientFactory $httpClientFactory, - array $data = [] - ) { - $this->_storeManager = $storeManager; - $this->_configFactory = $configFactory; - $this->mathRandom = $mathRandom; - $this->_httpClientFactory = $httpClientFactory; - parent::__construct( - $eventManager, - $paymentData, - $scopeConfig, - $logAdapterFactory, - $logger, - $moduleList, - $localeDate, - $centinelService, - $data - ); - } - - /** - * Check whether payment method can be used - * - * @param \Magento\Sales\Model\Quote|null $quote - * @return bool - */ - public function isAvailable($quote = null) - { - $storeId = $this->_storeManager->getStore($this->getStore())->getId(); - /** @var \Magento\Paypal\Model\Config $config */ - $config = $this->_configFactory->create()->setStoreId($storeId); - if (parent::isAvailable($quote) && $config->isMethodAvailable($this->getCode())) { - return true; - } - return false; - } - - /** - * Payment action getter compatible with payment model - * - * @see \Magento\Sales\Model\Payment::place() - * @return string - */ - public function getConfigPaymentAction() - { - switch ($this->getConfigData('payment_action')) { - case \Magento\Paypal\Model\Config::PAYMENT_ACTION_AUTH: - return \Magento\Payment\Model\Method\AbstractMethod::ACTION_AUTHORIZE; - case \Magento\Paypal\Model\Config::PAYMENT_ACTION_SALE: - return \Magento\Payment\Model\Method\AbstractMethod::ACTION_AUTHORIZE_CAPTURE; - default: - break; - } - } - - /** - * Authorize payment - * - * @param \Magento\Framework\Object|Payment $payment - * @param float $amount - * @return $this - */ - public function authorize(\Magento\Framework\Object $payment, $amount) - { - $request = $this->_buildPlaceRequest($payment, $amount); - $request->setTrxtype(self::TRXTYPE_AUTH_ONLY); - $this->_setReferenceTransaction($payment, $request); - $response = $this->_postRequest($request); - $this->_processErrors($response); - - switch ($response->getResultCode()) { - case self::RESPONSE_CODE_APPROVED: - $payment->setTransactionId($response->getPnref())->setIsTransactionClosed(0); - break; - case self::RESPONSE_CODE_FRAUDSERVICE_FILTER: - $payment->setTransactionId($response->getPnref())->setIsTransactionClosed(0); - $payment->setIsTransactionPending(true); - $payment->setIsFraudDetected(true); - break; - default: - break; - } - return $this; - } - - /** - * Get capture amount - * - * @param float $amount - * @return float - */ - protected function _getCaptureAmount($amount) - { - $infoInstance = $this->getInfoInstance(); - $amountToPay = round($amount, 2); - $authorizedAmount = round($infoInstance->getAmountAuthorized(), 2); - return $amountToPay != $authorizedAmount ? $amountToPay : 0; - } - - /** - * Capture payment - * - * @param \Magento\Framework\Object|Payment $payment - * @param float $amount - * @return $this - */ - public function capture(\Magento\Framework\Object $payment, $amount) - { - if ($payment->getReferenceTransactionId()) { - $request = $this->_buildPlaceRequest($payment, $amount); - $request->setTrxtype(self::TRXTYPE_SALE); - $request->setOrigid($payment->getReferenceTransactionId()); - } elseif ($payment->getParentTransactionId()) { - $request = $this->_buildBasicRequest($payment); - $request->setOrigid($payment->getParentTransactionId()); - $captureAmount = $this->_getCaptureAmount($amount); - if ($captureAmount) { - $request->setAmt($captureAmount); - } - $trxType = $this->getInfoInstance()->hasAmountPaid() ? self::TRXTYPE_SALE : self::TRXTYPE_DELAYED_CAPTURE; - $request->setTrxtype($trxType); - } else { - $request = $this->_buildPlaceRequest($payment, $amount); - $request->setTrxtype(self::TRXTYPE_SALE); - } - - $response = $this->_postRequest($request); - $this->_processErrors($response); - - switch ($response->getResultCode()) { - case self::RESPONSE_CODE_APPROVED: - $payment->setTransactionId($response->getPnref())->setIsTransactionClosed(0); - break; - case self::RESPONSE_CODE_FRAUDSERVICE_FILTER: - $payment->setTransactionId($response->getPnref())->setIsTransactionClosed(0); - $payment->setIsTransactionPending(true); - $payment->setIsFraudDetected(true); - break; - default: - break; - } - return $this; - } - - /** - * Void payment - * - * @param \Magento\Framework\Object|Payment $payment - * @return $this - */ - public function void(\Magento\Framework\Object $payment) - { - $request = $this->_buildBasicRequest($payment); - $request->setTrxtype(self::TRXTYPE_DELAYED_VOID); - $request->setOrigid($payment->getParentTransactionId()); - $response = $this->_postRequest($request); - $this->_processErrors($response); - - if ($response->getResultCode() == self::RESPONSE_CODE_APPROVED) { - $payment->setTransactionId( - $response->getPnref() - )->setIsTransactionClosed( - 1 - )->setShouldCloseParentTransaction( - 1 - ); - } - - return $this; - } - - /** - * Check void availability - * - * @param \Magento\Framework\Object $payment - * @return bool - */ - public function canVoid(\Magento\Framework\Object $payment) - { - if ($payment instanceof \Magento\Sales\Model\Order\Invoice || - $payment instanceof \Magento\Sales\Model\Order\Creditmemo - ) { - return false; - } - if ($payment->getAmountPaid()) { - $this->_canVoid = false; - } - - return $this->_canVoid; - } - - /** - * Attempt to void the authorization on cancelling - * - * @param \Magento\Framework\Object $payment - * @return $this - */ - public function cancel(\Magento\Framework\Object $payment) - { - if (!$payment->getOrder()->getInvoiceCollection()->count()) { - return $this->void($payment); - } - - return false; - } - - /** - * Refund capture - * - * @param \Magento\Framework\Object|Payment $payment - * @param float $amount - * @return $this - */ - public function refund(\Magento\Framework\Object $payment, $amount) - { - $request = $this->_buildBasicRequest($payment); - $request->setTrxtype(self::TRXTYPE_CREDIT); - $request->setOrigid($payment->getParentTransactionId()); - $request->setAmt(round($amount, 2)); - $response = $this->_postRequest($request); - $this->_processErrors($response); - - if ($response->getResultCode() == self::RESPONSE_CODE_APPROVED) { - $payment->setTransactionId($response->getPnref())->setIsTransactionClosed(1); - $payment->setShouldCloseParentTransaction(!$payment->getCreditmemo()->getInvoice()->canRefund()); - } - return $this; - } - - /** - * Fetch transaction details info - * - * @param \Magento\Payment\Model\Info $payment - * @param string $transactionId - * @return array - */ - public function fetchTransactionInfo(\Magento\Payment\Model\Info $payment, $transactionId) - { - $request = $this->_buildBasicRequest($payment); - $request->setTrxtype(self::TRXTYPE_DELAYED_INQUIRY); - $transactionId = $payment->getCcTransId() ? $payment->getCcTransId() : $transactionId; - $request->setOrigid($transactionId); - $response = $this->_postRequest($request); - - $this->_processErrors($response); - - if (!$this->_isTransactionUnderReview($response->getOrigresult())) { - $payment->setTransactionId($response->getOrigpnref())->setIsTransactionClosed(0); - if ($response->getOrigresult() == self::RESPONSE_CODE_APPROVED) { - $payment->setIsTransactionApproved(true); - } elseif ($response->getOrigresult() == self::RESPONSE_CODE_DECLINED_BY_MERCHANT) { - $payment->setIsTransactionDenied(true); - } - } - - $rawData = $response->getData(); - return $rawData ? $rawData : []; - } - - /** - * Check whether the transaction is in payment review status - * - * @param string $status - * @return bool - */ - protected static function _isTransactionUnderReview($status) - { - if (in_array($status, [self::RESPONSE_CODE_APPROVED, self::RESPONSE_CODE_DECLINED_BY_MERCHANT])) { - return false; - } - return true; - } - - /** - * Getter for URL to perform Payflow requests, based on test mode by default - * - * @param bool|null $testMode Ability to specify test mode using - * @return string - */ - protected function _getTransactionUrl($testMode = null) - { - $testMode = is_null($testMode) ? $this->getConfigData('sandbox_flag') : (bool)$testMode; - if ($testMode) { - return self::TRANSACTION_URL_TEST_MODE; - } - return self::TRANSACTION_URL; - } - - /** - * Post request to gateway and return response - * - * @param \Magento\Framework\Object $request - * @return \Magento\Framework\Object - * @throws \Exception - */ - protected function _postRequest(\Magento\Framework\Object $request) - { - $debugData = ['request' => $request->getData()]; - - /** @var \Magento\Framework\HTTP\ZendClient $client */ - $client = $this->_httpClientFactory->create(); - $result = new \Magento\Framework\Object(); - - $_config = ['maxredirects' => 5, 'timeout' => 30, 'verifypeer' => $this->getConfigData('verify_peer')]; - - $_isProxy = $this->getConfigData('use_proxy', false); - if ($_isProxy) { - $_config['proxy'] = $this->getConfigData('proxy_host') . ':' . $this->getConfigData('proxy_port'); - //http://proxy.shr.secureserver.net:3128', - $_config['httpproxytunnel'] = true; - $_config['proxytype'] = CURLPROXY_HTTP; - } - - $client->setUri( - $this->_getTransactionUrl() - )->setConfig( - $_config - )->setMethod( - \Zend_Http_Client::POST - )->setParameterPost( - $request->getData() - )->setHeaders( - 'X-VPS-VIT-CLIENT-CERTIFICATION-ID: 33baf5893fc2123d8b191d2d011b7fdc' - )->setHeaders( - 'X-VPS-Request-ID: ' . $request->getRequestId() - )->setHeaders( - 'X-VPS-CLIENT-TIMEOUT: ' . $this->_clientTimeout - ); - - try { - /** - * we are sending request to payflow pro without url encoding - * so we set up _urlEncodeBody flag to false - */ - $response = $client->setUrlEncodeBody(false)->request(); - } catch (\Exception $e) { - $result->setResponseCode( - -1 - )->setResponseReasonCode( - $e->getCode() - )->setResponseReasonText( - $e->getMessage() - ); - - $debugData['result'] = $result->getData(); - $this->_debug($debugData); - throw $e; - } - - $response = strstr($response->getBody(), 'RESULT'); - $valArray = explode('&', $response); - - foreach ($valArray as $val) { - $valArray2 = explode('=', $val); - $result->setData(strtolower($valArray2[0]), $valArray2[1]); - } - - $result->setResultCode($result->getResult())->setRespmsg($result->getRespmsg()); - - $debugData['result'] = $result->getData(); - $this->_debug($debugData); - - return $result; - } - - /** - * Return request object with information for 'authorization' or 'sale' action - * - * @param \Magento\Framework\Object|Payment $payment - * @param float $amount - * @return \Magento\Framework\Object - */ - protected function _buildPlaceRequest(\Magento\Framework\Object $payment, $amount) - { - $request = $this->_buildBasicRequest($payment); - $request->setAmt(round($amount, 2)); - $request->setAcct($payment->getCcNumber()); - $request->setExpdate(sprintf('%02d', $payment->getCcExpMonth()) . substr($payment->getCcExpYear(), -2, 2)); - $request->setCvv2($payment->getCcCid()); - - if ($this->getIsCentinelValidationEnabled()) { - $params = []; - $params = $this->getCentinelValidator()->exportCmpiData($params); - $request = \Magento\Framework\Object\Mapper::accumulateByMap($params, $request, $this->_centinelFieldMap); - } - - $order = $payment->getOrder(); - if (!empty($order)) { - $request->setCurrency($order->getBaseCurrencyCode()); - - $orderIncrementId = $order->getIncrementId(); - - $request->setCurrency($order->getBaseCurrencyCode()) - ->setInvnum($orderIncrementId) - ->setPonum($order->getId()) - ->setComment1($orderIncrementId); - $customerId = $order->getCustomerId(); - if ($customerId) { - $request->setCustref($customerId); - } - - $billing = $order->getBillingAddress(); - if (!empty($billing)) { - $request->setFirstname( - $billing->getFirstname() - )->setLastname( - $billing->getLastname() - )->setStreet( - implode(' ', $billing->getStreet()) - )->setCity( - $billing->getCity() - )->setState( - $billing->getRegionCode() - )->setZip( - $billing->getPostcode() - )->setCountry( - $billing->getCountry() - )->setEmail( - $payment->getOrder()->getCustomerEmail() - ); - } - $shipping = $order->getShippingAddress(); - if (!empty($shipping)) { - $request->setShiptofirstname( - $shipping->getFirstname() - )->setShiptolastname( - $shipping->getLastname() - )->setShiptostreet( - implode(' ', $shipping->getStreet()) - )->setShiptocity( - $shipping->getCity() - )->setShiptostate( - $shipping->getRegionCode() - )->setShiptozip( - $shipping->getPostcode() - )->setShiptocountry( - $shipping->getCountry() - ); - } - } - return $request; - } - - /** - * Return request object with basic information for gateway request - * - * @param \Magento\Framework\Object|Payment $payment - * @return \Magento\Framework\Object - */ - protected function _buildBasicRequest(\Magento\Framework\Object $payment) - { - $request = new \Magento\Framework\Object(); - /** @var \Magento\Paypal\Model\Config $config */ - $config = $this->_configFactory->create(); - $request->setUser( - $this->getConfigData('user') - )->setVendor( - $this->getConfigData('vendor') - )->setPartner( - $this->getConfigData('partner') - )->setPwd( - $this->getConfigData('pwd') - )->setVerbosity( - $this->getConfigData('verbosity') - )->setData( - 'BNCODE', - $config->getBuildNotationCode() - )->setTender( - self::TENDER_CC - )->setRequestId( - $this->_generateRequestId() - ); - return $request; - } - - /** - * Return unique value for request - * - * @return string - */ - protected function _generateRequestId() - { - return $this->mathRandom->getUniqueHash(); - } - - /** - * If response is failed throw exception - * - * @param \Magento\Framework\Object $response - * @return void - * @throws \Magento\Framework\Model\Exception - */ - protected function _processErrors(\Magento\Framework\Object $response) - { - if ($response->getResultCode() == self::RESPONSE_CODE_VOID_ERROR) { - throw new \Magento\Paypal\Exception(__('You cannot void a verification transaction.')); - } elseif ($response->getResultCode() != self::RESPONSE_CODE_APPROVED && - $response->getResultCode() != self::RESPONSE_CODE_FRAUDSERVICE_FILTER - ) { - throw new \Magento\Framework\Model\Exception($response->getRespmsg()); - } elseif ($response->getOrigresult() == self::RESPONSE_CODE_FRAUDSERVICE_FILTER) { - throw new \Magento\Framework\Model\Exception($response->getRespmsg()); - } - } - - /** - * Set reference transaction data into request - * - * @param \Magento\Framework\Object $payment - * @param \Magento\Framework\Object $request - * @return $this - */ - protected function _setReferenceTransaction(\Magento\Framework\Object $payment, $request) - { - return $this; - } - - /** - * Attempt to accept a pending payment - * - * @param \Magento\Payment\Model\Info $payment - * @return bool - */ - public function acceptPayment(\Magento\Payment\Model\Info $payment) - { - return $this->reviewPayment($payment, self::UPDATEACTION_APPROVED); - } - - /** - * Attempt to deny a pending payment - * - * @param \Magento\Payment\Model\Info $payment - * @return bool - */ - public function denyPayment(\Magento\Payment\Model\Info $payment) - { - return $this->reviewPayment($payment, self::UPDATEACTION_DECLINED_BY_MERCHANT); - } - - /** - * Perform the payment review - * - * @param \Magento\Payment\Model\Info $payment - * @param string $action - * @return bool - */ - public function reviewPayment(\Magento\Payment\Model\Info $payment, $action) - { - $request = $this->_buildBasicRequest($payment); - $transactionId = ($payment->getCcTransId()) ? $payment->getCcTransId() : $payment->getLastTransId(); - $request->setTrxtype(self::TRXTYPE_ACCEPT_DENY); - $request->setOrigid($transactionId); - $request->setUpdateaction($action); - - $response = $this->_postRequest($request); - $payment->setAdditionalInformation((array)$response->getData()); - $this->_processErrors($response); - - if (!$this->_isTransactionUnderReview($response->getOrigresult())) { - $payment->setTransactionId($response->getOrigpnref())->setIsTransactionClosed(0); - if ($response->getOrigresult() == self::RESPONSE_CODE_APPROVED) { - $payment->setIsTransactionApproved(true); - } elseif ($response->getOrigresult() == self::RESPONSE_CODE_DECLINED_BY_MERCHANT) { - $payment->setIsTransactionDenied(true); - } - } - $rawData = $response->getData(); - return ($rawData) ? $rawData : []; - } -} diff --git a/app/code/Magento/Paypal/Model/Payment/Method/Billing/AbstractAgreement.php b/app/code/Magento/Paypal/Model/Payment/Method/Billing/AbstractAgreement.php deleted file mode 100644 index 6c549f7ea3727..0000000000000 --- a/app/code/Magento/Paypal/Model/Payment/Method/Billing/AbstractAgreement.php +++ /dev/null @@ -1,115 +0,0 @@ -_agreementFactory = $agreementFactory; - parent::__construct($eventManager, $paymentData, $scopeConfig, $logAdapterFactory, $data); - } - - /** - * Check whether method is available - * - * @param \Magento\Paypal\Model\Quote|null $quote - * @return bool - */ - public function isAvailable($quote = null) - { - if (is_null($this->_isAvailable)) { - $this->_isAvailable = parent::isAvailable($quote) && $this->_isAvailable($quote); - $this->_canUseCheckout = $this->_isAvailable && $this->_canUseCheckout; - $this->_canUseInternal = $this->_isAvailable && $this->_canUseInternal; - } - return $this->_isAvailable; - } - - /** - * Assign data to info model instance - * - * @param mixed $data - * @return \Magento\Payment\Model\Info - */ - public function assignData($data) - { - $result = parent::assignData($data); - - $key = self::TRANSPORT_BILLING_AGREEMENT_ID; - $id = false; - if (is_array($data) && isset($data[$key])) { - $id = $data[$key]; - } elseif ($data instanceof \Magento\Framework\Object && $data->getData($key)) { - $id = $data->getData($key); - } - if ($id) { - $info = $this->getInfoInstance(); - $ba = $this->_agreementFactory->create()->load($id); - if ($ba->getId() && $ba->getCustomerId() == $info->getQuote()->getCustomerId()) { - $info->setAdditionalInformation( - $key, - $id - )->setAdditionalInformation( - self::PAYMENT_INFO_REFERENCE_ID, - $ba->getReferenceId() - ); - } - } - return $result; - } - - /** - * @param object $quote - * @return void - */ - abstract protected function _isAvailable($quote); -} diff --git a/app/code/Magento/Paypal/Model/Pro.php b/app/code/Magento/Paypal/Model/Pro.php deleted file mode 100644 index 196e8a4c6201f..0000000000000 --- a/app/code/Magento/Paypal/Model/Pro.php +++ /dev/null @@ -1,420 +0,0 @@ -_configFactory = $configFactory; - $this->_apiFactory = $apiFactory; - $this->_infoFactory = $infoFactory; - } - - /** - * Payment method code setter. Also instantiates/updates config - * - * @param string $code - * @param int|null $storeId - * @return $this - */ - public function setMethod($code, $storeId = null) - { - if (null === $this->_config) { - $params = [$code]; - if (null !== $storeId) { - $params[] = $storeId; - } - $this->_config = $this->_configFactory->create($this->_configType, ['params' => $params]); - } else { - $this->_config->setMethod($code); - if (null !== $storeId) { - $this->_config->setStoreId($storeId); - } - } - return $this; - } - - /** - * Config instance setter - * - * @param \Magento\Paypal\Model\Config $instace - * @param int|null $storeId - * @return $this - */ - public function setConfig(\Magento\Paypal\Model\Config $instace, $storeId = null) - { - $this->_config = $instace; - if (null !== $storeId) { - $this->_config->setStoreId($storeId); - } - return $this; - } - - /** - * Config instance getter - * - * @return \Magento\Paypal\Model\Config - */ - public function getConfig() - { - return $this->_config; - } - - /** - * API instance getter - * Sets current store id to current config instance and passes it to API - * - * @return \Magento\Paypal\Model\Api\Nvp - */ - public function getApi() - { - if (null === $this->_api) { - $this->_api = $this->_apiFactory->create($this->_apiType); - } - $this->_api->setConfigObject($this->_config); - return $this->_api; - } - - /** - * Destroy existing NVP Api object - * - * @return $this - */ - public function resetApi() - { - $this->_api = null; - - return $this; - } - - /** - * Instantiate and return info model - * - * @return \Magento\Paypal\Model\Info - */ - public function getInfo() - { - if (null === $this->_infoInstance) { - $this->_infoInstance = $this->_infoFactory->create(); - } - return $this->_infoInstance; - } - - /** - * Transfer transaction/payment information from API instance to order payment - * - * @param \Magento\Framework\Object|AbstractApi $from - * @param \Magento\Payment\Model\Info $to - * @return $this - */ - public function importPaymentInfo(\Magento\Framework\Object $from, \Magento\Payment\Model\Info $to) - { - // update PayPal-specific payment information in the payment object - $this->getInfo()->importToPayment($from, $to); - - /** - * Detect payment review and/or frauds - * PayPal pro API returns fraud results only in the payment call response - */ - if ($from->getDataUsingMethod(\Magento\Paypal\Model\Info::IS_FRAUD)) { - $to->setIsTransactionPending(true); - $to->setIsFraudDetected(true); - } elseif ($this->getInfo()->isPaymentReviewRequired($to)) { - $to->setIsTransactionPending(true); - } - - // give generic info about transaction state - if ($this->getInfo()->isPaymentSuccessful($to)) { - $to->setIsTransactionApproved(true); - } elseif ($this->getInfo()->isPaymentFailed($to)) { - $to->setIsTransactionDenied(true); - } - - return $this; - } - - /** - * Void transaction - * - * @param \Magento\Framework\Object $payment - * @return void - * @throws \Magento\Framework\Model\Exception - */ - public function void(\Magento\Framework\Object $payment) - { - $authTransactionId = $this->_getParentTransactionId($payment); - if ($authTransactionId) { - $api = $this->getApi(); - $api->setPayment($payment)->setAuthorizationId($authTransactionId)->callDoVoid(); - $this->importPaymentInfo($api, $payment); - } else { - throw new \Magento\Framework\Model\Exception(__('You need an authorization transaction to void.')); - } - } - - /** - * Attempt to capture payment - * Will return false if the payment is not supposed to be captured - * - * @param \Magento\Framework\Object $payment - * @param float $amount - * @return false|null - */ - public function capture(\Magento\Framework\Object $payment, $amount) - { - $authTransactionId = $this->_getParentTransactionId($payment); - if (!$authTransactionId) { - return false; - } - $api = $this->getApi()->setAuthorizationId( - $authTransactionId - )->setIsCaptureComplete( - $payment->getShouldCloseParentTransaction() - )->setAmount( - $amount - )->setCurrencyCode( - $payment->getOrder()->getBaseCurrencyCode() - )->setInvNum( - $payment->getOrder()->getIncrementId() - ); - // TODO: pass 'NOTE' to API - - $api->callDoCapture(); - $this->_importCaptureResultToPayment($api, $payment); - } - - /** - * Refund a capture transaction - * - * @param \Magento\Framework\Object $payment - * @param float $amount - * @return void - * @throws \Magento\Framework\Model\Exception - */ - public function refund(\Magento\Framework\Object $payment, $amount) - { - $captureTxnId = $this->_getParentTransactionId($payment); - if ($captureTxnId) { - $api = $this->getApi(); - $order = $payment->getOrder(); - $api->setPayment( - $payment - )->setTransactionId( - $captureTxnId - )->setAmount( - $amount - )->setCurrencyCode( - $order->getBaseCurrencyCode() - ); - $canRefundMore = $payment->getCreditmemo()->getInvoice()->canRefund(); - $isFullRefund = !$canRefundMore && - 0 == (double)$order->getBaseTotalOnlineRefunded() + (double)$order->getBaseTotalOfflineRefunded(); - $api->setRefundType( - $isFullRefund ? \Magento\Paypal\Model\Config::REFUND_TYPE_FULL : \Magento\Paypal\Model\Config::REFUND_TYPE_PARTIAL - ); - $api->callRefundTransaction(); - $this->_importRefundResultToPayment($api, $payment, $canRefundMore); - } else { - throw new \Magento\Framework\Model\Exception( - __('We can\'t issue a refund transaction because there is no capture transaction.') - ); - } - } - - /** - * Cancel payment - * - * @param \Magento\Framework\Object $payment - * @return void - */ - public function cancel(\Magento\Framework\Object $payment) - { - if (!$payment->getOrder()->getInvoiceCollection()->count()) { - $this->void($payment); - } - } - - /** - * Check whether can do payment review - * - * @param \Magento\Payment\Model\Info $payment - * @return bool - */ - public function canReviewPayment(\Magento\Payment\Model\Info $payment) - { - $pendingReason = $payment->getAdditionalInformation(\Magento\Paypal\Model\Info::PENDING_REASON_GLOBAL); - return $this->_isPaymentReviewRequired( - $payment - ) && $pendingReason != \Magento\Paypal\Model\Info::PAYMENTSTATUS_REVIEW; - } - - /** - * Check whether payment review is required - * - * @param \Magento\Payment\Model\Info $payment - * @return bool - */ - protected function _isPaymentReviewRequired(\Magento\Payment\Model\Info $payment) - { - return \Magento\Paypal\Model\Info::isPaymentReviewRequired($payment); - } - - /** - * Perform the payment review - * - * @param \Magento\Payment\Model\Info $payment - * @param string $action - * @return bool - */ - public function reviewPayment(\Magento\Payment\Model\Info $payment, $action) - { - $api = $this->getApi()->setTransactionId($payment->getLastTransId()); - - // check whether the review is still needed - $api->callGetTransactionDetails(); - $this->importPaymentInfo($api, $payment); - if (!$this->getInfo()->isPaymentReviewRequired($payment)) { - return false; - } - - // perform the review action - $api->setAction($action)->callManagePendingTransactionStatus(); - $api->callGetTransactionDetails(); - $this->importPaymentInfo($api, $payment); - return true; - } - - /** - * Fetch transaction details info - * - * @param \Magento\Payment\Model\Info $payment - * @param string $transactionId - * @return array - */ - public function fetchTransactionInfo(\Magento\Payment\Model\Info $payment, $transactionId) - { - $api = $this->getApi()->setTransactionId($transactionId)->setRawResponseNeeded(true); - $api->callGetTransactionDetails(); - $this->importPaymentInfo($api, $payment); - $data = $api->getRawSuccessResponseData(); - return $data ? $data : []; - } - - /** - * Import capture results to payment - * - * @param \Magento\Paypal\Model\Api\Nvp $api - * @param \Magento\Sales\Model\Order\Payment $payment - * @return void - */ - protected function _importCaptureResultToPayment($api, $payment) - { - $payment->setTransactionId($api->getTransactionId())->setIsTransactionClosed(false); - $this->importPaymentInfo($api, $payment); - } - - /** - * Import refund results to payment - * - * @param \Magento\Paypal\Model\Api\Nvp $api - * @param \Magento\Sales\Model\Order\Payment $payment - * @param bool $canRefundMore - * @return void - */ - protected function _importRefundResultToPayment($api, $payment, $canRefundMore) - { - $payment->setTransactionId( - $api->getRefundTransactionId() - )->setIsTransactionClosed( - 1 // refund initiated by merchant - )->setShouldCloseParentTransaction( - !$canRefundMore - ); - $this->importPaymentInfo($api, $payment); - } - - /** - * Parent transaction id getter - * - * @param \Magento\Framework\Object $payment - * @return string - */ - protected function _getParentTransactionId(\Magento\Framework\Object $payment) - { - return $payment->getParentTransactionId(); - } -} diff --git a/app/code/Magento/Paypal/Model/Report/Settlement.php b/app/code/Magento/Paypal/Model/Report/Settlement.php deleted file mode 100644 index 3a04078ae8214..0000000000000 --- a/app/code/Magento/Paypal/Model/Report/Settlement.php +++ /dev/null @@ -1,543 +0,0 @@ - [ - 'section_columns' => [ - '' => 0, - 'TransactionID' => 1, - 'InvoiceID' => 2, - 'PayPalReferenceID' => 3, - 'PayPalReferenceIDType' => 4, - 'TransactionEventCode' => 5, - 'TransactionInitiationDate' => 6, - 'TransactionCompletionDate' => 7, - 'TransactionDebitOrCredit' => 8, - 'GrossTransactionAmount' => 9, - 'GrossTransactionCurrency' => 10, - 'FeeDebitOrCredit' => 11, - 'FeeAmount' => 12, - 'FeeCurrency' => 13, - 'CustomField' => 14, - 'ConsumerID' => 15, - ], - 'rowmap' => [ - 'TransactionID' => 'transaction_id', - 'InvoiceID' => 'invoice_id', - 'PayPalReferenceID' => 'paypal_reference_id', - 'PayPalReferenceIDType' => 'paypal_reference_id_type', - 'TransactionEventCode' => 'transaction_event_code', - 'TransactionInitiationDate' => 'transaction_initiation_date', - 'TransactionCompletionDate' => 'transaction_completion_date', - 'TransactionDebitOrCredit' => 'transaction_debit_or_credit', - 'GrossTransactionAmount' => 'gross_transaction_amount', - 'GrossTransactionCurrency' => 'gross_transaction_currency', - 'FeeDebitOrCredit' => 'fee_debit_or_credit', - 'FeeAmount' => 'fee_amount', - 'FeeCurrency' => 'fee_currency', - 'CustomField' => 'custom_field', - 'ConsumerID' => 'consumer_id', - ], - ], - 'new' => [ - 'section_columns' => [ - '' => 0, - 'Transaction ID' => 1, - 'Invoice ID' => 2, - 'PayPal Reference ID' => 3, - 'PayPal Reference ID Type' => 4, - 'Transaction Event Code' => 5, - 'Transaction Initiation Date' => 6, - 'Transaction Completion Date' => 7, - 'Transaction Debit or Credit' => 8, - 'Gross Transaction Amount' => 9, - 'Gross Transaction Currency' => 10, - 'Fee Debit or Credit' => 11, - 'Fee Amount' => 12, - 'Fee Currency' => 13, - 'Custom Field' => 14, - 'Consumer ID' => 15, - 'Payment Tracking ID' => 16, - 'Store ID' => 17, - ], - 'rowmap' => [ - 'Transaction ID' => 'transaction_id', - 'Invoice ID' => 'invoice_id', - 'PayPal Reference ID' => 'paypal_reference_id', - 'PayPal Reference ID Type' => 'paypal_reference_id_type', - 'Transaction Event Code' => 'transaction_event_code', - 'Transaction Initiation Date' => 'transaction_initiation_date', - 'Transaction Completion Date' => 'transaction_completion_date', - 'Transaction Debit or Credit' => 'transaction_debit_or_credit', - 'Gross Transaction Amount' => 'gross_transaction_amount', - 'Gross Transaction Currency' => 'gross_transaction_currency', - 'Fee Debit or Credit' => 'fee_debit_or_credit', - 'Fee Amount' => 'fee_amount', - 'Fee Currency' => 'fee_currency', - 'Custom Field' => 'custom_field', - 'Consumer ID' => 'consumer_id', - 'Payment Tracking ID' => 'payment_tracking_id', - 'Store ID' => 'store_id', - ], - ], - ]; - - /** - * @var \Magento\Framework\Filesystem\Directory\WriteInterface - */ - protected $_tmpDirectory; - - /** - * @var \Magento\Store\Model\StoreManagerInterface - */ - protected $_storeManager; - - /** - * @var \Magento\Framework\App\Config\ScopeConfigInterface - */ - protected $_scopeConfig; - - /** - * @param \Magento\Framework\Model\Context $context - * @param \Magento\Framework\Registry $registry - * @param \Magento\Framework\Filesystem $filesystem - * @param \Magento\Store\Model\StoreManagerInterface $storeManager - * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig - * @param \Magento\Framework\Model\Resource\AbstractResource $resource - * @param \Magento\Framework\Data\Collection\Db $resourceCollection - * @param array $data - */ - public function __construct( - \Magento\Framework\Model\Context $context, - \Magento\Framework\Registry $registry, - \Magento\Framework\Filesystem $filesystem, - \Magento\Store\Model\StoreManagerInterface $storeManager, - \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, - \Magento\Framework\Model\Resource\AbstractResource $resource = null, - \Magento\Framework\Data\Collection\Db $resourceCollection = null, - array $data = [] - ) { - $this->_tmpDirectory = $filesystem->getDirectoryWrite(DirectoryList::SYS_TMP); - $this->_storeManager = $storeManager; - $this->_scopeConfig = $scopeConfig; - parent::__construct($context, $registry, $resource, $resourceCollection, $data); - } - - /** - * Initialize resource model - * - * @return void - */ - protected function _construct() - { - $this->_init('Magento\Paypal\Model\Resource\Report\Settlement'); - } - - /** - * Stop saving process if file with same report date, account ID and last modified date was already ferched - * - * @return \Magento\Framework\Model\AbstractModel - */ - public function beforeSave() - { - $this->_dataSaveAllowed = true; - if ($this->getId()) { - if ($this->getLastModified() == $this->getReportLastModified()) { - $this->_dataSaveAllowed = false; - } - } - $this->setLastModified($this->getReportLastModified()); - return parent::beforeSave(); - } - - /** - * Goes to specified host/path and fetches reports from there. - * Save reports to database. - * - * @param \Magento\Framework\Io\Sftp $connection - * @return int Number of report rows that were fetched and saved successfully - * @throws \Magento\Framework\Model\Exception - */ - public function fetchAndSave(\Magento\Framework\Io\Sftp $connection) - { - $fetched = 0; - $listing = $this->_filterReportsList($connection->rawls()); - foreach ($listing as $filename => $attributes) { - $localCsv = 'PayPal_STL_' . uniqid(\Magento\Framework\Math\Random::getRandomNumber()) . time() . '.csv'; - if ($connection->read($filename, $this->_tmpDirectory->getAbsolutePath($localCsv))) { - if (!$this->_tmpDirectory->isWritable($localCsv)) { - throw new \Magento\Framework\Model\Exception(__('We cannot create a target file for reading reports.')); - } - - $encoded = $this->_tmpDirectory->readFile($localCsv); - $csvFormat = 'new'; - - $fileEncoding = mb_detect_encoding($encoded); - - if (self::FILES_OUT_CHARSET != $fileEncoding) { - $decoded = @iconv($fileEncoding, self::FILES_OUT_CHARSET . '//IGNORE', $encoded); - $this->_tmpDirectory->writeFile($localCsv, $decoded); - $csvFormat = 'old'; - } - - // Set last modified date, this value will be overwritten during parsing - if (isset($attributes['mtime'])) { - $lastModified = new \Magento\Framework\Stdlib\DateTime\Date($attributes['mtime']); - $this->setReportLastModified( - $lastModified->toString(\Magento\Framework\Stdlib\DateTime::DATETIME_INTERNAL_FORMAT) - ); - } - - $this->setReportDate( - $this->_fileNameToDate($filename) - )->setFilename( - $filename - )->parseCsv( - $localCsv, - $csvFormat - ); - - if ($this->getAccountId()) { - $this->save(); - } - - if ($this->_dataSaveAllowed) { - $fetched += count($this->_rows); - } - // clean object and remove parsed file - $this->unsetData(); - $this->_tmpDirectory->delete($localCsv); - } - } - return $fetched; - } - - /** - * Connect to an SFTP server using specified configuration - * - * @param array $config - * @return \Magento\Framework\Io\Sftp - * @throws \InvalidArgumentException - */ - public static function createConnection(array $config) - { - if (!isset( - $config['hostname'] - ) || !isset( - $config['username'] - ) || !isset( - $config['password'] - ) || !isset( - $config['path'] - ) - ) { - throw new \InvalidArgumentException('Required config elements: hostname, username, password, path'); - } - $connection = new \Magento\Framework\Io\Sftp(); - $connection->open( - ['host' => $config['hostname'], 'username' => $config['username'], 'password' => $config['password']] - ); - $connection->cd($config['path']); - return $connection; - } - - /** - * Parse CSV file and collect report rows - * - * @param string $localCsv Path to CSV file - * @param string $format CSV format(column names) - * @return $this - */ - public function parseCsv($localCsv, $format = 'new') - { - $this->_rows = []; - - $sectionColumns = $this->_csvColumns[$format]['section_columns']; - $rowMap = $this->_csvColumns[$format]['rowmap']; - - $flippedSectionColumns = array_flip($sectionColumns); - $stream = $this->_tmpDirectory->openFile($localCsv); - while ($line = $stream->readCsv()) { - if (empty($line)) { - // The line was empty, so skip it. - continue; - } - $lineType = $line[0]; - switch ($lineType) { - case 'RH': - // Report header. - $lastModified = new \Magento\Framework\Stdlib\DateTime\Date($line[1]); - $this->setReportLastModified( - $lastModified->toString(\Magento\Framework\Stdlib\DateTime::DATETIME_INTERNAL_FORMAT) - ); - //$this->setAccountId($columns[2]); -- probably we'll just take that from the section header... - break; - case 'FH': - // File header. - // Nothing interesting here, move along - break; - case 'SH': - // Section header. - $this->setAccountId($line[3]); - $this->loadByAccountAndDate(); - break; - case 'CH': - // Section columns. - // In case ever the column order is changed, we will have the items recorded properly - // anyway. We have named, not numbered columns. - for ($i = 1; $i < count($line); $i++) { - $sectionColumns[$line[$i]] = $i; - } - $flippedSectionColumns = array_flip($sectionColumns); - break; - case 'SB': - // Section body. - $bodyItem = []; - for ($i = 1; $i < count($line); $i++) { - $bodyItem[$rowMap[$flippedSectionColumns[$i]]] = $line[$i]; - } - $this->_rows[] = $bodyItem; - break; - case 'SC': - // Section records count. - case 'RC': - // Report records count. - case 'SF': - // Section footer. - case 'FF': - // File footer. - case 'RF': - // Report footer. - // Nothing to see here, move along - break; - default: - break; - } - } - return $this; - } - - /** - * Load report by unique key (accoutn + report date) - * - * @return $this - */ - public function loadByAccountAndDate() - { - $this->getResource()->loadByAccountAndDate($this, $this->getAccountId(), $this->getReportDate()); - return $this; - } - - /** - * Return collected rows for further processing. - * - * @return array - */ - public function getRows() - { - return $this->_rows; - } - - /** - * Return name for row column - * - * @param string $field Field name in row model - * @return string - */ - public function getFieldLabel($field) - { - switch ($field) { - case 'report_date': - return __('Report Date'); - case 'account_id': - return __('Merchant Account'); - case 'transaction_id': - return __('Transaction ID'); - case 'invoice_id': - return __('Invoice ID'); - case 'paypal_reference_id': - return __('PayPal Reference ID'); - case 'paypal_reference_id_type': - return __('PayPal Reference ID Type'); - case 'transaction_event_code': - return __('Event Code'); - case 'transaction_event': - return __('Event'); - case 'transaction_initiation_date': - return __('Start Date'); - case 'transaction_completion_date': - return __('Finish Date'); - case 'transaction_debit_or_credit': - return __('Debit or Credit'); - case 'gross_transaction_amount': - return __('Gross Amount'); - case 'fee_debit_or_credit': - return __('Fee Debit or Credit'); - case 'fee_amount': - return __('Fee Amount'); - case 'custom_field': - return __('Custom'); - default: - return $field; - } - } - - /** - * Iterate through website configurations and collect all SFTP configurations - * Filter config values if necessary - * - * @param bool $automaticMode Whether to skip settings with disabled Automatic Fetching or not - * @return array - */ - public function getSftpCredentials($automaticMode = false) - { - $configs = []; - $uniques = []; - foreach ($this->_storeManager->getStores() as $store) { - /*@var $store \Magento\Store\Model\Store */ - $active = $this->_scopeConfig->isSetFlag( - 'paypal/fetch_reports/active', - \Magento\Store\Model\ScopeInterface::SCOPE_STORE, - $store - ); - if (!$active && $automaticMode) { - continue; - } - $cfg = [ - 'hostname' => $this->_scopeConfig->getValue( - 'paypal/fetch_reports/ftp_ip', - \Magento\Store\Model\ScopeInterface::SCOPE_STORE, - $store - ), - 'path' => $this->_scopeConfig->getValue( - 'paypal/fetch_reports/ftp_path', - \Magento\Store\Model\ScopeInterface::SCOPE_STORE, - $store - ), - 'username' => $this->_scopeConfig->getValue( - 'paypal/fetch_reports/ftp_login', - \Magento\Store\Model\ScopeInterface::SCOPE_STORE, - $store - ), - 'password' => $this->_scopeConfig->getValue( - 'paypal/fetch_reports/ftp_password', - \Magento\Store\Model\ScopeInterface::SCOPE_STORE, - $store - ), - 'sandbox' => $this->_scopeConfig->getValue( - 'paypal/fetch_reports/ftp_sandbox', - \Magento\Store\Model\ScopeInterface::SCOPE_STORE, - $store - ), - ]; - if (empty($cfg['username']) || empty($cfg['password'])) { - continue; - } - if (empty($cfg['hostname']) || $cfg['sandbox']) { - $cfg['hostname'] = $cfg['sandbox'] ? self::SANDBOX_REPORTS_HOSTNAME : self::REPORTS_HOSTNAME; - } - if (empty($cfg['path']) || $cfg['sandbox']) { - $cfg['path'] = self::REPORTS_PATH; - } - // avoid duplicates - if (in_array(serialize($cfg), $uniques)) { - continue; - } - $uniques[] = serialize($cfg); - $configs[] = $cfg; - } - return $configs; - } - - /** - * Converts a filename to date of report. - * - * @param string $filename - * @return string - */ - protected function _fileNameToDate($filename) - { - // Currently filenames look like STL-YYYYMMDD, so that is what we care about. - $dateSnippet = substr(basename($filename), 4, 8); - $result = substr($dateSnippet, 0, 4) . '-' . substr($dateSnippet, 4, 2) . '-' . substr($dateSnippet, 6, 2); - return $result; - } - - /** - * Filter SFTP file list by filename format - * - * @param array $list List of files as per $connection->rawls() - * @return array Trimmed down list of files - */ - protected function _filterReportsList($list) - { - $result = []; - $pattern = '/^STL-(\d{8,8})\.(\d{2,2})\.(.{3,3})\.CSV$/'; - foreach ($list as $filename => $data) { - if (preg_match($pattern, $filename)) { - $result[$filename] = $data; - } - } - return $result; - } -} diff --git a/app/code/Magento/Paypal/Model/Report/Settlement/Row.php b/app/code/Magento/Paypal/Model/Report/Settlement/Row.php deleted file mode 100644 index 3de0e748630b4..0000000000000 --- a/app/code/Magento/Paypal/Model/Report/Settlement/Row.php +++ /dev/null @@ -1,241 +0,0 @@ - - */ -class Row extends \Magento\Framework\Model\AbstractModel -{ - /** - * Assoc array event code => label - * - * @var array - */ - private $eventLabelsList = []; - - /** - * Cast amount relation - * - * @var array - */ - private $castAmountRelation = [ - 'fee_amount' => 'fee_debit_or_credit', - 'gross_transaction_amount' => 'transaction_debit_or_credit', - ]; - - /** - * Initialize resource model - * - * @return void - */ - protected function _construct() - { - $this->_init('Magento\Paypal\Model\Resource\Report\Settlement\Row'); - } - - /** - * Return description of Reference ID Type - * If no code specified, return full list of codes with their description - * - * @param string $code - * @return string - */ - public function getReferenceType($code) - { - $types = [ - 'ODR' => __('Order ID'), - 'PAP' => __('Preapproved Payment ID'), - 'TXN' => __('Transaction ID'), - 'SUB' => __('Subscription ID'), - ]; - return !empty($types[$code]) ? $types[$code] : $code; - } - - /** - * Get native description for transaction code - * - * @param string $code - * @return string - */ - public function getTransactionEvent($code) - { - $events = $this->getTransactionEvents(); - - return !empty($events[$code]) ? $events[$code] : $code; - } - - /** - * Return description of "Debit or Credit" value - * - * @param string $code - * @return string - */ - public function getDebitCreditText($code) - { - $options = ['CR' => __('Credit'), 'DR' => __('Debit')]; - - return !empty($options[$code]) ? $options[$code] : $code; - } - - /** - * Cast amounts of the specified keys - * - * PayPal settlement reports contain amounts in cents, hence the values need to be divided by 100 - * Also if the "credit" value is detected, it will be casted to negative amount - * - * @param string $key - * @return float|null - */ - public function getCastedAmount($key) - { - if (empty($this->castAmountRelation[$key])) { - return null; - } - if (empty($this->_data[$key]) || empty($this->_data[$this->castAmountRelation[$key]])) { - return null; - } - - $amount = $this->_data[$key] / 100; - if ('CR' == $this->_data[$this->castAmountRelation[$key]]) { - $amount = -1 * $amount; - } - return $amount; - } - - /** - * Get full list of codes with their description - * - * @return array - */ - public function getTransactionEvents() - { - if (empty($this->eventLabelsList)) { - $this->eventLabelsList = [ - 'T1502' => __('ACH Deposit (Hold for Dispute or Other Investigation)'), - 'T1104' => __('ACH Deposit (Reversal)'), - 'T0302' => __('ACH Funding for Funds Recovery from Account Balance'), - 'T1101' => __('ACH Withdrawal'), - 'T1106' => __('Account-to-Account Payment, initiated by PayPal'), - 'T0010' => __('Auction Payment other than through eBay'), - 'T0401' => __('AutoSweep'), - 'T1503' => __('Available Balance'), - 'T0803' => __('Balance Manager Account Bonus'), - 'T0806' => __('Bonus for first ACH Use'), - 'T1800' => __('Buyer Credit Payment'), - 'T1203' => __('Charge-off'), - 'T1201' => __('Chargeback'), - 'T0903' => __('Coupon Redemption'), - 'T0202' => __('Currency Conversion required to cover negative balance'), - 'T0801' => __('Debit Card Cash Back'), - 'T1102' => __('Debit Card Transaction'), - 'T0005' => __('Direct Payment API'), - 'T0303' => __('EFT Funding (German banking)'), - 'T0006' => __('Express Checkout APIs'), - 'T1108' => __('Fee Reversal'), - 'T0102' => __('Fee: Foreign ACH Withdrawal'), - 'T0104' => __('Fee: Mass Pay Request'), - 'T0101' => __('Fee: Web Site Payments Pro Account Monthly'), - 'T0103' => __('Fee: WorldLink Check Withdrawal'), - 'T1600' => __('Funding'), - 'T1300' => __('General (Authorization)'), - 'T1400' => __('General (Dividend)'), - 'T2000' => __('General (Funds Transfer from PayPal Account to Another)'), - 'T0700' => __('General (Purchase with a credit card)'), - 'T1900' => __('General Adjustment without businessrelated event'), - 'T0200' => __('General Currency Conversion'), - 'T0300' => __('General Funding of PayPal Account '), - 'T0900' => __('General Redemption'), - 'T0400' => __('General Withdrawal from PayPal Account'), - 'T1000' => __('General. Product no longer supported'), - 'T0500' => __('General: Use of PayPal account for purchasing as well as receiving payments'), - 'T0600' => __('General: Withdrawal from PayPal Account'), - 'T1700' => __('General: Withdrawal to Non-Bank Entity'), - 'T1200' => __('General: adjustment of a type not belonging to the other T12xx categories'), - 'T0800' => __('General: bonus of a type not belonging to the other T08xx categories'), - 'T9900' => __('General: event not yet categorized'), - 'T0100' => __('General: non-payment fee of a type not belonging to the other T01xx categories'), - 'T0000' => __('General: received payment of a type not belonging to the other T00xx categories'), - 'T1100' => __('General: reversal of a type not belonging to the other T11xx categories'), - 'T1500' => __('General: temporary hold of a type not belonging to the other T15xx categories'), - 'T0009' => __('Gift Certificate Payment: purchase of Gift Certificate'), - 'T0901' => __('Gift Certificate Redemption'), - 'T0503' => __('Hidden Virtual PayPal Debit Card Transaction'), - 'T1110' => __('Hold for Dispute Investigation'), - 'T1204' => __('Incentive'), - 'T0001' => __('Mass Pay Payment'), - 'T0802' => __('Merchant Referral Bonus'), - 'T0011' => __('Mobile Payment (made via a mobile phone)'), - 'T0701' => __('Negative Balance'), - 'T1501' => __('Open Authorization'), - 'T0301' => __('PayPal Balance Manager function of PayPal account'), - 'T0804' => __('PayPal Buyer Warranty Bonus'), - 'T0504' => __('PayPal Debit Card Cash Advance'), - 'T0502' => __('PayPal Debit Card Withdrawal from ATM'), - 'T0805' => __('PayPal Protection Bonus'), - 'T1107' => __('Payment Refund initiated by merchant'), - 'T0902' => __('Points Incentive Redemption'), - 'T0008' => __('Postage Payment to either USPS or UPS'), - 'T0003' => __('Preapproved Payment (BillUser API, either sent or received'), - 'T1301' => __('Reauthorization'), - 'T1205' => __('Reimbursement of Chargeback'), - 'T1202' => __('Reversal'), - 'T1105' => __('Reversal of General Account Hold'), - 'T1103' => __('Reversal of Points Usage'), - 'T1111' => __('Reversal of hold for Dispute Investigation'), - 'T0904' => __('Reward Voucher Redemption'), - 'T2001' => __('Settlement Consolidation'), - 'T0002' => __('Subscription Payment, either payment sent or payment received'), - 'T0201' => __('User-initiated Currency Conversion'), - 'T0501' => __('Virtual PayPal Debit Card Transaction'), - 'T0012' => __('Virtual Terminal Payment'), - 'T1302' => __('Void'), - 'T0007' => __('Website Payments Standard Payment'), - 'T1701' => __('WorldLink Withdrawal'), - 'T0004' => __('eBay Auction Payment'), - ]; - } - - return $this->eventLabelsList; - } -} diff --git a/app/code/Magento/Paypal/Model/Resource/Billing/Agreement.php b/app/code/Magento/Paypal/Model/Resource/Billing/Agreement.php deleted file mode 100644 index 7d189358c3ffa..0000000000000 --- a/app/code/Magento/Paypal/Model/Resource/Billing/Agreement.php +++ /dev/null @@ -1,58 +0,0 @@ -_init('paypal_billing_agreement', 'agreement_id'); - } - - /** - * Add order relation to billing agreement - * - * @param int $agreementId - * @param int $orderId - * @return $this - */ - public function addOrderRelation($agreementId, $orderId) - { - $this->_getWriteAdapter()->insert( - $this->getTable('paypal_billing_agreement_order'), - ['agreement_id' => $agreementId, 'order_id' => $orderId] - ); - return $this; - } - - /** - * Add billing agreement filter on orders collection - * - * @param \Magento\Sales\Model\Resource\Order\Collection $orderCollection - * @param string|int|array $agreementIds - * @return $this - */ - public function addOrdersFilter(\Magento\Sales\Model\Resource\Order\Collection $orderCollection, $agreementIds) - { - $agreementIds = is_array($agreementIds) ? $agreementIds : [$agreementIds]; - $orderCollection->getSelect()->joinInner( - ['pbao' => $this->getTable('paypal_billing_agreement_order')], - 'main_table.entity_id = pbao.order_id', - [] - )->where( - 'pbao.agreement_id IN(?)', - $agreementIds - ); - return $this; - } -} diff --git a/app/code/Magento/Paypal/Model/Resource/Billing/Agreement/Collection.php b/app/code/Magento/Paypal/Model/Resource/Billing/Agreement/Collection.php deleted file mode 100644 index d3d2fc6ed5834..0000000000000 --- a/app/code/Magento/Paypal/Model/Resource/Billing/Agreement/Collection.php +++ /dev/null @@ -1,125 +0,0 @@ - [ - 'customer_email' => 'ce.email', - 'customer_firstname' => 'firstname.value', - 'customer_lastname' => 'lastname.value', - 'agreement_created_at' => 'main_table.created_at', - 'agreement_updated_at' => 'main_table.updated_at', - ], - ]; - - /** - * @var \Magento\Customer\Model\Resource\Customer - */ - protected $_customerResource; - - /** - * @var \Magento\Eav\Helper\Data - */ - protected $_eavHelper; - - /** - * @param \Magento\Core\Model\EntityFactory $entityFactory - * @param \Magento\Framework\Logger $logger - * @param \Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy - * @param \Magento\Framework\Event\ManagerInterface $eventManager - * @param \Magento\Customer\Model\Resource\Customer $customerResource - * @param \Magento\Eav\Helper\Data $eavHelper - * @param mixed $connection - * @param \Magento\Framework\Model\Resource\Db\AbstractDb $resource - */ - public function __construct( - \Magento\Core\Model\EntityFactory $entityFactory, - \Magento\Framework\Logger $logger, - \Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, - \Magento\Framework\Event\ManagerInterface $eventManager, - \Magento\Customer\Model\Resource\Customer $customerResource, - \Magento\Eav\Helper\Data $eavHelper, - $connection = null, - \Magento\Framework\Model\Resource\Db\AbstractDb $resource = null - ) { - parent::__construct($entityFactory, $logger, $fetchStrategy, $eventManager, $connection, $resource); - $this->_eavHelper = $eavHelper; - $this->_customerResource = $customerResource; - } - - /** - * Collection initialization - * - * @return void - */ - protected function _construct() - { - $this->_init('Magento\Paypal\Model\Billing\Agreement', 'Magento\Paypal\Model\Resource\Billing\Agreement'); - } - - /** - * Add customer details(email, firstname, lastname) to select - * - * @return $this - */ - public function addCustomerDetails() - { - $select = $this->getSelect()->joinInner( - ['ce' => $this->getTable('customer_entity')], - 'ce.entity_id = main_table.customer_id', - ['customer_email' => 'email'] - ); - - $adapter = $this->getConnection(); - $firstNameMetadata = $this->_eavHelper->getAttributeMetadata( - \Magento\Customer\Api\CustomerMetadataInterface::ENTITY_TYPE_CUSTOMER, - 'firstname' - ); - $joinExpr = 'firstname.entity_id = main_table.customer_id AND ' . $adapter->quoteInto( - 'firstname.entity_type_id = ?', - $firstNameMetadata['entity_type_id'] - ) . ' AND ' . $adapter->quoteInto( - 'firstname.attribute_id = ?', - $firstNameMetadata['attribute_id'] - ); - - $select->joinLeft( - ['firstname' => $firstNameMetadata['attribute_table']], - $joinExpr, - ['customer_firstname' => 'value'] - ); - - $lastNameMetadata = $this->_eavHelper->getAttributeMetadata( - \Magento\Customer\Api\CustomerMetadataInterface::ENTITY_TYPE_CUSTOMER, - 'lastname' - ); - $joinExpr = 'lastname.entity_id = main_table.customer_id AND ' . $adapter->quoteInto( - 'lastname.entity_type_id = ?', - $lastNameMetadata['entity_type_id'] - ) . ' AND ' . $adapter->quoteInto( - 'lastname.attribute_id = ?', - $lastNameMetadata['attribute_id'] - ); - - $select->joinLeft( - ['lastname' => $lastNameMetadata['attribute_table']], - $joinExpr, - ['customer_lastname' => 'value'] - ); - return $this; - } -} diff --git a/app/code/Magento/Paypal/Model/Resource/Cert.php b/app/code/Magento/Paypal/Model/Resource/Cert.php deleted file mode 100644 index 6cd934d7ce5a1..0000000000000 --- a/app/code/Magento/Paypal/Model/Resource/Cert.php +++ /dev/null @@ -1,90 +0,0 @@ -_coreDate = $coreDate; - $this->dateTime = $dateTime; - parent::__construct($resource); - } - - /** - * Initialize connection - * - * @return void - */ - protected function _construct() - { - $this->_init('paypal_cert', 'cert_id'); - } - - /** - * Set date of last update - * - * @param \Magento\Framework\Model\AbstractModel $object - * @return \Magento\Framework\Model\Resource\Db\AbstractDb - */ - protected function _beforeSave(\Magento\Framework\Model\AbstractModel $object) - { - $object->setUpdatedAt($this->dateTime->formatDate($this->_coreDate->gmtDate())); - return parent::_beforeSave($object); - } - - /** - * Load model by website id - * - * @param \Magento\Paypal\Model\Cert $object - * @param bool $strictLoad - * @return \Magento\Paypal\Model\Cert - */ - public function loadByWebsite($object, $strictLoad = true) - { - $adapter = $this->_getReadAdapter(); - $select = $adapter->select()->from(['main_table' => $this->getMainTable()]); - - if ($strictLoad) { - $select->where('main_table.website_id =?', $object->getWebsiteId()); - } else { - $select->where( - 'main_table.website_id IN(0, ?)', - $object->getWebsiteId() - )->order( - 'main_table.website_id DESC' - )->limit( - 1 - ); - } - - $data = $adapter->fetchRow($select); - if ($data) { - $object->setData($data); - } - return $object; - } -} diff --git a/app/code/Magento/Paypal/Model/Resource/Report/Settlement.php b/app/code/Magento/Paypal/Model/Resource/Report/Settlement.php deleted file mode 100644 index cbf2c6ff2157e..0000000000000 --- a/app/code/Magento/Paypal/Model/Resource/Report/Settlement.php +++ /dev/null @@ -1,124 +0,0 @@ -_coreDate = $coreDate; - parent::__construct($resource); - } - - /** - * Init main table - * - * @return void - */ - protected function _construct() - { - $this->_init('paypal_settlement_report', 'report_id'); - $this->_rowsTable = $this->getTable('paypal_settlement_report_row'); - } - - /** - * Save report rows collected in settlement model - * - * @param \Magento\Framework\Model\AbstractModel|\Magento\Paypal\Model\Report\Settlement $object - * @return $this - */ - protected function _afterSave(\Magento\Framework\Model\AbstractModel $object) - { - $rows = $object->getRows(); - if (is_array($rows)) { - $adapter = $this->_getWriteAdapter(); - $reportId = (int)$object->getId(); - try { - $adapter->beginTransaction(); - if ($reportId) { - $adapter->delete($this->_rowsTable, ['report_id = ?' => $reportId]); - } - - foreach (array_keys($rows) as $key) { - /** - * Converting dates - */ - $completionDate = new \Magento\Framework\Stdlib\DateTime\Date($rows[$key]['transaction_completion_date']); - $rows[$key]['transaction_completion_date'] = $this->_coreDate->date( - null, - $completionDate->getTimestamp() - ); - $initiationDate = new \Magento\Framework\Stdlib\DateTime\Date($rows[$key]['transaction_initiation_date']); - $rows[$key]['transaction_initiation_date'] = $this->_coreDate->date( - null, - $initiationDate->getTimestamp() - ); - /* - * Converting numeric - */ - $rows[$key]['fee_amount'] = (double)$rows[$key]['fee_amount']; - /* - * Setting reportId - */ - $rows[$key]['report_id'] = $reportId; - } - if (!empty($rows)) { - $adapter->insertMultiple($this->_rowsTable, $rows); - } - $adapter->commit(); - } catch (\Exception $e) { - $adapter->rollback(); - } - } - - return $this; - } - - /** - * Check if report with same account and report date already fetched - * - * @param \Magento\Paypal\Model\Report\Settlement $report - * @param string $accountId - * @param string $reportDate - * @return $this - */ - public function loadByAccountAndDate(\Magento\Paypal\Model\Report\Settlement $report, $accountId, $reportDate) - { - $adapter = $this->_getReadAdapter(); - $select = $adapter->select()->from( - $this->getMainTable() - )->where( - 'account_id = :account_id' - )->where( - 'report_date = :report_date' - ); - - $data = $adapter->fetchRow($select, [':account_id' => $accountId, ':report_date' => $reportDate]); - if ($data) { - $report->addData($data); - } - - return $this; - } -} diff --git a/app/code/Magento/Paypal/Model/Resource/Report/Settlement/Options/TransactionEvents.php b/app/code/Magento/Paypal/Model/Resource/Report/Settlement/Options/TransactionEvents.php deleted file mode 100644 index 4fb5a3b4fbf09..0000000000000 --- a/app/code/Magento/Paypal/Model/Resource/Report/Settlement/Options/TransactionEvents.php +++ /dev/null @@ -1,34 +0,0 @@ - - */ -class TransactionEvents implements \Magento\Framework\Option\ArrayInterface -{ - /** - * @var \Magento\Paypal\Model\Report\Settlement\Row - */ - protected $_model; - - /** - * @param \Magento\Paypal\Model\Report\Settlement\Row $model - */ - public function __construct(\Magento\Paypal\Model\Report\Settlement\Row $model) - { - $this->_model = $model; - } - - /** - * {@inheritdoc} - */ - public function toOptionArray() - { - return $this->_model->getTransactionEvents(); - } -} diff --git a/app/code/Magento/Paypal/Model/Resource/Report/Settlement/Row.php b/app/code/Magento/Paypal/Model/Resource/Report/Settlement/Row.php deleted file mode 100644 index 9d40bb6f6ef93..0000000000000 --- a/app/code/Magento/Paypal/Model/Resource/Report/Settlement/Row.php +++ /dev/null @@ -1,24 +0,0 @@ - - */ -class Row extends \Magento\Framework\Model\Resource\Db\AbstractDb -{ - /** - * Resource model initialization. - * Set main entity table name and primary key field name. - * - * @return void - */ - protected function _construct() - { - $this->_init('paypal_settlement_report_row', 'row_id'); - } -} diff --git a/app/code/Magento/Paypal/Model/Resource/Report/Settlement/Row/Collection.php b/app/code/Magento/Paypal/Model/Resource/Report/Settlement/Row/Collection.php deleted file mode 100644 index 4aa0baf877d29..0000000000000 --- a/app/code/Magento/Paypal/Model/Resource/Report/Settlement/Row/Collection.php +++ /dev/null @@ -1,55 +0,0 @@ - - */ -namespace Magento\Paypal\Model\Resource\Report\Settlement\Row; - -class Collection extends \Magento\Framework\Model\Resource\Db\Collection\AbstractCollection -{ - /** - * Resource initializing - * - * @return void - */ - protected function _construct() - { - $this->_init( - 'Magento\Paypal\Model\Report\Settlement\Row', - 'Magento\Paypal\Model\Resource\Report\Settlement\Row' - ); - } - - /** - * Join reports info table - * - * @return $this - */ - protected function _initSelect() - { - parent::_initSelect(); - $this->getSelect()->join( - ['report' => $this->getTable('paypal_settlement_report')], - 'report.report_id = main_table.report_id', - ['report.account_id', 'report.report_date'] - ); - return $this; - } - - /** - * Filter items collection by account ID - * - * @param string $accountId - * @return $this - */ - public function addAccountFilter($accountId) - { - $this->getSelect()->where('report.account_id = ?', $accountId); - return $this; - } -} diff --git a/app/code/Magento/Paypal/Model/Standard.php b/app/code/Magento/Paypal/Model/Standard.php deleted file mode 100644 index 2c9141143796d..0000000000000 --- a/app/code/Magento/Paypal/Model/Standard.php +++ /dev/null @@ -1,312 +0,0 @@ -_paypalSession = $paypalSession; - $this->_checkoutSession = $checkoutSession; - $this->_urlBuilder = $urlBuilder; - $this->_storeManager = $storeManager; - $this->_orderFactory = $orderFactory; - $this->_apiStandardFactory = $apiStandardFactory; - $this->_cartFactory = $cartFactory; - $this->_configFactory = $configFactory; - parent::__construct($eventManager, $paymentData, $scopeConfig, $logAdapterFactory, $data); - } - - /** - * Whether method is available for specified currency - * - * @param string $currencyCode - * @return bool - */ - public function canUseForCurrency($currencyCode) - { - return $this->getConfig()->isCurrencyCodeSupported($currencyCode); - } - - /** - * Get paypal session namespace - * - * @return \Magento\Framework\Session\Generic - */ - public function getSession() - { - return $this->_paypalSession; - } - - /** - * Get checkout session namespace - * - * @return \Magento\Checkout\Model\Session - */ - public function getCheckout() - { - return $this->_checkoutSession; - } - - /** - * Get current quote - * - * @return \Magento\Sales\Model\Quote - */ - public function getQuote() - { - return $this->getCheckout()->getQuote(); - } - - /** - * Create main block for standard form - * - * @param string $name - * @return \Magento\Framework\View\Element\AbstractBlock - */ - public function createFormBlock($name) - { - $block = $this->getLayout()->createBlock( - 'Magento\Paypal\Block\Standard\Form', - $name - )->setMethod( - 'paypal_standard' - )->setPayment( - $this->getPayment() - )->setTemplate( - 'standard/form.phtml' - ); - - return $block; - } - - /** - * Return Order place redirect url - * - * @return string - */ - public function getOrderPlaceRedirectUrl() - { - return $this->_urlBuilder->getUrl('paypal/standard/redirect', ['_secure' => true]); - } - - /** - * Return form field array - * - * @return array - */ - public function getStandardCheckoutFormFields() - { - $orderIncrementId = $this->getCheckout()->getLastRealOrderId(); - $order = $this->_orderFactory->create()->loadByIncrementId($orderIncrementId); - /* @var $api \Magento\Paypal\Model\Api\Standard */ - $api = $this->_apiStandardFactory->create()->setConfigObject($this->getConfig()); - $api->setOrderId( - $orderIncrementId - )->setCurrencyCode($order->getBaseCurrencyCode()) - //->setPaymentAction() - ->setOrder( - $order - )->setNotifyUrl( - $this->_urlBuilder->getUrl('paypal/ipn/') - )->setReturnUrl( - $this->_urlBuilder->getUrl('paypal/standard/success') - )->setCancelUrl( - $this->_urlBuilder->getUrl('paypal/standard/cancel') - ); - - // export address - $isOrderVirtual = $order->getIsVirtual(); - $address = $isOrderVirtual ? $order->getBillingAddress() : $order->getShippingAddress(); - if ($isOrderVirtual) { - $api->setNoShipping(true); - } elseif ($address->validate()) { - $api->setAddress($address); - } - - // add cart totals and line items - $cart = $this->_cartFactory->create(['salesModel' => $order]); - $api->setPaypalCart($cart)->setIsLineItemsEnabled($this->_config->getConfigValue('lineItemsEnabled')); - $api->setCartSummary($this->_getAggregatedCartSummary()); - $api->setLocale($api->getLocaleCode()); - $result = $api->getStandardCheckoutRequest(); - return $result; - } - - /** - * Instantiate state and set it to state object - * - * @param string $paymentAction - * @param object $stateObject - * @return void - */ - public function initialize($paymentAction, $stateObject) - { - $state = \Magento\Sales\Model\Order::STATE_PENDING_PAYMENT; - $stateObject->setState($state); - $stateObject->setStatus('pending_payment'); - $stateObject->setIsNotified(false); - } - - /** - * Config instance getter - * @return \Magento\Paypal\Model\Config - */ - public function getConfig() - { - if (null === $this->_config) { - $params = [$this->_code]; - $store = $this->getStore(); - if ($store) { - $params[] = is_object($store) ? $store->getId() : $store; - } - $this->_config = $this->_configFactory->create('Magento\Paypal\Model\Config', ['params' => $params]); - } - return $this->_config; - } - - /** - * Check whether payment method can be used - * @param \Magento\Sales\Model\Quote|null $quote - * @return bool - */ - public function isAvailable($quote = null) - { - if (parent::isAvailable($quote) && $this->getConfig()->isMethodAvailable()) { - return true; - } - return false; - } - - /** - * Custom getter for payment configuration - * - * @param string $field - * @param int|null $storeId - * @return mixed - */ - public function getConfigData($field, $storeId = null) - { - return $this->getConfig()->getConfigValue($field); - } - - /** - * Aggregated cart summary label getter - * - * @return string - */ - private function _getAggregatedCartSummary() - { - if ($this->_config->getConfigValue('lineItemsSummary')) { - return $this->_config->getConfigValue('lineItemsSummary'); - } - return $this->_storeManager->getStore($this->getStore())->getFrontendName(); - } -} diff --git a/app/code/Magento/Paypal/Model/System/Config/Backend/Cert.php b/app/code/Magento/Paypal/Model/System/Config/Backend/Cert.php deleted file mode 100644 index 664b1b956e65b..0000000000000 --- a/app/code/Magento/Paypal/Model/System/Config/Backend/Cert.php +++ /dev/null @@ -1,99 +0,0 @@ -_certFactory = $certFactory; - $this->_encryptor = $encryptor; - $this->_tmpDirectory = $filesystem->getDirectoryRead(DirectoryList::SYS_TMP); - parent::__construct($context, $registry, $config, $resource, $resourceCollection, $data); - } - - /** - * Process additional data before save config - * - * @return $this - * @throws \Magento\Framework\Model\Exception - */ - public function beforeSave() - { - $value = $this->getValue(); - if (is_array($value) && !empty($value['delete'])) { - $this->setValue(''); - $this->_certFactory->create()->loadByWebsite($this->getScopeId())->delete(); - } - - if (!isset($_FILES['groups']['tmp_name'][$this->getGroupId()]['fields'][$this->getField()]['value'])) { - return $this; - } - $tmpPath = $this->_tmpDirectory->getRelativePath( - $_FILES['groups']['tmp_name'][$this->getGroupId()]['fields'][$this->getField()]['value'] - ); - if ($tmpPath && $this->_tmpDirectory->isExist($tmpPath)) { - if (!$this->_tmpDirectory->stat($tmpPath)['size']) { - throw new \Magento\Framework\Model\Exception(__('The PayPal certificate file is empty.')); - } - $this->setValue($_FILES['groups']['name'][$this->getGroupId()]['fields'][$this->getField()]['value']); - $content = $this->_encryptor->encrypt($this->_tmpDirectory->readFile($tmpPath)); - $this->_certFactory->create()->loadByWebsite($this->getScopeId())->setContent($content)->save(); - } - return $this; - } - - /** - * Process object after delete data - * - * @return $this - */ - public function afterDelete() - { - $this->_certFactory->create()->loadByWebsite($this->getScopeId())->delete(); - return $this; - } -} diff --git a/app/code/Magento/Paypal/Model/System/Config/Backend/Cron.php b/app/code/Magento/Paypal/Model/System/Config/Backend/Cron.php deleted file mode 100644 index 06ae266d17baa..0000000000000 --- a/app/code/Magento/Paypal/Model/System/Config/Backend/Cron.php +++ /dev/null @@ -1,69 +0,0 @@ -_configValueFactory = $configValueFactory; - parent::__construct($context, $registry, $config, $resource, $resourceCollection, $data); - } - - /** - * Cron settings after save - * - * @return $this - */ - public function afterSave() - { - $cronExprString = ''; - $time = explode( - ',', - $this->_configValueFactory->create()->load('paypal/fetch_reports/time', 'path')->getValue() - ); - - if ($this->_configValueFactory->create()->load('paypal/fetch_reports/active', 'path')->getValue()) { - $interval = $this->_configValueFactory->create()->load(self::CRON_MODEL_PATH_INTERVAL, 'path')->getValue(); - $cronExprString = "{$time[1]} {$time[0]} */{$interval} * *"; - } - - $this->_configValueFactory->create()->load( - self::CRON_STRING_PATH, - 'path' - )->setValue( - $cronExprString - )->setPath( - self::CRON_STRING_PATH - )->save(); - - return parent::afterSave(); - } -} diff --git a/app/code/Magento/Paypal/Model/System/Config/Backend/MerchantCountry.php b/app/code/Magento/Paypal/Model/System/Config/Backend/MerchantCountry.php deleted file mode 100644 index fd15e4f8ff78a..0000000000000 --- a/app/code/Magento/Paypal/Model/System/Config/Backend/MerchantCountry.php +++ /dev/null @@ -1,70 +0,0 @@ -_coreData = $coreData; - parent::__construct($context, $registry, $config, $resource, $resourceCollection, $data); - $this->_storeManager = $storeManager; - } - - /** - * Substitute empty value with Default country. - * - * @return void - */ - protected function _afterLoad() - { - $value = (string)$this->getValue(); - if (empty($value)) { - if ($this->getWebsite()) { - $defaultCountry = $this->_storeManager->getWebsite( - $this->getWebsite() - )->getConfig( - \Magento\Core\Helper\Data::XML_PATH_DEFAULT_COUNTRY - ); - } else { - $defaultCountry = $this->_coreData->getDefaultCountry($this->getStore()); - } - $this->setValue($defaultCountry); - } - } -} diff --git a/app/code/Magento/Paypal/Model/System/Config/Source/AuthorizationAmounts.php b/app/code/Magento/Paypal/Model/System/Config/Source/AuthorizationAmounts.php deleted file mode 100644 index 41d0fd6d98f8c..0000000000000 --- a/app/code/Magento/Paypal/Model/System/Config/Source/AuthorizationAmounts.php +++ /dev/null @@ -1,22 +0,0 @@ - - */ -class AuthorizationAmounts implements \Magento\Framework\Option\ArrayInterface -{ - /** - * {@inheritdoc} - */ - public function toOptionArray() - { - return []; - } -} diff --git a/app/code/Magento/Paypal/Model/System/Config/Source/BmlPosition.php b/app/code/Magento/Paypal/Model/System/Config/Source/BmlPosition.php deleted file mode 100644 index 45dfa6b3aa7f3..0000000000000 --- a/app/code/Magento/Paypal/Model/System/Config/Source/BmlPosition.php +++ /dev/null @@ -1,61 +0,0 @@ - __('Header (center)'), - '1' => __('Sidebar (right)') - ]; - } - - /** - * Bml positions source getter for Catalog Category Page - * - * @return array - */ - public function getBmlPositionsCCP() - { - return [ - '0' => __('Header (center)'), - '1' => __('Sidebar (right)') - ]; - } - - /** - * Bml positions source getter for Catalog Product Page - * - * @return array - */ - public function getBmlPositionsCPP() - { - return [ - '0' => __('Header (center)'), - '1' => __('Near Bill Me Later checkout button') - ]; - } - - /** - * Bml positions source getter for Checkout Cart Page - * - * @return array - */ - public function getBmlPositionsCheckout() - { - return [ - '0' => __('Header (center)'), - '1' => __('Near Bill Me Later checkout button') - ]; - } -} diff --git a/app/code/Magento/Paypal/Model/System/Config/Source/BmlSize.php b/app/code/Magento/Paypal/Model/System/Config/Source/BmlSize.php deleted file mode 100644 index 0adaeffe6c7b8..0000000000000 --- a/app/code/Magento/Paypal/Model/System/Config/Source/BmlSize.php +++ /dev/null @@ -1,144 +0,0 @@ - '190 x 100', - '234x60' => '234 x 60', - '300x50' => '300 x 50', - '468x60' => '468 x 60', - '728x90' => '728 x 90', - '800x66' => '800 x 66' - ]; - } - - /** - * Options getter for Home Page and position Sidebar (right) - * - * @return array - */ - public function getBmlSizeHPS() - { - return [ - '120x90' => '120 x 90', - '190x100' => '190 x 100', - '234x60' => '234 x 60', - '120x240' => '120 x 240', - '120x600' => '120 x 600', - '234x400' => '234 x 400', - '250x250' => '250 x 250' - ]; - } - - /** - * Options getter for Catalog Category Page and position Center - * - * @return array - */ - public function getBmlSizeCCPC() - { - return [ - '190x100' => '190 x 100', - '234x60' => '234 x 60', - '300x50' => '300 x 50', - '468x60' => '468 x 60', - '728x90' => '728 x 90', - '800x66' => '800 x 66' - ]; - } - - /** - * Options getter for Catalog Category Page and position Sidebar (right) - * - * @return array - */ - public function getBmlSizeCCPS() - { - return [ - '120x90' => '120 x 90', - '190x100' => '190 x 100', - '234x60' => '234 x 60', - '120x240' => '120 x 240', - '120x600' => '120 x 600', - '234x400' => '234 x 400', - '250x250' => '250 x 250' - ]; - } - - /** - * Options getter for Catalog Product Page and position Center - * - * @return array - */ - public function getBmlSizeCPPC() - { - return [ - '190x100' => '190 x 100', - '234x60' => '234 x 60', - '300x50' => '300 x 50', - '468x60' => '468 x 60', - '728x90' => '728 x 90', - '800x66' => '800 x 66' - ]; - } - - /** - * Options getter for Catalog Product Page and position Near Bill Me Later checkout button - * - * @return array - */ - public function getBmlSizeCPPN() - { - return [ - '120x90' => '120 x 90', - '190x100' => '190 x 100', - '234x60' => '234 x 60', - '120x240' => '120 x 240', - '120x600' => '120 x 600', - '234x400' => '234 x 400', - '250x250' => '250 x 250' - ]; - } - - /** - * Options getter for Checkout Cart Page and position Center - * - * @return array - */ - public function getBmlSizeCheckoutC() - { - return [ - '234x60' => '234 x 60', - '300x50' => '300 x 50', - '468x60' => '468 x 60', - '728x90' => '728 x 90', - '800x66' => '800 x 66' - ]; - } - - /** - * Options getter for Checkout Cart Page and position Near Bill Me Later checkout button - * - * @return array - */ - public function getBmlSizeCheckoutN() - { - return [ - '234x60' => '234 x 60', - '300x50' => '300 x 50', - '468x60' => '468 x 60' - ]; - } -} diff --git a/app/code/Magento/Paypal/Model/System/Config/Source/BuyerCountry.php b/app/code/Magento/Paypal/Model/System/Config/Source/BuyerCountry.php deleted file mode 100644 index d675e46dac3ff..0000000000000 --- a/app/code/Magento/Paypal/Model/System/Config/Source/BuyerCountry.php +++ /dev/null @@ -1,49 +0,0 @@ -_configFactory = $configFactory; - $this->_countryCollectionFactory = $countryCollectionFactory; - } - - /** - * {@inheritdoc} - */ - public function toOptionArray($isMultiselect = false) - { - $supported = $this->_configFactory->create()->getSupportedBuyerCountryCodes(); - $options = $this->_countryCollectionFactory->create()->addCountryCodeFilter( - $supported, - 'iso2' - )->loadData()->toOptionArray( - $isMultiselect ? false : __('--Please Select--') - ); - - return $options; - } -} diff --git a/app/code/Magento/Paypal/Model/System/Config/Source/FetchingSchedule.php b/app/code/Magento/Paypal/Model/System/Config/Source/FetchingSchedule.php deleted file mode 100644 index 0a84d54269f96..0000000000000 --- a/app/code/Magento/Paypal/Model/System/Config/Source/FetchingSchedule.php +++ /dev/null @@ -1,27 +0,0 @@ - __("Daily"), - 3 => __("Every 3 days"), - 7 => __("Every 7 days"), - 10 => __("Every 10 days"), - 14 => __("Every 14 days"), - 30 => __("Every 30 days"), - 40 => __("Every 40 days") - ]; - } -} diff --git a/app/code/Magento/Paypal/Model/System/Config/Source/Logo.php b/app/code/Magento/Paypal/Model/System/Config/Source/Logo.php deleted file mode 100644 index 01028113c6cbb..0000000000000 --- a/app/code/Magento/Paypal/Model/System/Config/Source/Logo.php +++ /dev/null @@ -1,34 +0,0 @@ -_configFactory = $configFactory; - } - - /** - * {@inheritdoc} - */ - public function toOptionArray() - { - $result = ['' => __('No Logo')]; - $result += $this->_configFactory->create()->getAdditionalOptionsLogoTypes(); - return $result; - } -} diff --git a/app/code/Magento/Paypal/Model/System/Config/Source/MerchantCountry.php b/app/code/Magento/Paypal/Model/System/Config/Source/MerchantCountry.php deleted file mode 100644 index de831f1bce738..0000000000000 --- a/app/code/Magento/Paypal/Model/System/Config/Source/MerchantCountry.php +++ /dev/null @@ -1,49 +0,0 @@ -_configFactory = $configFactory; - $this->_countryCollectionFactory = $countryCollectionFactory; - } - - /** - * {@inheritdoc} - */ - public function toOptionArray($isMultiselect = false) - { - $supported = $this->_configFactory->create()->getSupportedMerchantCountryCodes(); - $options = $this->_countryCollectionFactory->create()->addCountryCodeFilter( - $supported, - 'iso2' - )->loadData()->toOptionArray( - $isMultiselect ? false : __('--Please Select--') - ); - - return $options; - } -} diff --git a/app/code/Magento/Paypal/Model/System/Config/Source/PaymentActions.php b/app/code/Magento/Paypal/Model/System/Config/Source/PaymentActions.php deleted file mode 100644 index a1a2e2ed9cb6c..0000000000000 --- a/app/code/Magento/Paypal/Model/System/Config/Source/PaymentActions.php +++ /dev/null @@ -1,32 +0,0 @@ -_configFactory = $configFactory; - } - - /** - * {@inheritdoc} - */ - public function toOptionArray() - { - return $this->_configFactory->create()->getPaymentActions(); - } -} diff --git a/app/code/Magento/Paypal/Model/System/Config/Source/PaymentActions/Express.php b/app/code/Magento/Paypal/Model/System/Config/Source/PaymentActions/Express.php deleted file mode 100644 index 7c5b1a92c3c1f..0000000000000 --- a/app/code/Magento/Paypal/Model/System/Config/Source/PaymentActions/Express.php +++ /dev/null @@ -1,35 +0,0 @@ -_configFactory = $configFactory; - } - - /** - * {@inheritdoc} - */ - public function toOptionArray() - { - /** @var \Magento\Paypal\Model\Config $configModel */ - $configModel = $this->_configFactory->create(); - $configModel->setMethod(\Magento\Paypal\Model\Config::METHOD_WPP_EXPRESS); - return $configModel->getPaymentActions(); - } -} diff --git a/app/code/Magento/Paypal/Model/System/Config/Source/RequireBillingAddress.php b/app/code/Magento/Paypal/Model/System/Config/Source/RequireBillingAddress.php deleted file mode 100644 index b2b843f11ada5..0000000000000 --- a/app/code/Magento/Paypal/Model/System/Config/Source/RequireBillingAddress.php +++ /dev/null @@ -1,32 +0,0 @@ -_configFactory = $configFactory; - } - - /** - * {@inheritdoc} - */ - public function toOptionArray() - { - return $this->_configFactory->create()->getRequireBillingAddressOptions(); - } -} diff --git a/app/code/Magento/Paypal/Model/System/Config/Source/UrlMethod.php b/app/code/Magento/Paypal/Model/System/Config/Source/UrlMethod.php deleted file mode 100644 index 96c2c4aab5abd..0000000000000 --- a/app/code/Magento/Paypal/Model/System/Config/Source/UrlMethod.php +++ /dev/null @@ -1,19 +0,0 @@ - 'GET', 'label' => 'GET'], ['value' => 'POST', 'label' => 'POST']]; - } -} diff --git a/app/code/Magento/Paypal/README.md b/app/code/Magento/Paypal/README.md deleted file mode 100644 index 8f4453ae0a058..0000000000000 --- a/app/code/Magento/Paypal/README.md +++ /dev/null @@ -1,6 +0,0 @@ -Module Magento\PayPal implements integration with the PayPal payment system. Namely, it enables the following payment methods: -*PayPal Express Checkout -*PayPal Payments Standard -*PayPal Payments Pro -*PayPal Credit -*PayFlow Payment Gateway diff --git a/app/code/Magento/Paypal/UnavailableException.php b/app/code/Magento/Paypal/UnavailableException.php deleted file mode 100644 index 63f0f30997156..0000000000000 --- a/app/code/Magento/Paypal/UnavailableException.php +++ /dev/null @@ -1,14 +0,0 @@ -startSetup(); -/** - * Add paypal attributes to the: - * - sales/flat_quote_payment_item table - * - sales/flat_order table - */ -$installer->addAttribute('quote_payment', 'paypal_payer_id', []); -$installer->addAttribute('quote_payment', 'paypal_payer_status', []); -$installer->addAttribute('quote_payment', 'paypal_correlation_id', []); -$installer->addAttribute( - 'order', - 'paypal_ipn_customer_notified', - ['type' => 'int', 'visible' => false, 'default' => 0] -); - -$data = []; -$statuses = [ - 'pending_paypal' => __('Pending PayPal'), - 'paypal_reversed' => __('PayPal Reversed'), - 'paypal_canceled_reversal' => __('PayPal Canceled Reversal'), -]; -foreach ($statuses as $code => $info) { - $data[] = ['status' => $code, 'label' => $info]; -} -$installer->getConnection()->insertArray($installer->getTable('sales_order_status'), ['status', 'label'], $data); - -/** - * Prepare database after install - */ -$installer->endSetup(); diff --git a/app/code/Magento/Paypal/etc/acl.xml b/app/code/Magento/Paypal/etc/acl.xml deleted file mode 100644 index f10357d561dd6..0000000000000 --- a/app/code/Magento/Paypal/etc/acl.xml +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/app/code/Magento/Paypal/etc/adminhtml/di.xml b/app/code/Magento/Paypal/etc/adminhtml/di.xml deleted file mode 100644 index dd15a6539e7d7..0000000000000 --- a/app/code/Magento/Paypal/etc/adminhtml/di.xml +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - paypal - - - - - Magento\Paypal\Model\Session\Storage - - - - - paypal_payflow - - - - - Magento\Paypal\Model\PayflowSession\Storage - - - - - - - - - - - - diff --git a/app/code/Magento/Paypal/etc/adminhtml/events.xml b/app/code/Magento/Paypal/etc/adminhtml/events.xml deleted file mode 100644 index 9fa9aa923cd45..0000000000000 --- a/app/code/Magento/Paypal/etc/adminhtml/events.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - diff --git a/app/code/Magento/Paypal/etc/adminhtml/menu.xml b/app/code/Magento/Paypal/etc/adminhtml/menu.xml deleted file mode 100644 index 11d7c50166a6f..0000000000000 --- a/app/code/Magento/Paypal/etc/adminhtml/menu.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - diff --git a/app/code/Magento/Paypal/etc/adminhtml/routes.xml b/app/code/Magento/Paypal/etc/adminhtml/routes.xml deleted file mode 100644 index 9bbde08be4c3c..0000000000000 --- a/app/code/Magento/Paypal/etc/adminhtml/routes.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - diff --git a/app/code/Magento/Paypal/etc/adminhtml/system.xml b/app/code/Magento/Paypal/etc/adminhtml/system.xml deleted file mode 100644 index a567be7aa8589..0000000000000 --- a/app/code/Magento/Paypal/etc/adminhtml/system.xml +++ /dev/null @@ -1,2517 +0,0 @@ - - - - -
- - Magento\Paypal\Block\Adminhtml\System\Config\Fieldset\Hint - https://www.paypal-marketing.com/emarketing/partner/na/merchantlineup/home.page#mainTab=checkoutlineup - - - - Magento\Paypal\Block\Adminhtml\System\Config\Fieldset\Location - - - If not specified, Default Country from General Config will be used - Magento\Paypal\Block\Adminhtml\System\Config\Field\Country - Magento\Paypal\Model\System\Config\Source\MerchantCountry - Magento\Paypal\Model\System\Config\Backend\MerchantCountry - paypal/general/merchant_country - - -
-
- - - pp-method-general - Magento\Paypal\Block\Adminhtml\System\Config\Fieldset\Payment - Accept payments with a completely customizable checkout. - payment/paypal_direct/active - https://www.paypal.com/webapps/mpp/referral/website-payments-pro?partner_id=NB9WWHYEMVUMS - - - Magento\Paypal\Block\Adminhtml\System\Config\Fieldset\Expanded - - - Magento\Paypal\Block\Adminhtml\System\Config\Fieldset\Expanded - - - - - - - - - - - - - - - payment/paypal_direct/active - Magento\Backend\Model\Config\Source\Yesno - - - - paypal-enabler - 1 - - - Learn More]]> - - - - - - - - - Why Advertise Financing?
- Give your sales a boost when you advertise financing.
PayPal helps turn browsers into buyers with financing - from Bill Me Later®. Your customers have more time to pay, while you get paid up front – at no additional cost to you. - Use PayPal’s free banner ads that let you advertise Bill Me Later® financing as a payment option when your customers check out with PayPal. - The PayPal Advertising Program has been shown to generate additional purchases as well as increase consumer's average purchase sizes by 15% - or more. See Details.]]> -
- - - - - - - - - payment/paypal_express_bml/homepage_size - Magento\Paypal\Model\System\Config\Source\BmlSize::getBmlSizeHPH - - 0 - - - - Magento\Paypal\Model\System\Config\Source\BmlSize::getBmlSizeHPS - - 1 - - - - - - - - - - payment/paypal_express_bml/categorypage_size - Magento\Paypal\Model\System\Config\Source\BmlSize::getBmlSizeCCPC - 1 - - 0 - - - - Magento\Paypal\Model\System\Config\Source\BmlSize::getBmlSizeCCPS - - 1 - - - - - - - - - - payment/paypal_express_bml/productpage_size - Magento\Paypal\Model\System\Config\Source\BmlSize::getBmlSizeCPPC - 1 - - 0 - - - - Magento\Paypal\Model\System\Config\Source\BmlSize::getBmlSizeCPPN - - 1 - - - - - - - - - - - payment/paypal_express_bml/checkout_size - Magento\Paypal\Model\System\Config\Source\BmlSize::getBmlSizeCheckoutC - 1 - - 0 - - - - Magento\Paypal\Model\System\Config\Source\BmlSize::getBmlSizeCheckoutN - 1 - - 1 - - - -
-
- - - Magento\Paypal\Block\Adminhtml\System\Config\Fieldset\Expanded - - - It is recommended to set this value to "Debit or Credit Card" per store views. - payment/paypal_direct/title - 1 - - - - payment/paypal_direct/sort_order - validate-number - 1 - - - - payment/paypal_direct/payment_action - Magento\Paypal\Model\System\Config\Source\PaymentActions - 1 - - - - Magento\Backend\Block\System\Config\Form\Field\Heading - 1 - - - - - http://www.paypal.com/amexupdate.]]> - - payment/paypal_direct/cctypes - Magento\Paypal\Model\Config::getWppCcTypesAsOptionArray - 1 - - - - config-advanced - - - payment/paypal_direct/allowspecific - Magento\Payment\Model\Config\Source\Allspecificcountries - 1 - - - - payment/paypal_direct/specificcountry - Magento\Paypal\Model\System\Config\Source\BuyerCountry - - 1 - - 1 - - - - payment/paypal_direct/debug - Magento\Backend\Model\Config\Source\Yesno - 1 - - - - payment/paypal_direct/verify_peer - Magento\Backend\Model\Config\Source\Yesno - 1 - - - - payment/paypal_direct/line_items_enabled - Magento\Backend\Model\Config\Source\Yesno - 1 - - - - payment/paypal_direct/useccv - Magento\Backend\Model\Config\Source\Yesno - 1 - - - - Magento\Backend\Block\System\Config\Form\Field\Heading - 1 - - - - payment/paypal_direct/centinel - Magento\Backend\Model\Config\Source\Yesno - 1 - - - - payment/paypal_direct/centinel_is_mode_strict - Severe Validation Removes Chargeback Liability on Merchant - Magento\Backend\Model\Config\Source\Yesno - - 1 - - 1 - - - - payment/paypal_direct/centinel_api_url - If empty, a default value will be used. Custom URL may be provided by CardinalCommerce agreement. - Magento\Backend\Model\Config\Source\Yesno - - 1 - - 1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Magento\Paypal\Block\Adminhtml\System\Config\Fieldset\Expanded - - - - - - - - - - - config-advanced - - - - - - - - - - - - - -
- - - pp-method-general - Magento\Paypal\Block\Adminhtml\System\Config\Fieldset\Payment - Accept credit card and PayPal payments securely. - payment/paypal_standard/active - https://www.paypal.com/webapps/mpp/referral/website-payments-standard?partner_id=NB9WWHYEMVUMS - - - Magento\Paypal\Block\Adminhtml\System\Config\Fieldset\Expanded - - - - payment/paypal_standard/active - Magento\Backend\Model\Config\Source\Yesno - - - - paypal-enabler paypal-ec-conflicts - 1 - - - - - Magento\Paypal\Block\Adminhtml\System\Config\Fieldset\Expanded - - - It is recommended to set this value to "PayPal" per store views. - payment/paypal_standard/title - 1 - - - - payment/paypal_standard/sort_order - validate-number - 1 - - - - payment/paypal_standard/payment_action - Magento\Paypal\Model\System\Config\Source\PaymentActions - 1 - - - - config-advanced - - - payment/paypal_standard/allowspecific - Magento\Payment\Model\Config\Source\Allspecificcountries - 1 - - - - payment/paypal_standard/specificcountry - Magento\Paypal\Model\System\Config\Source\BuyerCountry - - 1 - - 1 - - - - payment/paypal_standard/sandbox_flag - Magento\Backend\Model\Config\Source\Yesno - 1 - - - - payment/paypal_standard/line_items_enabled - Magento\Backend\Model\Config\Source\Yesno - 1 - - - - payment/paypal_standard/line_items_summary - Uses store frontend name by default. - - 0 - - 1 - - - - payment/paypal_standard/debug - Magento\Backend\Model\Config\Source\Yesno - 1 - - - - payment/paypal_standard/verify_peer - Magento\Backend\Model\Config\Source\Yesno - 1 - - - - - - - Magento\Paypal\Block\Adminhtml\System\Config\Fieldset\Payment - pp-method-payflow - Connect your merchant account with a fully customizable gateway that lets customers pay without leaving your site. - payment/payflowpro/active - https://www.paypal.com/webapps/mpp/referral/paypal-payflow-pro?partner_id=NB9WWHYEMVUMS - 1 - - - Magento\Paypal\Block\Adminhtml\System\Config\Fieldset\Expanded - - - Magento\Paypal\Block\Adminhtml\System\Config\Fieldset\Expanded - - - payment/payflowpro/partner - 1 - - - - payment/payflowpro/user - Magento\Backend\Model\Config\Backend\Encrypted - 1 - - - - payment/payflowpro/vendor - 1 - - - - payment/payflowpro/pwd - Magento\Backend\Model\Config\Backend\Encrypted - 1 - - - - payment/payflowpro/sandbox_flag - Magento\Backend\Model\Config\Source\Yesno - 1 - - - - payment/payflowpro/use_proxy - Magento\Backend\Model\Config\Source\Yesno - 1 - - - - payment/payflowpro/proxy_host - - 1 - - 1 - - - - payment/payflowpro/proxy_port - - 1 - - 1 - - - - - payment/payflowpro/active - Magento\Backend\Model\Config\Source\Yesno - - - - paypal-enabler paypal-ec-separate - 1 - - - - - Magento\Paypal\Block\Adminhtml\System\Config\Fieldset\Expanded - - - It is recommended to set this value to "Debit or Credit Card" per store views. - payment/payflowpro/title - 1 - - - - payment/payflowpro/sort_order - validate-number - 1 - - - - payment/payflowpro/payment_action - Magento\Paypal\Model\System\Config\Source\PaymentActions - 1 - - - - Magento\Backend\Block\System\Config\Form\Field\Heading - 1 - - - - - http://www.paypal.com/amexupdate.]]> - - payment/payflowpro/cctypes - Magento\Paypal\Model\Config::getPayflowproCcTypesAsOptionArray - 1 - - - - config-advanced - - - payment/payflowpro/allowspecific - Magento\Payment\Model\Config\Source\Allspecificcountries - 1 - - - - payment/payflowpro/specificcountry - Magento\Paypal\Model\System\Config\Source\BuyerCountry - - 1 - - 1 - - - - payment/payflowpro/debug - Magento\Backend\Model\Config\Source\Yesno - 1 - - - - payment/payflowpro/verify_peer - Magento\Backend\Model\Config\Source\Yesno - 1 - - - - payment/payflowpro/useccv - Magento\Backend\Model\Config\Source\Yesno - 1 - - - - Magento\Backend\Block\System\Config\Form\Field\Heading - 1 - - - - payment/payflowpro/centinel - Magento\Backend\Model\Config\Source\Yesno - 1 - - - - payment/payflowpro/centinel_is_mode_strict - Severe validation removes chargeback liability on merchant. - Magento\Backend\Model\Config\Source\Yesno - - 1 - - 1 - - - - payment/payflowpro/centinel_api_url - A value is required for live mode. Refer to your CardinalCommerce agreement. - Magento\Backend\Model\Config\Source\Yesno - - 1 - - 1 - - - - - - - - - - - - - - - - - - - - Magento\Paypal\Block\Adminhtml\System\Config\Fieldset\Payment - pp-method-payflow - Connect your merchant account with a PCI-compliant gateway that lets customers pay without leaving your site. - payment/payflow_link/active - https://www.paypal.com/webapps/mpp/referral/paypal-payflow-link?partner_id=NB9WWHYEMVUMS - - - Magento\Paypal\Block\Adminhtml\System\Config\Fieldset\Expanded - - - Magento\Paypal\Block\Adminhtml\System\Config\Fieldset\Expanded - - not-required - - 1 - - - - payment/payflow_link/partner - 1 - - - - payment/payflow_link/vendor - 1 - - - - If you do not have multiple users set up on your account, please re-enter your Vendor/Merchant Login here. - payment/payflow_link/user - 1 - - - - payment/payflow_link/pwd - Magento\Backend\Model\Config\Backend\Encrypted - 1 - - - - payment/payflow_link/sandbox_flag - Magento\Backend\Model\Config\Source\Yesno - 1 - - - - payment/payflow_link/use_proxy - Magento\Backend\Model\Config\Source\Yesno - 1 - - - - payment/payflow_link/proxy_host - - 1 - - 1 - - - - payment/payflow_link/proxy_port - - 1 - - 1 - - - Magento\Paypal\Block\Adminhtml\System\Config\Payflowlink\Info - 1 - - - - - payment/payflow_link/active - Magento\Backend\Model\Config\Source\Yesno - - - - paypal-enabler paypal-ec-pe paypal-payflowlink - 1 - - - - payment/payflow_express/active - Magento\Backend\Model\Config\Source\Yesno - paypal-ec-payflow-enabler - 1 - - - - - - - - - Learn More]]> - - payment/payflow_express_bml/active - - - - - - - - Why Advertise Financing?
- Give your sales a boost when you advertise financing.
PayPal helps turn browsers into buyers with financing - from Bill Me Later®. Your customers have more time to pay, while you get paid up front – at no additional cost to you. - Use PayPal’s free banner ads that let you advertise Bill Me Later® financing as a payment option when your customers check out with PayPal. - The PayPal Advertising Program has been shown to generate additional purchases as well as increase consumer's average purchase sizes by 15% - or more. See Details.]]> -
- - - - - - - - - payment/paypal_express_bml/homepage_size - Magento\Paypal\Model\System\Config\Source\BmlSize::getBmlSizeHPH - 1 - - 0 - - - - Magento\Paypal\Model\System\Config\Source\BmlSize::getBmlSizeHPS - - 1 - - - - - - - - - - payment/paypal_express_bml/categorypage_size - Magento\Paypal\Model\System\Config\Source\BmlSize::getBmlSizeCCPC - 1 - - 0 - - - - Magento\Paypal\Model\System\Config\Source\BmlSize::getBmlSizeCCPS - - 1 - - - - - - - - - - payment/paypal_express_bml/productpage_size - Magento\Paypal\Model\System\Config\Source\BmlSize::getBmlSizeCPPC - 1 - - 0 - - - - Magento\Paypal\Model\System\Config\Source\BmlSize::getBmlSizeCPPN - - 1 - - - - - - - - - - payment/paypal_express_bml/checkout_size - Magento\Paypal\Model\System\Config\Source\BmlSize::getBmlSizeCheckoutC - 1 - - 0 - - - - Magento\Paypal\Model\System\Config\Source\BmlSize::getBmlSizeCheckoutN - 1 - - 1 - - - -
-
- - - Magento\Paypal\Block\Adminhtml\System\Config\Fieldset\Expanded - - - It is recommended to set this value to "Debit or Credit Card" per store views. - payment/payflow_link/title - 1 - - - - payment/payflow_link/sort_order - validate-number - 1 - - - - payment/payflow_link/payment_action - Magento\Paypal\Model\System\Config\Source\PaymentActions - 1 - - - - config-advanced - - - payment/payflow_link/allowspecific - Magento\Payment\Model\Config\Source\Allspecificcountries - 1 - - - - payment/payflow_link/specificcountry - Magento\Paypal\Model\System\Config\Source\BuyerCountry - - 1 - - 1 - - - - payment/payflow_link/debug - Magento\Backend\Model\Config\Source\Yesno - 1 - - - - payment/payflow_link/verify_peer - Magento\Backend\Model\Config\Source\Yesno - 1 - - - - payment/payflow_link/csc_editable - Magento\Backend\Model\Config\Source\Yesno - 1 - - - - payment/payflow_link/csc_required - Magento\Backend\Model\Config\Source\Yesno - - 1 - - 1 - - - - payment/payflow_link/email_confirmation - Magento\Backend\Model\Config\Source\Yesno - 1 - - - - payment/payflow_link/url_method - Magento\Paypal\Model\System\Config\Source\UrlMethod - 1 - - - - - - - - - - - - - - - - - - - - - - Magento\Paypal\Block\Adminhtml\System\Config\Fieldset\Expanded - - - - - - - - - - - Magento\Paypal\Block\Adminhtml\System\Config\Fieldset\Payment - pp-method-express - Add PayPal as an additional payment method to your checkout page. - payment/paypal_express/active - https://www.paypal.com/webapps/mpp/referral/paypal-express-checkout?partner_id=NB9WWHYEMVUMS - - - Magento\Paypal\Block\Adminhtml\System\Config\Fieldset\Expanded - - - Magento\Paypal\Block\Adminhtml\System\Config\Fieldset\Expanded - - - - Start accepting payments via PayPal!]]> - - Don't have a PayPal account? Simply enter your email address. - paypal/general/business_account - validate-email - 1 - - - - paypal/wpp/api_authentication - Magento\Paypal\Model\Config::getApiAuthenticationMethods - 1 - - - - paypal/wpp/api_username - Magento\Backend\Model\Config\Backend\Encrypted - 1 - - - - paypal/wpp/api_password - Magento\Backend\Model\Config\Backend\Encrypted - 1 - - - - paypal/wpp/api_signature - Magento\Backend\Model\Config\Backend\Encrypted - 1 - - 0 - - - - - paypal/wpp/api_cert - Magento\Paypal\Model\System\Config\Backend\Cert - 1 - - 1 - - - - Get Credentials from PayPal - - - - Sandbox Credentials - - - - Magento\Paypal\Block\Adminhtml\System\Config\ApiWizard - - - - paypal/wpp/sandbox_flag - Magento\Backend\Model\Config\Source\Yesno - 1 - - - - paypal/wpp/use_proxy - Magento\Backend\Model\Config\Source\Yesno - 1 - - - - paypal/wpp/proxy_host - 1 - - 1 - - - - - paypal/wpp/proxy_port - 1 - - 1 - - - - - - payment/paypal_express/active - Magento\Backend\Model\Config\Source\Yesno - 1 - - - - paypal-enabler paypal-ec-enabler - - - - - Learn More]]> - - payment/paypal_express_bml/active - Magento\Backend\Model\Config\Source\Yesno - 1 - - - - paypal-bml - - - - - - Magento\Paypal\Block\Adminhtml\System\Config\Fieldset\Expanded - - - It is recommended to set this value to "Magento_Paypal" per store views. - payment/paypal_express/title - 1 - - - - payment/paypal_express/sort_order - validate-number - 1 - - - - payment/paypal_express/payment_action - Magento\Paypal\Model\System\Config\Source\PaymentActions\Express - 1 - - - - payment/paypal_express/visible_on_cart - Also affects mini-shopping cart. - Magento\Backend\Model\Config\Source\Yesno - 1 - - - - payment/paypal_express/visible_on_product - Magento\Backend\Model\Config\Source\Yesno - 1 - - - - Specifies what the Authorization Honor Period is on the merchant’s PayPal account. It must mirror the setting in PayPal. - payment/paypal_express/authorization_honor_period - 1 - - Order - - - - - Specifies what the Order Valid Period is on the merchant’s PayPal account. It must mirror the setting in PayPal. - payment/paypal_express/order_valid_period - 1 - - Order - - - - - The default number of child authorizations in your PayPal account is 1. To do multiple authorizations please contact PayPal to request an increase. - payment/paypal_express/child_authorization_number - 1 - - Order - - - - - config-advanced - - - payment/paypal_express/allowspecific - Magento\Payment\Model\Config\Source\Allspecificcountries - 1 - - - - payment/paypal_express/specificcountry - Magento\Paypal\Model\System\Config\Source\BuyerCountry - 1 - - 1 - - - - - payment/paypal_express/debug - Magento\Backend\Model\Config\Source\Yesno - 1 - - - - payment/paypal_express/verify_peer - Magento\Backend\Model\Config\Source\Yesno - 1 - - - - payment/paypal_express/line_items_enabled - Magento\Backend\Model\Config\Source\Yesno - 1 - - - - payment/paypal_express/transfer_shipping_options - If this option is enabled, customer can change shipping address and shipping method on PayPal website. In live mode works via HTTPS protocol only. - Notice that PayPal can handle up to 10 shipping options. That is why Magento will transfer only first 10 cheapest shipping options if there are more than 10 available. - Magento\Backend\Model\Config\Source\Yesno - 1 - - 1 - - - - - paypal/wpp/button_flavor - Magento\Paypal\Model\Config::getExpressCheckoutButtonFlavors - 1 - - - - Ability for buyer to purchase without PayPal account. - payment/paypal_express/solution_type - Magento\Paypal\Model\Config::getExpressCheckoutSolutionTypes - 1 - - - - This feature needs be enabled first for the merchant account through PayPal technical support. - payment/paypal_express/require_billing_address - Magento\Paypal\Model\System\Config\Source\RequireBillingAddress - 1 - - - - Whether to create a billing agreement, if there are no active billing agreements available. - - - - payment/paypal_express/allow_ba_signup - Magento\Paypal\Model\Config::getExpressCheckoutBASignupOptions - 1 - - - - payment/paypal_express/skip_order_review_step - Magento\Backend\Model\Config\Source\Yesno - 1 - - - - - - - - - payment/paypal_billing_agreement/active - Magento\Backend\Model\Config\Source\Yesno - 1 - - - - payment/paypal_billing_agreement/title - 1 - - - - payment/paypal_billing_agreement/sort_order - validate-number - 1 - - - - payment/paypal_billing_agreement/payment_action - Magento\Paypal\Model\System\Config\Source\PaymentActions - 1 - - - - payment/paypal_billing_agreement/allowspecific - Magento\Payment\Model\Config\Source\Allspecificcountries - 1 - - - - payment/paypal_billing_agreement/specificcountry - Magento\Paypal\Model\System\Config\Source\BuyerCountry - 1 - - 1 - - - - - payment/paypal_billing_agreement/debug - Magento\Backend\Model\Config\Source\Yesno - 1 - - - - payment/paypal_billing_agreement/verify_peer - Magento\Backend\Model\Config\Source\Yesno - 1 - - - - payment/paypal_billing_agreement/line_items_enabled - Magento\Backend\Model\Config\Source\Yesno - 1 - - - - payment/paypal_billing_agreement/allow_billing_agreement_wizard - Magento\Backend\Model\Config\Source\Yesno - 1 - - - - - - - Magento\Backend\Block\System\Config\Form\Field\Heading - 1 - - - - paypal/fetch_reports/ftp_login - Magento\Backend\Model\Config\Backend\Encrypted - 1 - - - - paypal/fetch_reports/ftp_password - Magento\Backend\Model\Config\Backend\Encrypted - 1 - - - - paypal/fetch_reports/ftp_sandbox - Magento\Backend\Model\Config\Source\Yesno - 1 - - - - By default it is "reports.paypal.com". - Use colon to specify port. For example: "test.example.com:5224". - paypal/fetch_reports/ftp_ip - 1 - - 0 - - - - - By default it is "/ppreports/outgoing". - paypal/fetch_reports/ftp_path - 1 - - 0 - - - - - Magento\Backend\Block\System\Config\Form\Field\Heading - 1 - - - - paypal/fetch_reports/active - Magento\Backend\Model\Config\Source\Yesno - 1 - - - - PayPal retains reports for 45 days. - paypal/fetch_reports/schedule - Magento\Paypal\Model\System\Config\Source\FetchingSchedule - 1 - - - - paypal/fetch_reports/time - 1 - - - - - - - - Magento\Backend\Block\System\Config\Form\Field\Heading - 1 - - - - paypal/style/page_style - - - - 1 - - - - paypal/style/paypal_hdrimg - - https is highly encouraged.]]> - - 1 - - - - paypal/style/paypal_hdrbackcolor - - - - 1 - - - - paypal/style/paypal_hdrbordercolor - 2-pixel perimeter around the header space. - 1 - - - - paypal/style/paypal_payflowcolor - - - - 1 - - - - - - - - pp-method-general - Magento\Paypal\Block\Adminhtml\System\Config\Fieldset\Payment - payment/hosted_pro/active - Accept payments with a PCI compliant checkout that keeps customers on your site. - 1 - - - Magento\Paypal\Block\Adminhtml\System\Config\Fieldset\Expanded - - - Magento\Paypal\Block\Adminhtml\System\Config\Fieldset\Expanded - - - - - - - - - - - - - - - payment/hosted_pro/active - Magento\Backend\Model\Config\Source\Yesno - - - - paypal-enabler paypal-ec-separate - - - - Learn More]]> - - - - - - - - - Why Advertise Financing?
- Give your sales a boost when you advertise financing.
PayPal helps turn browsers into buyers with financing - from Bill Me Later®. Your customers have more time to pay, while you get paid up front – at no additional cost to you. - Use PayPal’s free banner ads that let you advertise Bill Me Later® financing as a payment option when your customers check out with PayPal. - The PayPal Advertising Program has been shown to generate additional purchases as well as increase consumer's average purchase sizes by 15% - or more. See Details.]]> -
- - - - - - - - - payment/paypal_express_bml/homepage_size - Magento\Paypal\Model\System\Config\Source\BmlSize::getBmlSizeHPH - 1 - - 0 - - - - Magento\Paypal\Model\System\Config\Source\BmlSize::getBmlSizeHPS - - 1 - - - - - - - - - - payment/paypal_express_bml/categorypage_size - Magento\Paypal\Model\System\Config\Source\BmlSize::getBmlSizeCCPC - 1 - - 0 - - - - Magento\Paypal\Model\System\Config\Source\BmlSize::getBmlSizeCCPS - - 1 - - - - - - - - - - payment/paypal_express_bml/productpage_size - Magento\Paypal\Model\System\Config\Source\BmlSize::getBmlSizeCPPC - 1 - - 0 - - - - Magento\Paypal\Model\System\Config\Source\BmlSize::getBmlSizeCPPN - - 1 - - - - - - - - - - payment/paypal_express_bml/checkout_size - Magento\Paypal\Model\System\Config\Source\BmlSize::getBmlSizeCheckoutC - 1 - - 0 - - - - Magento\Paypal\Model\System\Config\Source\BmlSize::getBmlSizeCheckoutN - 1 - - 1 - - - -
-
- - - Magento\Paypal\Block\Adminhtml\System\Config\Fieldset\Expanded - - - It is recommended to set this value to "PayPal" per store views. - payment/hosted_pro/title - - - - payment/hosted_pro/sort_order - validate-number - - - - payment/hosted_pro/payment_action - Magento\Paypal\Model\System\Config\Source\PaymentActions - - - - payment/hosted_pro/display_ec - Magento\Backend\Model\Config\Source\Yesno - - - - config-advanced - - - payment/hosted_pro/allowspecific - Magento\Payment\Model\Config\Source\Allspecificcountries - - - - payment/hosted_pro/specificcountry - Magento\Paypal\Model\System\Config\Source\BuyerCountry - - 1 - - - - - payment/hosted_pro/debug - Magento\Backend\Model\Config\Source\Yesno - - - - payment/hosted_pro/verify_peer - Magento\Backend\Model\Config\Source\Yesno - - - - - - - - - - - - - - - - -
-
-
- - - 1 - complex - Magento\Paypal\Block\Adminhtml\System\Config\Fieldset\Group - Choose a secure bundled payment solution for your business. - https://www.paypal-marketing.com/emarketing/partner/na/merchantlineup/home.page#mainTab=checkoutlineup&subTab=newlineup - - - - - - 1 - complex - Magento\Paypal\Block\Adminhtml\System\Config\Fieldset\Group - Add another payment method to your existing solution or as a stand-alone option. - https://merchant.paypal.com/cgi-bin/marketingweb?cmd=_render-content - - -
-
- - - - pp-method-general - Magento\Paypal\Block\Adminhtml\System\Config\Fieldset\Payment - https://www.paypal.com/webapps/mpp/referral/paypal-payments-advanced?partner_id=NB9WWHYEMVUMS - Accept payments with a PCI-compliant checkout that keeps customers on your site. - payment/payflow_advanced/active - - - Magento\Paypal\Block\Adminhtml\System\Config\Fieldset\Expanded - - - Magento\Paypal\Block\Adminhtml\System\Config\Fieldset\Expanded - - - - - - payment/payflow_advanced/partner - 1 - - - - payment/payflow_advanced/vendor - 1 - - - - PayPal recommends that you set up an additional User on your account at manager.paypal.com - PayPal recommends you set up an additional User on your account at manager.paypal.com, instead of entering your admin username and password here. This will enhance your security and prevent service interruptions if you later change your password. If you do not want to set up an additional User, you can re-enter your Merchant Login here. - payment/payflow_advanced/user - 1 - - - - payment/payflow_advanced/pwd - Magento\Backend\Model\Config\Backend\Encrypted - 1 - - - - payment/payflow_advanced/sandbox_flag - Magento\Backend\Model\Config\Source\Yesno - 1 - - - - payment/payflow_advanced/use_proxy - Magento\Backend\Model\Config\Source\Yesno - 1 - - - - payment/payflow_advanced/proxy_host - - 1 - - 1 - - - - payment/payflow_advanced/proxy_port - - 1 - - 1 - - - Magento\Paypal\Block\Adminhtml\System\Config\Payflowlink\Advanced - 1 - - - - - payment/payflow_advanced/active - Magento\Backend\Model\Config\Source\Yesno - - - - paypal-enabler paypal-ec-pe paypal-payflow-advanced - 1 - - - Magento\Paypal\Block\Adminhtml\System\Config\Field\Hidden - - - - - - Learn More]]> - - - - - - - - - - Why Advertise Financing?
- Give your sales a boost when you advertise financing.
PayPal helps turn browsers into buyers with financing - from Bill Me Later®. Your customers have more time to pay, while you get paid up front – at no additional cost to you. - Use PayPal’s free banner ads that let you advertise Bill Me Later® financing as a payment option when your customers check out with PayPal. - The PayPal Advertising Program has been shown to generate additional purchases as well as increase consumer's average purchase sizes by 15% - or more. See Details.]]> -
- - - - - - - - - payment/paypal_express_bml/homepage_size - Magento\Paypal\Model\System\Config\Source\BmlSize::getBmlSizeHPH - - 0 - - - - Magento\Paypal\Model\System\Config\Source\BmlSize::getBmlSizeHPS - - 1 - - - - - - - - - - payment/paypal_express_bml/categorypage_size - Magento\Paypal\Model\System\Config\Source\BmlSize::getBmlSizeCCPC - 1 - - 0 - - - - Magento\Paypal\Model\System\Config\Source\BmlSize::getBmlSizeCCPS - - 1 - - - - - - - - - - payment/paypal_express_bml/productpage_size - Magento\Paypal\Model\System\Config\Source\BmlSize::getBmlSizeCPPC - 1 - - 0 - - - - Magento\Paypal\Model\System\Config\Source\BmlSize::getBmlSizeCPPN - - 1 - - - - - - - - - - - payment/paypal_express_bml/checkout_size - Magento\Paypal\Model\System\Config\Source\BmlSize::getBmlSizeCheckoutC - 1 - - 0 - - - - Magento\Paypal\Model\System\Config\Source\BmlSize::getBmlSizeCheckoutN - 1 - - 1 - - - -
-
- - - Magento\Paypal\Block\Adminhtml\System\Config\Fieldset\Expanded - - - It is recommended to set this value to "Debit or Credit Card" per store views. - payment/payflow_advanced/title - 1 - - - - payment/payflow_advanced/sort_order - validate-number - 1 - - - - payment/payflow_advanced/payment_action - Magento\Paypal\Model\System\Config\Source\PaymentActions - 1 - - - - config-advanced - - - payment/payflow_advanced/allowspecific - Magento\Payment\Model\Config\Source\Allspecificcountries - 1 - - - - payment/payflow_advanced/specificcountry - Magento\Paypal\Model\System\Config\Source\BuyerCountry - - 1 - - 1 - - - - payment/payflow_advanced/debug - Magento\Backend\Model\Config\Source\Yesno - 1 - - - - payment/payflow_advanced/verify_peer - Magento\Backend\Model\Config\Source\Yesno - 1 - - - - payment/payflow_advanced/csc_editable - Magento\Backend\Model\Config\Source\Yesno - 1 - - - - payment/payflow_advanced/csc_required - Magento\Backend\Model\Config\Source\Yesno - - 1 - - 1 - - - - payment/payflow_advanced/email_confirmation - Magento\Backend\Model\Config\Source\Yesno - 1 - - - - payment/payflow_advanced/url_method - Magento\Paypal\Model\System\Config\Source\UrlMethod - 1 - - - - - - - - - - - - - - - - - - - - - - Magento\Paypal\Block\Adminhtml\System\Config\Fieldset\Expanded - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - complex - Magento\Paypal\Block\Adminhtml\System\Config\Fieldset\Group - Process payments using your own internet merchant account. - https://merchant.paypal.com/cgi-bin/marketingweb?cmd=_render-content - - - - 0 - - - - paypal-enabler paypal-ec-pe - - - - - not-required - - 1 - - - - Magento\Paypal\Block\Adminhtml\System\Config\Field\Hidden - - - - - - - - - Learn More]]> - - payment/payflow_express_bml/active - Magento\Backend\Model\Config\Source\Yesno - 1 - paypal-bml - - - - - - - - Why Advertise Financing?
- Give your sales a boost when you advertise financing.
PayPal helps turn browsers into buyers with financing - from Bill Me Later®. Your customers have more time to pay, while you get paid up front – at no additional cost to you. - Use PayPal’s free banner ads that let you advertise Bill Me Later® financing as a payment option when your customers check out with PayPal. - The PayPal Advertising Program has been shown to generate additional purchases as well as increase consumer's average purchase sizes by 15% - or more. See Details.]]> -
- - - - - - - - - payment/paypal_express_bml/homepage_size - Magento\Paypal\Model\System\Config\Source\BmlSize::getBmlSizeHPH - 1 - - 0 - - - - Magento\Paypal\Model\System\Config\Source\BmlSize::getBmlSizeHPS - - 1 - - - - - - - - - - payment/paypal_express_bml/categorypage_size - Magento\Paypal\Model\System\Config\Source\BmlSize::getBmlSizeCCPC - 1 - - 0 - - - - Magento\Paypal\Model\System\Config\Source\BmlSize::getBmlSizeCCPS - - 1 - - - - - - - - - - payment/paypal_express_bml/productpage_size - Magento\Paypal\Model\System\Config\Source\BmlSize::getBmlSizeCPPC - 1 - - 0 - - - - Magento\Paypal\Model\System\Config\Source\BmlSize::getBmlSizeCPPN - - 1 - - - - - - - - - - payment/paypal_express_bml/checkout_size - Magento\Paypal\Model\System\Config\Source\BmlSize::getBmlSizeCheckoutC - 1 - - 0 - - - - Magento\Paypal\Model\System\Config\Source\BmlSize::getBmlSizeCheckoutN - 1 - - 1 - - - -
-
- - - - - - - - - - Magento\Paypal\Block\Adminhtml\System\Config\Fieldset\Expanded - - - payment/payflow_express/title - 1 - - - - payment/payflow_express/sort_order - validate-number - 1 - - - - payment/payflow_express/payment_action - Magento\Paypal\Model\System\Config\Source\PaymentActions - 1 - - - - Also affects mini-shopping cart. - payment/payflow_express/visible_on_cart - Magento\Backend\Model\Config\Source\Yesno - 1 - - - - payment/payflow_express/visible_on_product - Magento\Backend\Model\Config\Source\Yesno - 1 - - - - config-advanced - - - payment/payflow_express/allowspecific - Magento\Payment\Model\Config\Source\Allspecificcountries - 1 - - - - payment/payflow_express/specificcountry - Magento\Paypal\Model\System\Config\Source\BuyerCountry - - 1 - - 1 - - - - payment/payflow_express/debug - Magento\Backend\Model\Config\Source\Yesno - 1 - - - - payment/payflow_express/verify_peer - Magento\Backend\Model\Config\Source\Yesno - 1 - - - - payment/payflow_express/line_items_enabled - Magento\Backend\Model\Config\Source\Yesno - 1 - - - - -
-
- - - payment/paypal_express/active - payment/payflow_express/active - - -
-
- - - pp-general-uk - https://www.paypal-business.co.uk/accept-online-payments-with-paypal/index.htm - http://www.youtube.com/watch?v=mdPjvziH_rk&list=PLF18B1094ABCD7CE8&index=6&feature=plpp_video - Accept credit cards, debit cards and PayPal payments securely. - - - pp-general-uk - https://www.paypal-business.co.uk/process-online-payments-with-paypal/index.htm - http://www.youtube.com/watch?v=LBe-TW87eGI&list=PLF18B1094ABCD7CE8&index=1&feature=plpp_video - Accept payments with a completely customizable checkout page. - - - - pp-general-uk - https://cms.paypal.com/cms_content/GB/en_GB/files/developer/HostedSolution.pdf - 0 - - - - - - paypal-enabler - - - - - - - - - - - - - - - - - - - - - - - - - - Magento\Paypal\Block\Adminhtml\System\Config\Fieldset\Expanded - - - - - - - - - - - config-advanced - - - - - - - - - - - - - - - -
-
- - - 1 - complex - Magento\Paypal\Block\Adminhtml\System\Config\Fieldset\Group - Add another payment method to your existing solution or as a stand-alone option. - https://www.paypal-marketing.com/emarketing/partner/na/merchantlineup/home.page#mainTab=checkoutlineup&subTab=newlineup - - - - - - - - -
-
- - - 1 - complex - Magento\Paypal\Block\Adminhtml\System\Config\Fieldset\Group - Add another payment method to your existing solution or as a stand-alone option. - https://www.paypal-marketing.com/emarketing/partner/na/merchantlineup/home.page#mainTab=checkoutlineup&subTab=newlineup - - - -
-
- - - - payment/paypal_express/active - payment/payflow_express/active - - - - - -
-
- - - - - - -
-
- - - - - - - -
-
- - - - - - - -
-
- - - - - - - -
-
- - - - - - - -
-
- - - - - -
-
- - - - - -
-
-
diff --git a/app/code/Magento/Paypal/etc/config.xml b/app/code/Magento/Paypal/etc/config.xml deleted file mode 100644 index e53fae175da3a..0000000000000 --- a/app/code/Magento/Paypal/etc/config.xml +++ /dev/null @@ -1,146 +0,0 @@ - - - - - - Magento_Cart_Community - - - - - - dynamic - - - - - - - - - 1 - - - - - - Magento\Paypal\Model\Express - PayPal Express Checkout - Authorization - Mark - 1 - 1 - 1 - never - paypal - 3 - 29 - 1 - 1 - 1 - - - Magento\Paypal\Model\Bml - Bill Me Later - paypal - - - Magento\Paypal\Model\Direct - PayPal Payments Pro - Authorization - VI,MC - 1 - paypal - 1 - - - Magento\Paypal\Model\Standard - PayPal Website Payments Standard - Sale - 1 - paypal - 1 - - - PayPal Express Checkout Payflow Edition - Authorization - 1 - 1 - 1 - paypal - 1 - Magento\Paypal\Model\PayflowExpress - - - Magento\Paypal\Model\Payflow\Bml - Bill Me Later - paypal - - - Magento\Paypal\Model\Payflowpro - Payflow Pro - Authorization - AE,VI - 1 - C - MEDIUM - - - paypal - 1 - - - 1 - 1 - Magento\Paypal\Model\Method\Agreement - PayPal Billing Agreement - paypal - 1 - - - Magento\Paypal\Model\Payflowlink - Authorization - HIGH - - paypal - Credit Card - PayPal - 1 - 1 - GET - 0 - 1 - - - Magento\Paypal\Model\Payflowadvanced - Authorization - HIGH - - paypal - Credit Card - PayPal - PayPal - PayPal - 1 - 1 - GET - 0 - 1 - - - Magento\Paypal\Model\Hostedpro - Payment by cards or by PayPal account - Authorization - paypal - 0 - 1 - - - - diff --git a/app/code/Magento/Paypal/etc/crontab.xml b/app/code/Magento/Paypal/etc/crontab.xml deleted file mode 100644 index d73d0db8d00bc..0000000000000 --- a/app/code/Magento/Paypal/etc/crontab.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - diff --git a/app/code/Magento/Paypal/etc/di.xml b/app/code/Magento/Paypal/etc/di.xml deleted file mode 100644 index 3f3fa6637fe6d..0000000000000 --- a/app/code/Magento/Paypal/etc/di.xml +++ /dev/null @@ -1,80 +0,0 @@ - - - - - - - Magento\Sales\Model\Resource\Setup - - - - - - Magento\Paypal\Model\Payflowadvanced - - - - - Magento\Paypal\Model\PayflowadvancedFactory - - - - - Magento\Paypal\Model\Payflow\Pro - - - - - Magento\Paypal\Model\Payflow\ProFactory - - - - - - Magento\Paypal\Model\Config::METHOD_WPP_EXPRESS - paypal/express/start/button/1 - Magento\Paypal\Model\Express\Checkout - product.info.addtocart.paypal - express/shortcut.phtml - - - - - product.info.addtocart.paypalShortcutContainer - express/shortcut/container.phtml - - - - - Magento\Paypal\Model\Config::METHOD_WPP_PE_EXPRESS - paypal/payflowexpress/start/button/1 - Magento\Paypal\Model\PayflowExpress\Checkout - product.info.addtocart.payflow - express/shortcut.phtml - - - - - Magento\Paypal\Model\Config::METHOD_WPP_EXPRESS - paypal/bml/start/button/1 - Magento\Paypal\Model\Config::METHOD_WPP_BML - product.info.addtocart.paypalbml - express/shortcut.phtml - - - - - - - - Magento\Paypal\Model\Config::METHOD_WPP_PE_EXPRESS - paypal/payflowbml/start/button/1 - Magento\Paypal\Model\Config::METHOD_WPP_PE_BML - product.info.addtocart.payflowbml - - - diff --git a/app/code/Magento/Paypal/etc/events.xml b/app/code/Magento/Paypal/etc/events.xml deleted file mode 100644 index 89d7fe1bac0a7..0000000000000 --- a/app/code/Magento/Paypal/etc/events.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - diff --git a/app/code/Magento/Paypal/etc/frontend/di.xml b/app/code/Magento/Paypal/etc/frontend/di.xml deleted file mode 100644 index 39c7042559037..0000000000000 --- a/app/code/Magento/Paypal/etc/frontend/di.xml +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - paypal - - - - - Magento\Paypal\Model\Session\Storage - - - - - paypal_payflow - - - - - Magento\Paypal\Model\PayflowSession\Storage - - - - - - /paypal/express - /paypal/payflowexpress - /paypal/standard - paypal/express/callbackshippingoptions - /paypal/bml - /paypal/payflowbml - - - - diff --git a/app/code/Magento/Paypal/etc/frontend/events.xml b/app/code/Magento/Paypal/etc/frontend/events.xml deleted file mode 100644 index 1917196d526b7..0000000000000 --- a/app/code/Magento/Paypal/etc/frontend/events.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - - - - - diff --git a/app/code/Magento/Paypal/etc/frontend/page_types.xml b/app/code/Magento/Paypal/etc/frontend/page_types.xml deleted file mode 100644 index 6a04edba3d055..0000000000000 --- a/app/code/Magento/Paypal/etc/frontend/page_types.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - - - - - - - - diff --git a/app/code/Magento/Paypal/etc/frontend/routes.xml b/app/code/Magento/Paypal/etc/frontend/routes.xml deleted file mode 100644 index eea6101bf0150..0000000000000 --- a/app/code/Magento/Paypal/etc/frontend/routes.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/app/code/Magento/Paypal/etc/module.xml b/app/code/Magento/Paypal/etc/module.xml deleted file mode 100644 index 2f2d5bba0fc27..0000000000000 --- a/app/code/Magento/Paypal/etc/module.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - diff --git a/app/code/Magento/Paypal/etc/payment.xml b/app/code/Magento/Paypal/etc/payment.xml deleted file mode 100644 index d69eefed9844b..0000000000000 --- a/app/code/Magento/Paypal/etc/payment.xml +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - - - - - - - - - - - - - - 1 - 1 - - - 1 - - - 1 - 1 - - - - diff --git a/app/code/Magento/Paypal/i18n/de_DE.csv b/app/code/Magento/Paypal/i18n/de_DE.csv deleted file mode 100644 index 7167fee8d54c0..0000000000000 --- a/app/code/Magento/Paypal/i18n/de_DE.csv +++ /dev/null @@ -1,692 +0,0 @@ -Custom,Kundenspezifisch -Close,Close -Cancel,Cancel -Back,Back -Price,Preis -ID,ID -Configure,Configure -No,Nein -Qty,Qty -Subtotal,Zwischensumme -"Incl. Tax","Incl. Tax" -Edit,Edit -"--Please Select--","--Please Select--" -Customer,Customer -"First Name","First Name" -"Last Name","Last Name" -Email,Email -"-- Please Select --","-- Please Select --" -Yes,Ja -Status,Status -Enabled,Enabled -"Sort Order","Sort Order" -Title,Title -"Are you sure you want to do this?","Are you sure you want to do this?" -Order,Bestellung -View,Ansicht -Active,Active -Position,Position -Dynamic,Dynamisch -N/A,"Nicht zutreffend" -Canceled,Canceled -"General Information","General Information" -Static,Statisch -"Advanced Settings","Advanced Settings" -"Learn More","Erfahren Sie mehr" -"Start Date","Start Date" -"Product Name","Product Name" -"3D Secure Card Validation","3D Secure Card Validation" -"Merchant Liability","Haftbarkeit des Händlers" -"Billing Information","Billing Information" -"Shipping Information","Shipping Information" -"Shipping Method",Lieferungsart -"Please agree to all the terms and conditions before placing the order.","Bitte stimmen Sie den Allgemeinen Geschäftsbedingungen zu, bevor Sie die Bestellung aufgeben." -"Account confirmation is required. Please, check your e-mail for confirmation link. To resend confirmation email please click here.","Account confirmation is required. Please, check your e-mail for confirmation link. To resend confirmation email please click here." -Password,Password -Continue,Continue -"Order #","Order #" -Login,Login -"Shipping Address",Lieferadresse -"Payment Method","Payment Method" -"Place Order","Erteilen Sie den Auftrag" -"Sorry, no quotes are available for this order at this time.","Es tut uns Leid, es gibt derzeit keine Preisangabe für diese Bestellung." -Sales,Verkäufe -Created,Created -Display,Display -User,User -Daily,Täglich -Date,Date -"Order Total","Order Total" -Never,Niemals -Updated,Updated -Reports,Berichte -"Order Status","Order Status" -"View Order","View Order" -Event,Vorgang -"Please Select","Please Select" -"Submitting order information...","Bestellinformationen werden gesendet..." -Authorization,Bewilligung -"You notified customer about invoice #%1.","You notified customer about invoice #%1." -"Note: %1","Note: %1" -"IPN ""%1""","IPN ""%1""" -"Billing Agreements",Rechnungsvereinbarungen -"Reference ID","Reference ID" -"Billing Agreement #%1","Billing Agreement #%1" -"Related Orders","Related Orders" -"Billing Agreement View","Rechnungsvereinbarung Ansicht" -"View Transaction Details","Überweisungsdetails zeigen" -"Reference Information",Referenz-Information -"Transaction Information",Überweisungs-Informationen -"PayPal Fee Information","PayPal Gebühren-Information" -"PayPal Settlement Reports","PayPal Abrechnungsberichte" -"We are connecting to the PayPal SFTP server to retrieve new reports. Are you sure you want to continue?","We are connecting to the PayPal SFTP server to retrieve new reports. Are you sure you want to continue?" -"Fetch Updates","Aktualisierungen herunterladen" -button_label,button_label -sandbox_button_label,sandbox_button_label -Help,Hilfe -"There is already another PayPal solution enabled. Enable this solution instead?","There is already another PayPal solution enabled. Enable this solution instead?" -"The following error(s) occured:","The following error(s) occured:" -"Some PayPal solutions conflict.","Some PayPal solutions conflict." -"PayPal Express Checkout is not enabled.","PayPal Express Checkout is not enabled." -"Please re-enable the previously enabled payment solutions.","Please re-enable the previously enabled payment solutions." -"View Demo","Demo anzeigen" -"See terms","See terms" -"You will be redirected to the PayPal website.","Sie werden zur PayPal Webseite weitergeleitet." -"Would you like to sign a billing agreement ' 'to streamline further purchases with PayPal?","Would you like to sign a billing agreement ' 'to streamline further purchases with PayPal?" -"You will be redirected to the PayPal website when you place an order.","Sie werden zur PayPal-Website weitergeleitet, wenn Sie eine Bestellung aufgeben." -"Click here if you are not redirected within 10 seconds.","Click here if you are not redirected within 10 seconds." -"You will be redirected to the PayPal website in a few seconds.","Sie werden in wenigen Sekunden auf die PayPal Website weitergeleitet." -"You canceled the billing agreement.","You canceled the billing agreement." -"We could not cancel the billing agreement.","We could not cancel the billing agreement." -"You deleted the billing agreement.","You deleted the billing agreement." -"We could not delete the billing agreement.","We could not delete the billing agreement." -"Please specify the correct billing agreement ID and try again.","Please specify the correct billing agreement ID and try again." -"View Transaction","Transaktion anzeigen" -"We found nothing to fetch because of an empty configuration.","We found nothing to fetch because of an empty configuration." -"We fetched %1 report rows from '%2@%3'.","We fetched %1 report rows from '%2@%3'." -"We couldn't fetch reports from '%1@%2'.","We couldn't fetch reports from '%1@%2'." -"Billing Agreement # %1","Billing Agreement # %1" -"We couldn't start the billing agreement wizard.","We couldn't start the billing agreement wizard." -"The billing agreement ""%1"" has been created.","The billing agreement ""%1"" has been created." -"We couldn't finish the billing agreement wizard.","We couldn't finish the billing agreement wizard." -"The billing agreement ""%1"" has been canceled.","The billing agreement ""%1"" has been canceled." -"We couldn't cancel the billing agreement.","We couldn't cancel the billing agreement." -"To proceed to Checkout, please log in using your email address.","To proceed to Checkout, please log in using your email address." -"We can't start Express Checkout.","We can't start Express Checkout." -"Express Checkout and Order have been canceled.","Express-Checkout und Bestellung wurden storniert." -"Express Checkout has been canceled.","Express-Checkout storniert." -"Unable to cancel Express Checkout","Unable to cancel Express Checkout" -"We can't process Express Checkout approval.","We can't process Express Checkout approval." -"We can't initialize Express Checkout review.","We can't initialize Express Checkout review." -"We can't update shipping method.","We can't update shipping method." -"We can't place the order.","We can't place the order." -"We can't initialize Express Checkout.","We can't initialize Express Checkout." -"PayPal Express Checkout Token does not exist.","PayPal Express-Checkout Token existiert nicht." -"A wrong PayPal Express Checkout Token is specified.","A wrong PayPal Express Checkout Token is specified." -"Your payment has been declined. Please try again.","Your payment has been declined. Please try again." -"We can't contact the PayPal gateway.","We can't contact the PayPal gateway." -"PayPal response hasn't required fields.","Die erforderlichen Pflichtfelder für die PayPal Antwort wurden nicht ausgefüllt." -"Something went wrong while processing your order.","Something went wrong while processing your order." -"PayPal gateway has rejected request. %1","PayPal gateway has rejected request. %1" -"PayPal gateway rejected the request. %1","PayPal gateway rejected the request. %1" -"I'm sorry - but we were not able to process your payment. Please try another payment method or contact us so we can assist you.","I'm sorry - but we were not able to process your payment. Please try another payment method or contact us so we can assist you." -"I'm sorry - but we are not able to complete your transaction. Please contact us so we can assist you.","I'm sorry - but we are not able to complete your transaction. Please contact us so we can assist you." -"The payment method code is not set.","The payment method code is not set." -"The reference ID is not set.","The reference ID is not set." -"Unable to save Billing Agreement:","Abrechnungsvereinbarung kann nicht gespeichert werden:" -"The customer ID is not set.","The customer ID is not set." -"The Billing Agreement status is not set.","The Billing Agreement status is not set." -"The PayPal certificate does not exist.","The PayPal certificate does not exist." -"We prefer PayPal (150 X 60)","Wir bevorzugen PayPal (150 X 60)" -"We prefer PayPal (150 X 40)","Wir bevorzugen PayPal (150 X 40)" -"Now accepting PayPal (150 X 60)","Jetzt wird PayPal (150 X 60) angenommen" -"Now accepting PayPal (150 X 40)","Wir nehmen jetzt PayPal an (150 X 40)" -"Payments by PayPal (150 X 60)","Zahlungen durch PayPal (150 X 60)" -"Payments by PayPal (150 X 40)","Zahlungen durch PayPal (150 X 40)" -"Shop now using (150 X 60)","Kaufen Sie jetzt ein indem sie (150 X 60) nutzen" -"Shop now using (150 X 40)","Kaufen Sie jetzt mit (150 X 40)" -Shortcut,Shortcut -"Acceptance Mark Image","Akzeptanz Kennzeichnungs-Logo" -Sale,Verkauf -"For Virtual Quotes Only","Nur für virtuelle Angebote" -Auto,Automatisch -"Ask Customer","Beim Kunden anfragen" -"IPN (Instant Payment Notification) Only","IPN (Instant Payment Notification) Only" -"API Signature","API Signatur" -"API Certificate",API-Zertifikat -"The ordering amount of %1 is pending approval on the payment gateway.","The ordering amount of %1 is pending approval on the payment gateway." -"Ordered amount of %1","Ordered amount of %1" -"We'll authorize the amount of %1 as soon as the payment gateway approves it.","We'll authorize the amount of %1 as soon as the payment gateway approves it." -"The authorized amount is %1.","The authorized amount is %1." -"The maximum number of child authorizations is reached.","Die maximal mögliche Anzahl an Kinder-Autorisationen ist erreicht." -"PayPal can't process orders with a zero balance due. ' 'To finish your purchase, please go through the standard checkout process.","PayPal can't process orders with a zero balance due. ' 'To finish your purchase, please go through the standard checkout process." -"Payer is not identified.","Zahler ist nicht identifiziert" -"Last Transaction ID","Letzte Überweisungs-Kennnummer" -"This customer did not include a confirmed address.","This customer did not include a confirmed address." -"The payment is authorized but not settled.","Die Zahlung wurde autorisiert aber noch nicht ausgeführt." -"The payment eCheck is not yet cleared.","Zahlung per eCheck ist noch nicht vereinbart." -"The merchant holds a non-U.S. account and does not have a withdrawal mechanism.","The merchant holds a non-U.S. account and does not have a withdrawal mechanism." -"The payment currency does not match any of the merchant's balances currency.","The payment currency does not match any of the merchant's balances currency." -"The payment is pending while it is being reviewed by PayPal for risk.","Zahlung steht noch aus und wird von PayPal auf Risiken geprüft." -"The payment is pending because it was made to an email address that is not yet registered or confirmed.","Die Zahlung steht noch aus, da sie an eine Email-Adresse versandt wurde, die weder registriert noch bestätigt ist." -"The merchant account is not yet verified.","Das Händlerkonto wurde noch nicht verifiziert." -"The payment was made via credit card. In order to receive funds merchant must upgrade account to Business or Premier status.","Die Zahlung wurde mit Kreditkarte getätigt. Damit der Händler Zahlungen erhalten kann, muss er sein Konto auf Business- oder Premiumstatus upgraden." -"Sorry, but something went wrong. Please contact PayPal customer service.","Sorry, but something went wrong. Please contact PayPal customer service." -"A reversal has occurred on this transaction due to a chargeback by your customer.","A reversal has occurred on this transaction due to a chargeback by your customer." -"A reversal has occurred on this transaction due to your customer triggering a money-back guarantee.","A reversal has occurred on this transaction due to your customer triggering a money-back guarantee." -"A reversal has occurred on this transaction due to a complaint about the transaction from your customer.","A reversal has occurred on this transaction due to a complaint about the transaction from your customer." -"A reversal has occurred on this transaction because you have given the customer a refund.","A reversal has occurred on this transaction because you have given the customer a refund." -"Reversal of an adjustment.","Storno einer Änderung" -"Transaction reversal due to fraud detected by PayPal administrators.","Transaction reversal due to fraud detected by PayPal administrators." -"Transaction reversal by PayPal administrators.","Transaction reversal by PayPal administrators." -"Reimbursement for a chargeback.","Rückerstattung für eine Rückbuchung" -"Settlement of a chargeback.","Zahlung eine Rücklastschrift" -"A reversal has occurred on this transaction because of a customer dispute suspecting unauthorized spoof.","A reversal has occurred on this transaction because of a customer dispute suspecting unauthorized spoof." -"Buyer claims that he did not receive goods or service.","Buyer claims that he did not receive goods or service." -"Buyer claims that the goods or service received differ from merchant’s description of the goods or service.","Buyer claims that the goods or service received differ from merchant’s description of the goods or service." -"Buyer claims that he/she did not authorize transaction.","Buyer claims that he/she did not authorize transaction." -"A case that has been resolved and close requires a reimbursement.","A case that has been resolved and close requires a reimbursement." -"Buyer claims that a possible duplicate payment was made to the merchant.","Buyer claims that a possible duplicate payment was made to the merchant." -"Buyer claims that the received merchandise is unsatisfactory, defective, or damaged.","Buyer claims that the received merchandise is unsatisfactory, defective, or damaged." -"Unknown reason. Please contact PayPal customer service.","Unbekannter Grund. Bitte kontaktieren Sie den PayPal Kundenservice." -"Payer ID","Zahler Kennnummer" -"Payer Email","Zahler Email" -"Payer Status","Zahler Status" -"Payer Address ID","Zahler Adressen Kennummer" -"Payer Address Status","Adressenstatus des Zahlers" -"Merchant Protection Eligibility","Händlerschutz Berechtigung" -"Triggered Fraud Filters","Ausgelöste Betrugsfilter" -"Last Correlation ID","Letzte Korrelations Identifizierung" -"Address Verification System Response","Adressen Prüfsystem Rückmeldung" -"CVV2 Check Result by PayPal","CVV2 Prüfergebnis durch PayPal" -"Buyer's Tax ID","Steuernummer des Käufers" -"Buyer's Tax ID Type","Art der Steuernummer des Käufers" -"PayPal/Centinel Visa Payer Authentication Service Result","PayPal/Centinel Visa Payer Authentication Service Ergebnis" -"PayPal/Centinel Electronic Commerce Indicator","PayPal/Cenitel Electronic Commerce Indikator" -Chargeback,Rücklastschrift -Complaint,Complaint -Dispute,Dispute -"Matched Address only (no ZIP)","Nur übereinstimmende Adresse (keine Postleitzahl)" -"Matched Address only (no ZIP) International","Matched Address only (no ZIP) International" -"No Details matched","Keine Details stimmen überein" -"No Details matched. International","Keines der Details stimmt überein. International" -"Exact Match. Address and nine-digit ZIP code","Genaue Übereinstimmung. Adresse und neunstellige Postleitzahl" -"Exact Match. Address and Postal Code. International","Genaue Übereinstimmung. Adresse und Postleitzahl. International" -"Exact Match. Address and Postal Code. UK-specific","Genaue Übereinstimmung. Adresse und Postleitzahl. GB-spezifisch" -"N/A. Not allowed for MOTO (Internet/Phone) transactions","Nicht zutreffend. MOTO (Internet/Telefon) Transaktionen nicht erlaubt" -"N/A. Global Unavailable","N/A. Weltweit nicht verfügbar" -"N/A. International Unavailable","N/A. International nicht verfügbar" -"Matched five-digit ZIP only (no Address)","Nur die fünfstellige Postleitzahl stimmt überein (keine Adresse)" -"Matched Postal Code only (no Address)","Nur die Postleitzahl stimmt überein (keine Adresse)" -"N/A. Retry","N/A. wiederholen" -"N/A. Service not Supported","Nicht zutreffend. Service nicht angeboten" -"N/A. Unavailable","N/A. Nicht verfügbar" -"Matched whole nine-didgit ZIP (no Address)","Die ganze neunstellige Postleitzahl stimmt überein (keine Adresse)" -"Yes. Matched Address and five-didgit ZIP","Ja. Adresse und fünfstellige Postleitzahl stimmen überein." -"All the address information matched","Alle Adressdaten stimmen überein" -"None of the address information matched","Keine der Adress-Informationen stimmt überein" -"Part of the address information matched","Die Adressen-Information stimmt teilweise überein" -"N/A. The merchant did not provide AVS information","Nicht zutreffend. Der Händler hat keine AVS Informationen angegeben" -"N/A. Address not checked, or acquirer had no response. Service not available","N/A. Adresse nicht geprüft oder der Käufer bekam keine Antwort. Service nicht verfügbar." -"Matched (CVV2CSC)","Übereinstimmung (CVV2CSC)" -"No match","Keine Übereinstimmung" -"N/A. Not processed","N/A. Nicht verarbeitet" -"N/A. Service not supported","Nicht verfügbar. Service wird nicht unterstützt." -"N/A. Service not available","N/A. Service ist nicht verfügbar" -"N/A. No response","N/A. Keine Antwort" -"Matched (CVV2)","abgeglichen (CVV2)" -"N/A. The merchant has not implemented CVV2 code handling","N/A. Der Händler benutzt keine CVV2 Code Verarbeitung" -"N/A. Merchant has indicated that CVV2 is not present on card","N/A. Händler hat angezeigt, dasssich CVV2 nicht auf der Karte befindet." -"Authenticated, Good Result","Authentifiziert, richtiges Ergebnis" -"Authenticated, Bad Result","Authentifiziert, falsches Ergebnis" -"Attempted Authentication, Good Result","Versuchte Authentifizierung, richtiges Ergebnis" -"Attempted Authentication, Bad Result","Versuchte Authentifizierung, falsches Ergebnis" -"No Liability Shift","Keine Haftung Wechseln" -"Issuer Liability","Haftung des Ausstellers" -CNPJ,CNPJ -CPF,CPF -"IPN ""%1"". Case type ""%2"". Case ID ""%3"" %4","IPN ""%1"". Case type ""%2"". Case ID ""%3"" %4" -"IPN ""%1"". A dispute has been resolved and closed. %2 Transaction amount %3.","IPN ""%1"". A dispute has been resolved and closed. %2 Transaction amount %3." -"IPN ""%1"". %2 Transaction amount %3. Transaction ID: ""%4""","IPN ""%1"". %2 Transaction amount %3. Transaction ID: ""%4""" -"You notified customer about creditmemo #%1.","You notified customer about creditmemo #%1." -"Created billing agreement #%1.","Created billing agreement #%1." -"We couldn't create a billing agreement for this order.","We couldn't create a billing agreement for this order." -"Payflow PNREF: #%1.","Payflow PNREF: #%1." -"Fetch transaction details method does not exists in Payflow","Fetch transaction details method does not exists in Payflow" -"We cannot send the new order email.","We cannot send the new order email." -"You cannot void a verification transaction.","You cannot void a verification transaction." -"Payment transactions disallow storing objects.","Zahlungen beinhalten nicht das Speichern der Objekte." -"You need to enter a transaction ID.","You need to enter a transaction ID." -"This operation requires an existing transaction object.","Dieser Vorgang erfordert einen bestehenden Transaktionsgegenstand." -"You need an authorization transaction to void.","You need an authorization transaction to void." -"We can't issue a refund transaction because there is no capture transaction.","We can't issue a refund transaction because there is no capture transaction." -"We cannot create a target file for reading reports.","We cannot create a target file for reading reports." -"Report Date",Berichtsdatum -"Merchant Account","Händler Konto" -"Transaction ID",TransaktionsID -"Invoice ID",Rechnungsnummer -"PayPal Reference ID","PayPal Referenz-Kennnummer" -"PayPal Reference ID Type","PayPal Referenz.Kennnummerntyp" -"Event Code",Vorgang-Schlüssel -"Finish Date","Finish Date" -"Debit or Credit","Soll oder Haben" -"Gross Amount",Bruttobetrag -"Fee Debit or Credit","Gebühr Soll oder Haben" -"Fee Amount","Gebühr Betrag" -"Order ID",Bestellungsidentifizierung -"Subscription ID",Bestellnummer -"Preapproved Payment ID","Vorabgenehmigte Zahlung Kennnummer" -Credit,Guthaben -Debit,Soll -"General: received payment of a type not belonging to the other T00xx categories","Allemein: Zahlung eines Typs erhalten, der nicht zu den anderen T00xx Kategorien gehört" -"Mass Pay Payment","""Mass Pay"" Zahlungen" -"Subscription Payment, either payment sent or payment received","Abonnementzahlung, entweder geschickte Zahlung oder Zahlung erhalten" -"Preapproved Payment (BillUser API), either sent or received","Vorausgenehmigte Bezahlung (BillUser API), entweder geschickt oder erhalten" -"eBay Auction Payment","eBay Auktion Zahlung" -"Direct Payment API","Direktzahlung API" -"Express Checkout APIs","Express Kaufabwicklung APIs" -"Website Payments Standard Payment","Webseite Zahlungen Standard Zahlung" -"Postage Payment to either USPS or UPS","Zahlung der Versandgebühr entweder an USPS oder UPS" -"Gift Certificate Payment: purchase of Gift Certificate","Zahlung mit Geschenkgutschein: Kauf von Geschenkgutscheinen" -"Auction Payment other than through eBay","Eine andere Auktionszahlung als über eBay" -"Mobile Payment (made via a mobile phone)","Handy Zahlung (Zahlung erfolgt per Handy)" -"Virtual Terminal Payment","Virtuelles Zahlungsterminal" -"General: non-payment fee of a type not belonging to the other T01xx categories","Gebühr für Zahlungsverweigerung eines Typs, der nicht zu den anderen T01xx Kategorien gehört" -"Fee: Web Site Payments Pro Account Monthly","Gebühr: monatliche Zahlungen der Webseite für Konto" -"Fee: Foreign ACH Withdrawal","Gebühr Storno" -"Fee: WorldLink Check Withdrawal","Gebühr: WorldLink Scheckauszahlung" -"Fee: Mass Pay Request","Gebühr: Anforderung Sammelzahlung" -"General Currency Conversion","Allgemein Währungsumrechnung" -"User-initiated Currency Conversion","Vom Benutzer ausgelöste Währungsumrechnung" -"Currency Conversion required to cover negative balance","Währungsumrechnung erforderlich, um negatives Saldo zu decken" -"General Funding of PayPal Account ","Allgemein Finanzierung des PayPal Kontos" -"PayPal Balance Manager function of PayPal account","PayPal Guthaben-Managerfunktion des PayPal Kontos" -"ACH Funding for Funds Recovery from Account Balance","ACH Finanzierung der Zurückgewinnung des Kontostands" -"EFT Funding (German banking)","EFT Finanzierung (Deutsches Banksystem)" -"General Withdrawal from PayPal Account","Allgemein Abhebung vom PayPal Konto" -AutoSweep,Selbstdurchlauf -"General: Use of PayPal account for purchasing as well as receiving payments","Allgemein: Verwendung des PayPal Kontos für Einkauf und den Empfang von Zahlungen" -"Virtual PayPal Debit Card Transaction","Virtuelle PayPal Überweisung mit Debitkarte" -"PayPal Debit Card Withdrawal from ATM","PayPal Debitkarte Abhebung von ATM" -"Hidden Virtual PayPal Debit Card Transaction","Verborgene virtuelle PayPal Debitkarten Überweisung" -"PayPal Debit Card Cash Advance","PayPal Debitkarte Barvorschuss" -"General: Withdrawal from PayPal Account","Allgemein: Abhebung vom PayPal Konto" -"General (Purchase with a credit card)","Allgemein (Kauf mit einer Kreditkarte)" -"Negative Balance","Negatives Guthaben" -"General: bonus of a type not belonging to the other T08xx categories","Allgemein: Bonus eines Typs der nicht zu den anderen T08xx Kategorien gehört" -"Debit Card Cash Back","Debitkarte Cash Back" -"Merchant Referral Bonus","Händler Empfehlungsbonus" -"Balance Manager Account Bonus","Guthaben-Manager Kontobonus" -"PayPal Buyer Warranty Bonus","PayPal Käufer Garantiebonus" -"PayPal Protection Bonus","PayPal Schutz Bonus" -"Bonus for first ACH Use","Bonus für erste ACH-Benutzung" -"General Redemption","Allgemein Rückzahlung" -"Gift Certificate Redemption","Einlösung von Geschenkgutscheinen" -"Points Incentive Redemption","Einlösung von Loyalitätspunkten" -"Coupon Redemption",Coupon-Einlösung -"Reward Voucher Redemption","Belohnungsgutschein Einlösung" -"General. Product no longer supported","Allgemein. Produkt wird nicht mehr untersützt" -"General: reversal of a type not belonging to the other T11xx categories","Allgemein: Storno eines Typs der nicht zu den anderen T11xx Kategorien gehört" -"ACH Withdrawal","ACH Abhebung" -"Debit Card Transaction","Debitkarte Überweisung" -"Reversal of Points Usage","Points Rückbelastung" -"ACH Deposit (Reversal)","ACH Einlage (Stornierung)" -"Reversal of General Account Hold","Storno des Hauptkontos durchführen" -"Account-to-Account Payment, initiated by PayPal","Konto-zu-Konto Zahlung, von PayPal eingeleitet" -"Payment Refund initiated by merchant","Rückerstattung der Zahlung durch den Händler initiiert" -"Fee Reversal","Gebühr: ACH Auslands-Abhebung[caution! - this translation is for job#55147 and vice versa. sorry]" -"Hold for Dispute Investigation","Zurückgehalten wegen Disput Überprüfung" -"Reversal of hold for Dispute Investigation","Stornierung einer Reservierung des Kontos wegen Disput Untersuchung" -"General: adjustment of a type not belonging to the other T12xx categories","Allgemein: Einstellung eines Typs der nicht zu den anderen T12xx Kategorien gehört" -Reversal,Rückbelastung -Charge-off,abbuchen -Incentive,Anreiz -"Reimbursement of Chargeback","Rückerstattung einer Rücklastschrift" -"General (Authorization)","Allgemein (Berechtigung)" -Reauthorization,"Erneute Autorisierung" -Void,Leer -"General (Dividend)","Allgemein (Dividende)" -"General: temporary hold of a type not belonging to the other T15xx categories","Allgemein: Vorübergehende Einbehaltung eines Typs, der nicht zu den anderen T15xx Kategorien gehört" -"Open Authorization","Autorisierung öffnen" -"ACH Deposit (Hold for Dispute or Other Investigation)","ACH Einlage (Für Dispute oder andere Untersuchungen zurückgehalten)" -"Available Balance","Verfügbares Guthaben" -Funding,Finanzierung -"General: Withdrawal to Non-Bank Entity","Allgemein: Abhebung von Nichtbank-Finanzintermediären" -"WorldLink Withdrawal","WorldLink Abhebung" -"Buyer Credit Payment","Käuferkredit Zahlung" -"General Adjustment without businessrelated event","Allgemeine Einstellung ohne geschäftsbezogenen Vorgang" -"General (Funds Transfer from PayPal Account to Another)","Allgemein (Geldtransfer von einem PayPal Konto auf ein anderes)" -"Settlement Consolidation","Zahlung Zusammenführung" -"General: event not yet categorized","Allgemein: noch nicht klassifiziert" -"The PayPal certificate file is empty.","The PayPal certificate file is empty." -"Header (center)","Header (center)" -"Sidebar (right)","Sidebar (right)" -"Near Bill Me Later checkout button","Near Bill Me Later checkout button" -"Every 3 days","alle 3 Tage" -"Every 7 days","alle 7 Tage" -"Every 10 days","alle 10 Tage" -"Every 14 days","alle 14 Tage" -"Every 30 days","alle 30 Tage" -"Every 40 days","alle 40 Tage" -"No Logo","Kein Logo" -"Pending PayPal","PayPal ausstehend" -"Billing Agreement",Rechnungsvereinbarung -"Created At","Created At" -"Updated At","Updated At" -"-- Please Select Billing Agreement--","-- Bitte wählen Sie Rechnungsvereinbarung --" -"Not sure what PayPal payment method to use? Click here to learn more.","Not sure what PayPal payment method to use? Click here to learn more." -"Important: ","Important: " -"To use PayPal Payments Advanced, you must configure your PayPal Payments Advanced account on the PayPal website.","To use PayPal Payments Advanced, you must configure your PayPal Payments Advanced account on the PayPal website." -"Once you log into your PayPal Advanced account, navigate to the Service Settings - Hosted Checkout Pages - Set Up menu and set the options described below","Once you log into your PayPal Advanced account, navigate to the Service Settings - Hosted Checkout Pages - Set Up menu and set the options described below" -"To use PayPal Payflow Link, you must configure your PayPal Payflow Link account on the PayPal website.","To use PayPal Payflow Link, you must configure your PayPal Payflow Link account on the PayPal website." -"Once you log into your PayPal Payflow Link account, navigate to the Service Settings - Hosted Checkout Pages - Set Up menu and set the options described below","Once you log into your PayPal Payflow Link account, navigate to the Service Settings - Hosted Checkout Pages - Set Up menu and set the options described below" -"Agreement Information","Agreement Information" -"Reference ID:","Reference ID:" -Status:,Status: -Created:,Created: -Updated:,Updated: -"Payment Method:","Payment Method:" -"Ship To","Ship To" -"Back to Billing Agreements","Zurück zu Rechnungsvereinbarungen" -"There are no billing agreements yet.","Es gibt noch keine Rechnungsvereinbahrungen." -"New Billing Agreement","Neue Abrechnungsvereinbarung" -"You will be redirected to the payment system website.","You will be redirected to the payment system website." -Create...,Create... -"Your billing agreement # is: %1.","Your billing agreement # is: %1." -"Review Order","Auftrag überprüfen" -"Please select a shipping method...","Bitte wählen Sie eine Versandart aus..." -"Update Shipping Method","Update Shipping Method" -"Edit Payment Information","Edit Payment Information" -"Items in Your Shopping Cart","Artikel in Ihrem Warenkorb" -"Edit Shopping Cart","Warenkorb bearbeiten" -"Please update order data to get shipping methods and rates","Aktualisieren Sie bitte die Auftragsdaten für Versandmethoden und -tarife" -"Checkout with PayPal","Mit PayPal abmelden" -"Please do not refresh the page until you complete payment.","Bitte die Seite nicht aktualisieren, bis Sie die Zahlung abgeschlossen haben." -"You will be required to enter your payment details after you place an order.","Sie werden aufgefordert, Ihre Zahlungsdaten eingeben, nachdem Sie eine Bestellung aufgegeben haben." -"Additional Options","Zusätzliche Optionen" -"Acceptance Mark","Akzeptanz Kennzeichnung" -"What is PayPal?","Was ist PayPal?" -"Sign a billing agreement to streamline further purchases with PayPal.","Unterzeichnen sie eine Rechnungsvereinbarung, um zukünftige Käufe mit PayPal zu rationalisieren." -Schedule,Schedule -Size,Size -"Sorry, something went wrong.","Sorry, something went wrong." -"Sorry, something went wrong. Please try again later.","Sorry, something went wrong. Please try again later." -"Test Mode","Test Mode" -"Payment Action","Payment Action" -"3D Secure","3D Secure" -"Severe 3D Secure Card Validation","Severe 3D Secure Card Validation" -"Severe Validation Removes Chargeback Liability on Merchant","Severe Validation Removes Chargeback Liability on Merchant" -"Centinel API URL","Centinel API URL" -"Debug Mode","Debug Mode" -"Sandbox Mode","Sandbox Mode" -1,1 -"Merchant Location","Merchant Location" -"Merchant Country","Merchant Country" -"If not specified, Default Country from General Config will be used","If not specified, Default Country from General Config will be used" -"Website Payments Pro (Includes Express Checkout)","Website Payments Pro (Includes Express Checkout)" -"Accept payments with a completely customizable checkout.","Accept payments with a completely customizable checkout." -"Required PayPal Settings","Required PayPal Settings" -"Website Payments Pro and Express Checkout","Website Payments Pro and Express Checkout" -"Enable this Solution","Enable this Solution" -"Advertise Bill Me Later","Advertise Bill Me Later" -" - Why Advertise Financing?
- Give your sales a boost when you advertise financing.
PayPal helps turn browsers into buyers with financing - from Bill Me Later®. Your customers have more time to pay, while you get paid up front – at no additional cost to you. - Use PayPal’s free banner ads that let you advertise Bill Me Later® financing as a payment option when your customers check out with PayPal. - The PayPal Advertising Program has been shown to generate additional purchases as well as increase consumer's average purchase sizes by 15% - or more. See Details. - "," - Why Advertise Financing?
- Give your sales a boost when you advertise financing.
PayPal helps turn browsers into buyers with financing - from Bill Me Later®. Your customers have more time to pay, while you get paid up front – at no additional cost to you. - Use PayPal’s free banner ads that let you advertise Bill Me Later® financing as a payment option when your customers check out with PayPal. - The PayPal Advertising Program has been shown to generate additional purchases as well as increase consumer's average purchase sizes by 15% - or more. See Details. - " -"Home Page","Home Page" -"Catalog Category Page","Catalog Category Page" -"Catalog Product Page","Catalog Product Page" -"Checkout Cart Page","Checkout Cart Page" -"Basic Settings - PayPal Website Payments Pro","Basic Settings - PayPal Website Payments Pro" -"It is recommended to set this value to ""Debit or Credit Card"" per store views.","It is recommended to set this value to ""Debit or Credit Card"" per store views." -"Credit Card Settings","Credit Card Settings" -"Allowed Credit Card Types","Allowed Credit Card Types" -" - 3D Secure validation is required for Maestro cards. Supporting of American Express cards require additional agreement. Learn more at http://www.paypal.com/amexupdate. - "," - 3D Secure validation is required for Maestro cards. Supporting of American Express cards require additional agreement. Learn more at http://www.paypal.com/amexupdate. - " -"Payment Applicable From","Payment Applicable From" -"Countries Payment Applicable From","Countries Payment Applicable From" -"Enable SSL verification","Enable SSL verification" -"Transfer Cart Line Items","Transfer Cart Line Items" -"Require CVV Entry","Require CVV Entry" -"Centinel Custom API URL","Centinel Custom API URL" -"If empty, a default value will be used. Custom URL may be provided by CardinalCommerce agreement.","If empty, a default value will be used. Custom URL may be provided by CardinalCommerce agreement." -"PayPal Billing Agreement Settings","PayPal Billing Agreement Settings" -"Settlement Report Settings","Settlement Report Settings" -"Frontend Experience Settings","Frontend Experience Settings" -"Basic Settings - PayPal Express Checkout","Basic Settings - PayPal Express Checkout" -"Website Payments Standard","Website Payments Standard" -"Accept credit card and PayPal payments securely.","Accept credit card and PayPal payments securely." -"Basic Settings - PayPal Website Payments Standard","Basic Settings - PayPal Website Payments Standard" -"It is recommended to set this value to ""PayPal"" per store views.","It is recommended to set this value to ""PayPal"" per store views." -"Summary Text for Aggregated Cart","Summary Text for Aggregated Cart" -"Uses store frontend name by default.","Uses store frontend name by default." -"Payflow Pro","Payflow Pro" -"Connect your merchant account with a fully customizable gateway that lets customers pay without leaving your site.","Connect your merchant account with a fully customizable gateway that lets customers pay without leaving your site." -Partner,Partner -Vendor,Vendor -"Use Proxy","Use Proxy" -"Proxy Host","Proxy Host" -"Proxy Port","Proxy Port" -"Basic Settings - PayPal Payflow Pro","Basic Settings - PayPal Payflow Pro" -" - Supporting of American Express cards require additional agreement. Learn more at http://www.paypal.com/amexupdate. - "," - Supporting of American Express cards require additional agreement. Learn more at http://www.paypal.com/amexupdate. - " -"Severe validation removes chargeback liability on merchant.","Severe validation removes chargeback liability on merchant." -"A value is required for live mode. Refer to your CardinalCommerce agreement.","A value is required for live mode. Refer to your CardinalCommerce agreement." -"Payflow Link (Includes Express Checkout)","Payflow Link (Includes Express Checkout)" -"Connect your merchant account with a PCI-compliant gateway that lets customers pay without leaving your site.","Connect your merchant account with a PCI-compliant gateway that lets customers pay without leaving your site." -"Payflow Link and Express Checkout","Payflow Link and Express Checkout" -"Email Associated with PayPal Merchant Account (Optional)","Email Associated with PayPal Merchant Account (Optional)" -"If you do not have multiple users set up on your account, please re-enter your Vendor/Merchant Login here.","If you do not have multiple users set up on your account, please re-enter your Vendor/Merchant Login here." -"Enable Payflow Link","Enable Payflow Link" -"Enable Express Checkout","Enable Express Checkout" -" - Why Advertise Financing?
- Give your sales a boost when you advertise financing.
PayPal helps turn browsers into buyers with financing - from Bill Me Later®. Your customers have more time to pay, while you get paid up front – at no additional cost to you. - Use PayPal’s free banner ads that let you advertise Bill Me Later® financing as a payment option when your customers check out with PayPal. - The PayPal Advertising Program has been shown to generate additional purchases as well as increase consumer's average purchase sizes by 15% - or more. See Details. - "," - Why Advertise Financing?
- Give your sales a boost when you advertise financing.
PayPal helps turn browsers into buyers with financing - from Bill Me Later®. Your customers have more time to pay, while you get paid up front – at no additional cost to you. - Use PayPal’s free banner ads that let you advertise Bill Me Later® financing as a payment option when your customers check out with PayPal. - The PayPal Advertising Program has been shown to generate additional purchases as well as increase consumer's average purchase sizes by 15% - or more. See Details. - " -"Basic Settings - PayPal Payflow Link","Basic Settings - PayPal Payflow Link" -"CVV Entry is Editable","CVV Entry is Editable" -"Send Email Confirmation","Send Email Confirmation" -"URL method for Cancel URL and Return URL","URL method for Cancel URL and Return URL" -"Express Checkout","Express Checkout" -"Add PayPal as an additional payment method to your checkout page.","Add PayPal as an additional payment method to your checkout page." -"Email Associated with PayPal Merchant Account","Email Associated with PayPal Merchant Account" -" - Start accepting payments via PayPal! - "," - Start accepting payments via PayPal! - " -"Don't have a PayPal account? Simply enter your email address.","Don't have a PayPal account? Simply enter your email address." -"API Authentication Methods","API Authentication Methods" -"API Username","API Username" -"API Password","API Password" -"Get Credentials from PayPal","Get Credentials from PayPal" -"Sandbox Credentials","Sandbox Credentials" -"API Uses Proxy","API Uses Proxy" -"Enable Bill Me Later","Enable Bill Me Later" -"PayPal Express Checkout lets you give customers access to financing through Bill Me Later® - at no additional cost to you. - You get paid up front, even though customers have more time to pay. A pre-integrated payment button lets customers pay quickly with Bill Me Later®. - Learn More - ","PayPal Express Checkout lets you give customers access to financing through Bill Me Later® - at no additional cost to you. - You get paid up front, even though customers have more time to pay. A pre-integrated payment button lets customers pay quickly with Bill Me Later®. - Learn More - " -"Publisher ID","Publisher ID" -"Required to display a banner","Required to display a banner" -"Get Publisher ID from PayPal","Get Publisher ID from PayPal" -"It is recommended to set this value to ""Magento_Paypal"" per store views.","It is recommended to set this value to ""Magento_Paypal"" per store views." -"Shortcut on Shopping Cart","Shortcut on Shopping Cart" -"Also affects mini-shopping cart.","Also affects mini-shopping cart." -"Shortcut on Product View","Shortcut on Product View" -"Authorization Honor Period (days)","Authorization Honor Period (days)" -"Specifies what the Authorization Honor Period is on the merchant’s PayPal account. It must mirror the setting in PayPal.","Specifies what the Authorization Honor Period is on the merchant’s PayPal account. It must mirror the setting in PayPal." -"Order Valid Period (days)","Order Valid Period (days)" -"Specifies what the Order Valid Period is on the merchant’s PayPal account. It must mirror the setting in PayPal.","Specifies what the Order Valid Period is on the merchant’s PayPal account. It must mirror the setting in PayPal." -"Number of Child Authorizations","Number of Child Authorizations" -"The default number of child authorizations in your PayPal account is 1. To do multiple authorizations please contact PayPal to request an increase.","The default number of child authorizations in your PayPal account is 1. To do multiple authorizations please contact PayPal to request an increase." -"Transfer Shipping Options","Transfer Shipping Options" -"If this option is enabled, customer can change shipping address and shipping method on PayPal website. In live mode works via HTTPS protocol only.","If this option is enabled, customer can change shipping address and shipping method on PayPal website. In live mode works via HTTPS protocol only." -"Notice that PayPal can handle up to 10 shipping options. That is why Magento will transfer only first 10 cheapest shipping options if there are more than 10 available.","Notice that PayPal can handle up to 10 shipping options. That is why Magento will transfer only first 10 cheapest shipping options if there are more than 10 available." -"Shortcut Buttons Flavor","Shortcut Buttons Flavor" -"Enable PayPal Guest Checkout","Enable PayPal Guest Checkout" -"Ability for buyer to purchase without PayPal account.","Ability for buyer to purchase without PayPal account." -"Require Customer's Billing Address","Require Customer's Billing Address" -"This feature needs be enabled first for the merchant account through PayPal technical support.","This feature needs be enabled first for the merchant account through PayPal technical support." -"Billing Agreement Signup","Billing Agreement Signup" -"Whether to create a billing agreement, if there are no active billing agreements available.","Whether to create a billing agreement, if there are no active billing agreements available." -" - Merchants need to apply to PayPal for enabling billing agreements feature. Do not enable this option until PayPal confirms that billing agreements are enabled for your merchant account. - "," - Merchants need to apply to PayPal for enabling billing agreements feature. Do not enable this option until PayPal confirms that billing agreements are enabled for your merchant account. - " -"Skip Order Review Step","Skip Order Review Step" -" - Will appear as a payment option only for customers who have at least one active billing agreement. - "," - Will appear as a payment option only for customers who have at least one active billing agreement. - " -"Allow in Billing Agreement Wizard","Allow in Billing Agreement Wizard" -"SFTP Credentials","SFTP Credentials" -"Custom Endpoint Hostname or IP-Address","Custom Endpoint Hostname or IP-Address" -"By default it is ""reports.paypal.com"".","By default it is ""reports.paypal.com""." -"Use colon to specify port. For example: ""test.example.com:5224"".","Use colon to specify port. For example: ""test.example.com:5224""." -"Custom Path","Custom Path" -"Scheduled Fetching","Scheduled Fetching" -"Enable Automatic Fetching","Enable Automatic Fetching" -"PayPal retains reports for 45 days.","PayPal retains reports for 45 days." -"Time of Day","Time of Day" -"PayPal Product Logo","PayPal Product Logo" -"Displays on catalog pages and homepage.","Displays on catalog pages and homepage." -"PayPal Merchant Pages Style","PayPal Merchant Pages Style" -"Page Style","Page Style" -" - Allowable values: ""paypal"", ""primary"" (default), your_custom_value (a custom payment page style from your merchant account profile). - "," - Allowable values: ""paypal"", ""primary"" (default), your_custom_value (a custom payment page style from your merchant account profile). - " -"Header Image URL","Header Image URL" -" - The image at the top left of the checkout page. Max size is 750x90-pixel. https is highly encouraged. - "," - The image at the top left of the checkout page. Max size is 750x90-pixel. https is highly encouraged. - " -"Header Background Color","Header Background Color" -" - The background color for the header of the checkout page. Case-insensitive six-character HTML hexadecimal color code in ASCII. - "," - The background color for the header of the checkout page. Case-insensitive six-character HTML hexadecimal color code in ASCII. - " -"Header Border Color","Header Border Color" -"2-pixel perimeter around the header space.","2-pixel perimeter around the header space." -"Page Background Color","Page Background Color" -" - The background color for the checkout page around the header and payment form. - "," - The background color for the checkout page around the header and payment form. - " -"Website Payments Pro Hosted Solution","Website Payments Pro Hosted Solution" -"Accept payments with a PCI compliant checkout that keeps customers on your site.","Accept payments with a PCI compliant checkout that keeps customers on your site." -"Payments Pro Hosted Solution","Payments Pro Hosted Solution" -" - Why Advertise Financing?
- Give your sales a boost when you advertise financing.
PayPal helps turn browsers into buyers with financing - from Bill Me Later®. Your customers have more time to pay, while you get paid up front – at no additional cost to you. - Use PayPal’s free banner ads that let you advertise Bill Me Later® financing as a payment option when your customers check out with PayPal. - The PayPal Advertising Program has been shown to generate additional purchases as well as increase consumer's average purchase sizes by 15% - or more. See Details. - "," - Why Advertise Financing?
- Give your sales a boost when you advertise financing.
PayPal helps turn browsers into buyers with financing - from Bill Me Later®. Your customers have more time to pay, while you get paid up front – at no additional cost to you. - Use PayPal’s free banner ads that let you advertise Bill Me Later® financing as a payment option when your customers check out with PayPal. - The PayPal Advertising Program has been shown to generate additional purchases as well as increase consumer's average purchase sizes by 15% - or more. See Details. - " -"Basic Settings - PayPal Payments Pro Hosted Solution","Basic Settings - PayPal Payments Pro Hosted Solution" -"Display Express Checkout in the Payment Information step","Display Express Checkout in the Payment Information step" -" - PayPal All-in-One Payment Solutions  Accept and process credit cards and PayPal payments. - "," - PayPal All-in-One Payment Solutions  Accept and process credit cards and PayPal payments. - " -"Choose a secure bundled payment solution for your business.","Choose a secure bundled payment solution for your business." -"PayPal Express Checkout","PayPal Express Checkout" -"Add another payment method to your existing solution or as a stand-alone option.","Add another payment method to your existing solution or as a stand-alone option." -"Payments Advanced (Includes Express Checkout)","Payments Advanced (Includes Express Checkout)" -"Accept payments with a PCI-compliant checkout that keeps customers on your site.","Accept payments with a PCI-compliant checkout that keeps customers on your site." -"Payments Advanced and Express Checkout","Payments Advanced and Express Checkout" -"PayPal recommends that you set up an additional User on your account at manager.paypal.com","PayPal recommends that you set up an additional User on your account at manager.paypal.com" -"PayPal recommends you set up an additional User on your account at manager.paypal.com, instead of entering your admin username and password here. This will enhance your security and prevent service interruptions if you later change your password. If you do not want to set up an additional User, you can re-enter your Merchant Login here.","PayPal recommends you set up an additional User on your account at manager.paypal.com, instead of entering your admin username and password here. This will enhance your security and prevent service interruptions if you later change your password. If you do not want to set up an additional User, you can re-enter your Merchant Login here." -" - Why Advertise Financing?
- Give your sales a boost when you advertise financing.
PayPal helps turn browsers into buyers with financing - from Bill Me Later®. Your customers have more time to pay, while you get paid up front – at no additional cost to you. - Use PayPal’s free banner ads that let you advertise Bill Me Later® financing as a payment option when your customers check out with PayPal. - The PayPal Advertising Program has been shown to generate additional purchases as well as increase consumer's average purchase sizes by 15% - or more. See Details. - "," - Why Advertise Financing?
- Give your sales a boost when you advertise financing.
PayPal helps turn browsers into buyers with financing - from Bill Me Later®. Your customers have more time to pay, while you get paid up front – at no additional cost to you. - Use PayPal’s free banner ads that let you advertise Bill Me Later® financing as a payment option when your customers check out with PayPal. - The PayPal Advertising Program has been shown to generate additional purchases as well as increase consumer's average purchase sizes by 15% - or more. See Details. - " -"Basic Settings - PayPal Payments Advanced","Basic Settings - PayPal Payments Advanced" -"Payments Pro (Includes Express Checkout)","Payments Pro (Includes Express Checkout)" -"Payments Pro and Express Checkout","Payments Pro and Express Checkout" -"Basic Settings - PayPal Payments Pro","Basic Settings - PayPal Payments Pro" -"Payments Standard","Payments Standard" -"Basic Settings - PayPal Payments Standard","Basic Settings - PayPal Payments Standard" -"PayPal Payment Gateways","PayPal Payment Gateways" -"Process payments using your own internet merchant account.","Process payments using your own internet merchant account." -"Payflow Pro (Includes Express Checkout)","Payflow Pro (Includes Express Checkout)" -"Payflow Pro and Express Checkout","Payflow Pro and Express Checkout" -" - Why Advertise Financing?
- Give your sales a boost when you advertise financing.
PayPal helps turn browsers into buyers with financing - from Bill Me Later®. Your customers have more time to pay, while you get paid up front – at no additional cost to you. - Use PayPal’s free banner ads that let you advertise Bill Me Later® financing as a payment option when your customers check out with PayPal. - The PayPal Advertising Program has been shown to generate additional purchases as well as increase consumer's average purchase sizes by 15% - or more. See Details. - "," - Why Advertise Financing?
- Give your sales a boost when you advertise financing.
PayPal helps turn browsers into buyers with financing - from Bill Me Later®. Your customers have more time to pay, while you get paid up front – at no additional cost to you. - Use PayPal’s free banner ads that let you advertise Bill Me Later® financing as a payment option when your customers check out with PayPal. - The PayPal Advertising Program has been shown to generate additional purchases as well as increase consumer's average purchase sizes by 15% - or more. See Details. - " -"Accept credit cards, debit cards and PayPal payments securely.","Accept credit cards, debit cards and PayPal payments securely." -"Accept payments with a completely customizable checkout page.","Accept payments with a completely customizable checkout page." -"Website Payments Pro Hosted Solution (Includes Express Checkout)","Website Payments Pro Hosted Solution (Includes Express Checkout)" -"Website Payments Pro Hosted Solution and Express Checkout","Website Payments Pro Hosted Solution and Express Checkout" -"Basic Settings - PayPal Website Payments Pro Hosted Solution","Basic Settings - PayPal Website Payments Pro Hosted Solution" -"PayPal Payment Solutions","PayPal Payment Solutions" diff --git a/app/code/Magento/Paypal/i18n/en_US.csv b/app/code/Magento/Paypal/i18n/en_US.csv deleted file mode 100644 index 7369fc0443680..0000000000000 --- a/app/code/Magento/Paypal/i18n/en_US.csv +++ /dev/null @@ -1,692 +0,0 @@ -Custom,Custom -Close,Close -Cancel,Cancel -Back,Back -Price,Price -ID,ID -Configure,Configure -No,No -Qty,Qty -Subtotal,Subtotal -"Incl. Tax","Incl. Tax" -Edit,Edit -"--Please Select--","--Please Select--" -Customer,Customer -"First Name","First Name" -"Last Name","Last Name" -Email,Email -"-- Please Select --","-- Please Select --" -Yes,Yes -Status,Status -Enabled,Enabled -"Sort Order","Sort Order" -Title,Title -"Are you sure you want to do this?","Are you sure you want to do this?" -Order,Order -View,View -Active,Active -Position,Position -Dynamic,Dynamic -N/A,N/A -Canceled,Canceled -"General Information","General Information" -Static,Static -"Advanced Settings","Advanced Settings" -"Learn More","Learn More" -"Start Date","Start Date" -"Product Name","Product Name" -"3D Secure Card Validation","3D Secure Card Validation" -"Merchant Liability","Merchant Liability" -"Billing Information","Billing Information" -"Shipping Information","Shipping Information" -"Shipping Method","Shipping Method" -"Please agree to all the terms and conditions before placing the order.","Please agree to all the terms and conditions before placing the order." -"Account confirmation is required. Please, check your e-mail for confirmation link. To resend confirmation email please click here.","Account confirmation is required. Please, check your e-mail for confirmation link. To resend confirmation email please click here." -Password,Password -Continue,Continue -"Order #","Order #" -Login,Login -"Shipping Address","Shipping Address" -"Payment Method","Payment Method" -"Place Order","Place Order" -"Sorry, no quotes are available for this order at this time.","Sorry, no quotes are available for this order at this time." -Sales,Sales -Created,Created -Display,Display -User,User -Daily,Daily -Date,Date -"Order Total","Order Total" -Never,Never -Updated,Updated -Reports,Reports -"Order Status","Order Status" -"View Order","View Order" -Event,Event -"Please Select","Please Select" -"Submitting order information...","Submitting order information..." -Authorization,Authorization -"You notified customer about invoice #%1.","You notified customer about invoice #%1." -"Note: %1","Note: %1" -"IPN ""%1""","IPN ""%1""" -"Billing Agreements","Billing Agreements" -"Reference ID","Reference ID" -"Billing Agreement #%1","Billing Agreement #%1" -"Related Orders","Related Orders" -"Billing Agreement View","Billing Agreement View" -"View Transaction Details","View Transaction Details" -"Reference Information","Reference Information" -"Transaction Information","Transaction Information" -"PayPal Fee Information","PayPal Fee Information" -"PayPal Settlement Reports","PayPal Settlement Reports" -"We are connecting to the PayPal SFTP server to retrieve new reports. Are you sure you want to continue?","We are connecting to the PayPal SFTP server to retrieve new reports. Are you sure you want to continue?" -"Fetch Updates","Fetch Updates" -button_label,button_label -sandbox_button_label,sandbox_button_label -Help,Help -"There is already another PayPal solution enabled. Enable this solution instead?","There is already another PayPal solution enabled. Enable this solution instead?" -"The following error(s) occured:","The following error(s) occured:" -"Some PayPal solutions conflict.","Some PayPal solutions conflict." -"PayPal Express Checkout is not enabled.","PayPal Express Checkout is not enabled." -"Please re-enable the previously enabled payment solutions.","Please re-enable the previously enabled payment solutions." -"View Demo","View Demo" -"See terms","See terms" -"You will be redirected to the PayPal website.","You will be redirected to the PayPal website." -"Would you like to sign a billing agreement ' 'to streamline further purchases with PayPal?","Would you like to sign a billing agreement ' 'to streamline further purchases with PayPal?" -"You will be redirected to the PayPal website when you place an order.","You will be redirected to the PayPal website when you place an order." -"Click here if you are not redirected within 10 seconds.","Click here if you are not redirected within 10 seconds." -"You will be redirected to the PayPal website in a few seconds.","You will be redirected to the PayPal website in a few seconds." -"You canceled the billing agreement.","You canceled the billing agreement." -"We could not cancel the billing agreement.","We could not cancel the billing agreement." -"You deleted the billing agreement.","You deleted the billing agreement." -"We could not delete the billing agreement.","We could not delete the billing agreement." -"Please specify the correct billing agreement ID and try again.","Please specify the correct billing agreement ID and try again." -"View Transaction","View Transaction" -"We found nothing to fetch because of an empty configuration.","We found nothing to fetch because of an empty configuration." -"We fetched %1 report rows from '%2@%3'.","We fetched %1 report rows from '%2@%3'." -"We couldn't fetch reports from '%1@%2'.","We couldn't fetch reports from '%1@%2'." -"Billing Agreement # %1","Billing Agreement # %1" -"We couldn't start the billing agreement wizard.","We couldn't start the billing agreement wizard." -"The billing agreement ""%1"" has been created.","The billing agreement ""%1"" has been created." -"We couldn't finish the billing agreement wizard.","We couldn't finish the billing agreement wizard." -"The billing agreement ""%1"" has been canceled.","The billing agreement ""%1"" has been canceled." -"We couldn't cancel the billing agreement.","We couldn't cancel the billing agreement." -"To proceed to Checkout, please log in using your email address.","To proceed to Checkout, please log in using your email address." -"We can't start Express Checkout.","We can't start Express Checkout." -"Express Checkout and Order have been canceled.","Express Checkout and Order have been canceled." -"Express Checkout has been canceled.","Express Checkout has been canceled." -"Unable to cancel Express Checkout","Unable to cancel Express Checkout" -"We can't process Express Checkout approval.","We can't process Express Checkout approval." -"We can't initialize Express Checkout review.","We can't initialize Express Checkout review." -"We can't update shipping method.","We can't update shipping method." -"We can't place the order.","We can't place the order." -"We can't initialize Express Checkout.","We can't initialize Express Checkout." -"PayPal Express Checkout Token does not exist.","PayPal Express Checkout Token does not exist." -"A wrong PayPal Express Checkout Token is specified.","A wrong PayPal Express Checkout Token is specified." -"Your payment has been declined. Please try again.","Your payment has been declined. Please try again." -"We can't contact the PayPal gateway.","We can't contact the PayPal gateway." -"PayPal response hasn't required fields.","PayPal response hasn't required fields." -"Something went wrong while processing your order.","Something went wrong while processing your order." -"PayPal gateway has rejected request. %1","PayPal gateway has rejected request. %1" -"PayPal gateway rejected the request. %1","PayPal gateway rejected the request. %1" -"I'm sorry - but we were not able to process your payment. Please try another payment method or contact us so we can assist you.","I'm sorry - but we were not able to process your payment. Please try another payment method or contact us so we can assist you." -"I'm sorry - but we are not able to complete your transaction. Please contact us so we can assist you.","I'm sorry - but we are not able to complete your transaction. Please contact us so we can assist you." -"The payment method code is not set.","The payment method code is not set." -"The reference ID is not set.","The reference ID is not set." -"Unable to save Billing Agreement:","Unable to save Billing Agreement:" -"The customer ID is not set.","The customer ID is not set." -"The Billing Agreement status is not set.","The Billing Agreement status is not set." -"The PayPal certificate does not exist.","The PayPal certificate does not exist." -"We prefer PayPal (150 X 60)","We prefer PayPal (150 X 60)" -"We prefer PayPal (150 X 40)","We prefer PayPal (150 X 40)" -"Now accepting PayPal (150 X 60)","Now accepting PayPal (150 X 60)" -"Now accepting PayPal (150 X 40)","Now accepting PayPal (150 X 40)" -"Payments by PayPal (150 X 60)","Payments by PayPal (150 X 60)" -"Payments by PayPal (150 X 40)","Payments by PayPal (150 X 40)" -"Shop now using (150 X 60)","Shop now using (150 X 60)" -"Shop now using (150 X 40)","Shop now using (150 X 40)" -Shortcut,Shortcut -"Acceptance Mark Image","Acceptance Mark Image" -Sale,Sale -"For Virtual Quotes Only","For Virtual Quotes Only" -Auto,Auto -"Ask Customer","Ask Customer" -"IPN (Instant Payment Notification) Only","IPN (Instant Payment Notification) Only" -"API Signature","API Signature" -"API Certificate","API Certificate" -"The ordering amount of %1 is pending approval on the payment gateway.","The ordering amount of %1 is pending approval on the payment gateway." -"Ordered amount of %1","Ordered amount of %1" -"We'll authorize the amount of %1 as soon as the payment gateway approves it.","We'll authorize the amount of %1 as soon as the payment gateway approves it." -"The authorized amount is %1.","The authorized amount is %1." -"The maximum number of child authorizations is reached.","The maximum number of child authorizations is reached." -"PayPal can't process orders with a zero balance due. ' 'To finish your purchase, please go through the standard checkout process.","PayPal can\'t process orders with a zero balance due. ' 'To finish your purchase, please go through the standard checkout process." -"Payer is not identified.","Payer is not identified." -"Last Transaction ID","Last Transaction ID" -"This customer did not include a confirmed address.","This customer did not include a confirmed address." -"The payment is authorized but not settled.","The payment is authorized but not settled." -"The payment eCheck is not yet cleared.","The payment eCheck is not yet cleared." -"The merchant holds a non-U.S. account and does not have a withdrawal mechanism.","The merchant holds a non-U.S. account and does not have a withdrawal mechanism." -"The payment currency does not match any of the merchant's balances currency.","The payment currency does not match any of the merchant's balances currency." -"The payment is pending while it is being reviewed by PayPal for risk.","The payment is pending while it is being reviewed by PayPal for risk." -"The payment is pending because it was made to an email address that is not yet registered or confirmed.","The payment is pending because it was made to an email address that is not yet registered or confirmed." -"The merchant account is not yet verified.","The merchant account is not yet verified." -"The payment was made via credit card. In order to receive funds merchant must upgrade account to Business or Premier status.","The payment was made via credit card. In order to receive funds merchant must upgrade account to Business or Premier status." -"Sorry, but something went wrong. Please contact PayPal customer service.","Sorry, but something went wrong. Please contact PayPal customer service." -"A reversal has occurred on this transaction due to a chargeback by your customer.","A reversal has occurred on this transaction due to a chargeback by your customer." -"A reversal has occurred on this transaction due to your customer triggering a money-back guarantee.","A reversal has occurred on this transaction due to your customer triggering a money-back guarantee." -"A reversal has occurred on this transaction due to a complaint about the transaction from your customer.","A reversal has occurred on this transaction due to a complaint about the transaction from your customer." -"A reversal has occurred on this transaction because you have given the customer a refund.","A reversal has occurred on this transaction because you have given the customer a refund." -"Reversal of an adjustment.","Reversal of an adjustment." -"Transaction reversal due to fraud detected by PayPal administrators.","Transaction reversal due to fraud detected by PayPal administrators." -"Transaction reversal by PayPal administrators.","Transaction reversal by PayPal administrators." -"Reimbursement for a chargeback.","Reimbursement for a chargeback." -"Settlement of a chargeback.","Settlement of a chargeback." -"A reversal has occurred on this transaction because of a customer dispute suspecting unauthorized spoof.","A reversal has occurred on this transaction because of a customer dispute suspecting unauthorized spoof." -"Buyer claims that he did not receive goods or service.","Buyer claims that he did not receive goods or service." -"Buyer claims that the goods or service received differ from merchant’s description of the goods or service.","Buyer claims that the goods or service received differ from merchant’s description of the goods or service." -"Buyer claims that he/she did not authorize transaction.","Buyer claims that he/she did not authorize transaction." -"A case that has been resolved and close requires a reimbursement.","A case that has been resolved and close requires a reimbursement." -"Buyer claims that a possible duplicate payment was made to the merchant.","Buyer claims that a possible duplicate payment was made to the merchant." -"Buyer claims that the received merchandise is unsatisfactory, defective, or damaged.","Buyer claims that the received merchandise is unsatisfactory, defective, or damaged." -"Unknown reason. Please contact PayPal customer service.","Unknown reason. Please contact PayPal customer service." -"Payer ID","Payer ID" -"Payer Email","Payer Email" -"Payer Status","Payer Status" -"Payer Address ID","Payer Address ID" -"Payer Address Status","Payer Address Status" -"Merchant Protection Eligibility","Merchant Protection Eligibility" -"Triggered Fraud Filters","Triggered Fraud Filters" -"Last Correlation ID","Last Correlation ID" -"Address Verification System Response","Address Verification System Response" -"CVV2 Check Result by PayPal","CVV2 Check Result by PayPal" -"Buyer's Tax ID","Buyer's Tax ID" -"Buyer's Tax ID Type","Buyer's Tax ID Type" -"PayPal/Centinel Visa Payer Authentication Service Result","PayPal/Centinel Visa Payer Authentication Service Result" -"PayPal/Centinel Electronic Commerce Indicator","PayPal/Centinel Electronic Commerce Indicator" -Chargeback,Chargeback -Complaint,Complaint -Dispute,Dispute -"Matched Address only (no ZIP)","Matched Address only (no ZIP)" -"Matched Address only (no ZIP) International","Matched Address only (no ZIP) International" -"No Details matched","No Details matched" -"No Details matched. International","No Details matched. International" -"Exact Match. Address and nine-digit ZIP code","Exact Match. Address and nine-digit ZIP code" -"Exact Match. Address and Postal Code. International","Exact Match. Address and Postal Code. International" -"Exact Match. Address and Postal Code. UK-specific","Exact Match. Address and Postal Code. UK-specific" -"N/A. Not allowed for MOTO (Internet/Phone) transactions","N/A. Not allowed for MOTO (Internet/Phone) transactions" -"N/A. Global Unavailable","N/A. Global Unavailable" -"N/A. International Unavailable","N/A. International Unavailable" -"Matched five-digit ZIP only (no Address)","Matched five-digit ZIP only (no Address)" -"Matched Postal Code only (no Address)","Matched Postal Code only (no Address)" -"N/A. Retry","N/A. Retry" -"N/A. Service not Supported","N/A. Service not Supported" -"N/A. Unavailable","N/A. Unavailable" -"Matched whole nine-didgit ZIP (no Address)","Matched whole nine-didgit ZIP (no Address)" -"Yes. Matched Address and five-didgit ZIP","Yes. Matched Address and five-didgit ZIP" -"All the address information matched","All the address information matched" -"None of the address information matched","None of the address information matched" -"Part of the address information matched","Part of the address information matched" -"N/A. The merchant did not provide AVS information","N/A. The merchant did not provide AVS information" -"N/A. Address not checked, or acquirer had no response. Service not available","N/A. Address not checked, or acquirer had no response. Service not available" -"Matched (CVV2CSC)","Matched (CVV2CSC)" -"No match","No match" -"N/A. Not processed","N/A. Not processed" -"N/A. Service not supported","N/A. Service not supported" -"N/A. Service not available","N/A. Service not available" -"N/A. No response","N/A. No response" -"Matched (CVV2)","Matched (CVV2)" -"N/A. The merchant has not implemented CVV2 code handling","N/A. The merchant has not implemented CVV2 code handling" -"N/A. Merchant has indicated that CVV2 is not present on card","N/A. Merchant has indicated that CVV2 is not present on card" -"Authenticated, Good Result","Authenticated, Good Result" -"Authenticated, Bad Result","Authenticated, Bad Result" -"Attempted Authentication, Good Result","Attempted Authentication, Good Result" -"Attempted Authentication, Bad Result","Attempted Authentication, Bad Result" -"No Liability Shift","No Liability Shift" -"Issuer Liability","Issuer Liability" -CNPJ,CNPJ -CPF,CPF -"IPN ""%1"". Case type ""%2"". Case ID ""%3"" %4","IPN ""%1"". Case type ""%2"". Case ID ""%3"" %4" -"IPN ""%1"". A dispute has been resolved and closed. %2 Transaction amount %3.","IPN ""%1"". A dispute has been resolved and closed. %2 Transaction amount %3." -"IPN ""%1"". %2 Transaction amount %3. Transaction ID: ""%4""","IPN ""%1"". %2 Transaction amount %3. Transaction ID: ""%4""" -"You notified customer about creditmemo #%1.","You notified customer about creditmemo #%1." -"Created billing agreement #%1.","Created billing agreement #%1." -"We couldn't create a billing agreement for this order.","We couldn't create a billing agreement for this order." -"Payflow PNREF: #%1.","Payflow PNREF: #%1." -"Fetch transaction details method does not exists in Payflow","Fetch transaction details method does not exists in Payflow" -"We cannot send the new order email.","We cannot send the new order email." -"You cannot void a verification transaction.","You cannot void a verification transaction." -"Payment transactions disallow storing objects.","Payment transactions disallow storing objects." -"You need to enter a transaction ID.","You need to enter a transaction ID." -"This operation requires an existing transaction object.","This operation requires an existing transaction object." -"You need an authorization transaction to void.","You need an authorization transaction to void." -"We can't issue a refund transaction because there is no capture transaction.","We can't issue a refund transaction because there is no capture transaction." -"We cannot create a target file for reading reports.","We cannot create a target file for reading reports." -"Report Date","Report Date" -"Merchant Account","Merchant Account" -"Transaction ID","Transaction ID" -"Invoice ID","Invoice ID" -"PayPal Reference ID","PayPal Reference ID" -"PayPal Reference ID Type","PayPal Reference ID Type" -"Event Code","Event Code" -"Finish Date","Finish Date" -"Debit or Credit","Debit or Credit" -"Gross Amount","Gross Amount" -"Fee Debit or Credit","Fee Debit or Credit" -"Fee Amount","Fee Amount" -"Order ID","Order ID" -"Subscription ID","Subscription ID" -"Preapproved Payment ID","Preapproved Payment ID" -Credit,Credit -Debit,Debit -"General: received payment of a type not belonging to the other T00xx categories","General: received payment of a type not belonging to the other T00xx categories" -"Mass Pay Payment","Mass Pay Payment" -"Subscription Payment, either payment sent or payment received","Subscription Payment, either payment sent or payment received" -"Preapproved Payment (BillUser API), either sent or received","Preapproved Payment (BillUser API), either sent or received" -"eBay Auction Payment","eBay Auction Payment" -"Direct Payment API","Direct Payment API" -"Express Checkout APIs","Express Checkout APIs" -"Website Payments Standard Payment","Website Payments Standard Payment" -"Postage Payment to either USPS or UPS","Postage Payment to either USPS or UPS" -"Gift Certificate Payment: purchase of Gift Certificate","Gift Certificate Payment: purchase of Gift Certificate" -"Auction Payment other than through eBay","Auction Payment other than through eBay" -"Mobile Payment (made via a mobile phone)","Mobile Payment (made via a mobile phone)" -"Virtual Terminal Payment","Virtual Terminal Payment" -"General: non-payment fee of a type not belonging to the other T01xx categories","General: non-payment fee of a type not belonging to the other T01xx categories" -"Fee: Web Site Payments Pro Account Monthly","Fee: Web Site Payments Pro Account Monthly" -"Fee: Foreign ACH Withdrawal","Fee: Foreign ACH Withdrawal" -"Fee: WorldLink Check Withdrawal","Fee: WorldLink Check Withdrawal" -"Fee: Mass Pay Request","Fee: Mass Pay Request" -"General Currency Conversion","General Currency Conversion" -"User-initiated Currency Conversion","User-initiated Currency Conversion" -"Currency Conversion required to cover negative balance","Currency Conversion required to cover negative balance" -"General Funding of PayPal Account ","General Funding of PayPal Account " -"PayPal Balance Manager function of PayPal account","PayPal Balance Manager function of PayPal account" -"ACH Funding for Funds Recovery from Account Balance","ACH Funding for Funds Recovery from Account Balance" -"EFT Funding (German banking)","EFT Funding (German banking)" -"General Withdrawal from PayPal Account","General Withdrawal from PayPal Account" -AutoSweep,AutoSweep -"General: Use of PayPal account for purchasing as well as receiving payments","General: Use of PayPal account for purchasing as well as receiving payments" -"Virtual PayPal Debit Card Transaction","Virtual PayPal Debit Card Transaction" -"PayPal Debit Card Withdrawal from ATM","PayPal Debit Card Withdrawal from ATM" -"Hidden Virtual PayPal Debit Card Transaction","Hidden Virtual PayPal Debit Card Transaction" -"PayPal Debit Card Cash Advance","PayPal Debit Card Cash Advance" -"General: Withdrawal from PayPal Account","General: Withdrawal from PayPal Account" -"General (Purchase with a credit card)","General (Purchase with a credit card)" -"Negative Balance","Negative Balance" -"General: bonus of a type not belonging to the other T08xx categories","General: bonus of a type not belonging to the other T08xx categories" -"Debit Card Cash Back","Debit Card Cash Back" -"Merchant Referral Bonus","Merchant Referral Bonus" -"Balance Manager Account Bonus","Balance Manager Account Bonus" -"PayPal Buyer Warranty Bonus","PayPal Buyer Warranty Bonus" -"PayPal Protection Bonus","PayPal Protection Bonus" -"Bonus for first ACH Use","Bonus for first ACH Use" -"General Redemption","General Redemption" -"Gift Certificate Redemption","Gift Certificate Redemption" -"Points Incentive Redemption","Points Incentive Redemption" -"Coupon Redemption","Coupon Redemption" -"Reward Voucher Redemption","Reward Voucher Redemption" -"General. Product no longer supported","General. Product no longer supported" -"General: reversal of a type not belonging to the other T11xx categories","General: reversal of a type not belonging to the other T11xx categories" -"ACH Withdrawal","ACH Withdrawal" -"Debit Card Transaction","Debit Card Transaction" -"Reversal of Points Usage","Reversal of Points Usage" -"ACH Deposit (Reversal)","ACH Deposit (Reversal)" -"Reversal of General Account Hold","Reversal of General Account Hold" -"Account-to-Account Payment, initiated by PayPal","Account-to-Account Payment, initiated by PayPal" -"Payment Refund initiated by merchant","Payment Refund initiated by merchant" -"Fee Reversal","Fee Reversal" -"Hold for Dispute Investigation","Hold for Dispute Investigation" -"Reversal of hold for Dispute Investigation","Reversal of hold for Dispute Investigation" -"General: adjustment of a type not belonging to the other T12xx categories","General: adjustment of a type not belonging to the other T12xx categories" -Reversal,Reversal -Charge-off,Charge-off -Incentive,Incentive -"Reimbursement of Chargeback","Reimbursement of Chargeback" -"General (Authorization)","General (Authorization)" -Reauthorization,Reauthorization -Void,Void -"General (Dividend)","General (Dividend)" -"General: temporary hold of a type not belonging to the other T15xx categories","General: temporary hold of a type not belonging to the other T15xx categories" -"Open Authorization","Open Authorization" -"ACH Deposit (Hold for Dispute or Other Investigation)","ACH Deposit (Hold for Dispute or Other Investigation)" -"Available Balance","Available Balance" -Funding,Funding -"General: Withdrawal to Non-Bank Entity","General: Withdrawal to Non-Bank Entity" -"WorldLink Withdrawal","WorldLink Withdrawal" -"Buyer Credit Payment","Buyer Credit Payment" -"General Adjustment without businessrelated event","General Adjustment without businessrelated event" -"General (Funds Transfer from PayPal Account to Another)","General (Funds Transfer from PayPal Account to Another)" -"Settlement Consolidation","Settlement Consolidation" -"General: event not yet categorized","General: event not yet categorized" -"The PayPal certificate file is empty.","The PayPal certificate file is empty." -"Header (center)","Header (center)" -"Sidebar (right)","Sidebar (right)" -"Near Bill Me Later checkout button","Near Bill Me Later checkout button" -"Every 3 days","Every 3 days" -"Every 7 days","Every 7 days" -"Every 10 days","Every 10 days" -"Every 14 days","Every 14 days" -"Every 30 days","Every 30 days" -"Every 40 days","Every 40 days" -"No Logo","No Logo" -"Pending PayPal","Pending PayPal" -"Billing Agreement","Billing Agreement" -"Created At","Created At" -"Updated At","Updated At" -"-- Please Select Billing Agreement--","-- Please Select Billing Agreement--" -"Not sure what PayPal payment method to use? Click here to learn more.","Not sure what PayPal payment method to use? Click here to learn more." -"Important: ","Important: " -"To use PayPal Payments Advanced, you must configure your PayPal Payments Advanced account on the PayPal website.","To use PayPal Payments Advanced, you must configure your PayPal Payments Advanced account on the PayPal website." -"Once you log into your PayPal Advanced account, navigate to the Service Settings - Hosted Checkout Pages - Set Up menu and set the options described below","Once you log into your PayPal Advanced account, navigate to the Service Settings - Hosted Checkout Pages - Set Up menu and set the options described below" -"To use PayPal Payflow Link, you must configure your PayPal Payflow Link account on the PayPal website.","To use PayPal Payflow Link, you must configure your PayPal Payflow Link account on the PayPal website." -"Once you log into your PayPal Payflow Link account, navigate to the Service Settings - Hosted Checkout Pages - Set Up menu and set the options described below","Once you log into your PayPal Payflow Link account, navigate to the Service Settings - Hosted Checkout Pages - Set Up menu and set the options described below" -"Agreement Information","Agreement Information" -"Reference ID:","Reference ID:" -Status:,Status: -Created:,Created: -Updated:,Updated: -"Payment Method:","Payment Method:" -"Ship To","Ship To" -"Back to Billing Agreements","Back to Billing Agreements" -"There are no billing agreements yet.","There are no billing agreements yet." -"New Billing Agreement","New Billing Agreement" -"You will be redirected to the payment system website.","You will be redirected to the payment system website." -Create...,Create... -"Your billing agreement # is: %1.","Your billing agreement # is: %1." -"Review Order","Review Order" -"Please select a shipping method...","Please select a shipping method..." -"Update Shipping Method","Update Shipping Method" -"Edit Payment Information","Edit Payment Information" -"Items in Your Shopping Cart","Items in Your Shopping Cart" -"Edit Shopping Cart","Edit Shopping Cart" -"Please update order data to get shipping methods and rates","Please update order data to get shipping methods and rates" -"Checkout with PayPal","Checkout with PayPal" -"Please do not refresh the page until you complete payment.","Please do not refresh the page until you complete payment." -"You will be required to enter your payment details after you place an order.","You will be required to enter your payment details after you place an order." -"Additional Options","Additional Options" -"Acceptance Mark","Acceptance Mark" -"What is PayPal?","What is PayPal?" -"Sign a billing agreement to streamline further purchases with PayPal.","Sign a billing agreement to streamline further purchases with PayPal." -Schedule,Schedule -Size,Size -"Sorry, something went wrong.","Sorry, something went wrong." -"Sorry, something went wrong. Please try again later.","Sorry, something went wrong. Please try again later." -"Test Mode","Test Mode" -"Payment Action","Payment Action" -"3D Secure","3D Secure" -"Severe 3D Secure Card Validation","Severe 3D Secure Card Validation" -"Severe Validation Removes Chargeback Liability on Merchant","Severe Validation Removes Chargeback Liability on Merchant" -"Centinel API URL","Centinel API URL" -"Debug Mode","Debug Mode" -"Sandbox Mode","Sandbox Mode" -1,1 -"Merchant Location","Merchant Location" -"Merchant Country","Merchant Country" -"If not specified, Default Country from General Config will be used","If not specified, Default Country from General Config will be used" -"Website Payments Pro (Includes Express Checkout)","Website Payments Pro (Includes Express Checkout)" -"Accept payments with a completely customizable checkout.","Accept payments with a completely customizable checkout." -"Required PayPal Settings","Required PayPal Settings" -"Website Payments Pro and Express Checkout","Website Payments Pro and Express Checkout" -"Enable this Solution","Enable this Solution" -"Advertise Bill Me Later","Advertise Bill Me Later" -" - Why Advertise Financing?
- Give your sales a boost when you advertise financing.
PayPal helps turn browsers into buyers with financing - from Bill Me Later®. Your customers have more time to pay, while you get paid up front – at no additional cost to you. - Use PayPal’s free banner ads that let you advertise Bill Me Later® financing as a payment option when your customers check out with PayPal. - The PayPal Advertising Program has been shown to generate additional purchases as well as increase consumer's average purchase sizes by 15% - or more. See Details. - "," - Why Advertise Financing?
- Give your sales a boost when you advertise financing.
PayPal helps turn browsers into buyers with financing - from Bill Me Later®. Your customers have more time to pay, while you get paid up front – at no additional cost to you. - Use PayPal’s free banner ads that let you advertise Bill Me Later® financing as a payment option when your customers check out with PayPal. - The PayPal Advertising Program has been shown to generate additional purchases as well as increase consumer's average purchase sizes by 15% - or more. See Details. - " -"Home Page","Home Page" -"Catalog Category Page","Catalog Category Page" -"Catalog Product Page","Catalog Product Page" -"Checkout Cart Page","Checkout Cart Page" -"Basic Settings - PayPal Website Payments Pro","Basic Settings - PayPal Website Payments Pro" -"It is recommended to set this value to ""Debit or Credit Card"" per store views.","It is recommended to set this value to ""Debit or Credit Card"" per store views." -"Credit Card Settings","Credit Card Settings" -"Allowed Credit Card Types","Allowed Credit Card Types" -" - 3D Secure validation is required for Maestro cards. Supporting of American Express cards require additional agreement. Learn more at http://www.paypal.com/amexupdate. - "," - 3D Secure validation is required for Maestro cards. Supporting of American Express cards require additional agreement. Learn more at http://www.paypal.com/amexupdate. - " -"Payment Applicable From","Payment Applicable From" -"Countries Payment Applicable From","Countries Payment Applicable From" -"Enable SSL verification","Enable SSL verification" -"Transfer Cart Line Items","Transfer Cart Line Items" -"Require CVV Entry","Require CVV Entry" -"Centinel Custom API URL","Centinel Custom API URL" -"If empty, a default value will be used. Custom URL may be provided by CardinalCommerce agreement.","If empty, a default value will be used. Custom URL may be provided by CardinalCommerce agreement." -"PayPal Billing Agreement Settings","PayPal Billing Agreement Settings" -"Settlement Report Settings","Settlement Report Settings" -"Frontend Experience Settings","Frontend Experience Settings" -"Basic Settings - PayPal Express Checkout","Basic Settings - PayPal Express Checkout" -"Website Payments Standard","Website Payments Standard" -"Accept credit card and PayPal payments securely.","Accept credit card and PayPal payments securely." -"Basic Settings - PayPal Website Payments Standard","Basic Settings - PayPal Website Payments Standard" -"It is recommended to set this value to ""PayPal"" per store views.","It is recommended to set this value to ""PayPal"" per store views." -"Summary Text for Aggregated Cart","Summary Text for Aggregated Cart" -"Uses store frontend name by default.","Uses store frontend name by default." -"Payflow Pro","Payflow Pro" -"Connect your merchant account with a fully customizable gateway that lets customers pay without leaving your site.","Connect your merchant account with a fully customizable gateway that lets customers pay without leaving your site." -Partner,Partner -Vendor,Vendor -"Use Proxy","Use Proxy" -"Proxy Host","Proxy Host" -"Proxy Port","Proxy Port" -"Basic Settings - PayPal Payflow Pro","Basic Settings - PayPal Payflow Pro" -" - Supporting of American Express cards require additional agreement. Learn more at http://www.paypal.com/amexupdate. - "," - Supporting of American Express cards require additional agreement. Learn more at http://www.paypal.com/amexupdate. - " -"Severe validation removes chargeback liability on merchant.","Severe validation removes chargeback liability on merchant." -"A value is required for live mode. Refer to your CardinalCommerce agreement.","A value is required for live mode. Refer to your CardinalCommerce agreement." -"Payflow Link (Includes Express Checkout)","Payflow Link (Includes Express Checkout)" -"Connect your merchant account with a PCI-compliant gateway that lets customers pay without leaving your site.","Connect your merchant account with a PCI-compliant gateway that lets customers pay without leaving your site." -"Payflow Link and Express Checkout","Payflow Link and Express Checkout" -"Email Associated with PayPal Merchant Account (Optional)","Email Associated with PayPal Merchant Account (Optional)" -"If you do not have multiple users set up on your account, please re-enter your Vendor/Merchant Login here.","If you do not have multiple users set up on your account, please re-enter your Vendor/Merchant Login here." -"Enable Payflow Link","Enable Payflow Link" -"Enable Express Checkout","Enable Express Checkout" -" - Why Advertise Financing?
- Give your sales a boost when you advertise financing.
PayPal helps turn browsers into buyers with financing - from Bill Me Later®. Your customers have more time to pay, while you get paid up front – at no additional cost to you. - Use PayPal’s free banner ads that let you advertise Bill Me Later® financing as a payment option when your customers check out with PayPal. - The PayPal Advertising Program has been shown to generate additional purchases as well as increase consumer's average purchase sizes by 15% - or more. See Details. - "," - Why Advertise Financing?
- Give your sales a boost when you advertise financing.
PayPal helps turn browsers into buyers with financing - from Bill Me Later®. Your customers have more time to pay, while you get paid up front – at no additional cost to you. - Use PayPal’s free banner ads that let you advertise Bill Me Later® financing as a payment option when your customers check out with PayPal. - The PayPal Advertising Program has been shown to generate additional purchases as well as increase consumer's average purchase sizes by 15% - or more. See Details. - " -"Basic Settings - PayPal Payflow Link","Basic Settings - PayPal Payflow Link" -"CVV Entry is Editable","CVV Entry is Editable" -"Send Email Confirmation","Send Email Confirmation" -"URL method for Cancel URL and Return URL","URL method for Cancel URL and Return URL" -"Express Checkout","Express Checkout" -"Add PayPal as an additional payment method to your checkout page.","Add PayPal as an additional payment method to your checkout page." -"Email Associated with PayPal Merchant Account","Email Associated with PayPal Merchant Account" -" - Start accepting payments via PayPal! - "," - Start accepting payments via PayPal! - " -"Don't have a PayPal account? Simply enter your email address.","Don't have a PayPal account? Simply enter your email address." -"API Authentication Methods","API Authentication Methods" -"API Username","API Username" -"API Password","API Password" -"Get Credentials from PayPal","Get Credentials from PayPal" -"Sandbox Credentials","Sandbox Credentials" -"API Uses Proxy","API Uses Proxy" -"Enable Bill Me Later","Enable Bill Me Later" -"PayPal Express Checkout lets you give customers access to financing through Bill Me Later® - at no additional cost to you. - You get paid up front, even though customers have more time to pay. A pre-integrated payment button lets customers pay quickly with Bill Me Later®. - Learn More - ","PayPal Express Checkout lets you give customers access to financing through Bill Me Later® - at no additional cost to you. - You get paid up front, even though customers have more time to pay. A pre-integrated payment button lets customers pay quickly with Bill Me Later®. - Learn More - " -"Publisher ID","Publisher ID" -"Required to display a banner","Required to display a banner" -"Get Publisher ID from PayPal","Get Publisher ID from PayPal" -"It is recommended to set this value to ""Magento_Paypal"" per store views.","It is recommended to set this value to ""Magento_Paypal"" per store views." -"Shortcut on Shopping Cart","Shortcut on Shopping Cart" -"Also affects mini-shopping cart.","Also affects mini-shopping cart." -"Shortcut on Product View","Shortcut on Product View" -"Authorization Honor Period (days)","Authorization Honor Period (days)" -"Specifies what the Authorization Honor Period is on the merchant’s PayPal account. It must mirror the setting in PayPal.","Specifies what the Authorization Honor Period is on the merchant’s PayPal account. It must mirror the setting in PayPal." -"Order Valid Period (days)","Order Valid Period (days)" -"Specifies what the Order Valid Period is on the merchant’s PayPal account. It must mirror the setting in PayPal.","Specifies what the Order Valid Period is on the merchant’s PayPal account. It must mirror the setting in PayPal." -"Number of Child Authorizations","Number of Child Authorizations" -"The default number of child authorizations in your PayPal account is 1. To do multiple authorizations please contact PayPal to request an increase.","The default number of child authorizations in your PayPal account is 1. To do multiple authorizations please contact PayPal to request an increase." -"Transfer Shipping Options","Transfer Shipping Options" -"If this option is enabled, customer can change shipping address and shipping method on PayPal website. In live mode works via HTTPS protocol only.","If this option is enabled, customer can change shipping address and shipping method on PayPal website. In live mode works via HTTPS protocol only." -"Notice that PayPal can handle up to 10 shipping options. That is why Magento will transfer only first 10 cheapest shipping options if there are more than 10 available.","Notice that PayPal can handle up to 10 shipping options. That is why Magento will transfer only first 10 cheapest shipping options if there are more than 10 available." -"Shortcut Buttons Flavor","Shortcut Buttons Flavor" -"Enable PayPal Guest Checkout","Enable PayPal Guest Checkout" -"Ability for buyer to purchase without PayPal account.","Ability for buyer to purchase without PayPal account." -"Require Customer's Billing Address","Require Customer's Billing Address" -"This feature needs be enabled first for the merchant account through PayPal technical support.","This feature needs be enabled first for the merchant account through PayPal technical support." -"Billing Agreement Signup","Billing Agreement Signup" -"Whether to create a billing agreement, if there are no active billing agreements available.","Whether to create a billing agreement, if there are no active billing agreements available." -" - Merchants need to apply to PayPal for enabling billing agreements feature. Do not enable this option until PayPal confirms that billing agreements are enabled for your merchant account. - "," - Merchants need to apply to PayPal for enabling billing agreements feature. Do not enable this option until PayPal confirms that billing agreements are enabled for your merchant account. - " -"Skip Order Review Step","Skip Order Review Step" -" - Will appear as a payment option only for customers who have at least one active billing agreement. - "," - Will appear as a payment option only for customers who have at least one active billing agreement. - " -"Allow in Billing Agreement Wizard","Allow in Billing Agreement Wizard" -"SFTP Credentials","SFTP Credentials" -"Custom Endpoint Hostname or IP-Address","Custom Endpoint Hostname or IP-Address" -"By default it is ""reports.paypal.com"".","By default it is ""reports.paypal.com""." -"Use colon to specify port. For example: ""test.example.com:5224"".","Use colon to specify port. For example: ""test.example.com:5224""." -"Custom Path","Custom Path" -"Scheduled Fetching","Scheduled Fetching" -"Enable Automatic Fetching","Enable Automatic Fetching" -"PayPal retains reports for 45 days.","PayPal retains reports for 45 days." -"Time of Day","Time of Day" -"PayPal Product Logo","PayPal Product Logo" -"Displays on catalog pages and homepage.","Displays on catalog pages and homepage." -"PayPal Merchant Pages Style","PayPal Merchant Pages Style" -"Page Style","Page Style" -" - Allowable values: ""paypal"", ""primary"" (default), your_custom_value (a custom payment page style from your merchant account profile). - "," - Allowable values: ""paypal"", ""primary"" (default), your_custom_value (a custom payment page style from your merchant account profile). - " -"Header Image URL","Header Image URL" -" - The image at the top left of the checkout page. Max size is 750x90-pixel. https is highly encouraged. - "," - The image at the top left of the checkout page. Max size is 750x90-pixel. https is highly encouraged. - " -"Header Background Color","Header Background Color" -" - The background color for the header of the checkout page. Case-insensitive six-character HTML hexadecimal color code in ASCII. - "," - The background color for the header of the checkout page. Case-insensitive six-character HTML hexadecimal color code in ASCII. - " -"Header Border Color","Header Border Color" -"2-pixel perimeter around the header space.","2-pixel perimeter around the header space." -"Page Background Color","Page Background Color" -" - The background color for the checkout page around the header and payment form. - "," - The background color for the checkout page around the header and payment form. - " -"Website Payments Pro Hosted Solution","Website Payments Pro Hosted Solution" -"Accept payments with a PCI compliant checkout that keeps customers on your site.","Accept payments with a PCI compliant checkout that keeps customers on your site." -"Payments Pro Hosted Solution","Payments Pro Hosted Solution" -" - Why Advertise Financing?
- Give your sales a boost when you advertise financing.
PayPal helps turn browsers into buyers with financing - from Bill Me Later®. Your customers have more time to pay, while you get paid up front – at no additional cost to you. - Use PayPal’s free banner ads that let you advertise Bill Me Later® financing as a payment option when your customers check out with PayPal. - The PayPal Advertising Program has been shown to generate additional purchases as well as increase consumer's average purchase sizes by 15% - or more. See Details. - "," - Why Advertise Financing?
- Give your sales a boost when you advertise financing.
PayPal helps turn browsers into buyers with financing - from Bill Me Later®. Your customers have more time to pay, while you get paid up front – at no additional cost to you. - Use PayPal’s free banner ads that let you advertise Bill Me Later® financing as a payment option when your customers check out with PayPal. - The PayPal Advertising Program has been shown to generate additional purchases as well as increase consumer's average purchase sizes by 15% - or more. See Details. - " -"Basic Settings - PayPal Payments Pro Hosted Solution","Basic Settings - PayPal Payments Pro Hosted Solution" -"Display Express Checkout in the Payment Information step","Display Express Checkout in the Payment Information step" -" - PayPal All-in-One Payment Solutions  Accept and process credit cards and PayPal payments. - "," - PayPal All-in-One Payment Solutions  Accept and process credit cards and PayPal payments. - " -"Choose a secure bundled payment solution for your business.","Choose a secure bundled payment solution for your business." -"PayPal Express Checkout","PayPal Express Checkout" -"Add another payment method to your existing solution or as a stand-alone option.","Add another payment method to your existing solution or as a stand-alone option." -"Payments Advanced (Includes Express Checkout)","Payments Advanced (Includes Express Checkout)" -"Accept payments with a PCI-compliant checkout that keeps customers on your site.","Accept payments with a PCI-compliant checkout that keeps customers on your site." -"Payments Advanced and Express Checkout","Payments Advanced and Express Checkout" -"PayPal recommends that you set up an additional User on your account at manager.paypal.com","PayPal recommends that you set up an additional User on your account at manager.paypal.com" -"PayPal recommends you set up an additional User on your account at manager.paypal.com, instead of entering your admin username and password here. This will enhance your security and prevent service interruptions if you later change your password. If you do not want to set up an additional User, you can re-enter your Merchant Login here.","PayPal recommends you set up an additional User on your account at manager.paypal.com, instead of entering your admin username and password here. This will enhance your security and prevent service interruptions if you later change your password. If you do not want to set up an additional User, you can re-enter your Merchant Login here." -" - Why Advertise Financing?
- Give your sales a boost when you advertise financing.
PayPal helps turn browsers into buyers with financing - from Bill Me Later®. Your customers have more time to pay, while you get paid up front – at no additional cost to you. - Use PayPal’s free banner ads that let you advertise Bill Me Later® financing as a payment option when your customers check out with PayPal. - The PayPal Advertising Program has been shown to generate additional purchases as well as increase consumer's average purchase sizes by 15% - or more. See Details. - "," - Why Advertise Financing?
- Give your sales a boost when you advertise financing.
PayPal helps turn browsers into buyers with financing - from Bill Me Later®. Your customers have more time to pay, while you get paid up front – at no additional cost to you. - Use PayPal’s free banner ads that let you advertise Bill Me Later® financing as a payment option when your customers check out with PayPal. - The PayPal Advertising Program has been shown to generate additional purchases as well as increase consumer's average purchase sizes by 15% - or more. See Details. - " -"Basic Settings - PayPal Payments Advanced","Basic Settings - PayPal Payments Advanced" -"Payments Pro (Includes Express Checkout)","Payments Pro (Includes Express Checkout)" -"Payments Pro and Express Checkout","Payments Pro and Express Checkout" -"Basic Settings - PayPal Payments Pro","Basic Settings - PayPal Payments Pro" -"Payments Standard","Payments Standard" -"Basic Settings - PayPal Payments Standard","Basic Settings - PayPal Payments Standard" -"PayPal Payment Gateways","PayPal Payment Gateways" -"Process payments using your own internet merchant account.","Process payments using your own internet merchant account." -"Payflow Pro (Includes Express Checkout)","Payflow Pro (Includes Express Checkout)" -"Payflow Pro and Express Checkout","Payflow Pro and Express Checkout" -" - Why Advertise Financing?
- Give your sales a boost when you advertise financing.
PayPal helps turn browsers into buyers with financing - from Bill Me Later®. Your customers have more time to pay, while you get paid up front – at no additional cost to you. - Use PayPal’s free banner ads that let you advertise Bill Me Later® financing as a payment option when your customers check out with PayPal. - The PayPal Advertising Program has been shown to generate additional purchases as well as increase consumer's average purchase sizes by 15% - or more. See Details. - "," - Why Advertise Financing?
- Give your sales a boost when you advertise financing.
PayPal helps turn browsers into buyers with financing - from Bill Me Later®. Your customers have more time to pay, while you get paid up front – at no additional cost to you. - Use PayPal’s free banner ads that let you advertise Bill Me Later® financing as a payment option when your customers check out with PayPal. - The PayPal Advertising Program has been shown to generate additional purchases as well as increase consumer's average purchase sizes by 15% - or more. See Details. - " -"Accept credit cards, debit cards and PayPal payments securely.","Accept credit cards, debit cards and PayPal payments securely." -"Accept payments with a completely customizable checkout page.","Accept payments with a completely customizable checkout page." -"Website Payments Pro Hosted Solution (Includes Express Checkout)","Website Payments Pro Hosted Solution (Includes Express Checkout)" -"Website Payments Pro Hosted Solution and Express Checkout","Website Payments Pro Hosted Solution and Express Checkout" -"Basic Settings - PayPal Website Payments Pro Hosted Solution","Basic Settings - PayPal Website Payments Pro Hosted Solution" -"PayPal Payment Solutions","PayPal Payment Solutions" diff --git a/app/code/Magento/Paypal/i18n/es_ES.csv b/app/code/Magento/Paypal/i18n/es_ES.csv deleted file mode 100644 index ceb8b989d9c17..0000000000000 --- a/app/code/Magento/Paypal/i18n/es_ES.csv +++ /dev/null @@ -1,692 +0,0 @@ -Custom,Personalizado -Close,Close -Cancel,Cancel -Back,Back -Price,Precio -ID,ID -Configure,Configure -No,No -Qty,Qty -Subtotal,Subtotal -"Incl. Tax","Incl. Tax" -Edit,Edit -"--Please Select--","--Please Select--" -Customer,Customer -"First Name","First Name" -"Last Name","Last Name" -Email,Email -"-- Please Select --","-- Please Select --" -Yes,Sí -Status,Status -Enabled,Enabled -"Sort Order","Sort Order" -Title,Title -"Are you sure you want to do this?","Are you sure you want to do this?" -Order,Encargar -View,Ver -Active,Active -Position,Position -Dynamic,Dinámico -N/A,N/A -Canceled,Canceled -"General Information","General Information" -Static,Estático -"Advanced Settings","Advanced Settings" -"Learn More","Saber más" -"Start Date","Start Date" -"Product Name","Product Name" -"3D Secure Card Validation","3D Secure Card Validation" -"Merchant Liability","Responsabilidad del comerciante" -"Billing Information","Billing Information" -"Shipping Information","Shipping Information" -"Shipping Method","Método de envío" -"Please agree to all the terms and conditions before placing the order.","Por favor, acepta todos los términos y condiciones antes de realizar el pedido." -"Account confirmation is required. Please, check your e-mail for confirmation link. To resend confirmation email please click here.","Account confirmation is required. Please, check your e-mail for confirmation link. To resend confirmation email please click here." -Password,Password -Continue,Continue -"Order #","Order #" -Login,Login -"Shipping Address","Dirección de Envío" -"Payment Method","Payment Method" -"Place Order","Hacer pedido" -"Sorry, no quotes are available for this order at this time.","Lamentamos informarle que en este momento no hay cotizaciones disponibles para este pedido." -Sales,Ventas -Created,Created -Display,Display -User,User -Daily,Diario -Date,Date -"Order Total","Order Total" -Never,Nunca -Updated,Updated -Reports,Informes -"Order Status","Order Status" -"View Order","View Order" -Event,Evento -"Please Select","Please Select" -"Submitting order information...","Enviando la información del pedido..." -Authorization,Autorización -"You notified customer about invoice #%1.","You notified customer about invoice #%1." -"Note: %1","Note: %1" -"IPN ""%1""","IPN ""%1""" -"Billing Agreements","Contratos de facturación" -"Reference ID","Reference ID" -"Billing Agreement #%1","Billing Agreement #%1" -"Related Orders","Related Orders" -"Billing Agreement View","Ver contrato de facturación" -"View Transaction Details","Ver Detalles de la Transacción" -"Reference Information","Información de Referencia" -"Transaction Information","Información de Transacción" -"PayPal Fee Information","Información de tarifa de PayPal" -"PayPal Settlement Reports","Informes de liquidación de PayPal" -"We are connecting to the PayPal SFTP server to retrieve new reports. Are you sure you want to continue?","We are connecting to the PayPal SFTP server to retrieve new reports. Are you sure you want to continue?" -"Fetch Updates","Nuevos resultados obtenidos" -button_label,button_label -sandbox_button_label,sandbox_button_label -Help,Ayuda -"There is already another PayPal solution enabled. Enable this solution instead?","There is already another PayPal solution enabled. Enable this solution instead?" -"The following error(s) occured:","The following error(s) occured:" -"Some PayPal solutions conflict.","Some PayPal solutions conflict." -"PayPal Express Checkout is not enabled.","PayPal Express Checkout is not enabled." -"Please re-enable the previously enabled payment solutions.","Please re-enable the previously enabled payment solutions." -"View Demo","Vea la demostración" -"See terms","See terms" -"You will be redirected to the PayPal website.","Se le redirigirá al sitio web de PayPal." -"Would you like to sign a billing agreement ' 'to streamline further purchases with PayPal?","Would you like to sign a billing agreement ' 'to streamline further purchases with PayPal?" -"You will be redirected to the PayPal website when you place an order.","Cuando realice el pedido se le devolverá a la página PayPal." -"Click here if you are not redirected within 10 seconds.","Click here if you are not redirected within 10 seconds." -"You will be redirected to the PayPal website in a few seconds.","Volverá a la página web de Paypal en unos segundos." -"You canceled the billing agreement.","You canceled the billing agreement." -"We could not cancel the billing agreement.","We could not cancel the billing agreement." -"You deleted the billing agreement.","You deleted the billing agreement." -"We could not delete the billing agreement.","We could not delete the billing agreement." -"Please specify the correct billing agreement ID and try again.","Please specify the correct billing agreement ID and try again." -"View Transaction","Ver transacción" -"We found nothing to fetch because of an empty configuration.","We found nothing to fetch because of an empty configuration." -"We fetched %1 report rows from '%2@%3'.","We fetched %1 report rows from '%2@%3'." -"We couldn't fetch reports from '%1@%2'.","We couldn't fetch reports from '%1@%2'." -"Billing Agreement # %1","Billing Agreement # %1" -"We couldn't start the billing agreement wizard.","We couldn't start the billing agreement wizard." -"The billing agreement ""%1"" has been created.","The billing agreement ""%1"" has been created." -"We couldn't finish the billing agreement wizard.","We couldn't finish the billing agreement wizard." -"The billing agreement ""%1"" has been canceled.","The billing agreement ""%1"" has been canceled." -"We couldn't cancel the billing agreement.","We couldn't cancel the billing agreement." -"To proceed to Checkout, please log in using your email address.","To proceed to Checkout, please log in using your email address." -"We can't start Express Checkout.","We can't start Express Checkout." -"Express Checkout and Order have been canceled.","El Pedido y la Salida Express se han cancelado." -"Express Checkout has been canceled.","La Salida Express se ha cancelado." -"Unable to cancel Express Checkout","Unable to cancel Express Checkout" -"We can't process Express Checkout approval.","We can't process Express Checkout approval." -"We can't initialize Express Checkout review.","We can't initialize Express Checkout review." -"We can't update shipping method.","We can't update shipping method." -"We can't place the order.","We can't place the order." -"We can't initialize Express Checkout.","We can't initialize Express Checkout." -"PayPal Express Checkout Token does not exist.","El símbolo para la Salida Express con Paypal no existe." -"A wrong PayPal Express Checkout Token is specified.","A wrong PayPal Express Checkout Token is specified." -"Your payment has been declined. Please try again.","Your payment has been declined. Please try again." -"We can't contact the PayPal gateway.","We can't contact the PayPal gateway." -"PayPal response hasn't required fields.","La respuesta de PayPal no tiene campos obligatorios." -"Something went wrong while processing your order.","Something went wrong while processing your order." -"PayPal gateway has rejected request. %1","PayPal gateway has rejected request. %1" -"PayPal gateway rejected the request. %1","PayPal gateway rejected the request. %1" -"I'm sorry - but we were not able to process your payment. Please try another payment method or contact us so we can assist you.","I'm sorry - but we were not able to process your payment. Please try another payment method or contact us so we can assist you." -"I'm sorry - but we are not able to complete your transaction. Please contact us so we can assist you.","I'm sorry - but we are not able to complete your transaction. Please contact us so we can assist you." -"The payment method code is not set.","The payment method code is not set." -"The reference ID is not set.","The reference ID is not set." -"Unable to save Billing Agreement:","No se puede guardar el Contrato de Facturación:" -"The customer ID is not set.","The customer ID is not set." -"The Billing Agreement status is not set.","The Billing Agreement status is not set." -"The PayPal certificate does not exist.","The PayPal certificate does not exist." -"We prefer PayPal (150 X 60)","Preferimos PayPal (150 X 60)" -"We prefer PayPal (150 X 40)","Preferimos PayPal (150 X 40)" -"Now accepting PayPal (150 X 60)","Ahora se acepta Paypal (150 X 60)" -"Now accepting PayPal (150 X 40)","Se acepta PayPal (150 X 40)" -"Payments by PayPal (150 X 60)","Pagos por PayPal (150 X 60)" -"Payments by PayPal (150 X 40)","Pagos por PayPal (150 X 40)" -"Shop now using (150 X 60)","Compre ahora utilizando (150 X 60)" -"Shop now using (150 X 40)","Compre ahora usando (150 X 40)" -Shortcut,"Acceso directo" -"Acceptance Mark Image","Imagen de Señal de Aceptación" -Sale,Venta -"For Virtual Quotes Only","Solo para presupuestos en línea" -Auto,Auto -"Ask Customer","Preguntar al Cliente" -"IPN (Instant Payment Notification) Only","IPN (Instant Payment Notification) Only" -"API Signature","Firma API" -"API Certificate","Certificdo API" -"The ordering amount of %1 is pending approval on the payment gateway.","The ordering amount of %1 is pending approval on the payment gateway." -"Ordered amount of %1","Ordered amount of %1" -"We'll authorize the amount of %1 as soon as the payment gateway approves it.","We'll authorize the amount of %1 as soon as the payment gateway approves it." -"The authorized amount is %1.","The authorized amount is %1." -"The maximum number of child authorizations is reached.","Se ha alcanzado el número máximo de autorizaciones infantiles." -"PayPal can't process orders with a zero balance due. ' 'To finish your purchase, please go through the standard checkout process.","PayPal can't process orders with a zero balance due. ' 'To finish your purchase, please go through the standard checkout process." -"Payer is not identified.","El pagador no se ha identificado." -"Last Transaction ID","Última Identificación de Transacción" -"This customer did not include a confirmed address.","This customer did not include a confirmed address." -"The payment is authorized but not settled.","El pago se ha autorizado, pero no se ha realizado." -"The payment eCheck is not yet cleared.","Todavía no se ha limpiado el eCheck de pago." -"The merchant holds a non-U.S. account and does not have a withdrawal mechanism.","The merchant holds a non-U.S. account and does not have a withdrawal mechanism." -"The payment currency does not match any of the merchant's balances currency.","The payment currency does not match any of the merchant's balances currency." -"The payment is pending while it is being reviewed by PayPal for risk.","El pago está pendiente, PayPal lo está revisando para asegurarse." -"The payment is pending because it was made to an email address that is not yet registered or confirmed.","El pago está pendiente porque se ha realizado a una dirección de mail que todavía no se ha registrado o confirmado." -"The merchant account is not yet verified.","Todavía no se ha verificado la cuenta de vendedor." -"The payment was made via credit card. In order to receive funds merchant must upgrade account to Business or Premier status.","El pago se ha realizado mediante tarjeta de crédito. Para recibir los fondos el vendedor tiene que actualizar la cuenta a estado Business o Premier." -"Sorry, but something went wrong. Please contact PayPal customer service.","Sorry, but something went wrong. Please contact PayPal customer service." -"A reversal has occurred on this transaction due to a chargeback by your customer.","A reversal has occurred on this transaction due to a chargeback by your customer." -"A reversal has occurred on this transaction due to your customer triggering a money-back guarantee.","A reversal has occurred on this transaction due to your customer triggering a money-back guarantee." -"A reversal has occurred on this transaction due to a complaint about the transaction from your customer.","A reversal has occurred on this transaction due to a complaint about the transaction from your customer." -"A reversal has occurred on this transaction because you have given the customer a refund.","A reversal has occurred on this transaction because you have given the customer a refund." -"Reversal of an adjustment.","Revocación de un ajuste." -"Transaction reversal due to fraud detected by PayPal administrators.","Transaction reversal due to fraud detected by PayPal administrators." -"Transaction reversal by PayPal administrators.","Transaction reversal by PayPal administrators." -"Reimbursement for a chargeback.","Devolución o reembolso." -"Settlement of a chargeback.","Liquidación de una transacción devuelta." -"A reversal has occurred on this transaction because of a customer dispute suspecting unauthorized spoof.","A reversal has occurred on this transaction because of a customer dispute suspecting unauthorized spoof." -"Buyer claims that he did not receive goods or service.","Buyer claims that he did not receive goods or service." -"Buyer claims that the goods or service received differ from merchant’s description of the goods or service.","Buyer claims that the goods or service received differ from merchant’s description of the goods or service." -"Buyer claims that he/she did not authorize transaction.","Buyer claims that he/she did not authorize transaction." -"A case that has been resolved and close requires a reimbursement.","A case that has been resolved and close requires a reimbursement." -"Buyer claims that a possible duplicate payment was made to the merchant.","Buyer claims that a possible duplicate payment was made to the merchant." -"Buyer claims that the received merchandise is unsatisfactory, defective, or damaged.","Buyer claims that the received merchandise is unsatisfactory, defective, or damaged." -"Unknown reason. Please contact PayPal customer service.","Razones desconocidas. Por favor, contacte el servicio de atención al cliente de PayPal." -"Payer ID","Id. del pagador" -"Payer Email","Correo electrónico del pagador" -"Payer Status","Situación del comprador" -"Payer Address ID","Id. de dirección del pagador" -"Payer Address Status","Estado de la dirección del comprador" -"Merchant Protection Eligibility","Requisitos de protección de mercado" -"Triggered Fraud Filters","Filtros de Fraude Desencadenados" -"Last Correlation ID","Última Identificación de Correlación" -"Address Verification System Response","Respuesta del Sistema de Verificación de Dirección" -"CVV2 Check Result by PayPal","Resultado de Comprobación CVV2 por PayPal" -"Buyer's Tax ID","Número de identificación social del contribuyente del comprador\es" -"Buyer's Tax ID Type","Tipo de número de identificación social del contribuyente del comprador\es" -"PayPal/Centinel Visa Payer Authentication Service Result","Resultado del servicio de autenticación del pagador con Visa a través de PayPal/Centinel" -"PayPal/Centinel Electronic Commerce Indicator","Indicador de comercio electrónico de PayPal/Centinel" -Chargeback,Facturar -Complaint,Complaint -Dispute,Dispute -"Matched Address only (no ZIP)","Sólo dirección correspondiente (no CP)" -"Matched Address only (no ZIP) International","Matched Address only (no ZIP) International" -"No Details matched","No ha habido coincidencias" -"No Details matched. International","Los detalles no coinciden. Internacional" -"Exact Match. Address and nine-digit ZIP code","Coincidencia exacta. Dirección y código ZIP de 9 dígitos" -"Exact Match. Address and Postal Code. International","Coincidencia exacta. Dirección y Código Postal. Internacional" -"Exact Match. Address and Postal Code. UK-specific","Coincidencia exacta. Dirección y Código Postal. Específico para Reino Unido" -"N/A. Not allowed for MOTO (Internet/Phone) transactions","N/A. No disponible para transacciones MOTO (Internet/móvil)" -"N/A. Global Unavailable","No disponible. Global no disponible." -"N/A. International Unavailable","No disponible. Internacional no disponible." -"Matched five-digit ZIP only (no Address)","Sólo Encaja el Código Postal de cinco dígitos (no la Dirección)" -"Matched Postal Code only (no Address)","Sólo Encaja el Código Postal (no la Dirección)" -"N/A. Retry","No disponible. Vuelva a intentar." -"N/A. Service not Supported","N/A. Servicio no disponible." -"N/A. Unavailable","No disponible. No disponible." -"Matched whole nine-didgit ZIP (no Address)","Sólo Encaja el Código Postal de nueve dígitos (no la Dirección)" -"Yes. Matched Address and five-didgit ZIP","Sí. La Dirección y el Código Postal de cinco dígitos coinciden." -"All the address information matched","Coincide toda la información de dirección" -"None of the address information matched","Ninguna información de la dirección coincide" -"Part of the address information matched","Parte de la información de la dirección coincidió" -"N/A. The merchant did not provide AVS information","N/A. El comerciante no ha proporcionado la información AVS" -"N/A. Address not checked, or acquirer had no response. Service not available","No disponible. No se ha comprobado la dirección o el usuario no obtuvo respuesta. Servicio no disponible." -"Matched (CVV2CSC)","CVV2CSC coincidentes." -"No match","No ha habido coincidencias" -"N/A. Not processed","No disponible. No procesado." -"N/A. Service not supported","N/A. Servicio no operativo" -"N/A. Service not available","No disponible. Servicio no disponible." -"N/A. No response","No disponible. Sin respuesta." -"Matched (CVV2)","Emparejado (CVV2)" -"N/A. The merchant has not implemented CVV2 code handling","No disponible. El comerciante no ha implementado la gestión del código CVV2." -"N/A. Merchant has indicated that CVV2 is not present on card","No disponible. El comerciante ha notificado que su tarjeta no tiene CVV2." -"Authenticated, Good Result","Autenticación, Resultado Correcto" -"Authenticated, Bad Result","Autenticación, Resultado Incorrecto" -"Attempted Authentication, Good Result","Intento de Autenticación, Resultado Correcto" -"Attempted Authentication, Bad Result","Intento de Autenticación, Resultado Incorrecto" -"No Liability Shift","No hay cambios de responsabilidad" -"Issuer Liability","Responsabilidad del Emisor" -CNPJ,CNPJ -CPF,CPF -"IPN ""%1"". Case type ""%2"". Case ID ""%3"" %4","IPN ""%1"". Case type ""%2"". Case ID ""%3"" %4" -"IPN ""%1"". A dispute has been resolved and closed. %2 Transaction amount %3.","IPN ""%1"". A dispute has been resolved and closed. %2 Transaction amount %3." -"IPN ""%1"". %2 Transaction amount %3. Transaction ID: ""%4""","IPN ""%1"". %2 Transaction amount %3. Transaction ID: ""%4""" -"You notified customer about creditmemo #%1.","You notified customer about creditmemo #%1." -"Created billing agreement #%1.","Created billing agreement #%1." -"We couldn't create a billing agreement for this order.","We couldn't create a billing agreement for this order." -"Payflow PNREF: #%1.","Payflow PNREF: #%1." -"Fetch transaction details method does not exists in Payflow","Fetch transaction details method does not exists in Payflow" -"We cannot send the new order email.","We cannot send the new order email." -"You cannot void a verification transaction.","You cannot void a verification transaction." -"Payment transactions disallow storing objects.","Las operaciones de pago no permiten almacenar objetos." -"You need to enter a transaction ID.","You need to enter a transaction ID." -"This operation requires an existing transaction object.","Esta operación requiere de una transacción ya existente." -"You need an authorization transaction to void.","You need an authorization transaction to void." -"We can't issue a refund transaction because there is no capture transaction.","We can't issue a refund transaction because there is no capture transaction." -"We cannot create a target file for reading reports.","We cannot create a target file for reading reports." -"Report Date","Fecha del informe" -"Merchant Account","Cuenta del comerciante" -"Transaction ID","Número de identificación de la transacción" -"Invoice ID","Identificación de la Factura" -"PayPal Reference ID","Id. de referencia de PayPal" -"PayPal Reference ID Type","Tipo de Id. de referencia de PayPal" -"Event Code","Código de Evento" -"Finish Date","Finish Date" -"Debit or Credit","Débito o Crédito" -"Gross Amount","Total Bruto" -"Fee Debit or Credit","Comisión Débito o Crédito" -"Fee Amount","Importe de la Comisión" -"Order ID","ID de Pedido" -"Subscription ID","ID de Suscripción." -"Preapproved Payment ID","Identificación del Pago Pre-autorizado" -Credit,Crédito -Debit,Débito -"General: received payment of a type not belonging to the other T00xx categories","General: pago recibido de una clase no perteneciente a las otras T00xx categorías" -"Mass Pay Payment","Pago Agrupado" -"Subscription Payment, either payment sent or payment received","Pago de suscripción, bien sea pago enviado o recibido." -"Preapproved Payment (BillUser API), either sent or received","Pagos previamente aprobados (BillUser API) enviados o recibidos" -"eBay Auction Payment","Pago de Subasta de eBay" -"Direct Payment API","API de pago directo" -"Express Checkout APIs","APIs de Paso por Caja Express" -"Website Payments Standard Payment","Pago estándar de la página web" -"Postage Payment to either USPS or UPS","Pago de los Gastos de Envío bien a USPS o a UPS" -"Gift Certificate Payment: purchase of Gift Certificate","Pago de Cheque Regalo: compra de Cheque Regalo" -"Auction Payment other than through eBay","Pago por Subasta diferente de eBay" -"Mobile Payment (made via a mobile phone)","Pago móvil (realizado vía teléfono móvil)" -"Virtual Terminal Payment","Pago Terminal virtual" -"General: non-payment fee of a type not belonging to the other T01xx categories","General: tarifa de impago de una clase no perteneciente a las otras T01xx categorías" -"Fee: Web Site Payments Pro Account Monthly","Comisión: cuenta Web Site Payments Pro mensual" -"Fee: Foreign ACH Withdrawal","Comisión: Retirada ACH en el extranjero" -"Fee: WorldLink Check Withdrawal","Comisión: Retirada mediante cheque WorldLink" -"Fee: Mass Pay Request","Comisión: Solicitud de Pago Masivo" -"General Currency Conversion","Conversión de Divisa General" -"User-initiated Currency Conversion","Conversión de moneda iniciada por el usuario" -"Currency Conversion required to cover negative balance","Se requiere una Conversión de Divisas para cubrir el saldo negativo" -"General Funding of PayPal Account ","Fondos Generales de la Cuenta de PayPal" -"PayPal Balance Manager function of PayPal account","Función del Gestor de saldo de PayPal de la cuenta de PayPal" -"ACH Funding for Funds Recovery from Account Balance","Financiación ACH para Recuperación de Fondos desde el Balance de Cuenta" -"EFT Funding (German banking)","Transacción EFT (Bancos alemanes)" -"General Withdrawal from PayPal Account","Retirada de fondos General desde la Cuenta de PayPal" -AutoSweep,AutoBarrido -"General: Use of PayPal account for purchasing as well as receiving payments","General: Uso de la cuenta PayPal tanto para comprar como para recibir pagos" -"Virtual PayPal Debit Card Transaction","Transacción de Tarjeta de Débito de PayPal Virtual" -"PayPal Debit Card Withdrawal from ATM","Retiro de dinero de tarjeta de débido de PayPal desde un cajero automático" -"Hidden Virtual PayPal Debit Card Transaction","Transacción Oculta de Tarjeta Virtual de Débito PayPal" -"PayPal Debit Card Cash Advance","Adelanto de efectivo de una tarjeta de débito en PayPal" -"General: Withdrawal from PayPal Account","General: Retirada de fondos desde la Cuenta de PayPal" -"General (Purchase with a credit card)","General (Compra con una tarjeta de crédito)" -"Negative Balance","No disponible. Saldo negativo" -"General: bonus of a type not belonging to the other T08xx categories","General: bonificación de una clase no perteneciente a las otras T08xx categorías" -"Debit Card Cash Back","Retirada de efectivo de tarjeta de débito" -"Merchant Referral Bonus","Bonificación de referencia del comerciante" -"Balance Manager Account Bonus","Bono de Cuenta de Gestor de Balance" -"PayPal Buyer Warranty Bonus","Bonificación de garantía del comprador en PayPal" -"PayPal Protection Bonus","Bono de protección de PayPal" -"Bonus for first ACH Use","Bono por el primer Uso de ACH" -"General Redemption","Amortización General" -"Gift Certificate Redemption","Canjear Cheque Regalo" -"Points Incentive Redemption","Puntos de incentivo por cancelación" -"Coupon Redemption","Reembolso de Cupón" -"Reward Voucher Redemption","Realizar canje de vales" -"General. Product no longer supported","General. Este producto ya no está admitido" -"General: reversal of a type not belonging to the other T11xx categories","General: revocación de una clase no perteneciente a las otras T01xx categorías" -"ACH Withdrawal","Retirada ACH" -"Debit Card Transaction","Transacción con tarjeta de débito" -"Reversal of Points Usage","Inversión de los puntos de utilización" -"ACH Deposit (Reversal)","Depósito ACH (Revocación)" -"Reversal of General Account Hold","Revocación de Cargo General en Cuenta" -"Account-to-Account Payment, initiated by PayPal","Pago Cuenta-a-Cuenta, iniciado por PayPal" -"Payment Refund initiated by merchant","Reembolso de Pago iniciado por el comerciante" -"Fee Reversal","Retroceso de Comisiones" -"Hold for Dispute Investigation","Manténgase a la Espera de la Investigación sobre la Disputa" -"Reversal of hold for Dispute Investigation","Reposición por la investigación de la disputa" -"General: adjustment of a type not belonging to the other T12xx categories","General: ajuste de una clase no perteneciente a las otras T12xx categorías" -Reversal,Inversión -Charge-off,Cancelar -Incentive,Incentivo -"Reimbursement of Chargeback","Reembolso de una transacción devuelta" -"General (Authorization)","General (Autorización)" -Reauthorization,Reautorización -Void,Nulo -"General (Dividend)","General (Dividendo)" -"General: temporary hold of a type not belonging to the other T15xx categories","General: cargo temporal de una clase no perteneciente a las otras T15xx categorías" -"Open Authorization","Abrir la autorización" -"ACH Deposit (Hold for Dispute or Other Investigation)","Depósito ACH (En Espera por Conflicto u Otra Investigación)" -"Available Balance","Balance Disponible" -Funding,Fondos -"General: Withdrawal to Non-Bank Entity","General: Retirada de fondos a una Entidad No Bancaria" -"WorldLink Withdrawal","Retirada de Fondos WorldLink" -"Buyer Credit Payment","Pago de Crédito de Comprador" -"General Adjustment without businessrelated event","Ajuste General sin ningún acontecimiento relacionado con el negocio" -"General (Funds Transfer from PayPal Account to Another)","General (Transferencia de Fondos desde una Cuenta Paypal a Otra Cuenta)" -"Settlement Consolidation","Consolidación del Acuerdo" -"General: event not yet categorized","General: suceso no catalogado aún" -"The PayPal certificate file is empty.","The PayPal certificate file is empty." -"Header (center)","Header (center)" -"Sidebar (right)","Sidebar (right)" -"Near Bill Me Later checkout button","Near Bill Me Later checkout button" -"Every 3 days","Cada 3 días" -"Every 7 days","Cada 7 días" -"Every 10 days","Cada 10 días" -"Every 14 days","Cada 14 días" -"Every 30 days","Cada 30 días" -"Every 40 days","Cada 40 días" -"No Logo","Sin logotipo" -"Pending PayPal","Pendiente de pago en PayPal" -"Billing Agreement","Acuerdo de facturación" -"Created At","Created At" -"Updated At","Updated At" -"-- Please Select Billing Agreement--","-- Por favor, Seleccione el Acuerdo de Facturación--" -"Not sure what PayPal payment method to use? Click here to learn more.","Not sure what PayPal payment method to use? Click here to learn more." -"Important: ","Important: " -"To use PayPal Payments Advanced, you must configure your PayPal Payments Advanced account on the PayPal website.","To use PayPal Payments Advanced, you must configure your PayPal Payments Advanced account on the PayPal website." -"Once you log into your PayPal Advanced account, navigate to the Service Settings - Hosted Checkout Pages - Set Up menu and set the options described below","Once you log into your PayPal Advanced account, navigate to the Service Settings - Hosted Checkout Pages - Set Up menu and set the options described below" -"To use PayPal Payflow Link, you must configure your PayPal Payflow Link account on the PayPal website.","To use PayPal Payflow Link, you must configure your PayPal Payflow Link account on the PayPal website." -"Once you log into your PayPal Payflow Link account, navigate to the Service Settings - Hosted Checkout Pages - Set Up menu and set the options described below","Once you log into your PayPal Payflow Link account, navigate to the Service Settings - Hosted Checkout Pages - Set Up menu and set the options described below" -"Agreement Information","Agreement Information" -"Reference ID:","Reference ID:" -Status:,Status: -Created:,Created: -Updated:,Updated: -"Payment Method:","Payment Method:" -"Ship To","Ship To" -"Back to Billing Agreements","Volver a los contratos de facturación" -"There are no billing agreements yet.","No hay acuerdos de facturación todavía." -"New Billing Agreement","Nuevo Acuerdo de Facturación" -"You will be redirected to the payment system website.","You will be redirected to the payment system website." -Create...,Create... -"Your billing agreement # is: %1.","Your billing agreement # is: %1." -"Review Order","Revise su pedido" -"Please select a shipping method...","Por favor, elija un método de envío..." -"Update Shipping Method","Update Shipping Method" -"Edit Payment Information","Edit Payment Information" -"Items in Your Shopping Cart","Artículos en Su Carro de la Compra" -"Edit Shopping Cart","Editar Carrito de la Compra" -"Please update order data to get shipping methods and rates","Por favor, actualice los datos del pedido para obtener métodos de envío y tarifas" -"Checkout with PayPal","Pago con PayPal" -"Please do not refresh the page until you complete payment.","No actualice la página hasta que complete el pago." -"You will be required to enter your payment details after you place an order.","Se le solicitará que introduzca los detalles del pago tras realizar el pedido." -"Additional Options","Opciones Adicionales" -"Acceptance Mark","Señal de Aceptación" -"What is PayPal?","¿Qué es PayPal?" -"Sign a billing agreement to streamline further purchases with PayPal.","Firma un acuerdo de facturación para agilizar futuras compras con PayPal." -Schedule,Schedule -Size,Size -"Sorry, something went wrong.","Sorry, something went wrong." -"Sorry, something went wrong. Please try again later.","Sorry, something went wrong. Please try again later." -"Test Mode","Test Mode" -"Payment Action","Payment Action" -"3D Secure","3D Secure" -"Severe 3D Secure Card Validation","Severe 3D Secure Card Validation" -"Severe Validation Removes Chargeback Liability on Merchant","Severe Validation Removes Chargeback Liability on Merchant" -"Centinel API URL","Centinel API URL" -"Debug Mode","Debug Mode" -"Sandbox Mode","Sandbox Mode" -1,1 -"Merchant Location","Merchant Location" -"Merchant Country","Merchant Country" -"If not specified, Default Country from General Config will be used","If not specified, Default Country from General Config will be used" -"Website Payments Pro (Includes Express Checkout)","Website Payments Pro (Includes Express Checkout)" -"Accept payments with a completely customizable checkout.","Accept payments with a completely customizable checkout." -"Required PayPal Settings","Required PayPal Settings" -"Website Payments Pro and Express Checkout","Website Payments Pro and Express Checkout" -"Enable this Solution","Enable this Solution" -"Advertise Bill Me Later","Advertise Bill Me Later" -" - Why Advertise Financing?
- Give your sales a boost when you advertise financing.
PayPal helps turn browsers into buyers with financing - from Bill Me Later®. Your customers have more time to pay, while you get paid up front – at no additional cost to you. - Use PayPal’s free banner ads that let you advertise Bill Me Later® financing as a payment option when your customers check out with PayPal. - The PayPal Advertising Program has been shown to generate additional purchases as well as increase consumer's average purchase sizes by 15% - or more. See Details. - "," - Why Advertise Financing?
- Give your sales a boost when you advertise financing.
PayPal helps turn browsers into buyers with financing - from Bill Me Later®. Your customers have more time to pay, while you get paid up front – at no additional cost to you. - Use PayPal’s free banner ads that let you advertise Bill Me Later® financing as a payment option when your customers check out with PayPal. - The PayPal Advertising Program has been shown to generate additional purchases as well as increase consumer's average purchase sizes by 15% - or more. See Details. - " -"Home Page","Home Page" -"Catalog Category Page","Catalog Category Page" -"Catalog Product Page","Catalog Product Page" -"Checkout Cart Page","Checkout Cart Page" -"Basic Settings - PayPal Website Payments Pro","Basic Settings - PayPal Website Payments Pro" -"It is recommended to set this value to ""Debit or Credit Card"" per store views.","It is recommended to set this value to ""Debit or Credit Card"" per store views." -"Credit Card Settings","Credit Card Settings" -"Allowed Credit Card Types","Allowed Credit Card Types" -" - 3D Secure validation is required for Maestro cards. Supporting of American Express cards require additional agreement. Learn more at http://www.paypal.com/amexupdate. - "," - 3D Secure validation is required for Maestro cards. Supporting of American Express cards require additional agreement. Learn more at http://www.paypal.com/amexupdate. - " -"Payment Applicable From","Payment Applicable From" -"Countries Payment Applicable From","Countries Payment Applicable From" -"Enable SSL verification","Enable SSL verification" -"Transfer Cart Line Items","Transfer Cart Line Items" -"Require CVV Entry","Require CVV Entry" -"Centinel Custom API URL","Centinel Custom API URL" -"If empty, a default value will be used. Custom URL may be provided by CardinalCommerce agreement.","If empty, a default value will be used. Custom URL may be provided by CardinalCommerce agreement." -"PayPal Billing Agreement Settings","PayPal Billing Agreement Settings" -"Settlement Report Settings","Settlement Report Settings" -"Frontend Experience Settings","Frontend Experience Settings" -"Basic Settings - PayPal Express Checkout","Basic Settings - PayPal Express Checkout" -"Website Payments Standard","Website Payments Standard" -"Accept credit card and PayPal payments securely.","Accept credit card and PayPal payments securely." -"Basic Settings - PayPal Website Payments Standard","Basic Settings - PayPal Website Payments Standard" -"It is recommended to set this value to ""PayPal"" per store views.","It is recommended to set this value to ""PayPal"" per store views." -"Summary Text for Aggregated Cart","Summary Text for Aggregated Cart" -"Uses store frontend name by default.","Uses store frontend name by default." -"Payflow Pro","Payflow Pro" -"Connect your merchant account with a fully customizable gateway that lets customers pay without leaving your site.","Connect your merchant account with a fully customizable gateway that lets customers pay without leaving your site." -Partner,Partner -Vendor,Vendor -"Use Proxy","Use Proxy" -"Proxy Host","Proxy Host" -"Proxy Port","Proxy Port" -"Basic Settings - PayPal Payflow Pro","Basic Settings - PayPal Payflow Pro" -" - Supporting of American Express cards require additional agreement. Learn more at http://www.paypal.com/amexupdate. - "," - Supporting of American Express cards require additional agreement. Learn more at http://www.paypal.com/amexupdate. - " -"Severe validation removes chargeback liability on merchant.","Severe validation removes chargeback liability on merchant." -"A value is required for live mode. Refer to your CardinalCommerce agreement.","A value is required for live mode. Refer to your CardinalCommerce agreement." -"Payflow Link (Includes Express Checkout)","Payflow Link (Includes Express Checkout)" -"Connect your merchant account with a PCI-compliant gateway that lets customers pay without leaving your site.","Connect your merchant account with a PCI-compliant gateway that lets customers pay without leaving your site." -"Payflow Link and Express Checkout","Payflow Link and Express Checkout" -"Email Associated with PayPal Merchant Account (Optional)","Email Associated with PayPal Merchant Account (Optional)" -"If you do not have multiple users set up on your account, please re-enter your Vendor/Merchant Login here.","If you do not have multiple users set up on your account, please re-enter your Vendor/Merchant Login here." -"Enable Payflow Link","Enable Payflow Link" -"Enable Express Checkout","Enable Express Checkout" -" - Why Advertise Financing?
- Give your sales a boost when you advertise financing.
PayPal helps turn browsers into buyers with financing - from Bill Me Later®. Your customers have more time to pay, while you get paid up front – at no additional cost to you. - Use PayPal’s free banner ads that let you advertise Bill Me Later® financing as a payment option when your customers check out with PayPal. - The PayPal Advertising Program has been shown to generate additional purchases as well as increase consumer's average purchase sizes by 15% - or more. See Details. - "," - Why Advertise Financing?
- Give your sales a boost when you advertise financing.
PayPal helps turn browsers into buyers with financing - from Bill Me Later®. Your customers have more time to pay, while you get paid up front – at no additional cost to you. - Use PayPal’s free banner ads that let you advertise Bill Me Later® financing as a payment option when your customers check out with PayPal. - The PayPal Advertising Program has been shown to generate additional purchases as well as increase consumer's average purchase sizes by 15% - or more. See Details. - " -"Basic Settings - PayPal Payflow Link","Basic Settings - PayPal Payflow Link" -"CVV Entry is Editable","CVV Entry is Editable" -"Send Email Confirmation","Send Email Confirmation" -"URL method for Cancel URL and Return URL","URL method for Cancel URL and Return URL" -"Express Checkout","Express Checkout" -"Add PayPal as an additional payment method to your checkout page.","Add PayPal as an additional payment method to your checkout page." -"Email Associated with PayPal Merchant Account","Email Associated with PayPal Merchant Account" -" - Start accepting payments via PayPal! - "," - Start accepting payments via PayPal! - " -"Don't have a PayPal account? Simply enter your email address.","Don't have a PayPal account? Simply enter your email address." -"API Authentication Methods","API Authentication Methods" -"API Username","API Username" -"API Password","API Password" -"Get Credentials from PayPal","Get Credentials from PayPal" -"Sandbox Credentials","Sandbox Credentials" -"API Uses Proxy","API Uses Proxy" -"Enable Bill Me Later","Enable Bill Me Later" -"PayPal Express Checkout lets you give customers access to financing through Bill Me Later® - at no additional cost to you. - You get paid up front, even though customers have more time to pay. A pre-integrated payment button lets customers pay quickly with Bill Me Later®. - Learn More - ","PayPal Express Checkout lets you give customers access to financing through Bill Me Later® - at no additional cost to you. - You get paid up front, even though customers have more time to pay. A pre-integrated payment button lets customers pay quickly with Bill Me Later®. - Learn More - " -"Publisher ID","Publisher ID" -"Required to display a banner","Required to display a banner" -"Get Publisher ID from PayPal","Get Publisher ID from PayPal" -"It is recommended to set this value to ""Magento_Paypal"" per store views.","It is recommended to set this value to ""Magento_Paypal"" per store views." -"Shortcut on Shopping Cart","Shortcut on Shopping Cart" -"Also affects mini-shopping cart.","Also affects mini-shopping cart." -"Shortcut on Product View","Shortcut on Product View" -"Authorization Honor Period (days)","Authorization Honor Period (days)" -"Specifies what the Authorization Honor Period is on the merchant’s PayPal account. It must mirror the setting in PayPal.","Specifies what the Authorization Honor Period is on the merchant’s PayPal account. It must mirror the setting in PayPal." -"Order Valid Period (days)","Order Valid Period (days)" -"Specifies what the Order Valid Period is on the merchant’s PayPal account. It must mirror the setting in PayPal.","Specifies what the Order Valid Period is on the merchant’s PayPal account. It must mirror the setting in PayPal." -"Number of Child Authorizations","Number of Child Authorizations" -"The default number of child authorizations in your PayPal account is 1. To do multiple authorizations please contact PayPal to request an increase.","The default number of child authorizations in your PayPal account is 1. To do multiple authorizations please contact PayPal to request an increase." -"Transfer Shipping Options","Transfer Shipping Options" -"If this option is enabled, customer can change shipping address and shipping method on PayPal website. In live mode works via HTTPS protocol only.","If this option is enabled, customer can change shipping address and shipping method on PayPal website. In live mode works via HTTPS protocol only." -"Notice that PayPal can handle up to 10 shipping options. That is why Magento will transfer only first 10 cheapest shipping options if there are more than 10 available.","Notice that PayPal can handle up to 10 shipping options. That is why Magento will transfer only first 10 cheapest shipping options if there are more than 10 available." -"Shortcut Buttons Flavor","Shortcut Buttons Flavor" -"Enable PayPal Guest Checkout","Enable PayPal Guest Checkout" -"Ability for buyer to purchase without PayPal account.","Ability for buyer to purchase without PayPal account." -"Require Customer's Billing Address","Require Customer's Billing Address" -"This feature needs be enabled first for the merchant account through PayPal technical support.","This feature needs be enabled first for the merchant account through PayPal technical support." -"Billing Agreement Signup","Billing Agreement Signup" -"Whether to create a billing agreement, if there are no active billing agreements available.","Whether to create a billing agreement, if there are no active billing agreements available." -" - Merchants need to apply to PayPal for enabling billing agreements feature. Do not enable this option until PayPal confirms that billing agreements are enabled for your merchant account. - "," - Merchants need to apply to PayPal for enabling billing agreements feature. Do not enable this option until PayPal confirms that billing agreements are enabled for your merchant account. - " -"Skip Order Review Step","Skip Order Review Step" -" - Will appear as a payment option only for customers who have at least one active billing agreement. - "," - Will appear as a payment option only for customers who have at least one active billing agreement. - " -"Allow in Billing Agreement Wizard","Allow in Billing Agreement Wizard" -"SFTP Credentials","SFTP Credentials" -"Custom Endpoint Hostname or IP-Address","Custom Endpoint Hostname or IP-Address" -"By default it is ""reports.paypal.com"".","By default it is ""reports.paypal.com""." -"Use colon to specify port. For example: ""test.example.com:5224"".","Use colon to specify port. For example: ""test.example.com:5224""." -"Custom Path","Custom Path" -"Scheduled Fetching","Scheduled Fetching" -"Enable Automatic Fetching","Enable Automatic Fetching" -"PayPal retains reports for 45 days.","PayPal retains reports for 45 days." -"Time of Day","Time of Day" -"PayPal Product Logo","PayPal Product Logo" -"Displays on catalog pages and homepage.","Displays on catalog pages and homepage." -"PayPal Merchant Pages Style","PayPal Merchant Pages Style" -"Page Style","Page Style" -" - Allowable values: ""paypal"", ""primary"" (default), your_custom_value (a custom payment page style from your merchant account profile). - "," - Allowable values: ""paypal"", ""primary"" (default), your_custom_value (a custom payment page style from your merchant account profile). - " -"Header Image URL","Header Image URL" -" - The image at the top left of the checkout page. Max size is 750x90-pixel. https is highly encouraged. - "," - The image at the top left of the checkout page. Max size is 750x90-pixel. https is highly encouraged. - " -"Header Background Color","Header Background Color" -" - The background color for the header of the checkout page. Case-insensitive six-character HTML hexadecimal color code in ASCII. - "," - The background color for the header of the checkout page. Case-insensitive six-character HTML hexadecimal color code in ASCII. - " -"Header Border Color","Header Border Color" -"2-pixel perimeter around the header space.","2-pixel perimeter around the header space." -"Page Background Color","Page Background Color" -" - The background color for the checkout page around the header and payment form. - "," - The background color for the checkout page around the header and payment form. - " -"Website Payments Pro Hosted Solution","Website Payments Pro Hosted Solution" -"Accept payments with a PCI compliant checkout that keeps customers on your site.","Accept payments with a PCI compliant checkout that keeps customers on your site." -"Payments Pro Hosted Solution","Payments Pro Hosted Solution" -" - Why Advertise Financing?
- Give your sales a boost when you advertise financing.
PayPal helps turn browsers into buyers with financing - from Bill Me Later®. Your customers have more time to pay, while you get paid up front – at no additional cost to you. - Use PayPal’s free banner ads that let you advertise Bill Me Later® financing as a payment option when your customers check out with PayPal. - The PayPal Advertising Program has been shown to generate additional purchases as well as increase consumer's average purchase sizes by 15% - or more. See Details. - "," - Why Advertise Financing?
- Give your sales a boost when you advertise financing.
PayPal helps turn browsers into buyers with financing - from Bill Me Later®. Your customers have more time to pay, while you get paid up front – at no additional cost to you. - Use PayPal’s free banner ads that let you advertise Bill Me Later® financing as a payment option when your customers check out with PayPal. - The PayPal Advertising Program has been shown to generate additional purchases as well as increase consumer's average purchase sizes by 15% - or more. See Details. - " -"Basic Settings - PayPal Payments Pro Hosted Solution","Basic Settings - PayPal Payments Pro Hosted Solution" -"Display Express Checkout in the Payment Information step","Display Express Checkout in the Payment Information step" -" - PayPal All-in-One Payment Solutions  Accept and process credit cards and PayPal payments. - "," - PayPal All-in-One Payment Solutions  Accept and process credit cards and PayPal payments. - " -"Choose a secure bundled payment solution for your business.","Choose a secure bundled payment solution for your business." -"PayPal Express Checkout","PayPal Express Checkout" -"Add another payment method to your existing solution or as a stand-alone option.","Add another payment method to your existing solution or as a stand-alone option." -"Payments Advanced (Includes Express Checkout)","Payments Advanced (Includes Express Checkout)" -"Accept payments with a PCI-compliant checkout that keeps customers on your site.","Accept payments with a PCI-compliant checkout that keeps customers on your site." -"Payments Advanced and Express Checkout","Payments Advanced and Express Checkout" -"PayPal recommends that you set up an additional User on your account at manager.paypal.com","PayPal recommends that you set up an additional User on your account at manager.paypal.com" -"PayPal recommends you set up an additional User on your account at manager.paypal.com, instead of entering your admin username and password here. This will enhance your security and prevent service interruptions if you later change your password. If you do not want to set up an additional User, you can re-enter your Merchant Login here.","PayPal recommends you set up an additional User on your account at manager.paypal.com, instead of entering your admin username and password here. This will enhance your security and prevent service interruptions if you later change your password. If you do not want to set up an additional User, you can re-enter your Merchant Login here." -" - Why Advertise Financing?
- Give your sales a boost when you advertise financing.
PayPal helps turn browsers into buyers with financing - from Bill Me Later®. Your customers have more time to pay, while you get paid up front – at no additional cost to you. - Use PayPal’s free banner ads that let you advertise Bill Me Later® financing as a payment option when your customers check out with PayPal. - The PayPal Advertising Program has been shown to generate additional purchases as well as increase consumer's average purchase sizes by 15% - or more. See Details. - "," - Why Advertise Financing?
- Give your sales a boost when you advertise financing.
PayPal helps turn browsers into buyers with financing - from Bill Me Later®. Your customers have more time to pay, while you get paid up front – at no additional cost to you. - Use PayPal’s free banner ads that let you advertise Bill Me Later® financing as a payment option when your customers check out with PayPal. - The PayPal Advertising Program has been shown to generate additional purchases as well as increase consumer's average purchase sizes by 15% - or more. See Details. - " -"Basic Settings - PayPal Payments Advanced","Basic Settings - PayPal Payments Advanced" -"Payments Pro (Includes Express Checkout)","Payments Pro (Includes Express Checkout)" -"Payments Pro and Express Checkout","Payments Pro and Express Checkout" -"Basic Settings - PayPal Payments Pro","Basic Settings - PayPal Payments Pro" -"Payments Standard","Payments Standard" -"Basic Settings - PayPal Payments Standard","Basic Settings - PayPal Payments Standard" -"PayPal Payment Gateways","PayPal Payment Gateways" -"Process payments using your own internet merchant account.","Process payments using your own internet merchant account." -"Payflow Pro (Includes Express Checkout)","Payflow Pro (Includes Express Checkout)" -"Payflow Pro and Express Checkout","Payflow Pro and Express Checkout" -" - Why Advertise Financing?
- Give your sales a boost when you advertise financing.
PayPal helps turn browsers into buyers with financing - from Bill Me Later®. Your customers have more time to pay, while you get paid up front – at no additional cost to you. - Use PayPal’s free banner ads that let you advertise Bill Me Later® financing as a payment option when your customers check out with PayPal. - The PayPal Advertising Program has been shown to generate additional purchases as well as increase consumer's average purchase sizes by 15% - or more. See Details. - "," - Why Advertise Financing?
- Give your sales a boost when you advertise financing.
PayPal helps turn browsers into buyers with financing - from Bill Me Later®. Your customers have more time to pay, while you get paid up front – at no additional cost to you. - Use PayPal’s free banner ads that let you advertise Bill Me Later® financing as a payment option when your customers check out with PayPal. - The PayPal Advertising Program has been shown to generate additional purchases as well as increase consumer's average purchase sizes by 15% - or more. See Details. - " -"Accept credit cards, debit cards and PayPal payments securely.","Accept credit cards, debit cards and PayPal payments securely." -"Accept payments with a completely customizable checkout page.","Accept payments with a completely customizable checkout page." -"Website Payments Pro Hosted Solution (Includes Express Checkout)","Website Payments Pro Hosted Solution (Includes Express Checkout)" -"Website Payments Pro Hosted Solution and Express Checkout","Website Payments Pro Hosted Solution and Express Checkout" -"Basic Settings - PayPal Website Payments Pro Hosted Solution","Basic Settings - PayPal Website Payments Pro Hosted Solution" -"PayPal Payment Solutions","PayPal Payment Solutions" diff --git a/app/code/Magento/Paypal/i18n/fr_FR.csv b/app/code/Magento/Paypal/i18n/fr_FR.csv deleted file mode 100644 index 4fa18266f9921..0000000000000 --- a/app/code/Magento/Paypal/i18n/fr_FR.csv +++ /dev/null @@ -1,692 +0,0 @@ -Custom,Personnalisé -Close,Close -Cancel,Cancel -Back,Back -Price,Prix -ID,ID -Configure,Configure -No,Non -Qty,Qty -Subtotal,Sous-total -"Incl. Tax","Incl. Tax" -Edit,Edit -"--Please Select--","--Please Select--" -Customer,Customer -"First Name","First Name" -"Last Name","Last Name" -Email,Email -"-- Please Select --","-- Please Select --" -Yes,Oui -Status,Status -Enabled,Enabled -"Sort Order","Sort Order" -Title,Title -"Are you sure you want to do this?","Are you sure you want to do this?" -Order,Commande -View,Vue -Active,Active -Position,Position -Dynamic,Dynamique -N/A,N/A -Canceled,Canceled -"General Information","General Information" -Static,Statique -"Advanced Settings","Advanced Settings" -"Learn More","En savoir plus" -"Start Date","Start Date" -"Product Name","Product Name" -"3D Secure Card Validation","3D Secure Card Validation" -"Merchant Liability","Responsabilité du vendeur" -"Billing Information","Billing Information" -"Shipping Information","Shipping Information" -"Shipping Method","Méthode d'expédition" -"Please agree to all the terms and conditions before placing the order.","Veuillez accepter toutes les conditions générales avant de passer la commande." -"Account confirmation is required. Please, check your e-mail for confirmation link. To resend confirmation email please click here.","Account confirmation is required. Please, check your e-mail for confirmation link. To resend confirmation email please click here." -Password,Password -Continue,Continue -"Order #","Order #" -Login,Login -"Shipping Address","Adresse d'expédition" -"Payment Method","Payment Method" -"Place Order","Placer une commande" -"Sorry, no quotes are available for this order at this time.","Désolé, aucune estimation n'est actuellement disponible pour cette commande." -Sales,Ventes -Created,Created -Display,Display -User,User -Daily,"Tous les jours" -Date,Date -"Order Total","Order Total" -Never,Jamais -Updated,Updated -Reports,Rapports -"Order Status","Order Status" -"View Order","View Order" -Event,Évènement -"Please Select","Please Select" -"Submitting order information...","Traitement de la commande..." -Authorization,Autorisation -"You notified customer about invoice #%1.","You notified customer about invoice #%1." -"Note: %1","Note: %1" -"IPN ""%1""","IPN ""%1""" -"Billing Agreements","Accords de facturation" -"Reference ID","Reference ID" -"Billing Agreement #%1","Billing Agreement #%1" -"Related Orders","Related Orders" -"Billing Agreement View","Voir l'accord de facturation" -"View Transaction Details","Voir les détails de la transction" -"Reference Information","Informations de référence" -"Transaction Information","Information de la transaction" -"PayPal Fee Information","Informations des frais Paypal" -"PayPal Settlement Reports","Rapports sur le règlement PayPal" -"We are connecting to the PayPal SFTP server to retrieve new reports. Are you sure you want to continue?","We are connecting to the PayPal SFTP server to retrieve new reports. Are you sure you want to continue?" -"Fetch Updates","Mises à jour de récupération" -button_label,button_label -sandbox_button_label,sandbox_button_label -Help,Aide -"There is already another PayPal solution enabled. Enable this solution instead?","There is already another PayPal solution enabled. Enable this solution instead?" -"The following error(s) occured:","The following error(s) occured:" -"Some PayPal solutions conflict.","Some PayPal solutions conflict." -"PayPal Express Checkout is not enabled.","PayPal Express Checkout is not enabled." -"Please re-enable the previously enabled payment solutions.","Please re-enable the previously enabled payment solutions." -"View Demo","Voir démo" -"See terms","See terms" -"You will be redirected to the PayPal website.","Vous serez redirigé vers le site de Paypal." -"Would you like to sign a billing agreement ' 'to streamline further purchases with PayPal?","Would you like to sign a billing agreement ' 'to streamline further purchases with PayPal?" -"You will be redirected to the PayPal website when you place an order.","Vous serez redirigé vers le site de PayPal quand vous effectuerez une commande." -"Click here if you are not redirected within 10 seconds.","Click here if you are not redirected within 10 seconds." -"You will be redirected to the PayPal website in a few seconds.","Vous serez redirigé vers le site web de Paypal dans quelques secondes." -"You canceled the billing agreement.","You canceled the billing agreement." -"We could not cancel the billing agreement.","We could not cancel the billing agreement." -"You deleted the billing agreement.","You deleted the billing agreement." -"We could not delete the billing agreement.","We could not delete the billing agreement." -"Please specify the correct billing agreement ID and try again.","Please specify the correct billing agreement ID and try again." -"View Transaction","Voir la transaction" -"We found nothing to fetch because of an empty configuration.","We found nothing to fetch because of an empty configuration." -"We fetched %1 report rows from '%2@%3'.","We fetched %1 report rows from '%2@%3'." -"We couldn't fetch reports from '%1@%2'.","We couldn't fetch reports from '%1@%2'." -"Billing Agreement # %1","Billing Agreement # %1" -"We couldn't start the billing agreement wizard.","We couldn't start the billing agreement wizard." -"The billing agreement ""%1"" has been created.","The billing agreement ""%1"" has been created." -"We couldn't finish the billing agreement wizard.","We couldn't finish the billing agreement wizard." -"The billing agreement ""%1"" has been canceled.","The billing agreement ""%1"" has been canceled." -"We couldn't cancel the billing agreement.","We couldn't cancel the billing agreement." -"To proceed to Checkout, please log in using your email address.","To proceed to Checkout, please log in using your email address." -"We can't start Express Checkout.","We can't start Express Checkout." -"Express Checkout and Order have been canceled.","Le contrôle express et la commande ont été annulés." -"Express Checkout has been canceled.","Le contrôle express a été annulé." -"Unable to cancel Express Checkout","Unable to cancel Express Checkout" -"We can't process Express Checkout approval.","We can't process Express Checkout approval." -"We can't initialize Express Checkout review.","We can't initialize Express Checkout review." -"We can't update shipping method.","We can't update shipping method." -"We can't place the order.","We can't place the order." -"We can't initialize Express Checkout.","We can't initialize Express Checkout." -"PayPal Express Checkout Token does not exist.","Le mot de vérification du paiement express via Paypal n'existe pas." -"A wrong PayPal Express Checkout Token is specified.","A wrong PayPal Express Checkout Token is specified." -"Your payment has been declined. Please try again.","Your payment has been declined. Please try again." -"We can't contact the PayPal gateway.","We can't contact the PayPal gateway." -"PayPal response hasn't required fields.","La réponse PayPal n'a pas les champs obligatoires." -"Something went wrong while processing your order.","Something went wrong while processing your order." -"PayPal gateway has rejected request. %1","PayPal gateway has rejected request. %1" -"PayPal gateway rejected the request. %1","PayPal gateway rejected the request. %1" -"I'm sorry - but we were not able to process your payment. Please try another payment method or contact us so we can assist you.","I'm sorry - but we were not able to process your payment. Please try another payment method or contact us so we can assist you." -"I'm sorry - but we are not able to complete your transaction. Please contact us so we can assist you.","I'm sorry - but we are not able to complete your transaction. Please contact us so we can assist you." -"The payment method code is not set.","The payment method code is not set." -"The reference ID is not set.","The reference ID is not set." -"Unable to save Billing Agreement:","Impossible d'enregistrer l'accord de facturation :" -"The customer ID is not set.","The customer ID is not set." -"The Billing Agreement status is not set.","The Billing Agreement status is not set." -"The PayPal certificate does not exist.","The PayPal certificate does not exist." -"We prefer PayPal (150 X 60)","Nous préférons PayPal (150 X 60)" -"We prefer PayPal (150 X 40)","Nous préférons Paypal (150 X 40)" -"Now accepting PayPal (150 X 60)","PayPal désormais accepté (150 X 60)" -"Now accepting PayPal (150 X 40)","Accepte maintenant PayPal (150 X 40)" -"Payments by PayPal (150 X 60)","Paiements par PayPal (150 X 60)" -"Payments by PayPal (150 X 40)","Paiements par PayPal (150 X 40)" -"Shop now using (150 X 60)","Boutique utilisant maintenant (150 X 60)" -"Shop now using (150 X 40)","Faites vos achats en utilisant (150 X 40)" -Shortcut,Raccourci -"Acceptance Mark Image","Image de marque d'acceptance" -Sale,Vente -"For Virtual Quotes Only","Pour les devis virtuels uniquement" -Auto,Automatique -"Ask Customer","Demander au client" -"IPN (Instant Payment Notification) Only","IPN (Instant Payment Notification) Only" -"API Signature","Signature API" -"API Certificate","Certificat API" -"The ordering amount of %1 is pending approval on the payment gateway.","The ordering amount of %1 is pending approval on the payment gateway." -"Ordered amount of %1","Ordered amount of %1" -"We'll authorize the amount of %1 as soon as the payment gateway approves it.","We'll authorize the amount of %1 as soon as the payment gateway approves it." -"The authorized amount is %1.","The authorized amount is %1." -"The maximum number of child authorizations is reached.","Le nombre maximum d'autorisations pour enfant est atteint." -"PayPal can't process orders with a zero balance due. ' 'To finish your purchase, please go through the standard checkout process.","PayPal can't process orders with a zero balance due. ' 'To finish your purchase, please go through the standard checkout process." -"Payer is not identified.","Le payeur n'est pas identifié." -"Last Transaction ID","Dernier identifiant de transaction" -"This customer did not include a confirmed address.","This customer did not include a confirmed address." -"The payment is authorized but not settled.","Le paiement est autorisé mais pas encore réglé." -"The payment eCheck is not yet cleared.","Le paiement eCheck n'est pas encore validé." -"The merchant holds a non-U.S. account and does not have a withdrawal mechanism.","The merchant holds a non-U.S. account and does not have a withdrawal mechanism." -"The payment currency does not match any of the merchant's balances currency.","The payment currency does not match any of the merchant's balances currency." -"The payment is pending while it is being reviewed by PayPal for risk.","Le paiement est en attente alors qu'il est actuellement examiné par PayPal pour le risque." -"The payment is pending because it was made to an email address that is not yet registered or confirmed.","Le paiement est en attente car il a été fait vers une adresse qui n'est pas encore enregistrée ou confirmée." -"The merchant account is not yet verified.","Le compte du vendeur n'est pas vérifié." -"The payment was made via credit card. In order to receive funds merchant must upgrade account to Business or Premier status.","Le paiement a été effectué via carte de crédit. Afin de recevoir les fonds, le vendeur doit obtenir un compte Business ou Premier." -"Sorry, but something went wrong. Please contact PayPal customer service.","Sorry, but something went wrong. Please contact PayPal customer service." -"A reversal has occurred on this transaction due to a chargeback by your customer.","A reversal has occurred on this transaction due to a chargeback by your customer." -"A reversal has occurred on this transaction due to your customer triggering a money-back guarantee.","A reversal has occurred on this transaction due to your customer triggering a money-back guarantee." -"A reversal has occurred on this transaction due to a complaint about the transaction from your customer.","A reversal has occurred on this transaction due to a complaint about the transaction from your customer." -"A reversal has occurred on this transaction because you have given the customer a refund.","A reversal has occurred on this transaction because you have given the customer a refund." -"Reversal of an adjustment.","Annulation d'un ajustement." -"Transaction reversal due to fraud detected by PayPal administrators.","Transaction reversal due to fraud detected by PayPal administrators." -"Transaction reversal by PayPal administrators.","Transaction reversal by PayPal administrators." -"Reimbursement for a chargeback.","Remboursement pour un rejet de débit." -"Settlement of a chargeback.","Accord de remboursement." -"A reversal has occurred on this transaction because of a customer dispute suspecting unauthorized spoof.","A reversal has occurred on this transaction because of a customer dispute suspecting unauthorized spoof." -"Buyer claims that he did not receive goods or service.","Buyer claims that he did not receive goods or service." -"Buyer claims that the goods or service received differ from merchant’s description of the goods or service.","Buyer claims that the goods or service received differ from merchant’s description of the goods or service." -"Buyer claims that he/she did not authorize transaction.","Buyer claims that he/she did not authorize transaction." -"A case that has been resolved and close requires a reimbursement.","A case that has been resolved and close requires a reimbursement." -"Buyer claims that a possible duplicate payment was made to the merchant.","Buyer claims that a possible duplicate payment was made to the merchant." -"Buyer claims that the received merchandise is unsatisfactory, defective, or damaged.","Buyer claims that the received merchandise is unsatisfactory, defective, or damaged." -"Unknown reason. Please contact PayPal customer service.","Raison inconnue. Veuillez contacter le service client de PayPal." -"Payer ID","ID du payeur" -"Payer Email","E-mail du payeur" -"Payer Status","Statut du payeur" -"Payer Address ID","Identifiant de l'adresse de l'acheteur" -"Payer Address Status","Statut d'adresse du payeur" -"Merchant Protection Eligibility","Eligibilité de protection marchande" -"Triggered Fraud Filters","A déclenché les détecteurs de fraude" -"Last Correlation ID","Dernier identifiant en corrélation" -"Address Verification System Response","Réponse du système à la vérification d'adresse" -"CVV2 Check Result by PayPal","Résultats de chèque CVV2 via Paypal" -"Buyer's Tax ID","Identification fiscale de l'acheteur" -"Buyer's Tax ID Type","Type d'identification fiscale de l'acheteur" -"PayPal/Centinel Visa Payer Authentication Service Result","PayPal/Centinel Visa Payer Authentication Service Result" -"PayPal/Centinel Electronic Commerce Indicator","Indicateur de commerce électronique de Paypal." -Chargeback,"Frais de retour" -Complaint,Complaint -Dispute,Dispute -"Matched Address only (no ZIP)","Adresse correspondante uniquement (pas de ZIP)" -"Matched Address only (no ZIP) International","Matched Address only (no ZIP) International" -"No Details matched","Pas de détails correspondants" -"No Details matched. International","Pas de détail trouvé. International" -"Exact Match. Address and nine-digit ZIP code","Correspondance exacte. Adresse et code postal ZIP à neuf chiffres" -"Exact Match. Address and Postal Code. International","Correspondance exacte. Adresse et code postal. International" -"Exact Match. Address and Postal Code. UK-specific","Correspondance exacte. Adresse et code postal. Spécifique à la Grande Bretagne" -"N/A. Not allowed for MOTO (Internet/Phone) transactions","N/A. Non autorisé pour des transactions MOTO (Internet / Téléphone)" -"N/A. Global Unavailable","N/A. Indisponible" -"N/A. International Unavailable","N/A. International indisponible." -"Matched five-digit ZIP only (no Address)","ZIP à 5 chiffres correspondant uniquement (pas d'adresse)" -"Matched Postal Code only (no Address)","Code postal correspondant uniquement (pas d'adresse)" -"N/A. Retry","N/A. Réessayez" -"N/A. Service not Supported","N/A. Le service n'est pas pris en charge" -"N/A. Unavailable","N/A. Indisponible." -"Matched whole nine-didgit ZIP (no Address)","ZIP complet à 9 chiffres correspondant uniquement (pas d'adresse)" -"Yes. Matched Address and five-didgit ZIP","Oui. Adresse correspondante et ZIP à 5 chiffres" -"All the address information matched","Toutes les informations de l'adresse correspondent" -"None of the address information matched","Aucune des informations de l'adresse ne correspondait." -"Part of the address information matched","Une partie des informations de l'adresse correspond" -"N/A. The merchant did not provide AVS information","N/A. Le commerçant n'a pas fourni d'information AVS" -"N/A. Address not checked, or acquirer had no response. Service not available","N/A. Adresse non spécifiée, ou pas de réponse. Service non disponible." -"Matched (CVV2CSC)","Assorti (CVV2CSC)" -"No match","Aucune correspondance" -"N/A. Not processed","N/A. Non effectué." -"N/A. Service not supported","N/A. Appareil non supporté" -"N/A. Service not available","N/A. Service non disponible." -"N/A. No response","N/A Pas de réponse" -"Matched (CVV2)","Correspondance (CVV2)" -"N/A. The merchant has not implemented CVV2 code handling","N/A. Le vendeur n'a pas implémenté la gestion du code CVV2" -"N/A. Merchant has indicated that CVV2 is not present on card","N/A. Le vendeur a indiqué que ce CVV2 n'est pas présent." -"Authenticated, Good Result","Authentifié, bon résultat" -"Authenticated, Bad Result","Authentifié, mauvais résultat" -"Attempted Authentication, Good Result","Essai d'authentification, bon résultat" -"Attempted Authentication, Bad Result","Essai d'authentification, mauvais résultat" -"No Liability Shift","Pas de transfert de responsabilité" -"Issuer Liability","Responsabilité de l'émetteur" -CNPJ,CNPJ -CPF,CPF -"IPN ""%1"". Case type ""%2"". Case ID ""%3"" %4","IPN ""%1"". Case type ""%2"". Case ID ""%3"" %4" -"IPN ""%1"". A dispute has been resolved and closed. %2 Transaction amount %3.","IPN ""%1"". A dispute has been resolved and closed. %2 Transaction amount %3." -"IPN ""%1"". %2 Transaction amount %3. Transaction ID: ""%4""","IPN ""%1"". %2 Transaction amount %3. Transaction ID: ""%4""" -"You notified customer about creditmemo #%1.","You notified customer about creditmemo #%1." -"Created billing agreement #%1.","Created billing agreement #%1." -"We couldn't create a billing agreement for this order.","We couldn't create a billing agreement for this order." -"Payflow PNREF: #%1.","Payflow PNREF: #%1." -"Fetch transaction details method does not exists in Payflow","Fetch transaction details method does not exists in Payflow" -"We cannot send the new order email.","We cannot send the new order email." -"You cannot void a verification transaction.","You cannot void a verification transaction." -"Payment transactions disallow storing objects.","Les transactions de paiement ne permettent pas le stockage d'objets." -"You need to enter a transaction ID.","You need to enter a transaction ID." -"This operation requires an existing transaction object.","Cette opération nécessite un objet de transaction existant." -"You need an authorization transaction to void.","You need an authorization transaction to void." -"We can't issue a refund transaction because there is no capture transaction.","We can't issue a refund transaction because there is no capture transaction." -"We cannot create a target file for reading reports.","We cannot create a target file for reading reports." -"Report Date","Date du rapport" -"Merchant Account","Compte du vendeur" -"Transaction ID","ID de la transaction" -"Invoice ID","Identifiant de la facture" -"PayPal Reference ID","Identifiant de référence Paypal" -"PayPal Reference ID Type","Type d'identifiant de référence Paypal" -"Event Code","Code de l'évènement" -"Finish Date","Finish Date" -"Debit or Credit","Débit ou crédit" -"Gross Amount","Montant brut" -"Fee Debit or Credit","Frais de débit ou crédit" -"Fee Amount","Montant des frais" -"Order ID","Identifiant commande" -"Subscription ID","Identifiant de l'inscrit" -"Preapproved Payment ID","Identifiant du paiement pré-approuvé" -Credit,Crédit -Debit,Débit -"General: received payment of a type not belonging to the other T00xx categories","Général : paiement reçu ne correspondant pas aux autres catégories T01xx" -"Mass Pay Payment","Paiement de masse" -"Subscription Payment, either payment sent or payment received","Paiement de l'abonnement, paiement envoyé ou paiement reçu" -"Preapproved Payment (BillUser API), either sent or received","Paiement préapprouvés (API facture utilisateur), envoyé ou reçu" -"eBay Auction Payment","Paiement d'enchères eBay" -"Direct Payment API","Paiement direct via l'API" -"Express Checkout APIs","APIs de paiement Express" -"Website Payments Standard Payment","Paiement site paiement standard" -"Postage Payment to either USPS or UPS","Envoi d'un paiement à USPS ou UPS" -"Gift Certificate Payment: purchase of Gift Certificate","Paiement du certificat de cadeau : acheter un certificat de cadeau" -"Auction Payment other than through eBay","Paiement des enchères autres que via eBay" -"Mobile Payment (made via a mobile phone)","Paiement mobile (effectué via un téléphone mobile)" -"Virtual Terminal Payment","Terminal de paiement virtuel" -"General: non-payment fee of a type not belonging to the other T01xx categories","Général : frais de non paiement ne correspondant pas aux catégories T01xx" -"Fee: Web Site Payments Pro Account Monthly","Frais : compte mensuelle de sites web pro" -"Fee: Foreign ACH Withdrawal","Frais : virement à l'étranger" -"Fee: WorldLink Check Withdrawal","Frais : virement Worldlink" -"Fee: Mass Pay Request","Frais : requête de paiement de masse" -"General Currency Conversion","Conversion de monnaie" -"User-initiated Currency Conversion","Conversion de devise initiée par l'utilisateur" -"Currency Conversion required to cover negative balance","Conversion de monnaie nécessaire pour compenser balance négative" -"General Funding of PayPal Account ","Fonds du compte Paypal" -"PayPal Balance Manager function of PayPal account","Fonction de gestion de la balance de votre compte Paypal" -"ACH Funding for Funds Recovery from Account Balance","Fonds ACH pour récupération de fonds depuis la balance du compte" -"EFT Funding (German banking)","Fonds EFT (banque allemande)" -"General Withdrawal from PayPal Account","Virement général depuis le compte Paypal" -AutoSweep,"Emporter automatiquement" -"General: Use of PayPal account for purchasing as well as receiving payments","Général : Utilisation du compte Paypal pour acheter et recevoir des paiements" -"Virtual PayPal Debit Card Transaction","Transaction via carte de débit virtuelle Paypal" -"PayPal Debit Card Withdrawal from ATM","Retrait depuis distributeur automatique à partir d'une carte de débit Paypal" -"Hidden Virtual PayPal Debit Card Transaction","Transaction cachée via carte de débit Paypal" -"PayPal Debit Card Cash Advance","Avance de fonds carte de débit PayPal" -"General: Withdrawal from PayPal Account","Général : virement depuis le compte Paypal." -"General (Purchase with a credit card)","Général (commande via carte de crédit)" -"Negative Balance","Solde négatif" -"General: bonus of a type not belonging to the other T08xx categories","Général : bonus d'un type ne correspondant pas aux autres catégories T08xx" -"Debit Card Cash Back","Remboursement carte de débit." -"Merchant Referral Bonus","Bonus de parrainage d'un vendeur" -"Balance Manager Account Bonus","Bonus de la balance du manager" -"PayPal Buyer Warranty Bonus","Bonus Garantie Acheteur PayPal" -"PayPal Protection Bonus","Bonus de protection Paypal" -"Bonus for first ACH Use","Bonus pour première utilisation de l'ACH" -"General Redemption","Remboursement général" -"Gift Certificate Redemption","Obtenir annulation du certificat de cadeau" -"Points Incentive Redemption","Remboursement de prime de points" -"Coupon Redemption","Annulations de coupons" -"Reward Voucher Redemption","Remboursement bon de récompense" -"General. Product no longer supported","Général. Produit plus supporté." -"General: reversal of a type not belonging to the other T11xx categories","Général : annulation d'un type ne correspondant pas aux autres catégories T11xx" -"ACH Withdrawal","Virement ACH" -"Debit Card Transaction","Transaction via carte de débit." -"Reversal of Points Usage","Reprise de l'utilisation des points" -"ACH Deposit (Reversal)","Dépôt ACH (annulation)" -"Reversal of General Account Hold","Annulation de l'attente du compte" -"Account-to-Account Payment, initiated by PayPal","Paiement compte-à-compte, initié par PayPal" -"Payment Refund initiated by merchant","Remboursement de paiement initié par le marchand" -"Fee Reversal","Annulation des frais" -"Hold for Dispute Investigation","Retenir pour enquête du litige" -"Reversal of hold for Dispute Investigation","Reprise de l'immobilisation pour enquête sur la contestation" -"General: adjustment of a type not belonging to the other T12xx categories","Général : ajustement à un type ne correspondant pas aux autres catégories T12xx" -Reversal,Reprise -Charge-off,Radiés -Incentive,Motivation -"Reimbursement of Chargeback",Remboursement. -"General (Authorization)","Général (autorisation)" -Reauthorization,Réautorisation -Void,Annuler -"General (Dividend)","Générale (dividendes)" -"General: temporary hold of a type not belonging to the other T15xx categories","Général : blocage temporaire d'un type ne correspondant pas aux catégories T15xx" -"Open Authorization","Autorisation ouverte" -"ACH Deposit (Hold for Dispute or Other Investigation)","Dépôt ACH (bloquer pour litige ou autre enquête)" -"Available Balance","Solde disponible" -Funding,Fonds -"General: Withdrawal to Non-Bank Entity","Général : virement vers une entité non-bancaire" -"WorldLink Withdrawal","Virement WorldLink" -"Buyer Credit Payment","Paiement acheteur" -"General Adjustment without businessrelated event","Ajustement général avec les évènements liés au commerce" -"General (Funds Transfer from PayPal Account to Another)","Général (transfert de fonds d'un compte Paypal à un autre)" -"Settlement Consolidation","Consolidation de l'accord." -"General: event not yet categorized","Général : évènement n'appartenant à aucune catégorie" -"The PayPal certificate file is empty.","The PayPal certificate file is empty." -"Header (center)","Header (center)" -"Sidebar (right)","Sidebar (right)" -"Near Bill Me Later checkout button","Near Bill Me Later checkout button" -"Every 3 days","Tous les 3 jours" -"Every 7 days","Tous les 7 jours" -"Every 10 days","Tous les 10 jours" -"Every 14 days","Tous les 14 jours" -"Every 30 days","Tous les 30 jours" -"Every 40 days","Tous les 40 jours" -"No Logo","Pas de logo" -"Pending PayPal","PayPal en attente" -"Billing Agreement","Accord de facturation" -"Created At","Created At" -"Updated At","Updated At" -"-- Please Select Billing Agreement--","-- Veuillez sélectionner un accord de facturation--" -"Not sure what PayPal payment method to use? Click here to learn more.","Not sure what PayPal payment method to use? Click here to learn more." -"Important: ","Important: " -"To use PayPal Payments Advanced, you must configure your PayPal Payments Advanced account on the PayPal website.","To use PayPal Payments Advanced, you must configure your PayPal Payments Advanced account on the PayPal website." -"Once you log into your PayPal Advanced account, navigate to the Service Settings - Hosted Checkout Pages - Set Up menu and set the options described below","Once you log into your PayPal Advanced account, navigate to the Service Settings - Hosted Checkout Pages - Set Up menu and set the options described below" -"To use PayPal Payflow Link, you must configure your PayPal Payflow Link account on the PayPal website.","To use PayPal Payflow Link, you must configure your PayPal Payflow Link account on the PayPal website." -"Once you log into your PayPal Payflow Link account, navigate to the Service Settings - Hosted Checkout Pages - Set Up menu and set the options described below","Once you log into your PayPal Payflow Link account, navigate to the Service Settings - Hosted Checkout Pages - Set Up menu and set the options described below" -"Agreement Information","Agreement Information" -"Reference ID:","Reference ID:" -Status:,Status: -Created:,Created: -Updated:,Updated: -"Payment Method:","Payment Method:" -"Ship To","Ship To" -"Back to Billing Agreements","Retour aux accords de facturation" -"There are no billing agreements yet.","Il n'y a pas encore d'accord de facturation" -"New Billing Agreement","Nouvel Accord de Facturation" -"You will be redirected to the payment system website.","You will be redirected to the payment system website." -Create...,Create... -"Your billing agreement # is: %1.","Your billing agreement # is: %1." -"Review Order","Vérification de la commande" -"Please select a shipping method...","Veuillez sélectionner un mode d'expédition..." -"Update Shipping Method","Update Shipping Method" -"Edit Payment Information","Edit Payment Information" -"Items in Your Shopping Cart","Objets dans votre panier" -"Edit Shopping Cart","Modifier le panier" -"Please update order data to get shipping methods and rates","Veuillez mettre à jour les données de la commande afin d'obtenir les modes et tarifs d'envoi" -"Checkout with PayPal","Commander avec PayPal" -"Please do not refresh the page until you complete payment.","Merci de ne pas actualiser cette page avant la finalisation du paiement." -"You will be required to enter your payment details after you place an order.","Vous devrez saisir vos informations de paiement après avoir passé une commande." -"Additional Options","Options additionnelles" -"Acceptance Mark","Marque d'acceptance" -"What is PayPal?","Qu'est-ce que Paypal?" -"Sign a billing agreement to streamline further purchases with PayPal.","Signez un accord de facture pour continuer vos achats via Paypal." -Schedule,Schedule -Size,Size -"Sorry, something went wrong.","Sorry, something went wrong." -"Sorry, something went wrong. Please try again later.","Sorry, something went wrong. Please try again later." -"Test Mode","Test Mode" -"Payment Action","Payment Action" -"3D Secure","3D Secure" -"Severe 3D Secure Card Validation","Severe 3D Secure Card Validation" -"Severe Validation Removes Chargeback Liability on Merchant","Severe Validation Removes Chargeback Liability on Merchant" -"Centinel API URL","Centinel API URL" -"Debug Mode","Debug Mode" -"Sandbox Mode","Sandbox Mode" -1,1 -"Merchant Location","Merchant Location" -"Merchant Country","Merchant Country" -"If not specified, Default Country from General Config will be used","If not specified, Default Country from General Config will be used" -"Website Payments Pro (Includes Express Checkout)","Website Payments Pro (Includes Express Checkout)" -"Accept payments with a completely customizable checkout.","Accept payments with a completely customizable checkout." -"Required PayPal Settings","Required PayPal Settings" -"Website Payments Pro and Express Checkout","Website Payments Pro and Express Checkout" -"Enable this Solution","Enable this Solution" -"Advertise Bill Me Later","Advertise Bill Me Later" -" - Why Advertise Financing?
- Give your sales a boost when you advertise financing.
PayPal helps turn browsers into buyers with financing - from Bill Me Later®. Your customers have more time to pay, while you get paid up front – at no additional cost to you. - Use PayPal’s free banner ads that let you advertise Bill Me Later® financing as a payment option when your customers check out with PayPal. - The PayPal Advertising Program has been shown to generate additional purchases as well as increase consumer's average purchase sizes by 15% - or more. See Details. - "," - Why Advertise Financing?
- Give your sales a boost when you advertise financing.
PayPal helps turn browsers into buyers with financing - from Bill Me Later®. Your customers have more time to pay, while you get paid up front – at no additional cost to you. - Use PayPal’s free banner ads that let you advertise Bill Me Later® financing as a payment option when your customers check out with PayPal. - The PayPal Advertising Program has been shown to generate additional purchases as well as increase consumer's average purchase sizes by 15% - or more. See Details. - " -"Home Page","Home Page" -"Catalog Category Page","Catalog Category Page" -"Catalog Product Page","Catalog Product Page" -"Checkout Cart Page","Checkout Cart Page" -"Basic Settings - PayPal Website Payments Pro","Basic Settings - PayPal Website Payments Pro" -"It is recommended to set this value to ""Debit or Credit Card"" per store views.","It is recommended to set this value to ""Debit or Credit Card"" per store views." -"Credit Card Settings","Credit Card Settings" -"Allowed Credit Card Types","Allowed Credit Card Types" -" - 3D Secure validation is required for Maestro cards. Supporting of American Express cards require additional agreement. Learn more at http://www.paypal.com/amexupdate. - "," - 3D Secure validation is required for Maestro cards. Supporting of American Express cards require additional agreement. Learn more at http://www.paypal.com/amexupdate. - " -"Payment Applicable From","Payment Applicable From" -"Countries Payment Applicable From","Countries Payment Applicable From" -"Enable SSL verification","Enable SSL verification" -"Transfer Cart Line Items","Transfer Cart Line Items" -"Require CVV Entry","Require CVV Entry" -"Centinel Custom API URL","Centinel Custom API URL" -"If empty, a default value will be used. Custom URL may be provided by CardinalCommerce agreement.","If empty, a default value will be used. Custom URL may be provided by CardinalCommerce agreement." -"PayPal Billing Agreement Settings","PayPal Billing Agreement Settings" -"Settlement Report Settings","Settlement Report Settings" -"Frontend Experience Settings","Frontend Experience Settings" -"Basic Settings - PayPal Express Checkout","Basic Settings - PayPal Express Checkout" -"Website Payments Standard","Website Payments Standard" -"Accept credit card and PayPal payments securely.","Accept credit card and PayPal payments securely." -"Basic Settings - PayPal Website Payments Standard","Basic Settings - PayPal Website Payments Standard" -"It is recommended to set this value to ""PayPal"" per store views.","It is recommended to set this value to ""PayPal"" per store views." -"Summary Text for Aggregated Cart","Summary Text for Aggregated Cart" -"Uses store frontend name by default.","Uses store frontend name by default." -"Payflow Pro","Payflow Pro" -"Connect your merchant account with a fully customizable gateway that lets customers pay without leaving your site.","Connect your merchant account with a fully customizable gateway that lets customers pay without leaving your site." -Partner,Partner -Vendor,Vendor -"Use Proxy","Use Proxy" -"Proxy Host","Proxy Host" -"Proxy Port","Proxy Port" -"Basic Settings - PayPal Payflow Pro","Basic Settings - PayPal Payflow Pro" -" - Supporting of American Express cards require additional agreement. Learn more at http://www.paypal.com/amexupdate. - "," - Supporting of American Express cards require additional agreement. Learn more at http://www.paypal.com/amexupdate. - " -"Severe validation removes chargeback liability on merchant.","Severe validation removes chargeback liability on merchant." -"A value is required for live mode. Refer to your CardinalCommerce agreement.","A value is required for live mode. Refer to your CardinalCommerce agreement." -"Payflow Link (Includes Express Checkout)","Payflow Link (Includes Express Checkout)" -"Connect your merchant account with a PCI-compliant gateway that lets customers pay without leaving your site.","Connect your merchant account with a PCI-compliant gateway that lets customers pay without leaving your site." -"Payflow Link and Express Checkout","Payflow Link and Express Checkout" -"Email Associated with PayPal Merchant Account (Optional)","Email Associated with PayPal Merchant Account (Optional)" -"If you do not have multiple users set up on your account, please re-enter your Vendor/Merchant Login here.","If you do not have multiple users set up on your account, please re-enter your Vendor/Merchant Login here." -"Enable Payflow Link","Enable Payflow Link" -"Enable Express Checkout","Enable Express Checkout" -" - Why Advertise Financing?
- Give your sales a boost when you advertise financing.
PayPal helps turn browsers into buyers with financing - from Bill Me Later®. Your customers have more time to pay, while you get paid up front – at no additional cost to you. - Use PayPal’s free banner ads that let you advertise Bill Me Later® financing as a payment option when your customers check out with PayPal. - The PayPal Advertising Program has been shown to generate additional purchases as well as increase consumer's average purchase sizes by 15% - or more. See Details. - "," - Why Advertise Financing?
- Give your sales a boost when you advertise financing.
PayPal helps turn browsers into buyers with financing - from Bill Me Later®. Your customers have more time to pay, while you get paid up front – at no additional cost to you. - Use PayPal’s free banner ads that let you advertise Bill Me Later® financing as a payment option when your customers check out with PayPal. - The PayPal Advertising Program has been shown to generate additional purchases as well as increase consumer's average purchase sizes by 15% - or more. See Details. - " -"Basic Settings - PayPal Payflow Link","Basic Settings - PayPal Payflow Link" -"CVV Entry is Editable","CVV Entry is Editable" -"Send Email Confirmation","Send Email Confirmation" -"URL method for Cancel URL and Return URL","URL method for Cancel URL and Return URL" -"Express Checkout","Express Checkout" -"Add PayPal as an additional payment method to your checkout page.","Add PayPal as an additional payment method to your checkout page." -"Email Associated with PayPal Merchant Account","Email Associated with PayPal Merchant Account" -" - Start accepting payments via PayPal! - "," - Start accepting payments via PayPal! - " -"Don't have a PayPal account? Simply enter your email address.","Don't have a PayPal account? Simply enter your email address." -"API Authentication Methods","API Authentication Methods" -"API Username","API Username" -"API Password","API Password" -"Get Credentials from PayPal","Get Credentials from PayPal" -"Sandbox Credentials","Sandbox Credentials" -"API Uses Proxy","API Uses Proxy" -"Enable Bill Me Later","Enable Bill Me Later" -"PayPal Express Checkout lets you give customers access to financing through Bill Me Later® - at no additional cost to you. - You get paid up front, even though customers have more time to pay. A pre-integrated payment button lets customers pay quickly with Bill Me Later®. - Learn More - ","PayPal Express Checkout lets you give customers access to financing through Bill Me Later® - at no additional cost to you. - You get paid up front, even though customers have more time to pay. A pre-integrated payment button lets customers pay quickly with Bill Me Later®. - Learn More - " -"Publisher ID","Publisher ID" -"Required to display a banner","Required to display a banner" -"Get Publisher ID from PayPal","Get Publisher ID from PayPal" -"It is recommended to set this value to ""Magento_Paypal"" per store views.","It is recommended to set this value to ""Magento_Paypal"" per store views." -"Shortcut on Shopping Cart","Shortcut on Shopping Cart" -"Also affects mini-shopping cart.","Also affects mini-shopping cart." -"Shortcut on Product View","Shortcut on Product View" -"Authorization Honor Period (days)","Authorization Honor Period (days)" -"Specifies what the Authorization Honor Period is on the merchant’s PayPal account. It must mirror the setting in PayPal.","Specifies what the Authorization Honor Period is on the merchant’s PayPal account. It must mirror the setting in PayPal." -"Order Valid Period (days)","Order Valid Period (days)" -"Specifies what the Order Valid Period is on the merchant’s PayPal account. It must mirror the setting in PayPal.","Specifies what the Order Valid Period is on the merchant’s PayPal account. It must mirror the setting in PayPal." -"Number of Child Authorizations","Number of Child Authorizations" -"The default number of child authorizations in your PayPal account is 1. To do multiple authorizations please contact PayPal to request an increase.","The default number of child authorizations in your PayPal account is 1. To do multiple authorizations please contact PayPal to request an increase." -"Transfer Shipping Options","Transfer Shipping Options" -"If this option is enabled, customer can change shipping address and shipping method on PayPal website. In live mode works via HTTPS protocol only.","If this option is enabled, customer can change shipping address and shipping method on PayPal website. In live mode works via HTTPS protocol only." -"Notice that PayPal can handle up to 10 shipping options. That is why Magento will transfer only first 10 cheapest shipping options if there are more than 10 available.","Notice that PayPal can handle up to 10 shipping options. That is why Magento will transfer only first 10 cheapest shipping options if there are more than 10 available." -"Shortcut Buttons Flavor","Shortcut Buttons Flavor" -"Enable PayPal Guest Checkout","Enable PayPal Guest Checkout" -"Ability for buyer to purchase without PayPal account.","Ability for buyer to purchase without PayPal account." -"Require Customer's Billing Address","Require Customer's Billing Address" -"This feature needs be enabled first for the merchant account through PayPal technical support.","This feature needs be enabled first for the merchant account through PayPal technical support." -"Billing Agreement Signup","Billing Agreement Signup" -"Whether to create a billing agreement, if there are no active billing agreements available.","Whether to create a billing agreement, if there are no active billing agreements available." -" - Merchants need to apply to PayPal for enabling billing agreements feature. Do not enable this option until PayPal confirms that billing agreements are enabled for your merchant account. - "," - Merchants need to apply to PayPal for enabling billing agreements feature. Do not enable this option until PayPal confirms that billing agreements are enabled for your merchant account. - " -"Skip Order Review Step","Skip Order Review Step" -" - Will appear as a payment option only for customers who have at least one active billing agreement. - "," - Will appear as a payment option only for customers who have at least one active billing agreement. - " -"Allow in Billing Agreement Wizard","Allow in Billing Agreement Wizard" -"SFTP Credentials","SFTP Credentials" -"Custom Endpoint Hostname or IP-Address","Custom Endpoint Hostname or IP-Address" -"By default it is ""reports.paypal.com"".","By default it is ""reports.paypal.com""." -"Use colon to specify port. For example: ""test.example.com:5224"".","Use colon to specify port. For example: ""test.example.com:5224""." -"Custom Path","Custom Path" -"Scheduled Fetching","Scheduled Fetching" -"Enable Automatic Fetching","Enable Automatic Fetching" -"PayPal retains reports for 45 days.","PayPal retains reports for 45 days." -"Time of Day","Time of Day" -"PayPal Product Logo","PayPal Product Logo" -"Displays on catalog pages and homepage.","Displays on catalog pages and homepage." -"PayPal Merchant Pages Style","PayPal Merchant Pages Style" -"Page Style","Page Style" -" - Allowable values: ""paypal"", ""primary"" (default), your_custom_value (a custom payment page style from your merchant account profile). - "," - Allowable values: ""paypal"", ""primary"" (default), your_custom_value (a custom payment page style from your merchant account profile). - " -"Header Image URL","Header Image URL" -" - The image at the top left of the checkout page. Max size is 750x90-pixel. https is highly encouraged. - "," - The image at the top left of the checkout page. Max size is 750x90-pixel. https is highly encouraged. - " -"Header Background Color","Header Background Color" -" - The background color for the header of the checkout page. Case-insensitive six-character HTML hexadecimal color code in ASCII. - "," - The background color for the header of the checkout page. Case-insensitive six-character HTML hexadecimal color code in ASCII. - " -"Header Border Color","Header Border Color" -"2-pixel perimeter around the header space.","2-pixel perimeter around the header space." -"Page Background Color","Page Background Color" -" - The background color for the checkout page around the header and payment form. - "," - The background color for the checkout page around the header and payment form. - " -"Website Payments Pro Hosted Solution","Website Payments Pro Hosted Solution" -"Accept payments with a PCI compliant checkout that keeps customers on your site.","Accept payments with a PCI compliant checkout that keeps customers on your site." -"Payments Pro Hosted Solution","Payments Pro Hosted Solution" -" - Why Advertise Financing?
- Give your sales a boost when you advertise financing.
PayPal helps turn browsers into buyers with financing - from Bill Me Later®. Your customers have more time to pay, while you get paid up front – at no additional cost to you. - Use PayPal’s free banner ads that let you advertise Bill Me Later® financing as a payment option when your customers check out with PayPal. - The PayPal Advertising Program has been shown to generate additional purchases as well as increase consumer's average purchase sizes by 15% - or more. See Details. - "," - Why Advertise Financing?
- Give your sales a boost when you advertise financing.
PayPal helps turn browsers into buyers with financing - from Bill Me Later®. Your customers have more time to pay, while you get paid up front – at no additional cost to you. - Use PayPal’s free banner ads that let you advertise Bill Me Later® financing as a payment option when your customers check out with PayPal. - The PayPal Advertising Program has been shown to generate additional purchases as well as increase consumer's average purchase sizes by 15% - or more. See Details. - " -"Basic Settings - PayPal Payments Pro Hosted Solution","Basic Settings - PayPal Payments Pro Hosted Solution" -"Display Express Checkout in the Payment Information step","Display Express Checkout in the Payment Information step" -" - PayPal All-in-One Payment Solutions  Accept and process credit cards and PayPal payments. - "," - PayPal All-in-One Payment Solutions  Accept and process credit cards and PayPal payments. - " -"Choose a secure bundled payment solution for your business.","Choose a secure bundled payment solution for your business." -"PayPal Express Checkout","PayPal Express Checkout" -"Add another payment method to your existing solution or as a stand-alone option.","Add another payment method to your existing solution or as a stand-alone option." -"Payments Advanced (Includes Express Checkout)","Payments Advanced (Includes Express Checkout)" -"Accept payments with a PCI-compliant checkout that keeps customers on your site.","Accept payments with a PCI-compliant checkout that keeps customers on your site." -"Payments Advanced and Express Checkout","Payments Advanced and Express Checkout" -"PayPal recommends that you set up an additional User on your account at manager.paypal.com","PayPal recommends that you set up an additional User on your account at manager.paypal.com" -"PayPal recommends you set up an additional User on your account at manager.paypal.com, instead of entering your admin username and password here. This will enhance your security and prevent service interruptions if you later change your password. If you do not want to set up an additional User, you can re-enter your Merchant Login here.","PayPal recommends you set up an additional User on your account at manager.paypal.com, instead of entering your admin username and password here. This will enhance your security and prevent service interruptions if you later change your password. If you do not want to set up an additional User, you can re-enter your Merchant Login here." -" - Why Advertise Financing?
- Give your sales a boost when you advertise financing.
PayPal helps turn browsers into buyers with financing - from Bill Me Later®. Your customers have more time to pay, while you get paid up front – at no additional cost to you. - Use PayPal’s free banner ads that let you advertise Bill Me Later® financing as a payment option when your customers check out with PayPal. - The PayPal Advertising Program has been shown to generate additional purchases as well as increase consumer's average purchase sizes by 15% - or more. See Details. - "," - Why Advertise Financing?
- Give your sales a boost when you advertise financing.
PayPal helps turn browsers into buyers with financing - from Bill Me Later®. Your customers have more time to pay, while you get paid up front – at no additional cost to you. - Use PayPal’s free banner ads that let you advertise Bill Me Later® financing as a payment option when your customers check out with PayPal. - The PayPal Advertising Program has been shown to generate additional purchases as well as increase consumer's average purchase sizes by 15% - or more. See Details. - " -"Basic Settings - PayPal Payments Advanced","Basic Settings - PayPal Payments Advanced" -"Payments Pro (Includes Express Checkout)","Payments Pro (Includes Express Checkout)" -"Payments Pro and Express Checkout","Payments Pro and Express Checkout" -"Basic Settings - PayPal Payments Pro","Basic Settings - PayPal Payments Pro" -"Payments Standard","Payments Standard" -"Basic Settings - PayPal Payments Standard","Basic Settings - PayPal Payments Standard" -"PayPal Payment Gateways","PayPal Payment Gateways" -"Process payments using your own internet merchant account.","Process payments using your own internet merchant account." -"Payflow Pro (Includes Express Checkout)","Payflow Pro (Includes Express Checkout)" -"Payflow Pro and Express Checkout","Payflow Pro and Express Checkout" -" - Why Advertise Financing?
- Give your sales a boost when you advertise financing.
PayPal helps turn browsers into buyers with financing - from Bill Me Later®. Your customers have more time to pay, while you get paid up front – at no additional cost to you. - Use PayPal’s free banner ads that let you advertise Bill Me Later® financing as a payment option when your customers check out with PayPal. - The PayPal Advertising Program has been shown to generate additional purchases as well as increase consumer's average purchase sizes by 15% - or more. See Details. - "," - Why Advertise Financing?
- Give your sales a boost when you advertise financing.
PayPal helps turn browsers into buyers with financing - from Bill Me Later®. Your customers have more time to pay, while you get paid up front – at no additional cost to you. - Use PayPal’s free banner ads that let you advertise Bill Me Later® financing as a payment option when your customers check out with PayPal. - The PayPal Advertising Program has been shown to generate additional purchases as well as increase consumer's average purchase sizes by 15% - or more. See Details. - " -"Accept credit cards, debit cards and PayPal payments securely.","Accept credit cards, debit cards and PayPal payments securely." -"Accept payments with a completely customizable checkout page.","Accept payments with a completely customizable checkout page." -"Website Payments Pro Hosted Solution (Includes Express Checkout)","Website Payments Pro Hosted Solution (Includes Express Checkout)" -"Website Payments Pro Hosted Solution and Express Checkout","Website Payments Pro Hosted Solution and Express Checkout" -"Basic Settings - PayPal Website Payments Pro Hosted Solution","Basic Settings - PayPal Website Payments Pro Hosted Solution" -"PayPal Payment Solutions","PayPal Payment Solutions" diff --git a/app/code/Magento/Paypal/i18n/nl_NL.csv b/app/code/Magento/Paypal/i18n/nl_NL.csv deleted file mode 100644 index 415dc929332c2..0000000000000 --- a/app/code/Magento/Paypal/i18n/nl_NL.csv +++ /dev/null @@ -1,692 +0,0 @@ -Custom,Zelfgekozen -Close,Close -Cancel,Cancel -Back,Back -Price,Prijs -ID,ID -Configure,Configure -No,Nee -Qty,Qty -Subtotal,Subtotaal -"Incl. Tax","Incl. Tax" -Edit,Edit -"--Please Select--","--Please Select--" -Customer,Customer -"First Name","First Name" -"Last Name","Last Name" -Email,Email -"-- Please Select --","-- Please Select --" -Yes,Ja -Status,Status -Enabled,Enabled -"Sort Order","Sort Order" -Title,Title -"Are you sure you want to do this?","Are you sure you want to do this?" -Order,Bestelling -View,Bekijk -Active,Active -Position,Position -Dynamic,Dynamisch -N/A,Nvt -Canceled,Canceled -"General Information","General Information" -Static,Statisch -"Advanced Settings","Advanced Settings" -"Learn More","Meer Informatie" -"Start Date","Start Date" -"Product Name","Product Name" -"3D Secure Card Validation","3D Secure Card Validation" -"Merchant Liability","Winkelier Aansprakelijkheid" -"Billing Information","Billing Information" -"Shipping Information","Shipping Information" -"Shipping Method",Verzendingsmethode -"Please agree to all the terms and conditions before placing the order.","Ga alstublieft akkoord met alle voorwaarden voor het plaatsen van de bestelling." -"Account confirmation is required. Please, check your e-mail for confirmation link. To resend confirmation email please click here.","Account confirmation is required. Please, check your e-mail for confirmation link. To resend confirmation email please click here." -Password,Password -Continue,Continue -"Order #","Order #" -Login,Login -"Shipping Address",Verzendingsadres -"Payment Method","Payment Method" -"Place Order","Bestelling plaatsen" -"Sorry, no quotes are available for this order at this time.","Sorry, geen prijsopgaven zijn beschikbaar voor deze bestelling op dit moment." -Sales,Verkoop -Created,Created -Display,Display -User,User -Daily,Dagelijks -Date,Date -"Order Total","Order Total" -Never,Nooit -Updated,Updated -Reports,Verslagen -"Order Status","Order Status" -"View Order","View Order" -Event,Gebeurtenis -"Please Select","Please Select" -"Submitting order information...","Bestellingsinformatie aan het overbrengen..." -Authorization,Autorisatie -"You notified customer about invoice #%1.","You notified customer about invoice #%1." -"Note: %1","Note: %1" -"IPN ""%1""","IPN ""%1""" -"Billing Agreements","Facturering Overeenkomsten" -"Reference ID","Reference ID" -"Billing Agreement #%1","Billing Agreement #%1" -"Related Orders","Related Orders" -"Billing Agreement View","Factureringsovereenkomst Beeld" -"View Transaction Details","Bekijk Transactie Details" -"Reference Information",Verwijsinformatie -"Transaction Information","Transactie Informatie" -"PayPal Fee Information","PayPal kosten informatie" -"PayPal Settlement Reports","PayPal Overeenstemming Rapporten" -"We are connecting to the PayPal SFTP server to retrieve new reports. Are you sure you want to continue?","We are connecting to the PayPal SFTP server to retrieve new reports. Are you sure you want to continue?" -"Fetch Updates","Updates halen" -button_label,button_label -sandbox_button_label,sandbox_button_label -Help,Help -"There is already another PayPal solution enabled. Enable this solution instead?","There is already another PayPal solution enabled. Enable this solution instead?" -"The following error(s) occured:","The following error(s) occured:" -"Some PayPal solutions conflict.","Some PayPal solutions conflict." -"PayPal Express Checkout is not enabled.","PayPal Express Checkout is not enabled." -"Please re-enable the previously enabled payment solutions.","Please re-enable the previously enabled payment solutions." -"View Demo","Bekijk Demo" -"See terms","See terms" -"You will be redirected to the PayPal website.","U zult doorverwezen worden naar de PayPal website." -"Would you like to sign a billing agreement ' 'to streamline further purchases with PayPal?","Would you like to sign a billing agreement ' 'to streamline further purchases with PayPal?" -"You will be redirected to the PayPal website when you place an order.","U wordt door verwezen naar de PayPal website wanneer u een bestelling plaatst." -"Click here if you are not redirected within 10 seconds.","Click here if you are not redirected within 10 seconds." -"You will be redirected to the PayPal website in a few seconds.","U zult binnen enkele seconden naar de PayPal website worden geleid." -"You canceled the billing agreement.","You canceled the billing agreement." -"We could not cancel the billing agreement.","We could not cancel the billing agreement." -"You deleted the billing agreement.","You deleted the billing agreement." -"We could not delete the billing agreement.","We could not delete the billing agreement." -"Please specify the correct billing agreement ID and try again.","Please specify the correct billing agreement ID and try again." -"View Transaction","Transactie bekijken" -"We found nothing to fetch because of an empty configuration.","We found nothing to fetch because of an empty configuration." -"We fetched %1 report rows from '%2@%3'.","We fetched %1 report rows from '%2@%3'." -"We couldn't fetch reports from '%1@%2'.","We couldn't fetch reports from '%1@%2'." -"Billing Agreement # %1","Billing Agreement # %1" -"We couldn't start the billing agreement wizard.","We couldn't start the billing agreement wizard." -"The billing agreement ""%1"" has been created.","The billing agreement ""%1"" has been created." -"We couldn't finish the billing agreement wizard.","We couldn't finish the billing agreement wizard." -"The billing agreement ""%1"" has been canceled.","The billing agreement ""%1"" has been canceled." -"We couldn't cancel the billing agreement.","We couldn't cancel the billing agreement." -"To proceed to Checkout, please log in using your email address.","To proceed to Checkout, please log in using your email address." -"We can't start Express Checkout.","We can't start Express Checkout." -"Express Checkout and Order have been canceled.","Express Checkout en bestelling zijn geannuleerd." -"Express Checkout has been canceled.","Express Checkout is geannuleerd." -"Unable to cancel Express Checkout","Unable to cancel Express Checkout" -"We can't process Express Checkout approval.","We can't process Express Checkout approval." -"We can't initialize Express Checkout review.","We can't initialize Express Checkout review." -"We can't update shipping method.","We can't update shipping method." -"We can't place the order.","We can't place the order." -"We can't initialize Express Checkout.","We can't initialize Express Checkout." -"PayPal Express Checkout Token does not exist.","PayPal Express Afrekenen Teken bestaan niet." -"A wrong PayPal Express Checkout Token is specified.","A wrong PayPal Express Checkout Token is specified." -"Your payment has been declined. Please try again.","Your payment has been declined. Please try again." -"We can't contact the PayPal gateway.","We can't contact the PayPal gateway." -"PayPal response hasn't required fields.","Antwoord van PayPal bevat de vereiste velden niet." -"Something went wrong while processing your order.","Something went wrong while processing your order." -"PayPal gateway has rejected request. %1","PayPal gateway has rejected request. %1" -"PayPal gateway rejected the request. %1","PayPal gateway rejected the request. %1" -"I'm sorry - but we were not able to process your payment. Please try another payment method or contact us so we can assist you.","I'm sorry - but we were not able to process your payment. Please try another payment method or contact us so we can assist you." -"I'm sorry - but we are not able to complete your transaction. Please contact us so we can assist you.","I'm sorry - but we are not able to complete your transaction. Please contact us so we can assist you." -"The payment method code is not set.","The payment method code is not set." -"The reference ID is not set.","The reference ID is not set." -"Unable to save Billing Agreement:","Niet mogelijk om Betalingsovereenkomst op te slaan:" -"The customer ID is not set.","The customer ID is not set." -"The Billing Agreement status is not set.","The Billing Agreement status is not set." -"The PayPal certificate does not exist.","The PayPal certificate does not exist." -"We prefer PayPal (150 X 60)","Paypal heeft onze voorkeur (150 X 60)" -"We prefer PayPal (150 X 40)","PayPal heeft onze voorkeur (150 X 40)" -"Now accepting PayPal (150 X 60)","Accepteert nu PayPal (150 X 60)" -"Now accepting PayPal (150 X 40)","Accepteert nu PayPal (150 X 40)" -"Payments by PayPal (150 X 60)","Betalingen door PayPal (150 X 60)" -"Payments by PayPal (150 X 40)","Betalingen door PayPal (150 X 40)" -"Shop now using (150 X 60)","Winkel nu met (150 X 60)" -"Shop now using (150 X 40)","Winkel nu met (150 X 40)" -Shortcut,Snelkoppeling -"Acceptance Mark Image","Acceptatie Stempel Afbeelding" -Sale,Verkoop -"For Virtual Quotes Only","Alleen Voor Virtuele Prijsopgaves" -Auto,Auto -"Ask Customer","Vraag een Klant" -"IPN (Instant Payment Notification) Only","IPN (Instant Payment Notification) Only" -"API Signature","API Handtekening" -"API Certificate","API Certificaat" -"The ordering amount of %1 is pending approval on the payment gateway.","The ordering amount of %1 is pending approval on the payment gateway." -"Ordered amount of %1","Ordered amount of %1" -"We'll authorize the amount of %1 as soon as the payment gateway approves it.","We'll authorize the amount of %1 as soon as the payment gateway approves it." -"The authorized amount is %1.","The authorized amount is %1." -"The maximum number of child authorizations is reached.","Het maximale aantal kindmachtigingen is bereikt." -"PayPal can't process orders with a zero balance due. ' 'To finish your purchase, please go through the standard checkout process.","PayPal can't process orders with a zero balance due. ' 'To finish your purchase, please go through the standard checkout process." -"Payer is not identified.","Betaler is niet geïdentificeerd." -"Last Transaction ID","Laatste Transactie ID" -"This customer did not include a confirmed address.","This customer did not include a confirmed address." -"The payment is authorized but not settled.","De betaling is gemachtigd, maar niet afgehandeld." -"The payment eCheck is not yet cleared.","De betalings eCheck is nog niet vrijgegeven." -"The merchant holds a non-U.S. account and does not have a withdrawal mechanism.","The merchant holds a non-U.S. account and does not have a withdrawal mechanism." -"The payment currency does not match any of the merchant's balances currency.","The payment currency does not match any of the merchant's balances currency." -"The payment is pending while it is being reviewed by PayPal for risk.","De betaling staat in de wacht, terwijl deze beoordeeld wordt op risico door PayPal." -"The payment is pending because it was made to an email address that is not yet registered or confirmed.","De betaling staat in de wacht omdat deze aangemaakt is met een emailadres dat nog niet geregistreerd of bevestigd is." -"The merchant account is not yet verified.","De handelsaccount is nog niet geverifieerd." -"The payment was made via credit card. In order to receive funds merchant must upgrade account to Business or Premier status.","De betaling werd gemaakt via creditcard. Om de gelden te ontvangen, moet de handelaar de account upgraden naar Business of Premier status." -"Sorry, but something went wrong. Please contact PayPal customer service.","Sorry, but something went wrong. Please contact PayPal customer service." -"A reversal has occurred on this transaction due to a chargeback by your customer.","A reversal has occurred on this transaction due to a chargeback by your customer." -"A reversal has occurred on this transaction due to your customer triggering a money-back guarantee.","A reversal has occurred on this transaction due to your customer triggering a money-back guarantee." -"A reversal has occurred on this transaction due to a complaint about the transaction from your customer.","A reversal has occurred on this transaction due to a complaint about the transaction from your customer." -"A reversal has occurred on this transaction because you have given the customer a refund.","A reversal has occurred on this transaction because you have given the customer a refund." -"Reversal of an adjustment.","Omzetting van een aanpassing" -"Transaction reversal due to fraud detected by PayPal administrators.","Transaction reversal due to fraud detected by PayPal administrators." -"Transaction reversal by PayPal administrators.","Transaction reversal by PayPal administrators." -"Reimbursement for a chargeback.","Vergoeding voor een terugboeking" -"Settlement of a chargeback.","Regeling van een terugboeking." -"A reversal has occurred on this transaction because of a customer dispute suspecting unauthorized spoof.","A reversal has occurred on this transaction because of a customer dispute suspecting unauthorized spoof." -"Buyer claims that he did not receive goods or service.","Buyer claims that he did not receive goods or service." -"Buyer claims that the goods or service received differ from merchant’s description of the goods or service.","Buyer claims that the goods or service received differ from merchant’s description of the goods or service." -"Buyer claims that he/she did not authorize transaction.","Buyer claims that he/she did not authorize transaction." -"A case that has been resolved and close requires a reimbursement.","A case that has been resolved and close requires a reimbursement." -"Buyer claims that a possible duplicate payment was made to the merchant.","Buyer claims that a possible duplicate payment was made to the merchant." -"Buyer claims that the received merchandise is unsatisfactory, defective, or damaged.","Buyer claims that the received merchandise is unsatisfactory, defective, or damaged." -"Unknown reason. Please contact PayPal customer service.","Onbekende oorzaak. Neem alstublieft contact op met de klantendienst van PayPal." -"Payer ID","Betaler ID" -"Payer Email","Betaler Email" -"Payer Status","Betaler Status" -"Payer Address ID","Betaler Adres ID" -"Payer Address Status","Betaler Adres Status" -"Merchant Protection Eligibility","In aanmerking komen voor handelaar bescherming" -"Triggered Fraud Filters","Fraudeur Filters Getriggerd" -"Last Correlation ID","Laatste Correlatie ID" -"Address Verification System Response","Adres Verificatie Systeem Antwoord" -"CVV2 Check Result by PayPal","CVV2 Controle Resultaat van PayPal" -"Buyer's Tax ID","Kopers Belastings ID" -"Buyer's Tax ID Type","Koper 's Belastings ID Type" -"PayPal/Centinel Visa Payer Authentication Service Result","PayPal/Centinel Visa Betaler Machtigingsservice Resultaat" -"PayPal/Centinel Electronic Commerce Indicator","PayPal/Centinel Elektronische Handelsindicator" -Chargeback,Terugboeking -Complaint,Complaint -Dispute,Dispute -"Matched Address only (no ZIP)","Alleen Adres komt overeen (geen ZIP)" -"Matched Address only (no ZIP) International","Matched Address only (no ZIP) International" -"No Details matched","Geen Details kwamen overeen" -"No Details matched. International","Geen Details kwamen overeen. Internationaal" -"Exact Match. Address and nine-digit ZIP code","Exacte overeenkomst. Adres en negencijferige ZIP code" -"Exact Match. Address and Postal Code. International","Exacte overeenkomst. Adres en postcode. Internationaal" -"Exact Match. Address and Postal Code. UK-specific","Exacte overeenkomst. Adres en postcode. Specifiek voor Verenigd Koninkrijk" -"N/A. Not allowed for MOTO (Internet/Phone) transactions","n.v.t. Niet toegestaan voor MOTO (Internet/Telefoon) overboekingen" -"N/A. Global Unavailable","n.v.t. Globaal Onbeschikbaar" -"N/A. International Unavailable","n.v.t. Internationaal Onbeschikbaar" -"Matched five-digit ZIP only (no Address)","Alleen 5-getal ZIP code komt overeen (geen Adres)" -"Matched Postal Code only (no Address)","Alleen Post Code komt overeen (geen Adres)" -"N/A. Retry","n.v.t. Probeer opnieuw" -"N/A. Service not Supported","n.v.t. Service niet ondersteund" -"N/A. Unavailable","n.v.t. Niet beschikbaar" -"Matched whole nine-didgit ZIP (no Address)","Gehele 9-cijferige ZIP code komt overeen (geen Adres)" -"Yes. Matched Address and five-didgit ZIP","Ja. Het adres en de 5-cijferige ZIP code komen overeen" -"All the address information matched","Al de adres komt overeen" -"None of the address information matched","Geen van de adres informatie kwam overeen" -"Part of the address information matched","Deel van de adresinformatie komt overeen" -"N/A. The merchant did not provide AVS information","n.v.t. De handelaar heeft geen AVS informatie overhandigd" -"N/A. Address not checked, or acquirer had no response. Service not available","n.v.t. Adres niet gecontroleerd of verkrijger had geen reactie. Service niet beschikbaar" -"Matched (CVV2CSC)","Komt over een (CVV2CSC)" -"No match","Geen overeenkomst" -"N/A. Not processed","n.v.t. Niet verwerkt" -"N/A. Service not supported","N/A. Dienst niet ondersteund." -"N/A. Service not available","n.v.t. Service niet beschikbaar" -"N/A. No response","n.v.t. Geen reactie" -"Matched (CVV2)","Komt over een (CVV2)" -"N/A. The merchant has not implemented CVV2 code handling","n.v.t. De handelaar heeft geen CVV2 code verwerking ingevoerd" -"N/A. Merchant has indicated that CVV2 is not present on card","n.v.t. Handelaar heeft aangegeven dat CVV2 niet aanwezig is op de kaart" -"Authenticated, Good Result","Geverifieerd, Goed Resultaat" -"Authenticated, Bad Result","Geverifieerd, Slecht Resultaat" -"Attempted Authentication, Good Result","Poging tot Autorisatie, Goed Resultaat" -"Attempted Authentication, Bad Result","Poging tot Autorisatie, Slecht Resultaat" -"No Liability Shift","Geen Aansprakelijkheid Verschuiving" -"Issuer Liability","Uitgever Verantwoordelijkheid" -CNPJ,CNPJ -CPF,CPF -"IPN ""%1"". Case type ""%2"". Case ID ""%3"" %4","IPN ""%1"". Case type ""%2"". Case ID ""%3"" %4" -"IPN ""%1"". A dispute has been resolved and closed. %2 Transaction amount %3.","IPN ""%1"". A dispute has been resolved and closed. %2 Transaction amount %3." -"IPN ""%1"". %2 Transaction amount %3. Transaction ID: ""%4""","IPN ""%1"". %2 Transaction amount %3. Transaction ID: ""%4""" -"You notified customer about creditmemo #%1.","You notified customer about creditmemo #%1." -"Created billing agreement #%1.","Created billing agreement #%1." -"We couldn't create a billing agreement for this order.","We couldn't create a billing agreement for this order." -"Payflow PNREF: #%1.","Payflow PNREF: #%1." -"Fetch transaction details method does not exists in Payflow","Fetch transaction details method does not exists in Payflow" -"We cannot send the new order email.","We cannot send the new order email." -"You cannot void a verification transaction.","You cannot void a verification transaction." -"Payment transactions disallow storing objects.","Betalingstransacties staan het opslaan van objecten niet toe." -"You need to enter a transaction ID.","You need to enter a transaction ID." -"This operation requires an existing transaction object.","Deze operatie vereist een bestaand transactie object." -"You need an authorization transaction to void.","You need an authorization transaction to void." -"We can't issue a refund transaction because there is no capture transaction.","We can't issue a refund transaction because there is no capture transaction." -"We cannot create a target file for reading reports.","We cannot create a target file for reading reports." -"Report Date","Datum bericht" -"Merchant Account","Handelaar Account" -"Transaction ID","Transactie ID" -"Invoice ID","Factuur ID" -"PayPal Reference ID","PayPal referentie ID" -"PayPal Reference ID Type","PayPal referentie ID type" -"Event Code","Gebeurtenis code" -"Finish Date","Finish Date" -"Debit or Credit","Debet of Credit" -"Gross Amount",Brutobedrag -"Fee Debit or Credit","Kosten betaalrekening of creditcard" -"Fee Amount","Kosten bedrag" -"Order ID","ID Bestelling" -"Subscription ID","Abonnement ID" -"Preapproved Payment ID","Vooraf goedgekeurde Betaling ID" -Credit,Krediet -Debit,Debet -"General: received payment of a type not belonging to the other T00xx categories","Algemeen: betaling ontvangen van een type dat niet behoort tot de andere T00xx categorieën" -"Mass Pay Payment",Bulkbetaling -"Subscription Payment, either payment sent or payment received","Abonnementsbetaling, betaling verzonden of betaling ontvangen" -"Preapproved Payment (BillUser API), either sent or received","Vooraf goedgekeurde Betaling (RekeningGebruiker API), verzonden of ontvangen" -"eBay Auction Payment","eBay veiling betaling" -"Direct Payment API","Directe Betaling API" -"Express Checkout APIs","Versneld afrekenen APIs" -"Website Payments Standard Payment","Website Betalingen Standaard Betaling" -"Postage Payment to either USPS or UPS","Porto betaling aan USPS dan wel UPS" -"Gift Certificate Payment: purchase of Gift Certificate","Geschenkcertificaat Betaling: aankoop van Geschenkcertificaat" -"Auction Payment other than through eBay","Veiling Betaling anders dan via eBay" -"Mobile Payment (made via a mobile phone)","Mobiele Betaling (betaling via een mobiele telefoon)" -"Virtual Terminal Payment","Virtuele Laatste Betaling" -"General: non-payment fee of a type not belonging to the other T01xx categories","Algemeen: niet-betalingsvergoeding van een type dat niet behoort tot de andere T01xx categorieën" -"Fee: Web Site Payments Pro Account Monthly","Kosten: betalingen website pro account per maand" -"Fee: Foreign ACH Withdrawal","Kosten: buitenlandse ACH opname" -"Fee: WorldLink Check Withdrawal","Kosten: WereldLink check opname" -"Fee: Mass Pay Request","Kosten: massaal betalingsverzoek" -"General Currency Conversion","Algemene Valuta Omzetting" -"User-initiated Currency Conversion","Gebruiker-geïnitieerde munteenheid conversie" -"Currency Conversion required to cover negative balance","Valuta Conversie nodig om het negatieve balans te dekken" -"General Funding of PayPal Account ","Algemene Financiering van PayPal Account" -"PayPal Balance Manager function of PayPal account","PayPal Balansbeheerder functie van PayPal account" -"ACH Funding for Funds Recovery from Account Balance","ACH Financiering voor fondsen herstel op het account balans" -"EFT Funding (German banking)","EFT fondsen (Duits bankieren)" -"General Withdrawal from PayPal Account","Algemene Opname van PayPal Account" -AutoSweep,AutomatischOpschonen -"General: Use of PayPal account for purchasing as well as receiving payments","Algemeen: Gebruik van PayPal account voor zowel aankopen als ontvangen van betalingen" -"Virtual PayPal Debit Card Transaction","Virtuele Paypal Debitcard Transactie" -"PayPal Debit Card Withdrawal from ATM","PayPal betaalkaart geld pinnen" -"Hidden Virtual PayPal Debit Card Transaction","Verborgen Virtuele PayPal Debitcard Transactie" -"PayPal Debit Card Cash Advance","PayPal betaalkaart kas voorschot" -"General: Withdrawal from PayPal Account","Algemeen: Opname van PayPal Account" -"General (Purchase with a credit card)","Algemeen (Aankoop met een creditcard)" -"Negative Balance","Negatief Balans" -"General: bonus of a type not belonging to the other T08xx categories","Algemeen: bonus van een type dat niet behoort tot de andere T08xx categorieën" -"Debit Card Cash Back","Debetkaart Geld Terug" -"Merchant Referral Bonus","Handelaar Doorverwijzing Bonus" -"Balance Manager Account Bonus","Balans Beheerder Account Bonus" -"PayPal Buyer Warranty Bonus","PayPal koper garantie bonus" -"PayPal Protection Bonus","PayPal beschermingsbonus" -"Bonus for first ACH Use","Bonus voor eerste ACH gebruik" -"General Redemption","Algemene Afschrijving" -"Gift Certificate Redemption","Geschenkcertificaat Inlossen" -"Points Incentive Redemption","Punten Incentive Aflossing" -"Coupon Redemption","Waardebon Inleveren" -"Reward Voucher Redemption","Beloning Voucher Aflossing" -"General. Product no longer supported","Algemeen. Product niet langer ondersteund" -"General: reversal of a type not belonging to the other T11xx categories","Algemeen: omkering van een type dat niet behoort tot de andere T11xx categorieën" -"ACH Withdrawal","ACH Opname" -"Debit Card Transaction","Debetkaart Transactie" -"Reversal of Points Usage","Omzetting van Puntengebruik" -"ACH Deposit (Reversal)","ACH Storting (Herroeping)" -"Reversal of General Account Hold","Omzetting van Algemene Rekening Houder" -"Account-to-Account Payment, initiated by PayPal","Account-naar-Account Betaling, gestart door PayPal" -"Payment Refund initiated by merchant","Betalingsterugstorting gestart door handelaar" -"Fee Reversal","Omkeren kosten" -"Hold for Dispute Investigation","Wacht op Onderzoek naar Geschil" -"Reversal of hold for Dispute Investigation","Aanpassing van houder voor onderzoek naar dispuut" -"General: adjustment of a type not belonging to the other T12xx categories","Algemeen: aanpassing van een type dat niet behoort tot de andere T12xx categorieën" -Reversal,Omzetting -Charge-off,Afschrijving -Incentive,Prikkel -"Reimbursement of Chargeback","Vergoeding van een terugboeking" -"General (Authorization)","Algemeen (Machtiging)" -Reauthorization,"Nieuwe autorisatie" -Void,Geldig -"General (Dividend)","Algemeen (Dividend)" -"General: temporary hold of a type not belonging to the other T15xx categories","Algemeen: tijdelijke blokkering van een type dat niet behoort tot de andere T15xx categorieën" -"Open Authorization","Open authorisatie" -"ACH Deposit (Hold for Dispute or Other Investigation)","ACH Storting (Wordt gehouden ingeval van dispuut of een ander onderzoek)" -"Available Balance","Beschikbaar Balans" -Funding,Financiering -"General: Withdrawal to Non-Bank Entity","Algemeen: Opname naar Niet-Bancaire Entiteit" -"WorldLink Withdrawal","WorldLink Opname" -"Buyer Credit Payment","Koper krediet betaling" -"General Adjustment without businessrelated event","Algemene Aanpassing zonder zakengerelateerde gebeurtenis" -"General (Funds Transfer from PayPal Account to Another)","Algemeen (Geldmiddelen Overplaatsen van een PayPal Account naar een Andere)" -"Settlement Consolidation","Overeenkomst consolidatie" -"General: event not yet categorized","Algemeen: gebeurtenis nog niet gecategoriseerd" -"The PayPal certificate file is empty.","The PayPal certificate file is empty." -"Header (center)","Header (center)" -"Sidebar (right)","Sidebar (right)" -"Near Bill Me Later checkout button","Near Bill Me Later checkout button" -"Every 3 days","Iedere 3 dagen" -"Every 7 days","Iedere 7 dagen" -"Every 10 days","Iedere 10 dagen" -"Every 14 days","Iedere 14 dagen" -"Every 30 days","Iedere 30 dagen" -"Every 40 days","Iedere 40 dagen" -"No Logo","Geen Logo" -"Pending PayPal","In afwachting van PayPal" -"Billing Agreement",Factuurovereenkomst -"Created At","Created At" -"Updated At","Updated At" -"-- Please Select Billing Agreement--","-- Selecteer a.u.b. rekeningovereenkomst --" -"Not sure what PayPal payment method to use? Click here to learn more.","Not sure what PayPal payment method to use? Click here to learn more." -"Important: ","Important: " -"To use PayPal Payments Advanced, you must configure your PayPal Payments Advanced account on the PayPal website.","To use PayPal Payments Advanced, you must configure your PayPal Payments Advanced account on the PayPal website." -"Once you log into your PayPal Advanced account, navigate to the Service Settings - Hosted Checkout Pages - Set Up menu and set the options described below","Once you log into your PayPal Advanced account, navigate to the Service Settings - Hosted Checkout Pages - Set Up menu and set the options described below" -"To use PayPal Payflow Link, you must configure your PayPal Payflow Link account on the PayPal website.","To use PayPal Payflow Link, you must configure your PayPal Payflow Link account on the PayPal website." -"Once you log into your PayPal Payflow Link account, navigate to the Service Settings - Hosted Checkout Pages - Set Up menu and set the options described below","Once you log into your PayPal Payflow Link account, navigate to the Service Settings - Hosted Checkout Pages - Set Up menu and set the options described below" -"Agreement Information","Agreement Information" -"Reference ID:","Reference ID:" -Status:,Status: -Created:,Created: -Updated:,Updated: -"Payment Method:","Payment Method:" -"Ship To","Ship To" -"Back to Billing Agreements","Terug naar Factureringsovereenkomsten" -"There are no billing agreements yet.","Er zijn nog geen facturatieovereenkomsten." -"New Billing Agreement","Nieuwe factuurovereenkomst" -"You will be redirected to the payment system website.","You will be redirected to the payment system website." -Create...,Create... -"Your billing agreement # is: %1.","Your billing agreement # is: %1." -"Review Order","Overzicht van de bestelling" -"Please select a shipping method...","Selecteer een methode van verzending..." -"Update Shipping Method","Update Shipping Method" -"Edit Payment Information","Edit Payment Information" -"Items in Your Shopping Cart","Artikelen in Uw Winkelwagen" -"Edit Shopping Cart","Bewerken winkelmandje" -"Please update order data to get shipping methods and rates","Update alstublieft de bestellings gegevens om verzendings methodes en tarieven te krijgen" -"Checkout with PayPal","Checkout met PayPal" -"Please do not refresh the page until you complete payment.","Ververs alstublieft niet de pagina totdat de betaling is voltooid." -"You will be required to enter your payment details after you place an order.","U zult uw betalingsdetails moeten invoeren na het plaatsen van een bestelling." -"Additional Options","Meer Opties" -"Acceptance Mark","Acceptatie Stempel" -"What is PayPal?","Wat is PayPal?" -"Sign a billing agreement to streamline further purchases with PayPal.","Teken een betaalovereenkomst om toekomstige aankopen met PayPal te stroomlijnen." -Schedule,Schedule -Size,Size -"Sorry, something went wrong.","Sorry, something went wrong." -"Sorry, something went wrong. Please try again later.","Sorry, something went wrong. Please try again later." -"Test Mode","Test Mode" -"Payment Action","Payment Action" -"3D Secure","3D Secure" -"Severe 3D Secure Card Validation","Severe 3D Secure Card Validation" -"Severe Validation Removes Chargeback Liability on Merchant","Severe Validation Removes Chargeback Liability on Merchant" -"Centinel API URL","Centinel API URL" -"Debug Mode","Debug Mode" -"Sandbox Mode","Sandbox Mode" -1,1 -"Merchant Location","Merchant Location" -"Merchant Country","Merchant Country" -"If not specified, Default Country from General Config will be used","If not specified, Default Country from General Config will be used" -"Website Payments Pro (Includes Express Checkout)","Website Payments Pro (Includes Express Checkout)" -"Accept payments with a completely customizable checkout.","Accept payments with a completely customizable checkout." -"Required PayPal Settings","Required PayPal Settings" -"Website Payments Pro and Express Checkout","Website Payments Pro and Express Checkout" -"Enable this Solution","Enable this Solution" -"Advertise Bill Me Later","Advertise Bill Me Later" -" - Why Advertise Financing?
- Give your sales a boost when you advertise financing.
PayPal helps turn browsers into buyers with financing - from Bill Me Later®. Your customers have more time to pay, while you get paid up front – at no additional cost to you. - Use PayPal’s free banner ads that let you advertise Bill Me Later® financing as a payment option when your customers check out with PayPal. - The PayPal Advertising Program has been shown to generate additional purchases as well as increase consumer's average purchase sizes by 15% - or more. See Details. - "," - Why Advertise Financing?
- Give your sales a boost when you advertise financing.
PayPal helps turn browsers into buyers with financing - from Bill Me Later®. Your customers have more time to pay, while you get paid up front – at no additional cost to you. - Use PayPal’s free banner ads that let you advertise Bill Me Later® financing as a payment option when your customers check out with PayPal. - The PayPal Advertising Program has been shown to generate additional purchases as well as increase consumer's average purchase sizes by 15% - or more. See Details. - " -"Home Page","Home Page" -"Catalog Category Page","Catalog Category Page" -"Catalog Product Page","Catalog Product Page" -"Checkout Cart Page","Checkout Cart Page" -"Basic Settings - PayPal Website Payments Pro","Basic Settings - PayPal Website Payments Pro" -"It is recommended to set this value to ""Debit or Credit Card"" per store views.","It is recommended to set this value to ""Debit or Credit Card"" per store views." -"Credit Card Settings","Credit Card Settings" -"Allowed Credit Card Types","Allowed Credit Card Types" -" - 3D Secure validation is required for Maestro cards. Supporting of American Express cards require additional agreement. Learn more at http://www.paypal.com/amexupdate. - "," - 3D Secure validation is required for Maestro cards. Supporting of American Express cards require additional agreement. Learn more at http://www.paypal.com/amexupdate. - " -"Payment Applicable From","Payment Applicable From" -"Countries Payment Applicable From","Countries Payment Applicable From" -"Enable SSL verification","Enable SSL verification" -"Transfer Cart Line Items","Transfer Cart Line Items" -"Require CVV Entry","Require CVV Entry" -"Centinel Custom API URL","Centinel Custom API URL" -"If empty, a default value will be used. Custom URL may be provided by CardinalCommerce agreement.","If empty, a default value will be used. Custom URL may be provided by CardinalCommerce agreement." -"PayPal Billing Agreement Settings","PayPal Billing Agreement Settings" -"Settlement Report Settings","Settlement Report Settings" -"Frontend Experience Settings","Frontend Experience Settings" -"Basic Settings - PayPal Express Checkout","Basic Settings - PayPal Express Checkout" -"Website Payments Standard","Website Payments Standard" -"Accept credit card and PayPal payments securely.","Accept credit card and PayPal payments securely." -"Basic Settings - PayPal Website Payments Standard","Basic Settings - PayPal Website Payments Standard" -"It is recommended to set this value to ""PayPal"" per store views.","It is recommended to set this value to ""PayPal"" per store views." -"Summary Text for Aggregated Cart","Summary Text for Aggregated Cart" -"Uses store frontend name by default.","Uses store frontend name by default." -"Payflow Pro","Payflow Pro" -"Connect your merchant account with a fully customizable gateway that lets customers pay without leaving your site.","Connect your merchant account with a fully customizable gateway that lets customers pay without leaving your site." -Partner,Partner -Vendor,Vendor -"Use Proxy","Use Proxy" -"Proxy Host","Proxy Host" -"Proxy Port","Proxy Port" -"Basic Settings - PayPal Payflow Pro","Basic Settings - PayPal Payflow Pro" -" - Supporting of American Express cards require additional agreement. Learn more at http://www.paypal.com/amexupdate. - "," - Supporting of American Express cards require additional agreement. Learn more at http://www.paypal.com/amexupdate. - " -"Severe validation removes chargeback liability on merchant.","Severe validation removes chargeback liability on merchant." -"A value is required for live mode. Refer to your CardinalCommerce agreement.","A value is required for live mode. Refer to your CardinalCommerce agreement." -"Payflow Link (Includes Express Checkout)","Payflow Link (Includes Express Checkout)" -"Connect your merchant account with a PCI-compliant gateway that lets customers pay without leaving your site.","Connect your merchant account with a PCI-compliant gateway that lets customers pay without leaving your site." -"Payflow Link and Express Checkout","Payflow Link and Express Checkout" -"Email Associated with PayPal Merchant Account (Optional)","Email Associated with PayPal Merchant Account (Optional)" -"If you do not have multiple users set up on your account, please re-enter your Vendor/Merchant Login here.","If you do not have multiple users set up on your account, please re-enter your Vendor/Merchant Login here." -"Enable Payflow Link","Enable Payflow Link" -"Enable Express Checkout","Enable Express Checkout" -" - Why Advertise Financing?
- Give your sales a boost when you advertise financing.
PayPal helps turn browsers into buyers with financing - from Bill Me Later®. Your customers have more time to pay, while you get paid up front – at no additional cost to you. - Use PayPal’s free banner ads that let you advertise Bill Me Later® financing as a payment option when your customers check out with PayPal. - The PayPal Advertising Program has been shown to generate additional purchases as well as increase consumer's average purchase sizes by 15% - or more. See Details. - "," - Why Advertise Financing?
- Give your sales a boost when you advertise financing.
PayPal helps turn browsers into buyers with financing - from Bill Me Later®. Your customers have more time to pay, while you get paid up front – at no additional cost to you. - Use PayPal’s free banner ads that let you advertise Bill Me Later® financing as a payment option when your customers check out with PayPal. - The PayPal Advertising Program has been shown to generate additional purchases as well as increase consumer's average purchase sizes by 15% - or more. See Details. - " -"Basic Settings - PayPal Payflow Link","Basic Settings - PayPal Payflow Link" -"CVV Entry is Editable","CVV Entry is Editable" -"Send Email Confirmation","Send Email Confirmation" -"URL method for Cancel URL and Return URL","URL method for Cancel URL and Return URL" -"Express Checkout","Express Checkout" -"Add PayPal as an additional payment method to your checkout page.","Add PayPal as an additional payment method to your checkout page." -"Email Associated with PayPal Merchant Account","Email Associated with PayPal Merchant Account" -" - Start accepting payments via PayPal! - "," - Start accepting payments via PayPal! - " -"Don't have a PayPal account? Simply enter your email address.","Don't have a PayPal account? Simply enter your email address." -"API Authentication Methods","API Authentication Methods" -"API Username","API Username" -"API Password","API Password" -"Get Credentials from PayPal","Get Credentials from PayPal" -"Sandbox Credentials","Sandbox Credentials" -"API Uses Proxy","API Uses Proxy" -"Enable Bill Me Later","Enable Bill Me Later" -"PayPal Express Checkout lets you give customers access to financing through Bill Me Later® - at no additional cost to you. - You get paid up front, even though customers have more time to pay. A pre-integrated payment button lets customers pay quickly with Bill Me Later®. - Learn More - ","PayPal Express Checkout lets you give customers access to financing through Bill Me Later® - at no additional cost to you. - You get paid up front, even though customers have more time to pay. A pre-integrated payment button lets customers pay quickly with Bill Me Later®. - Learn More - " -"Publisher ID","Publisher ID" -"Required to display a banner","Required to display a banner" -"Get Publisher ID from PayPal","Get Publisher ID from PayPal" -"It is recommended to set this value to ""Magento_Paypal"" per store views.","It is recommended to set this value to ""Magento_Paypal"" per store views." -"Shortcut on Shopping Cart","Shortcut on Shopping Cart" -"Also affects mini-shopping cart.","Also affects mini-shopping cart." -"Shortcut on Product View","Shortcut on Product View" -"Authorization Honor Period (days)","Authorization Honor Period (days)" -"Specifies what the Authorization Honor Period is on the merchant’s PayPal account. It must mirror the setting in PayPal.","Specifies what the Authorization Honor Period is on the merchant’s PayPal account. It must mirror the setting in PayPal." -"Order Valid Period (days)","Order Valid Period (days)" -"Specifies what the Order Valid Period is on the merchant’s PayPal account. It must mirror the setting in PayPal.","Specifies what the Order Valid Period is on the merchant’s PayPal account. It must mirror the setting in PayPal." -"Number of Child Authorizations","Number of Child Authorizations" -"The default number of child authorizations in your PayPal account is 1. To do multiple authorizations please contact PayPal to request an increase.","The default number of child authorizations in your PayPal account is 1. To do multiple authorizations please contact PayPal to request an increase." -"Transfer Shipping Options","Transfer Shipping Options" -"If this option is enabled, customer can change shipping address and shipping method on PayPal website. In live mode works via HTTPS protocol only.","If this option is enabled, customer can change shipping address and shipping method on PayPal website. In live mode works via HTTPS protocol only." -"Notice that PayPal can handle up to 10 shipping options. That is why Magento will transfer only first 10 cheapest shipping options if there are more than 10 available.","Notice that PayPal can handle up to 10 shipping options. That is why Magento will transfer only first 10 cheapest shipping options if there are more than 10 available." -"Shortcut Buttons Flavor","Shortcut Buttons Flavor" -"Enable PayPal Guest Checkout","Enable PayPal Guest Checkout" -"Ability for buyer to purchase without PayPal account.","Ability for buyer to purchase without PayPal account." -"Require Customer's Billing Address","Require Customer's Billing Address" -"This feature needs be enabled first for the merchant account through PayPal technical support.","This feature needs be enabled first for the merchant account through PayPal technical support." -"Billing Agreement Signup","Billing Agreement Signup" -"Whether to create a billing agreement, if there are no active billing agreements available.","Whether to create a billing agreement, if there are no active billing agreements available." -" - Merchants need to apply to PayPal for enabling billing agreements feature. Do not enable this option until PayPal confirms that billing agreements are enabled for your merchant account. - "," - Merchants need to apply to PayPal for enabling billing agreements feature. Do not enable this option until PayPal confirms that billing agreements are enabled for your merchant account. - " -"Skip Order Review Step","Skip Order Review Step" -" - Will appear as a payment option only for customers who have at least one active billing agreement. - "," - Will appear as a payment option only for customers who have at least one active billing agreement. - " -"Allow in Billing Agreement Wizard","Allow in Billing Agreement Wizard" -"SFTP Credentials","SFTP Credentials" -"Custom Endpoint Hostname or IP-Address","Custom Endpoint Hostname or IP-Address" -"By default it is ""reports.paypal.com"".","By default it is ""reports.paypal.com""." -"Use colon to specify port. For example: ""test.example.com:5224"".","Use colon to specify port. For example: ""test.example.com:5224""." -"Custom Path","Custom Path" -"Scheduled Fetching","Scheduled Fetching" -"Enable Automatic Fetching","Enable Automatic Fetching" -"PayPal retains reports for 45 days.","PayPal retains reports for 45 days." -"Time of Day","Time of Day" -"PayPal Product Logo","PayPal Product Logo" -"Displays on catalog pages and homepage.","Displays on catalog pages and homepage." -"PayPal Merchant Pages Style","PayPal Merchant Pages Style" -"Page Style","Page Style" -" - Allowable values: ""paypal"", ""primary"" (default), your_custom_value (a custom payment page style from your merchant account profile). - "," - Allowable values: ""paypal"", ""primary"" (default), your_custom_value (a custom payment page style from your merchant account profile). - " -"Header Image URL","Header Image URL" -" - The image at the top left of the checkout page. Max size is 750x90-pixel. https is highly encouraged. - "," - The image at the top left of the checkout page. Max size is 750x90-pixel. https is highly encouraged. - " -"Header Background Color","Header Background Color" -" - The background color for the header of the checkout page. Case-insensitive six-character HTML hexadecimal color code in ASCII. - "," - The background color for the header of the checkout page. Case-insensitive six-character HTML hexadecimal color code in ASCII. - " -"Header Border Color","Header Border Color" -"2-pixel perimeter around the header space.","2-pixel perimeter around the header space." -"Page Background Color","Page Background Color" -" - The background color for the checkout page around the header and payment form. - "," - The background color for the checkout page around the header and payment form. - " -"Website Payments Pro Hosted Solution","Website Payments Pro Hosted Solution" -"Accept payments with a PCI compliant checkout that keeps customers on your site.","Accept payments with a PCI compliant checkout that keeps customers on your site." -"Payments Pro Hosted Solution","Payments Pro Hosted Solution" -" - Why Advertise Financing?
- Give your sales a boost when you advertise financing.
PayPal helps turn browsers into buyers with financing - from Bill Me Later®. Your customers have more time to pay, while you get paid up front – at no additional cost to you. - Use PayPal’s free banner ads that let you advertise Bill Me Later® financing as a payment option when your customers check out with PayPal. - The PayPal Advertising Program has been shown to generate additional purchases as well as increase consumer's average purchase sizes by 15% - or more. See Details. - "," - Why Advertise Financing?
- Give your sales a boost when you advertise financing.
PayPal helps turn browsers into buyers with financing - from Bill Me Later®. Your customers have more time to pay, while you get paid up front – at no additional cost to you. - Use PayPal’s free banner ads that let you advertise Bill Me Later® financing as a payment option when your customers check out with PayPal. - The PayPal Advertising Program has been shown to generate additional purchases as well as increase consumer's average purchase sizes by 15% - or more. See Details. - " -"Basic Settings - PayPal Payments Pro Hosted Solution","Basic Settings - PayPal Payments Pro Hosted Solution" -"Display Express Checkout in the Payment Information step","Display Express Checkout in the Payment Information step" -" - PayPal All-in-One Payment Solutions  Accept and process credit cards and PayPal payments. - "," - PayPal All-in-One Payment Solutions  Accept and process credit cards and PayPal payments. - " -"Choose a secure bundled payment solution for your business.","Choose a secure bundled payment solution for your business." -"PayPal Express Checkout","PayPal Express Checkout" -"Add another payment method to your existing solution or as a stand-alone option.","Add another payment method to your existing solution or as a stand-alone option." -"Payments Advanced (Includes Express Checkout)","Payments Advanced (Includes Express Checkout)" -"Accept payments with a PCI-compliant checkout that keeps customers on your site.","Accept payments with a PCI-compliant checkout that keeps customers on your site." -"Payments Advanced and Express Checkout","Payments Advanced and Express Checkout" -"PayPal recommends that you set up an additional User on your account at manager.paypal.com","PayPal recommends that you set up an additional User on your account at manager.paypal.com" -"PayPal recommends you set up an additional User on your account at manager.paypal.com, instead of entering your admin username and password here. This will enhance your security and prevent service interruptions if you later change your password. If you do not want to set up an additional User, you can re-enter your Merchant Login here.","PayPal recommends you set up an additional User on your account at manager.paypal.com, instead of entering your admin username and password here. This will enhance your security and prevent service interruptions if you later change your password. If you do not want to set up an additional User, you can re-enter your Merchant Login here." -" - Why Advertise Financing?
- Give your sales a boost when you advertise financing.
PayPal helps turn browsers into buyers with financing - from Bill Me Later®. Your customers have more time to pay, while you get paid up front – at no additional cost to you. - Use PayPal’s free banner ads that let you advertise Bill Me Later® financing as a payment option when your customers check out with PayPal. - The PayPal Advertising Program has been shown to generate additional purchases as well as increase consumer's average purchase sizes by 15% - or more. See Details. - "," - Why Advertise Financing?
- Give your sales a boost when you advertise financing.
PayPal helps turn browsers into buyers with financing - from Bill Me Later®. Your customers have more time to pay, while you get paid up front – at no additional cost to you. - Use PayPal’s free banner ads that let you advertise Bill Me Later® financing as a payment option when your customers check out with PayPal. - The PayPal Advertising Program has been shown to generate additional purchases as well as increase consumer's average purchase sizes by 15% - or more. See Details. - " -"Basic Settings - PayPal Payments Advanced","Basic Settings - PayPal Payments Advanced" -"Payments Pro (Includes Express Checkout)","Payments Pro (Includes Express Checkout)" -"Payments Pro and Express Checkout","Payments Pro and Express Checkout" -"Basic Settings - PayPal Payments Pro","Basic Settings - PayPal Payments Pro" -"Payments Standard","Payments Standard" -"Basic Settings - PayPal Payments Standard","Basic Settings - PayPal Payments Standard" -"PayPal Payment Gateways","PayPal Payment Gateways" -"Process payments using your own internet merchant account.","Process payments using your own internet merchant account." -"Payflow Pro (Includes Express Checkout)","Payflow Pro (Includes Express Checkout)" -"Payflow Pro and Express Checkout","Payflow Pro and Express Checkout" -" - Why Advertise Financing?
- Give your sales a boost when you advertise financing.
PayPal helps turn browsers into buyers with financing - from Bill Me Later®. Your customers have more time to pay, while you get paid up front – at no additional cost to you. - Use PayPal’s free banner ads that let you advertise Bill Me Later® financing as a payment option when your customers check out with PayPal. - The PayPal Advertising Program has been shown to generate additional purchases as well as increase consumer's average purchase sizes by 15% - or more. See Details. - "," - Why Advertise Financing?
- Give your sales a boost when you advertise financing.
PayPal helps turn browsers into buyers with financing - from Bill Me Later®. Your customers have more time to pay, while you get paid up front – at no additional cost to you. - Use PayPal’s free banner ads that let you advertise Bill Me Later® financing as a payment option when your customers check out with PayPal. - The PayPal Advertising Program has been shown to generate additional purchases as well as increase consumer's average purchase sizes by 15% - or more. See Details. - " -"Accept credit cards, debit cards and PayPal payments securely.","Accept credit cards, debit cards and PayPal payments securely." -"Accept payments with a completely customizable checkout page.","Accept payments with a completely customizable checkout page." -"Website Payments Pro Hosted Solution (Includes Express Checkout)","Website Payments Pro Hosted Solution (Includes Express Checkout)" -"Website Payments Pro Hosted Solution and Express Checkout","Website Payments Pro Hosted Solution and Express Checkout" -"Basic Settings - PayPal Website Payments Pro Hosted Solution","Basic Settings - PayPal Website Payments Pro Hosted Solution" -"PayPal Payment Solutions","PayPal Payment Solutions" diff --git a/app/code/Magento/Paypal/i18n/pt_BR.csv b/app/code/Magento/Paypal/i18n/pt_BR.csv deleted file mode 100644 index c106ca0dd4504..0000000000000 --- a/app/code/Magento/Paypal/i18n/pt_BR.csv +++ /dev/null @@ -1,692 +0,0 @@ -Custom,Personalizado -Close,Close -Cancel,Cancel -Back,Back -Price,Preço -ID,ID -Configure,Configure -No,Não -Qty,Qty -Subtotal,Subtotal -"Incl. Tax","Incl. Tax" -Edit,Edit -"--Please Select--","--Please Select--" -Customer,Customer -"First Name","First Name" -"Last Name","Last Name" -Email,Email -"-- Please Select --","-- Please Select --" -Yes,Sim -Status,Status -Enabled,Enabled -"Sort Order","Sort Order" -Title,Title -"Are you sure you want to do this?","Are you sure you want to do this?" -Order,Pedido -View,Ver -Active,Active -Position,Position -Dynamic,Dinâmico -N/A,Indisponível -Canceled,Canceled -"General Information","General Information" -Static,Estático -"Advanced Settings","Advanced Settings" -"Learn More","Saiba Mais" -"Start Date","Start Date" -"Product Name","Product Name" -"3D Secure Card Validation","3D Secure Card Validation" -"Merchant Liability","Responsabilidade do Comerciante" -"Billing Information","Billing Information" -"Shipping Information","Shipping Information" -"Shipping Method","Tipo de Frete" -"Please agree to all the terms and conditions before placing the order.","Por favor concorde com todos os Termos e Condições antes de colocar a ordem." -"Account confirmation is required. Please, check your e-mail for confirmation link. To resend confirmation email please click here.","Account confirmation is required. Please, check your e-mail for confirmation link. To resend confirmation email please click here." -Password,Password -Continue,Continue -"Order #","Order #" -Login,Login -"Shipping Address","Endereço de Envio" -"Payment Method","Payment Method" -"Place Order","Colocar Ordem" -"Sorry, no quotes are available for this order at this time.","Desculpe, não há citações disponíveis neste momento para esta ordem." -Sales,Vendas -Created,Created -Display,Display -User,User -Daily,Diário -Date,Date -"Order Total","Order Total" -Never,Nunca -Updated,Updated -Reports,Relatórios -"Order Status","Order Status" -"View Order","View Order" -Event,Evento -"Please Select","Please Select" -"Submitting order information...","Enviando informações da ordem..." -Authorization,Autorização -"You notified customer about invoice #%1.","You notified customer about invoice #%1." -"Note: %1","Note: %1" -"IPN ""%1""","IPN ""%1""" -"Billing Agreements","Contratos de faturamento" -"Reference ID","Reference ID" -"Billing Agreement #%1","Billing Agreement #%1" -"Related Orders","Related Orders" -"Billing Agreement View","Visualização de Contrato de Faturamento" -"View Transaction Details","Visualizar Detalhes da Transação." -"Reference Information","Informação de Referência" -"Transaction Information","Informação da Transação" -"PayPal Fee Information","Informação de Taxa PayPal" -"PayPal Settlement Reports","Relatórios de Pagamento PayPal" -"We are connecting to the PayPal SFTP server to retrieve new reports. Are you sure you want to continue?","We are connecting to the PayPal SFTP server to retrieve new reports. Are you sure you want to continue?" -"Fetch Updates","Buscar Atualizações" -button_label,button_label -sandbox_button_label,sandbox_button_label -Help,Ajuda -"There is already another PayPal solution enabled. Enable this solution instead?","There is already another PayPal solution enabled. Enable this solution instead?" -"The following error(s) occured:","The following error(s) occured:" -"Some PayPal solutions conflict.","Some PayPal solutions conflict." -"PayPal Express Checkout is not enabled.","PayPal Express Checkout is not enabled." -"Please re-enable the previously enabled payment solutions.","Please re-enable the previously enabled payment solutions." -"View Demo","Visualizar Demonstração" -"See terms","See terms" -"You will be redirected to the PayPal website.","Você será redirecionado para o site PayPal." -"Would you like to sign a billing agreement ' 'to streamline further purchases with PayPal?","Would you like to sign a billing agreement ' 'to streamline further purchases with PayPal?" -"You will be redirected to the PayPal website when you place an order.","Você será redirecionado para o site PayPal quando você colocar uma ordem." -"Click here if you are not redirected within 10 seconds.","Click here if you are not redirected within 10 seconds." -"You will be redirected to the PayPal website in a few seconds.","Você será redirecionado para a página do PayPal em alguns segundos." -"You canceled the billing agreement.","You canceled the billing agreement." -"We could not cancel the billing agreement.","We could not cancel the billing agreement." -"You deleted the billing agreement.","You deleted the billing agreement." -"We could not delete the billing agreement.","We could not delete the billing agreement." -"Please specify the correct billing agreement ID and try again.","Please specify the correct billing agreement ID and try again." -"View Transaction","Visualizar Transação" -"We found nothing to fetch because of an empty configuration.","We found nothing to fetch because of an empty configuration." -"We fetched %1 report rows from '%2@%3'.","We fetched %1 report rows from '%2@%3'." -"We couldn't fetch reports from '%1@%2'.","We couldn't fetch reports from '%1@%2'." -"Billing Agreement # %1","Billing Agreement # %1" -"We couldn't start the billing agreement wizard.","We couldn't start the billing agreement wizard." -"The billing agreement ""%1"" has been created.","The billing agreement ""%1"" has been created." -"We couldn't finish the billing agreement wizard.","We couldn't finish the billing agreement wizard." -"The billing agreement ""%1"" has been canceled.","The billing agreement ""%1"" has been canceled." -"We couldn't cancel the billing agreement.","We couldn't cancel the billing agreement." -"To proceed to Checkout, please log in using your email address.","To proceed to Checkout, please log in using your email address." -"We can't start Express Checkout.","We can't start Express Checkout." -"Express Checkout and Order have been canceled.","Caixa Expresso e Ordem foram canceladas." -"Express Checkout has been canceled.","Caixa Expresso foi cancelada." -"Unable to cancel Express Checkout","Unable to cancel Express Checkout" -"We can't process Express Checkout approval.","We can't process Express Checkout approval." -"We can't initialize Express Checkout review.","We can't initialize Express Checkout review." -"We can't update shipping method.","We can't update shipping method." -"We can't place the order.","We can't place the order." -"We can't initialize Express Checkout.","We can't initialize Express Checkout." -"PayPal Express Checkout Token does not exist.","Fechar Pedido com PayPal Express: Token não existe" -"A wrong PayPal Express Checkout Token is specified.","A wrong PayPal Express Checkout Token is specified." -"Your payment has been declined. Please try again.","Your payment has been declined. Please try again." -"We can't contact the PayPal gateway.","We can't contact the PayPal gateway." -"PayPal response hasn't required fields.","Resposta PayPal não tem os campos obrigatórios." -"Something went wrong while processing your order.","Something went wrong while processing your order." -"PayPal gateway has rejected request. %1","PayPal gateway has rejected request. %1" -"PayPal gateway rejected the request. %1","PayPal gateway rejected the request. %1" -"I'm sorry - but we were not able to process your payment. Please try another payment method or contact us so we can assist you.","I'm sorry - but we were not able to process your payment. Please try another payment method or contact us so we can assist you." -"I'm sorry - but we are not able to complete your transaction. Please contact us so we can assist you.","I'm sorry - but we are not able to complete your transaction. Please contact us so we can assist you." -"The payment method code is not set.","The payment method code is not set." -"The reference ID is not set.","The reference ID is not set." -"Unable to save Billing Agreement:","Não foi possível salvar Acordo de Cobrança:" -"The customer ID is not set.","The customer ID is not set." -"The Billing Agreement status is not set.","The Billing Agreement status is not set." -"The PayPal certificate does not exist.","The PayPal certificate does not exist." -"We prefer PayPal (150 X 60)","Preferimos PayPal (150 x 60)" -"We prefer PayPal (150 X 40)","Preferimos PayPal (150 x 40)" -"Now accepting PayPal (150 X 60)","Aceitando agora PayPal (150 X 60)" -"Now accepting PayPal (150 X 40)","Aceitando agora PayPal (150 X 40)" -"Payments by PayPal (150 X 60)","Pagamentos por PayPal (150 x 60)" -"Payments by PayPal (150 X 40)","Pagamentos por PayPal (150 x 40)" -"Shop now using (150 X 60)","Compre agora usando (150 X 60)" -"Shop now using (150 X 40)","Compre agora usando (150 X 40)" -Shortcut,Atalho -"Acceptance Mark Image","Imagem de Marca de Aceitação" -Sale,Venda -"For Virtual Quotes Only","Somente para Orçamentos Virtuais" -Auto,Auto -"Ask Customer","Pergunte ao cliente" -"IPN (Instant Payment Notification) Only","IPN (Instant Payment Notification) Only" -"API Signature","Assinatura API" -"API Certificate","Certificado API" -"The ordering amount of %1 is pending approval on the payment gateway.","The ordering amount of %1 is pending approval on the payment gateway." -"Ordered amount of %1","Ordered amount of %1" -"We'll authorize the amount of %1 as soon as the payment gateway approves it.","We'll authorize the amount of %1 as soon as the payment gateway approves it." -"The authorized amount is %1.","The authorized amount is %1." -"The maximum number of child authorizations is reached.","O número máximo de autorizações de criança foi atingido." -"PayPal can't process orders with a zero balance due. ' 'To finish your purchase, please go through the standard checkout process.","PayPal can't process orders with a zero balance due. ' 'To finish your purchase, please go through the standard checkout process." -"Payer is not identified.","O pagante não está identificado." -"Last Transaction ID","ID da Última Transação" -"This customer did not include a confirmed address.","This customer did not include a confirmed address." -"The payment is authorized but not settled.","O pagamento está autorizado, mas não liquidado." -"The payment eCheck is not yet cleared.","O pagamento eCheck ainda não está clarificado." -"The merchant holds a non-U.S. account and does not have a withdrawal mechanism.","The merchant holds a non-U.S. account and does not have a withdrawal mechanism." -"The payment currency does not match any of the merchant's balances currency.","The payment currency does not match any of the merchant's balances currency." -"The payment is pending while it is being reviewed by PayPal for risk.","O pagamento está pendente enquanto ele está sendo revisado para o risco por PayPal." -"The payment is pending because it was made to an email address that is not yet registered or confirmed.","O pagamento está pendente porque foi feito para um endereço de e-mail que ainda não está registrado ou confirmado." -"The merchant account is not yet verified.","A conta de comerciante ainda não foi confirmada." -"The payment was made via credit card. In order to receive funds merchant must upgrade account to Business or Premier status.","O pagamento foi feito via cartão de crédito. A fim de receber fundos o comerciante deve atualizar sua conta para status Business ou Premier." -"Sorry, but something went wrong. Please contact PayPal customer service.","Sorry, but something went wrong. Please contact PayPal customer service." -"A reversal has occurred on this transaction due to a chargeback by your customer.","A reversal has occurred on this transaction due to a chargeback by your customer." -"A reversal has occurred on this transaction due to your customer triggering a money-back guarantee.","A reversal has occurred on this transaction due to your customer triggering a money-back guarantee." -"A reversal has occurred on this transaction due to a complaint about the transaction from your customer.","A reversal has occurred on this transaction due to a complaint about the transaction from your customer." -"A reversal has occurred on this transaction because you have given the customer a refund.","A reversal has occurred on this transaction because you have given the customer a refund." -"Reversal of an adjustment.","Reversão de um ajustamento." -"Transaction reversal due to fraud detected by PayPal administrators.","Transaction reversal due to fraud detected by PayPal administrators." -"Transaction reversal by PayPal administrators.","Transaction reversal by PayPal administrators." -"Reimbursement for a chargeback.","Reembolso de uma cobrança retroativa." -"Settlement of a chargeback.","Liquidação de um estorno." -"A reversal has occurred on this transaction because of a customer dispute suspecting unauthorized spoof.","A reversal has occurred on this transaction because of a customer dispute suspecting unauthorized spoof." -"Buyer claims that he did not receive goods or service.","Buyer claims that he did not receive goods or service." -"Buyer claims that the goods or service received differ from merchant’s description of the goods or service.","Buyer claims that the goods or service received differ from merchant’s description of the goods or service." -"Buyer claims that he/she did not authorize transaction.","Buyer claims that he/she did not authorize transaction." -"A case that has been resolved and close requires a reimbursement.","A case that has been resolved and close requires a reimbursement." -"Buyer claims that a possible duplicate payment was made to the merchant.","Buyer claims that a possible duplicate payment was made to the merchant." -"Buyer claims that the received merchandise is unsatisfactory, defective, or damaged.","Buyer claims that the received merchandise is unsatisfactory, defective, or damaged." -"Unknown reason. Please contact PayPal customer service.","Motivo desconhecido. Favor contactar o atendimento a clientes do PayPal." -"Payer ID","Identificação do Pagante" -"Payer Email","E-mail do Pagante" -"Payer Status","Estado Atual do Pagante" -"Payer Address ID","Identificação do Endereço do Pagante" -"Payer Address Status","Estado Atual do Endereço do Pagante" -"Merchant Protection Eligibility","Elegibilidade de Proteção do Comerciante" -"Triggered Fraud Filters","Desencadeados Filtros de Fraude" -"Last Correlation ID","ID da Última Correlação" -"Address Verification System Response","Resposta de Sistema de Verificação de Endereço" -"CVV2 Check Result by PayPal","CVV2: Verificar Resultado pelo PayPal" -"Buyer's Tax ID","CPF do Comprador" -"Buyer's Tax ID Type","Tipo de CPF/CNPJ do Comprador" -"PayPal/Centinel Visa Payer Authentication Service Result","Resultado do Serviço de Autenticação Pagador Visa PayPal/Centinel" -"PayPal/Centinel Electronic Commerce Indicator","Indicador de Comércio Eletrônico PayPal/Centinel" -Chargeback,Estorno -Complaint,Complaint -Dispute,Dispute -"Matched Address only (no ZIP)","Apenas Endereço Correspondido (sem ZIP)" -"Matched Address only (no ZIP) International","Matched Address only (no ZIP) International" -"No Details matched","Nenhuns Detalhes correspondem" -"No Details matched. International","Nenhuns Detalhes correspondem. Internacional" -"Exact Match. Address and nine-digit ZIP code","Correspondência exata. Endereço e código postal CEP de nove dígitos" -"Exact Match. Address and Postal Code. International","Correspondência exata. Endereço e CEP. Internacional" -"Exact Match. Address and Postal Code. UK-specific","Correspondência exata. Endereço e CEP. Específicas do Reino Unido" -"N/A. Not allowed for MOTO (Internet/Phone) transactions","N/A. Não permitido para transações MOTO (Internet/Telefone)" -"N/A. Global Unavailable","N/A. Global Não Disponível" -"N/A. International Unavailable","N/A. Internacional Não Disponível" -"Matched five-digit ZIP only (no Address)","Apenas ZIP de cinco dígitos correspondido (sem Endereço)" -"Matched Postal Code only (no Address)","Apenas Código Postal Correspondido (sem Endereço)" -"N/A. Retry","N/A. Tentar novamente" -"N/A. Service not Supported","N/A. Serviço não Suportado" -"N/A. Unavailable","N/A. Indisponível" -"Matched whole nine-didgit ZIP (no Address)","ZIP total de nove dígitos correspondido (sem Endereço)" -"Yes. Matched Address and five-didgit ZIP","Sim. Endereço Correspondente e ZIP de cinco dígitos" -"All the address information matched","Todas as informações do endereço correspondem" -"None of the address information matched","Nenhuma das informações de endereço corresponderam" -"Part of the address information matched","Parte das informações de endereço correspondeu" -"N/A. The merchant did not provide AVS information","N/A. O comerciante não forneceu informação AVS" -"N/A. Address not checked, or acquirer had no response. Service not available","N/A. Endereço não verificado, ou comprador sem resposta. Serviço não disponível" -"Matched (CVV2CSC)","Correspondido (CVV2CSC)" -"No match","Nenhuma correspondência" -"N/A. Not processed","N/A. Não processado" -"N/A. Service not supported","N/A. Serviço não suportado" -"N/A. Service not available","N/A. Serviço não disponível" -"N/A. No response","N/A. Sem resposta" -"Matched (CVV2)","Correspondido (CVV2)" -"N/A. The merchant has not implemented CVV2 code handling","N/A. O comerciante não implementou manipulação de código CVV2" -"N/A. Merchant has indicated that CVV2 is not present on card","N/A. Comerciante indicou que CVV2 não está presente no cartão" -"Authenticated, Good Result","Autenticado, Bom Resultado" -"Authenticated, Bad Result","Autenticado, Mau Resultado" -"Attempted Authentication, Good Result","Autenticação Tentada, Bom Resultado" -"Attempted Authentication, Bad Result","Autenticação Tentada, Mau Resultado" -"No Liability Shift","Nenhuma Mudança de Responsabilidade" -"Issuer Liability","Responsabilidade do Emissor" -CNPJ,"CNPJ (Cadastro Nacional de Pessoas Jurídicas)" -CPF,"CPF (Cadastro de Contribuintes Pessoas Físicas)" -"IPN ""%1"". Case type ""%2"". Case ID ""%3"" %4","IPN ""%1"". Case type ""%2"". Case ID ""%3"" %4" -"IPN ""%1"". A dispute has been resolved and closed. %2 Transaction amount %3.","IPN ""%1"". A dispute has been resolved and closed. %2 Transaction amount %3." -"IPN ""%1"". %2 Transaction amount %3. Transaction ID: ""%4""","IPN ""%1"". %2 Transaction amount %3. Transaction ID: ""%4""" -"You notified customer about creditmemo #%1.","You notified customer about creditmemo #%1." -"Created billing agreement #%1.","Created billing agreement #%1." -"We couldn't create a billing agreement for this order.","We couldn't create a billing agreement for this order." -"Payflow PNREF: #%1.","Payflow PNREF: #%1." -"Fetch transaction details method does not exists in Payflow","Fetch transaction details method does not exists in Payflow" -"We cannot send the new order email.","We cannot send the new order email." -"You cannot void a verification transaction.","You cannot void a verification transaction." -"Payment transactions disallow storing objects.","Transações de pagamento não permitem armazenar objetos." -"You need to enter a transaction ID.","You need to enter a transaction ID." -"This operation requires an existing transaction object.","Esta operação requer um objeto existente de transação." -"You need an authorization transaction to void.","You need an authorization transaction to void." -"We can't issue a refund transaction because there is no capture transaction.","We can't issue a refund transaction because there is no capture transaction." -"We cannot create a target file for reading reports.","We cannot create a target file for reading reports." -"Report Date","Data do Relatório" -"Merchant Account","Conta do Comerciante" -"Transaction ID","ID da Transação" -"Invoice ID","ID da fatura" -"PayPal Reference ID","ID de Referência PayPal" -"PayPal Reference ID Type","Tipo de ID de Referência PayPal" -"Event Code","Código de Evento" -"Finish Date","Finish Date" -"Debit or Credit","Débito ou Crédito" -"Gross Amount","Valor Bruto" -"Fee Debit or Credit","Taxa de Débito ou de Crédito" -"Fee Amount","Valor da Taxa" -"Order ID","ID da Ordem" -"Subscription ID","ID de Subscrição" -"Preapproved Payment ID","ID do Pagamento Pré-aprovado" -Credit,Crédito -Debit,Débito -"General: received payment of a type not belonging to the other T00xx categories","Geral: pagamento recebido de um tipo que não pertence às outras categorias T00xx" -"Mass Pay Payment","Pagamento de Pagamento em Massa" -"Subscription Payment, either payment sent or payment received","Pagamento de Subscrição, ou de pagamento enviado ou pagamento recebido" -"Preapproved Payment (BillUser API), either sent or received","Pagamento Pré-aprovado (BillUser API), quer enviado ou recebido" -"eBay Auction Payment","Pagamento do Leilão eBay" -"Direct Payment API","API de Pagamento Direto" -"Express Checkout APIs","APIs Caixa Expresso" -"Website Payments Standard Payment","Pagamento de Pagamentos de Site Padrão" -"Postage Payment to either USPS or UPS","Pagamento de Porte quer para USPS ou UPS" -"Gift Certificate Payment: purchase of Gift Certificate","Pagamento de Vale Oferta: compra de Vale Oferta" -"Auction Payment other than through eBay","Pagamento de Leilão que não seja através de eBay" -"Mobile Payment (made via a mobile phone)","Pagamento Móvel (feito através de um celular)" -"Virtual Terminal Payment","Pagamento via Terminal Virtual" -"General: non-payment fee of a type not belonging to the other T01xx categories","Geral: taxa de não-pagamento de um tipo que não pertence às outras categorias T01xx" -"Fee: Web Site Payments Pro Account Monthly","Taxa: Conta Pro de Pagamentos de Web Site Mensal" -"Fee: Foreign ACH Withdrawal","Taxa: Retirada ACH Exterior" -"Fee: WorldLink Check Withdrawal","Taxa: Levantamento Verificado WorldLink" -"Fee: Mass Pay Request","Taxa: Pedido de Pagamento em Massa" -"General Currency Conversion","Conversão de Moeda em Geral" -"User-initiated Currency Conversion","Conversão de Moeda por Iniciativa do Usuário" -"Currency Conversion required to cover negative balance","Necessária a Conversão de Moeda para cobrir saldo negativo" -"General Funding of PayPal Account ","Financiamento Geral de Conta PayPal" -"PayPal Balance Manager function of PayPal account","Função PayPal de Gerente de Saldo da conta PayPal" -"ACH Funding for Funds Recovery from Account Balance","Financiamento ACH para Recuperação de Fundos de Saldo da Conta" -"EFT Funding (German banking)","Financiamento com transação eletrônica (banco alemão)" -"General Withdrawal from PayPal Account","Levantamento Geral a partir da Conta PayPal" -AutoSweep,AutoVarredura -"General: Use of PayPal account for purchasing as well as receiving payments","Geral: Uso de conta PayPal para a compra bem como para receber pagamentos" -"Virtual PayPal Debit Card Transaction","Transação via Cartão de Débito Virtual PayPal" -"PayPal Debit Card Withdrawal from ATM","Levantamento de ATM com Cartão de Débito PayPal" -"Hidden Virtual PayPal Debit Card Transaction","Transação Virtual Escondida com Cartão de Débito PayPal" -"PayPal Debit Card Cash Advance","Adiantamento de Dinheiro com Cartão de Débito PayPal" -"General: Withdrawal from PayPal Account","Geral: Levantamento a partir da Conta PayPal" -"General (Purchase with a credit card)","Geral (Compra com Cartão de Crédito)" -"Negative Balance","Balanço Negativo" -"General: bonus of a type not belonging to the other T08xx categories","Geral: bônus de um tipo que não pertence às outras categorias T08xx" -"Debit Card Cash Back","Desconto em Uso de Cartão de Débito" -"Merchant Referral Bonus","Bónus de Comerciante" -"Balance Manager Account Bonus","Conta de Gerente Bônus de Balanço" -"PayPal Buyer Warranty Bonus","Garantia Bonus de Comprador PayPal" -"PayPal Protection Bonus","Bônus de Proteção PayPal" -"Bonus for first ACH Use","Bônus pelo primeiro uso do ACH" -"General Redemption","Redenção Geral" -"Gift Certificate Redemption","Redenção de Vale Oferta" -"Points Incentive Redemption","Redenção de Pontos de Incentivo" -"Coupon Redemption","Resgate de Cupom" -"Reward Voucher Redemption","Resgate de Voucher de Recompensa" -"General. Product no longer supported","Geral. Produto não é mais suportado" -"General: reversal of a type not belonging to the other T11xx categories","Geral: reversão de um tipo que não pertence às outras categorias T11xx" -"ACH Withdrawal","Levantamento ACH" -"Debit Card Transaction","Transação em Cartão de Débito" -"Reversal of Points Usage","Reversão de Pontos de Uso" -"ACH Deposit (Reversal)","Depósito ACH (Reverso)" -"Reversal of General Account Hold","Reversão do Domínio da Conta Geral" -"Account-to-Account Payment, initiated by PayPal","Pagamento Conta para Conta, iniciado por PayPal" -"Payment Refund initiated by merchant","Reembolso de Pagamento por iniciativa do Comerciante" -"Fee Reversal","Reversão de Taxa" -"Hold for Dispute Investigation","Espere por Investigação de Disputa" -"Reversal of hold for Dispute Investigation","Reversão de espera por Disputa de Investigação" -"General: adjustment of a type not belonging to the other T12xx categories","Geral: ajuste de um tipo que não pertence às outras categorias T12xx" -Reversal,Reversão -Charge-off,"Baixa contábil" -Incentive,Incentivo -"Reimbursement of Chargeback","Reembolso de Cobrança Retroativa." -"General (Authorization)","Geral (Autorização)" -Reauthorization,Reautorização -Void,Anular -"General (Dividend)","Geral (Dividendo)" -"General: temporary hold of a type not belonging to the other T15xx categories","Geral: retenção temporária de um tipo que não pertence às outras categorias T15xx" -"Open Authorization","Autorização Aberta" -"ACH Deposit (Hold for Dispute or Other Investigation)","Depósito ACH (Apoio para Disputa ou Outra Investigação)" -"Available Balance","Saldo Disponível" -Funding,Financiamento -"General: Withdrawal to Non-Bank Entity","Geral: Levantamento de Entidade Não-Bancária" -"WorldLink Withdrawal","Levantamento WorldLink" -"Buyer Credit Payment","Pagamento de Crédito do Comprador" -"General Adjustment without businessrelated event","Ajuste Geral sem evento de negócios relacionado" -"General (Funds Transfer from PayPal Account to Another)","Geral (Transferência de Fundos da Conta PayPal para Outra)" -"Settlement Consolidation","Consolidação de liquidação" -"General: event not yet categorized","Geral: evento ainda não classificado" -"The PayPal certificate file is empty.","The PayPal certificate file is empty." -"Header (center)","Header (center)" -"Sidebar (right)","Sidebar (right)" -"Near Bill Me Later checkout button","Near Bill Me Later checkout button" -"Every 3 days","A cada 3 dias" -"Every 7 days","A cada 7 dias" -"Every 10 days","A cada 10 dias" -"Every 14 days","A cada 14 dias" -"Every 30 days","A cada 30 dias" -"Every 40 days","A cada 40 dias" -"No Logo","Nenhum Logo" -"Pending PayPal","Pendência com PayPal" -"Billing Agreement","Contrato de faturamento" -"Created At","Created At" -"Updated At","Updated At" -"-- Please Select Billing Agreement--","-- Por Favor, Escolha o Acordo de Cobrança--" -"Not sure what PayPal payment method to use? Click here to learn more.","Not sure what PayPal payment method to use? Click here to learn more." -"Important: ","Important: " -"To use PayPal Payments Advanced, you must configure your PayPal Payments Advanced account on the PayPal website.","To use PayPal Payments Advanced, you must configure your PayPal Payments Advanced account on the PayPal website." -"Once you log into your PayPal Advanced account, navigate to the Service Settings - Hosted Checkout Pages - Set Up menu and set the options described below","Once you log into your PayPal Advanced account, navigate to the Service Settings - Hosted Checkout Pages - Set Up menu and set the options described below" -"To use PayPal Payflow Link, you must configure your PayPal Payflow Link account on the PayPal website.","To use PayPal Payflow Link, you must configure your PayPal Payflow Link account on the PayPal website." -"Once you log into your PayPal Payflow Link account, navigate to the Service Settings - Hosted Checkout Pages - Set Up menu and set the options described below","Once you log into your PayPal Payflow Link account, navigate to the Service Settings - Hosted Checkout Pages - Set Up menu and set the options described below" -"Agreement Information","Agreement Information" -"Reference ID:","Reference ID:" -Status:,Status: -Created:,Created: -Updated:,Updated: -"Payment Method:","Payment Method:" -"Ship To","Ship To" -"Back to Billing Agreements","Voltar para Contratos de Faturamento" -"There are no billing agreements yet.","Ainda não existem acordos de faturamento." -"New Billing Agreement","Novo Contrato de Faturamento" -"You will be redirected to the payment system website.","You will be redirected to the payment system website." -Create...,Create... -"Your billing agreement # is: %1.","Your billing agreement # is: %1." -"Review Order","Analisar o pedido" -"Please select a shipping method...","Por favor selecione um método de envio..." -"Update Shipping Method","Update Shipping Method" -"Edit Payment Information","Edit Payment Information" -"Items in Your Shopping Cart","Itens em seu carrinho de compras" -"Edit Shopping Cart","Editar Carrinho de Compras" -"Please update order data to get shipping methods and rates","Por favor atualize os dados do pedido para ver as formas de envio e tarifas" -"Checkout with PayPal","Fechar Pedido com o PayPal" -"Please do not refresh the page until you complete payment.","Por favor não atualize a página até concluir o pagamento." -"You will be required to enter your payment details after you place an order.","Você será obrigado a inserir seus detalhes de pagamento depois de colocar uma ordem." -"Additional Options","Opções Adicionais" -"Acceptance Mark","Marca de Aceitação" -"What is PayPal?","O que é o PayPal?" -"Sign a billing agreement to streamline further purchases with PayPal.","Assine um acordo de faturamento para agilizar ainda mais as compras com o PayPal." -Schedule,Schedule -Size,Size -"Sorry, something went wrong.","Sorry, something went wrong." -"Sorry, something went wrong. Please try again later.","Sorry, something went wrong. Please try again later." -"Test Mode","Test Mode" -"Payment Action","Payment Action" -"3D Secure","3D Secure" -"Severe 3D Secure Card Validation","Severe 3D Secure Card Validation" -"Severe Validation Removes Chargeback Liability on Merchant","Severe Validation Removes Chargeback Liability on Merchant" -"Centinel API URL","Centinel API URL" -"Debug Mode","Debug Mode" -"Sandbox Mode","Sandbox Mode" -1,1 -"Merchant Location","Merchant Location" -"Merchant Country","Merchant Country" -"If not specified, Default Country from General Config will be used","If not specified, Default Country from General Config will be used" -"Website Payments Pro (Includes Express Checkout)","Website Payments Pro (Includes Express Checkout)" -"Accept payments with a completely customizable checkout.","Accept payments with a completely customizable checkout." -"Required PayPal Settings","Required PayPal Settings" -"Website Payments Pro and Express Checkout","Website Payments Pro and Express Checkout" -"Enable this Solution","Enable this Solution" -"Advertise Bill Me Later","Advertise Bill Me Later" -" - Why Advertise Financing?
- Give your sales a boost when you advertise financing.
PayPal helps turn browsers into buyers with financing - from Bill Me Later®. Your customers have more time to pay, while you get paid up front – at no additional cost to you. - Use PayPal’s free banner ads that let you advertise Bill Me Later® financing as a payment option when your customers check out with PayPal. - The PayPal Advertising Program has been shown to generate additional purchases as well as increase consumer's average purchase sizes by 15% - or more. See Details. - "," - Why Advertise Financing?
- Give your sales a boost when you advertise financing.
PayPal helps turn browsers into buyers with financing - from Bill Me Later®. Your customers have more time to pay, while you get paid up front – at no additional cost to you. - Use PayPal’s free banner ads that let you advertise Bill Me Later® financing as a payment option when your customers check out with PayPal. - The PayPal Advertising Program has been shown to generate additional purchases as well as increase consumer's average purchase sizes by 15% - or more. See Details. - " -"Home Page","Home Page" -"Catalog Category Page","Catalog Category Page" -"Catalog Product Page","Catalog Product Page" -"Checkout Cart Page","Checkout Cart Page" -"Basic Settings - PayPal Website Payments Pro","Basic Settings - PayPal Website Payments Pro" -"It is recommended to set this value to ""Debit or Credit Card"" per store views.","It is recommended to set this value to ""Debit or Credit Card"" per store views." -"Credit Card Settings","Credit Card Settings" -"Allowed Credit Card Types","Allowed Credit Card Types" -" - 3D Secure validation is required for Maestro cards. Supporting of American Express cards require additional agreement. Learn more at http://www.paypal.com/amexupdate. - "," - 3D Secure validation is required for Maestro cards. Supporting of American Express cards require additional agreement. Learn more at http://www.paypal.com/amexupdate. - " -"Payment Applicable From","Payment Applicable From" -"Countries Payment Applicable From","Countries Payment Applicable From" -"Enable SSL verification","Enable SSL verification" -"Transfer Cart Line Items","Transfer Cart Line Items" -"Require CVV Entry","Require CVV Entry" -"Centinel Custom API URL","Centinel Custom API URL" -"If empty, a default value will be used. Custom URL may be provided by CardinalCommerce agreement.","If empty, a default value will be used. Custom URL may be provided by CardinalCommerce agreement." -"PayPal Billing Agreement Settings","PayPal Billing Agreement Settings" -"Settlement Report Settings","Settlement Report Settings" -"Frontend Experience Settings","Frontend Experience Settings" -"Basic Settings - PayPal Express Checkout","Basic Settings - PayPal Express Checkout" -"Website Payments Standard","Website Payments Standard" -"Accept credit card and PayPal payments securely.","Accept credit card and PayPal payments securely." -"Basic Settings - PayPal Website Payments Standard","Basic Settings - PayPal Website Payments Standard" -"It is recommended to set this value to ""PayPal"" per store views.","It is recommended to set this value to ""PayPal"" per store views." -"Summary Text for Aggregated Cart","Summary Text for Aggregated Cart" -"Uses store frontend name by default.","Uses store frontend name by default." -"Payflow Pro","Payflow Pro" -"Connect your merchant account with a fully customizable gateway that lets customers pay without leaving your site.","Connect your merchant account with a fully customizable gateway that lets customers pay without leaving your site." -Partner,Partner -Vendor,Vendor -"Use Proxy","Use Proxy" -"Proxy Host","Proxy Host" -"Proxy Port","Proxy Port" -"Basic Settings - PayPal Payflow Pro","Basic Settings - PayPal Payflow Pro" -" - Supporting of American Express cards require additional agreement. Learn more at http://www.paypal.com/amexupdate. - "," - Supporting of American Express cards require additional agreement. Learn more at http://www.paypal.com/amexupdate. - " -"Severe validation removes chargeback liability on merchant.","Severe validation removes chargeback liability on merchant." -"A value is required for live mode. Refer to your CardinalCommerce agreement.","A value is required for live mode. Refer to your CardinalCommerce agreement." -"Payflow Link (Includes Express Checkout)","Payflow Link (Includes Express Checkout)" -"Connect your merchant account with a PCI-compliant gateway that lets customers pay without leaving your site.","Connect your merchant account with a PCI-compliant gateway that lets customers pay without leaving your site." -"Payflow Link and Express Checkout","Payflow Link and Express Checkout" -"Email Associated with PayPal Merchant Account (Optional)","Email Associated with PayPal Merchant Account (Optional)" -"If you do not have multiple users set up on your account, please re-enter your Vendor/Merchant Login here.","If you do not have multiple users set up on your account, please re-enter your Vendor/Merchant Login here." -"Enable Payflow Link","Enable Payflow Link" -"Enable Express Checkout","Enable Express Checkout" -" - Why Advertise Financing?
- Give your sales a boost when you advertise financing.
PayPal helps turn browsers into buyers with financing - from Bill Me Later®. Your customers have more time to pay, while you get paid up front – at no additional cost to you. - Use PayPal’s free banner ads that let you advertise Bill Me Later® financing as a payment option when your customers check out with PayPal. - The PayPal Advertising Program has been shown to generate additional purchases as well as increase consumer's average purchase sizes by 15% - or more. See Details. - "," - Why Advertise Financing?
- Give your sales a boost when you advertise financing.
PayPal helps turn browsers into buyers with financing - from Bill Me Later®. Your customers have more time to pay, while you get paid up front – at no additional cost to you. - Use PayPal’s free banner ads that let you advertise Bill Me Later® financing as a payment option when your customers check out with PayPal. - The PayPal Advertising Program has been shown to generate additional purchases as well as increase consumer's average purchase sizes by 15% - or more. See Details. - " -"Basic Settings - PayPal Payflow Link","Basic Settings - PayPal Payflow Link" -"CVV Entry is Editable","CVV Entry is Editable" -"Send Email Confirmation","Send Email Confirmation" -"URL method for Cancel URL and Return URL","URL method for Cancel URL and Return URL" -"Express Checkout","Express Checkout" -"Add PayPal as an additional payment method to your checkout page.","Add PayPal as an additional payment method to your checkout page." -"Email Associated with PayPal Merchant Account","Email Associated with PayPal Merchant Account" -" - Start accepting payments via PayPal! - "," - Start accepting payments via PayPal! - " -"Don't have a PayPal account? Simply enter your email address.","Don't have a PayPal account? Simply enter your email address." -"API Authentication Methods","API Authentication Methods" -"API Username","API Username" -"API Password","API Password" -"Get Credentials from PayPal","Get Credentials from PayPal" -"Sandbox Credentials","Sandbox Credentials" -"API Uses Proxy","API Uses Proxy" -"Enable Bill Me Later","Enable Bill Me Later" -"PayPal Express Checkout lets you give customers access to financing through Bill Me Later® - at no additional cost to you. - You get paid up front, even though customers have more time to pay. A pre-integrated payment button lets customers pay quickly with Bill Me Later®. - Learn More - ","PayPal Express Checkout lets you give customers access to financing through Bill Me Later® - at no additional cost to you. - You get paid up front, even though customers have more time to pay. A pre-integrated payment button lets customers pay quickly with Bill Me Later®. - Learn More - " -"Publisher ID","Publisher ID" -"Required to display a banner","Required to display a banner" -"Get Publisher ID from PayPal","Get Publisher ID from PayPal" -"It is recommended to set this value to ""Magento_Paypal"" per store views.","It is recommended to set this value to ""Magento_Paypal"" per store views." -"Shortcut on Shopping Cart","Shortcut on Shopping Cart" -"Also affects mini-shopping cart.","Also affects mini-shopping cart." -"Shortcut on Product View","Shortcut on Product View" -"Authorization Honor Period (days)","Authorization Honor Period (days)" -"Specifies what the Authorization Honor Period is on the merchant’s PayPal account. It must mirror the setting in PayPal.","Specifies what the Authorization Honor Period is on the merchant’s PayPal account. It must mirror the setting in PayPal." -"Order Valid Period (days)","Order Valid Period (days)" -"Specifies what the Order Valid Period is on the merchant’s PayPal account. It must mirror the setting in PayPal.","Specifies what the Order Valid Period is on the merchant’s PayPal account. It must mirror the setting in PayPal." -"Number of Child Authorizations","Number of Child Authorizations" -"The default number of child authorizations in your PayPal account is 1. To do multiple authorizations please contact PayPal to request an increase.","The default number of child authorizations in your PayPal account is 1. To do multiple authorizations please contact PayPal to request an increase." -"Transfer Shipping Options","Transfer Shipping Options" -"If this option is enabled, customer can change shipping address and shipping method on PayPal website. In live mode works via HTTPS protocol only.","If this option is enabled, customer can change shipping address and shipping method on PayPal website. In live mode works via HTTPS protocol only." -"Notice that PayPal can handle up to 10 shipping options. That is why Magento will transfer only first 10 cheapest shipping options if there are more than 10 available.","Notice that PayPal can handle up to 10 shipping options. That is why Magento will transfer only first 10 cheapest shipping options if there are more than 10 available." -"Shortcut Buttons Flavor","Shortcut Buttons Flavor" -"Enable PayPal Guest Checkout","Enable PayPal Guest Checkout" -"Ability for buyer to purchase without PayPal account.","Ability for buyer to purchase without PayPal account." -"Require Customer's Billing Address","Require Customer's Billing Address" -"This feature needs be enabled first for the merchant account through PayPal technical support.","This feature needs be enabled first for the merchant account through PayPal technical support." -"Billing Agreement Signup","Billing Agreement Signup" -"Whether to create a billing agreement, if there are no active billing agreements available.","Whether to create a billing agreement, if there are no active billing agreements available." -" - Merchants need to apply to PayPal for enabling billing agreements feature. Do not enable this option until PayPal confirms that billing agreements are enabled for your merchant account. - "," - Merchants need to apply to PayPal for enabling billing agreements feature. Do not enable this option until PayPal confirms that billing agreements are enabled for your merchant account. - " -"Skip Order Review Step","Skip Order Review Step" -" - Will appear as a payment option only for customers who have at least one active billing agreement. - "," - Will appear as a payment option only for customers who have at least one active billing agreement. - " -"Allow in Billing Agreement Wizard","Allow in Billing Agreement Wizard" -"SFTP Credentials","SFTP Credentials" -"Custom Endpoint Hostname or IP-Address","Custom Endpoint Hostname or IP-Address" -"By default it is ""reports.paypal.com"".","By default it is ""reports.paypal.com""." -"Use colon to specify port. For example: ""test.example.com:5224"".","Use colon to specify port. For example: ""test.example.com:5224""." -"Custom Path","Custom Path" -"Scheduled Fetching","Scheduled Fetching" -"Enable Automatic Fetching","Enable Automatic Fetching" -"PayPal retains reports for 45 days.","PayPal retains reports for 45 days." -"Time of Day","Time of Day" -"PayPal Product Logo","PayPal Product Logo" -"Displays on catalog pages and homepage.","Displays on catalog pages and homepage." -"PayPal Merchant Pages Style","PayPal Merchant Pages Style" -"Page Style","Page Style" -" - Allowable values: ""paypal"", ""primary"" (default), your_custom_value (a custom payment page style from your merchant account profile). - "," - Allowable values: ""paypal"", ""primary"" (default), your_custom_value (a custom payment page style from your merchant account profile). - " -"Header Image URL","Header Image URL" -" - The image at the top left of the checkout page. Max size is 750x90-pixel. https is highly encouraged. - "," - The image at the top left of the checkout page. Max size is 750x90-pixel. https is highly encouraged. - " -"Header Background Color","Header Background Color" -" - The background color for the header of the checkout page. Case-insensitive six-character HTML hexadecimal color code in ASCII. - "," - The background color for the header of the checkout page. Case-insensitive six-character HTML hexadecimal color code in ASCII. - " -"Header Border Color","Header Border Color" -"2-pixel perimeter around the header space.","2-pixel perimeter around the header space." -"Page Background Color","Page Background Color" -" - The background color for the checkout page around the header and payment form. - "," - The background color for the checkout page around the header and payment form. - " -"Website Payments Pro Hosted Solution","Website Payments Pro Hosted Solution" -"Accept payments with a PCI compliant checkout that keeps customers on your site.","Accept payments with a PCI compliant checkout that keeps customers on your site." -"Payments Pro Hosted Solution","Payments Pro Hosted Solution" -" - Why Advertise Financing?
- Give your sales a boost when you advertise financing.
PayPal helps turn browsers into buyers with financing - from Bill Me Later®. Your customers have more time to pay, while you get paid up front – at no additional cost to you. - Use PayPal’s free banner ads that let you advertise Bill Me Later® financing as a payment option when your customers check out with PayPal. - The PayPal Advertising Program has been shown to generate additional purchases as well as increase consumer's average purchase sizes by 15% - or more. See Details. - "," - Why Advertise Financing?
- Give your sales a boost when you advertise financing.
PayPal helps turn browsers into buyers with financing - from Bill Me Later®. Your customers have more time to pay, while you get paid up front – at no additional cost to you. - Use PayPal’s free banner ads that let you advertise Bill Me Later® financing as a payment option when your customers check out with PayPal. - The PayPal Advertising Program has been shown to generate additional purchases as well as increase consumer's average purchase sizes by 15% - or more. See Details. - " -"Basic Settings - PayPal Payments Pro Hosted Solution","Basic Settings - PayPal Payments Pro Hosted Solution" -"Display Express Checkout in the Payment Information step","Display Express Checkout in the Payment Information step" -" - PayPal All-in-One Payment Solutions  Accept and process credit cards and PayPal payments. - "," - PayPal All-in-One Payment Solutions  Accept and process credit cards and PayPal payments. - " -"Choose a secure bundled payment solution for your business.","Choose a secure bundled payment solution for your business." -"PayPal Express Checkout","PayPal Express Checkout" -"Add another payment method to your existing solution or as a stand-alone option.","Add another payment method to your existing solution or as a stand-alone option." -"Payments Advanced (Includes Express Checkout)","Payments Advanced (Includes Express Checkout)" -"Accept payments with a PCI-compliant checkout that keeps customers on your site.","Accept payments with a PCI-compliant checkout that keeps customers on your site." -"Payments Advanced and Express Checkout","Payments Advanced and Express Checkout" -"PayPal recommends that you set up an additional User on your account at manager.paypal.com","PayPal recommends that you set up an additional User on your account at manager.paypal.com" -"PayPal recommends you set up an additional User on your account at manager.paypal.com, instead of entering your admin username and password here. This will enhance your security and prevent service interruptions if you later change your password. If you do not want to set up an additional User, you can re-enter your Merchant Login here.","PayPal recommends you set up an additional User on your account at manager.paypal.com, instead of entering your admin username and password here. This will enhance your security and prevent service interruptions if you later change your password. If you do not want to set up an additional User, you can re-enter your Merchant Login here." -" - Why Advertise Financing?
- Give your sales a boost when you advertise financing.
PayPal helps turn browsers into buyers with financing - from Bill Me Later®. Your customers have more time to pay, while you get paid up front – at no additional cost to you. - Use PayPal’s free banner ads that let you advertise Bill Me Later® financing as a payment option when your customers check out with PayPal. - The PayPal Advertising Program has been shown to generate additional purchases as well as increase consumer's average purchase sizes by 15% - or more. See Details. - "," - Why Advertise Financing?
- Give your sales a boost when you advertise financing.
PayPal helps turn browsers into buyers with financing - from Bill Me Later®. Your customers have more time to pay, while you get paid up front – at no additional cost to you. - Use PayPal’s free banner ads that let you advertise Bill Me Later® financing as a payment option when your customers check out with PayPal. - The PayPal Advertising Program has been shown to generate additional purchases as well as increase consumer's average purchase sizes by 15% - or more. See Details. - " -"Basic Settings - PayPal Payments Advanced","Basic Settings - PayPal Payments Advanced" -"Payments Pro (Includes Express Checkout)","Payments Pro (Includes Express Checkout)" -"Payments Pro and Express Checkout","Payments Pro and Express Checkout" -"Basic Settings - PayPal Payments Pro","Basic Settings - PayPal Payments Pro" -"Payments Standard","Payments Standard" -"Basic Settings - PayPal Payments Standard","Basic Settings - PayPal Payments Standard" -"PayPal Payment Gateways","PayPal Payment Gateways" -"Process payments using your own internet merchant account.","Process payments using your own internet merchant account." -"Payflow Pro (Includes Express Checkout)","Payflow Pro (Includes Express Checkout)" -"Payflow Pro and Express Checkout","Payflow Pro and Express Checkout" -" - Why Advertise Financing?
- Give your sales a boost when you advertise financing.
PayPal helps turn browsers into buyers with financing - from Bill Me Later®. Your customers have more time to pay, while you get paid up front – at no additional cost to you. - Use PayPal’s free banner ads that let you advertise Bill Me Later® financing as a payment option when your customers check out with PayPal. - The PayPal Advertising Program has been shown to generate additional purchases as well as increase consumer's average purchase sizes by 15% - or more. See Details. - "," - Why Advertise Financing?
- Give your sales a boost when you advertise financing.
PayPal helps turn browsers into buyers with financing - from Bill Me Later®. Your customers have more time to pay, while you get paid up front – at no additional cost to you. - Use PayPal’s free banner ads that let you advertise Bill Me Later® financing as a payment option when your customers check out with PayPal. - The PayPal Advertising Program has been shown to generate additional purchases as well as increase consumer's average purchase sizes by 15% - or more. See Details. - " -"Accept credit cards, debit cards and PayPal payments securely.","Accept credit cards, debit cards and PayPal payments securely." -"Accept payments with a completely customizable checkout page.","Accept payments with a completely customizable checkout page." -"Website Payments Pro Hosted Solution (Includes Express Checkout)","Website Payments Pro Hosted Solution (Includes Express Checkout)" -"Website Payments Pro Hosted Solution and Express Checkout","Website Payments Pro Hosted Solution and Express Checkout" -"Basic Settings - PayPal Website Payments Pro Hosted Solution","Basic Settings - PayPal Website Payments Pro Hosted Solution" -"PayPal Payment Solutions","PayPal Payment Solutions" diff --git a/app/code/Magento/Paypal/i18n/zh_CN.csv b/app/code/Magento/Paypal/i18n/zh_CN.csv deleted file mode 100644 index b7589a8ab15a2..0000000000000 --- a/app/code/Magento/Paypal/i18n/zh_CN.csv +++ /dev/null @@ -1,692 +0,0 @@ -Custom,自定义 -Close,Close -Cancel,Cancel -Back,Back -Price,价格 -ID,ID -Configure,Configure -No,否 -Qty,Qty -Subtotal,小计 -"Incl. Tax","Incl. Tax" -Edit,Edit -"--Please Select--","--Please Select--" -Customer,Customer -"First Name","First Name" -"Last Name","Last Name" -Email,Email -"-- Please Select --","-- Please Select --" -Yes,是 -Status,Status -Enabled,Enabled -"Sort Order","Sort Order" -Title,Title -"Are you sure you want to do this?","Are you sure you want to do this?" -Order,订单 -View,查看 -Active,Active -Position,Position -Dynamic,动态 -N/A,N/A -Canceled,Canceled -"General Information","General Information" -Static,静态 -"Advanced Settings","Advanced Settings" -"Learn More",了解更多 -"Start Date","Start Date" -"Product Name","Product Name" -"3D Secure Card Validation","3D Secure Card Validation" -"Merchant Liability",商家责任 -"Billing Information","Billing Information" -"Shipping Information","Shipping Information" -"Shipping Method",运送方式 -"Please agree to all the terms and conditions before placing the order.",请在下订单前同意所有的条款和条件。 -"Account confirmation is required. Please, check your e-mail for confirmation link. To resend confirmation email please click here.","Account confirmation is required. Please, check your e-mail for confirmation link. To resend confirmation email please click here." -Password,Password -Continue,Continue -"Order #","Order #" -Login,Login -"Shipping Address",送货地址 -"Payment Method","Payment Method" -"Place Order",下订单 -"Sorry, no quotes are available for this order at this time.",抱歉,当前该订单中没有报价可用。 -Sales,销售 -Created,Created -Display,Display -User,User -Daily,每天 -Date,Date -"Order Total","Order Total" -Never,永不 -Updated,Updated -Reports,报告 -"Order Status","Order Status" -"View Order","View Order" -Event,事件 -"Please Select","Please Select" -"Submitting order information...",正在提交订单信息... -Authorization,授权 -"You notified customer about invoice #%1.","You notified customer about invoice #%1." -"Note: %1","Note: %1" -"IPN ""%1""","IPN ""%1""" -"Billing Agreements",记账协议 -"Reference ID","Reference ID" -"Billing Agreement #%1","Billing Agreement #%1" -"Related Orders","Related Orders" -"Billing Agreement View",记账协议视图 -"View Transaction Details",查看交易详情 -"Reference Information",参考信息 -"Transaction Information",交易信息 -"PayPal Fee Information",PayPal费用信息 -"PayPal Settlement Reports",PayPal处理报告 -"We are connecting to the PayPal SFTP server to retrieve new reports. Are you sure you want to continue?","We are connecting to the PayPal SFTP server to retrieve new reports. Are you sure you want to continue?" -"Fetch Updates",获取更新 -button_label,button_label -sandbox_button_label,sandbox_button_label -Help,帮助 -"There is already another PayPal solution enabled. Enable this solution instead?","There is already another PayPal solution enabled. Enable this solution instead?" -"The following error(s) occured:","The following error(s) occured:" -"Some PayPal solutions conflict.","Some PayPal solutions conflict." -"PayPal Express Checkout is not enabled.","PayPal Express Checkout is not enabled." -"Please re-enable the previously enabled payment solutions.","Please re-enable the previously enabled payment solutions." -"View Demo",查看演示 -"See terms","See terms" -"You will be redirected to the PayPal website.",您将被重定向到PayPal网站。 -"Would you like to sign a billing agreement ' 'to streamline further purchases with PayPal?","Would you like to sign a billing agreement ' 'to streamline further purchases with PayPal?" -"You will be redirected to the PayPal website when you place an order.",在您下单时,您会被重定向到PayPal网站。 -"Click here if you are not redirected within 10 seconds.","Click here if you are not redirected within 10 seconds." -"You will be redirected to the PayPal website in a few seconds.",几秒钟后,您将被重定向到PayPal网站。 -"You canceled the billing agreement.","You canceled the billing agreement." -"We could not cancel the billing agreement.","We could not cancel the billing agreement." -"You deleted the billing agreement.","You deleted the billing agreement." -"We could not delete the billing agreement.","We could not delete the billing agreement." -"Please specify the correct billing agreement ID and try again.","Please specify the correct billing agreement ID and try again." -"View Transaction",查看交易 -"We found nothing to fetch because of an empty configuration.","We found nothing to fetch because of an empty configuration." -"We fetched %1 report rows from '%2@%3'.","We fetched %1 report rows from '%2@%3'." -"We couldn't fetch reports from '%1@%2'.","We couldn't fetch reports from '%1@%2'." -"Billing Agreement # %1","Billing Agreement # %1" -"We couldn't start the billing agreement wizard.","We couldn't start the billing agreement wizard." -"The billing agreement ""%1"" has been created.","The billing agreement ""%1"" has been created." -"We couldn't finish the billing agreement wizard.","We couldn't finish the billing agreement wizard." -"The billing agreement ""%1"" has been canceled.","The billing agreement ""%1"" has been canceled." -"We couldn't cancel the billing agreement.","We couldn't cancel the billing agreement." -"To proceed to Checkout, please log in using your email address.","To proceed to Checkout, please log in using your email address." -"We can't start Express Checkout.","We can't start Express Checkout." -"Express Checkout and Order have been canceled.",快速结账且订单已取消。 -"Express Checkout has been canceled.",快速结账已被取消。 -"Unable to cancel Express Checkout","Unable to cancel Express Checkout" -"We can't process Express Checkout approval.","We can't process Express Checkout approval." -"We can't initialize Express Checkout review.","We can't initialize Express Checkout review." -"We can't update shipping method.","We can't update shipping method." -"We can't place the order.","We can't place the order." -"We can't initialize Express Checkout.","We can't initialize Express Checkout." -"PayPal Express Checkout Token does not exist.",PayPal快速结账令牌不存在。 -"A wrong PayPal Express Checkout Token is specified.","A wrong PayPal Express Checkout Token is specified." -"Your payment has been declined. Please try again.","Your payment has been declined. Please try again." -"We can't contact the PayPal gateway.","We can't contact the PayPal gateway." -"PayPal response hasn't required fields.",PayPal的响应缺少必须字段。 -"Something went wrong while processing your order.","Something went wrong while processing your order." -"PayPal gateway has rejected request. %1","PayPal gateway has rejected request. %1" -"PayPal gateway rejected the request. %1","PayPal gateway rejected the request. %1" -"I'm sorry - but we were not able to process your payment. Please try another payment method or contact us so we can assist you.","I'm sorry - but we were not able to process your payment. Please try another payment method or contact us so we can assist you." -"I'm sorry - but we are not able to complete your transaction. Please contact us so we can assist you.","I'm sorry - but we are not able to complete your transaction. Please contact us so we can assist you." -"The payment method code is not set.","The payment method code is not set." -"The reference ID is not set.","The reference ID is not set." -"Unable to save Billing Agreement:",无法保存记账协议: -"The customer ID is not set.","The customer ID is not set." -"The Billing Agreement status is not set.","The Billing Agreement status is not set." -"The PayPal certificate does not exist.","The PayPal certificate does not exist." -"We prefer PayPal (150 X 60)",我们喜欢PayPal(150X60) -"We prefer PayPal (150 X 40)",我们喜欢PayPal(150X40) -"Now accepting PayPal (150 X 60)",现在接受PayPal(150X60) -"Now accepting PayPal (150 X 40)",现在接受PayPal(150X40) -"Payments by PayPal (150 X 60)",用PayPal付款(150X60) -"Payments by PayPal (150 X 40)",用PayPal付款(150X40) -"Shop now using (150 X 60)",立刻购物并使用(150X60) -"Shop now using (150 X 40)",立刻购物并使用(150X40) -Shortcut,快捷方式 -"Acceptance Mark Image",接受标志图片 -Sale,销售 -"For Virtual Quotes Only",仅用于虚拟产品 -Auto,自动 -"Ask Customer",询问顾客 -"IPN (Instant Payment Notification) Only","IPN (Instant Payment Notification) Only" -"API Signature",API签名 -"API Certificate",API证书 -"The ordering amount of %1 is pending approval on the payment gateway.","The ordering amount of %1 is pending approval on the payment gateway." -"Ordered amount of %1","Ordered amount of %1" -"We'll authorize the amount of %1 as soon as the payment gateway approves it.","We'll authorize the amount of %1 as soon as the payment gateway approves it." -"The authorized amount is %1.","The authorized amount is %1." -"The maximum number of child authorizations is reached.",授权子帐户的最大数量已达到。 -"PayPal can't process orders with a zero balance due. ' 'To finish your purchase, please go through the standard checkout process.","PayPal can't process orders with a zero balance due. ' 'To finish your purchase, please go through the standard checkout process." -"Payer is not identified.",付款者未经检定。 -"Last Transaction ID",最新交易ID -"This customer did not include a confirmed address.","This customer did not include a confirmed address." -"The payment is authorized but not settled.",支付已获授权但尚未确定。 -"The payment eCheck is not yet cleared.",支付的电子支票尚未兑现。 -"The merchant holds a non-U.S. account and does not have a withdrawal mechanism.","The merchant holds a non-U.S. account and does not have a withdrawal mechanism." -"The payment currency does not match any of the merchant's balances currency.","The payment currency does not match any of the merchant's balances currency." -"The payment is pending while it is being reviewed by PayPal for risk.",支付被挂起,因为正在由PayPal进行风险评估。 -"The payment is pending because it was made to an email address that is not yet registered or confirmed.",支付被挂起,因为支付使用了一个未经确认的电子邮件地址。 -"The merchant account is not yet verified.",银行帐户尚未验证。 -"The payment was made via credit card. In order to receive funds merchant must upgrade account to Business or Premier status.",支付是通过信用卡进行的。为了收到资金,银行必须将帐户升级为商业或白金状态。 -"Sorry, but something went wrong. Please contact PayPal customer service.","Sorry, but something went wrong. Please contact PayPal customer service." -"A reversal has occurred on this transaction due to a chargeback by your customer.","A reversal has occurred on this transaction due to a chargeback by your customer." -"A reversal has occurred on this transaction due to your customer triggering a money-back guarantee.","A reversal has occurred on this transaction due to your customer triggering a money-back guarantee." -"A reversal has occurred on this transaction due to a complaint about the transaction from your customer.","A reversal has occurred on this transaction due to a complaint about the transaction from your customer." -"A reversal has occurred on this transaction because you have given the customer a refund.","A reversal has occurred on this transaction because you have given the customer a refund." -"Reversal of an adjustment.",调整撤销 -"Transaction reversal due to fraud detected by PayPal administrators.","Transaction reversal due to fraud detected by PayPal administrators." -"Transaction reversal by PayPal administrators.","Transaction reversal by PayPal administrators." -"Reimbursement for a chargeback.",偿还退款。 -"Settlement of a chargeback.",处理返款。 -"A reversal has occurred on this transaction because of a customer dispute suspecting unauthorized spoof.","A reversal has occurred on this transaction because of a customer dispute suspecting unauthorized spoof." -"Buyer claims that he did not receive goods or service.","Buyer claims that he did not receive goods or service." -"Buyer claims that the goods or service received differ from merchant’s description of the goods or service.","Buyer claims that the goods or service received differ from merchant’s description of the goods or service." -"Buyer claims that he/she did not authorize transaction.","Buyer claims that he/she did not authorize transaction." -"A case that has been resolved and close requires a reimbursement.","A case that has been resolved and close requires a reimbursement." -"Buyer claims that a possible duplicate payment was made to the merchant.","Buyer claims that a possible duplicate payment was made to the merchant." -"Buyer claims that the received merchandise is unsatisfactory, defective, or damaged.","Buyer claims that the received merchandise is unsatisfactory, defective, or damaged." -"Unknown reason. Please contact PayPal customer service.",未知原因。请联系PayPal客户服务。 -"Payer ID",付款者ID -"Payer Email",付款者邮件地址 -"Payer Status",付款者状态 -"Payer Address ID",付款者地址ID -"Payer Address Status",付款者地址状态 -"Merchant Protection Eligibility",银行保护的资格 -"Triggered Fraud Filters",触发的欺诈筛选器 -"Last Correlation ID",最新关联ID -"Address Verification System Response",地址验证系统响应 -"CVV2 Check Result by PayPal",PayPal的CVV2检查结果 -"Buyer's Tax ID","买家的纳税人 ID" -"Buyer's Tax ID Type","买家的纳税人 ID 类型" -"PayPal/Centinel Visa Payer Authentication Service Result","PayPal/Centinel Visa付款者验证服务结果" -"PayPal/Centinel Electronic Commerce Indicator","PayPal/Centinel Electronic Commerce指示器" -Chargeback,退款 -Complaint,Complaint -Dispute,Dispute -"Matched Address only (no ZIP)",只匹配地址(无邮编) -"Matched Address only (no ZIP) International","Matched Address only (no ZIP) International" -"No Details matched",无匹配资料 -"No Details matched. International",无匹配资料。国际化 -"Exact Match. Address and nine-digit ZIP code",完全匹配,地址和九位邮编 -"Exact Match. Address and Postal Code. International",完全匹配。地址和邮编。国际 -"Exact Match. Address and Postal Code. UK-specific",完全匹配。地址和邮编。仅限英国 -"N/A. Not allowed for MOTO (Internet/Phone) transactions","N/A. 不允许MOTO(网络,手机厂商)交易" -"N/A. Global Unavailable",N/A.全球不可用 -"N/A. International Unavailable","N/A. 国际不可用" -"Matched five-digit ZIP only (no Address)",只匹配五位邮编(无地址) -"Matched Postal Code only (no Address)",只匹配邮编(无地址) -"N/A. Retry","N/A. 重试" -"N/A. Service not Supported","N/A. 不支持的服务" -"N/A. Unavailable","N/A. 不可用" -"Matched whole nine-didgit ZIP (no Address)",只匹配九位邮编(无地址) -"Yes. Matched Address and five-didgit ZIP",是的,匹配地址与五位邮编 -"All the address information matched",所有地址信息都匹配 -"None of the address information matched",无匹配地址信息 -"Part of the address information matched",地址信息中部分匹配 -"N/A. The merchant did not provide AVS information","N/A. 商家未提供AVS信息。" -"N/A. Address not checked, or acquirer had no response. Service not available",N/A。地址未检查,或对方行未响应。服务不可用 -"Matched (CVV2CSC)",匹配(CVV2CSC) -"No match",无匹配结果 -"N/A. Not processed","N/A. 未处理" -"N/A. Service not supported",N/A。服务不支持 -"N/A. Service not available","N/A. 服务不可用" -"N/A. No response","N/A. 没有响应" -"Matched (CVV2)",匹配(CVV2) -"N/A. The merchant has not implemented CVV2 code handling","N/A. 商家未完成CVV2码的处理" -"N/A. Merchant has indicated that CVV2 is not present on card","N/A. 商家指出信用卡缺少CVV2码" -"Authenticated, Good Result",已身份验证,结果正常 -"Authenticated, Bad Result",已身份验证,结果有误 -"Attempted Authentication, Good Result",尝试身份验证,结果正常 -"Attempted Authentication, Bad Result",尝试身份验证,结果有误 -"No Liability Shift",无责任转移 -"Issuer Liability",发卡人责任 -CNPJ,CNPJ -CPF,CPF -"IPN ""%1"". Case type ""%2"". Case ID ""%3"" %4","IPN ""%1"". Case type ""%2"". Case ID ""%3"" %4" -"IPN ""%1"". A dispute has been resolved and closed. %2 Transaction amount %3.","IPN ""%1"". A dispute has been resolved and closed. %2 Transaction amount %3." -"IPN ""%1"". %2 Transaction amount %3. Transaction ID: ""%4""","IPN ""%1"". %2 Transaction amount %3. Transaction ID: ""%4""" -"You notified customer about creditmemo #%1.","You notified customer about creditmemo #%1." -"Created billing agreement #%1.","Created billing agreement #%1." -"We couldn't create a billing agreement for this order.","We couldn't create a billing agreement for this order." -"Payflow PNREF: #%1.","Payflow PNREF: #%1." -"Fetch transaction details method does not exists in Payflow","Fetch transaction details method does not exists in Payflow" -"We cannot send the new order email.","We cannot send the new order email." -"You cannot void a verification transaction.","You cannot void a verification transaction." -"Payment transactions disallow storing objects.",支付交易不允许的店铺对象。 -"You need to enter a transaction ID.","You need to enter a transaction ID." -"This operation requires an existing transaction object.",该操作需要一个现有的交易目标。 -"You need an authorization transaction to void.","You need an authorization transaction to void." -"We can't issue a refund transaction because there is no capture transaction.","We can't issue a refund transaction because there is no capture transaction." -"We cannot create a target file for reading reports.","We cannot create a target file for reading reports." -"Report Date",报告日期 -"Merchant Account",银行帐户 -"Transaction ID",交易ID -"Invoice ID",发票ID -"PayPal Reference ID",PayPal推荐ID -"PayPal Reference ID Type",PayPal推荐ID类型 -"Event Code",事件代码 -"Finish Date","Finish Date" -"Debit or Credit",借记卡或信用卡 -"Gross Amount",总额 -"Fee Debit or Credit",借记卡或信用卡费用 -"Fee Amount",费率 -"Order ID","订单 ID" -"Subscription ID",订阅ID -"Preapproved Payment ID",预审核的支付ID -Credit,信用 -Debit,借记 -"General: received payment of a type not belonging to the other T00xx categories",常规:一种不属于其他T00xx分类的支付收款 -"Mass Pay Payment",大量付款支付。 -"Subscription Payment, either payment sent or payment received",订阅支付,可通过发出或收到的付款进行 -"Preapproved Payment (BillUser API), either sent or received","预审核接收或发送的支付(BillUser API)" -"eBay Auction Payment",eBay拍卖付款 -"Direct Payment API",直接支付API -"Express Checkout APIs",快速结账API -"Website Payments Standard Payment",网站支付标准版付款 -"Postage Payment to either USPS or UPS",USPS或UPS的运费 -"Gift Certificate Payment: purchase of Gift Certificate",礼品券支付:购买礼品券 -"Auction Payment other than through eBay",eBay之外的其他拍卖支付 -"Mobile Payment (made via a mobile phone)",移动支付(通过手机进行) -"Virtual Terminal Payment",虚拟终端支付 -"General: non-payment fee of a type not belonging to the other T01xx categories",常规:一种不属于其他T01xx分类的非支付费用 -"Fee: Web Site Payments Pro Account Monthly",费用:专业帐户月度网站支付 -"Fee: Foreign ACH Withdrawal",费用:外国ACH撤销 -"Fee: WorldLink Check Withdrawal",费用:WorldLink支票撤销 -"Fee: Mass Pay Request",费用:批量付款请求 -"General Currency Conversion",常规货币转换 -"User-initiated Currency Conversion",用户发起的货币转换 -"Currency Conversion required to cover negative balance",货币转换需要考虑余额负值 -"General Funding of PayPal Account ",PayPal帐户的常规退款 -"PayPal Balance Manager function of PayPal account",PayPal帐户的PayPal余额管理器功能 -"ACH Funding for Funds Recovery from Account Balance",来自帐户余额的返款恢复ACH返款 -"EFT Funding (German banking)",EFT返款(德国银行) -"General Withdrawal from PayPal Account",来自PayPal帐户的常规撤销 -AutoSweep,自动清理 -"General: Use of PayPal account for purchasing as well as receiving payments",常规:使用PayPal帐户进行付款以及收款 -"Virtual PayPal Debit Card Transaction",虚拟PayPal借记卡交易 -"PayPal Debit Card Withdrawal from ATM",从ATM进行PayPal借记卡撤销 -"Hidden Virtual PayPal Debit Card Transaction",隐藏虚拟PayPal借记卡交易 -"PayPal Debit Card Cash Advance",PayPal借记卡预付现金 -"General: Withdrawal from PayPal Account",常规:通过PayPal帐户撤销 -"General (Purchase with a credit card)",常规(使用信用卡购买) -"Negative Balance",逆差 -"General: bonus of a type not belonging to the other T08xx categories",常规:通过一种不再属于其他T08xx类型的奖励 -"Debit Card Cash Back",借记卡返现 -"Merchant Referral Bonus",银行推荐奖励 -"Balance Manager Account Bonus",余额管理器帐户点数 -"PayPal Buyer Warranty Bonus",PayPal买家担保津贴 -"PayPal Protection Bonus",PayPal保护津贴 -"Bonus for first ACH Use",首次使用ACH奖励 -"General Redemption",常规兑换 -"Gift Certificate Redemption",礼品券兑换 -"Points Incentive Redemption",兑换奖励点 -"Coupon Redemption",代金券兑换 -"Reward Voucher Redemption",奖励兑换 -"General. Product no longer supported",常规。产品不在被支持 -"General: reversal of a type not belonging to the other T11xx categories",常规:不属于其他T11xx分类的保留类型 -"ACH Withdrawal",ACH撤销 -"Debit Card Transaction",借记卡交易 -"Reversal of Points Usage",点数使用情况撤销 -"ACH Deposit (Reversal)",ACH保证金(撤销) -"Reversal of General Account Hold",常规帐户保持的撤销 -"Account-to-Account Payment, initiated by PayPal",帐户到帐户支付,由PayPal开创 -"Payment Refund initiated by merchant",由商户发起的支付退款 -"Fee Reversal",撤销手续费 -"Hold for Dispute Investigation",保留做争议调查 -"Reversal of hold for Dispute Investigation",撤销保留的争议调查 -"General: adjustment of a type not belonging to the other T12xx categories",常规:调整为一种不再属于其他T12xx分类的类型 -Reversal,撤销 -Charge-off,收取 -Incentive,奖励 -"Reimbursement of Chargeback",退款的偿还 -"General (Authorization)",常规(身份验证) -Reauthorization,撤销授权 -Void,无效 -"General (Dividend)",常规(利息) -"General: temporary hold of a type not belonging to the other T15xx categories",常规:不属于其他T15xx分类的暂时保留类型 -"Open Authorization",开放授权 -"ACH Deposit (Hold for Dispute or Other Investigation)",ACH保证金(用作保证或其他调查用途) -"Available Balance",可用余额 -Funding,退款 -"General: Withdrawal to Non-Bank Entity",常规:通过非银行实体撤销 -"WorldLink Withdrawal",WorldLink撤销 -"Buyer Credit Payment",买家信用支付 -"General Adjustment without businessrelated event",与业务无关的常规调整 -"General (Funds Transfer from PayPal Account to Another)",常规(从一个PayPal帐户向另一个转移资金) -"Settlement Consolidation",合并处理 -"General: event not yet categorized",常规:事件尚未分类 -"The PayPal certificate file is empty.","The PayPal certificate file is empty." -"Header (center)","Header (center)" -"Sidebar (right)","Sidebar (right)" -"Near Bill Me Later checkout button","Near Bill Me Later checkout button" -"Every 3 days",每3天 -"Every 7 days",每7天 -"Every 10 days",每10天 -"Every 14 days",每14天 -"Every 30 days",每30天 -"Every 40 days",每40天 -"No Logo",没有标示 -"Pending PayPal",挂起的PayPal -"Billing Agreement",记账协议 -"Created At","Created At" -"Updated At","Updated At" -"-- Please Select Billing Agreement--","-- 请选择记账协议 --" -"Not sure what PayPal payment method to use? Click here to learn more.","Not sure what PayPal payment method to use? Click here to learn more." -"Important: ","Important: " -"To use PayPal Payments Advanced, you must configure your PayPal Payments Advanced account on the PayPal website.","To use PayPal Payments Advanced, you must configure your PayPal Payments Advanced account on the PayPal website." -"Once you log into your PayPal Advanced account, navigate to the Service Settings - Hosted Checkout Pages - Set Up menu and set the options described below","Once you log into your PayPal Advanced account, navigate to the Service Settings - Hosted Checkout Pages - Set Up menu and set the options described below" -"To use PayPal Payflow Link, you must configure your PayPal Payflow Link account on the PayPal website.","To use PayPal Payflow Link, you must configure your PayPal Payflow Link account on the PayPal website." -"Once you log into your PayPal Payflow Link account, navigate to the Service Settings - Hosted Checkout Pages - Set Up menu and set the options described below","Once you log into your PayPal Payflow Link account, navigate to the Service Settings - Hosted Checkout Pages - Set Up menu and set the options described below" -"Agreement Information","Agreement Information" -"Reference ID:","Reference ID:" -Status:,Status: -Created:,Created: -Updated:,Updated: -"Payment Method:","Payment Method:" -"Ship To","Ship To" -"Back to Billing Agreements",返回记账协议 -"There are no billing agreements yet.",尚无记账协议。 -"New Billing Agreement",新建记账协议 -"You will be redirected to the payment system website.","You will be redirected to the payment system website." -Create...,Create... -"Your billing agreement # is: %1.","Your billing agreement # is: %1." -"Review Order",查看订单 -"Please select a shipping method...",请选择送货方法... -"Update Shipping Method","Update Shipping Method" -"Edit Payment Information","Edit Payment Information" -"Items in Your Shopping Cart",您购物车中的商品 -"Edit Shopping Cart",编辑购物车 -"Please update order data to get shipping methods and rates",请更新订单数据,获取配送方式和价格 -"Checkout with PayPal",使用PayPal结账 -"Please do not refresh the page until you complete payment.",请不要刷新该页面,直到付款完成。 -"You will be required to enter your payment details after you place an order.",下单后,您需要输入付款详情。 -"Additional Options",其他选项 -"Acceptance Mark",接受标志 -"What is PayPal?",什么是PayPal? -"Sign a billing agreement to streamline further purchases with PayPal.",与PayPal签署记账协议简化后续购买。 -Schedule,Schedule -Size,Size -"Sorry, something went wrong.","Sorry, something went wrong." -"Sorry, something went wrong. Please try again later.","Sorry, something went wrong. Please try again later." -"Test Mode","Test Mode" -"Payment Action","Payment Action" -"3D Secure","3D Secure" -"Severe 3D Secure Card Validation","Severe 3D Secure Card Validation" -"Severe Validation Removes Chargeback Liability on Merchant","Severe Validation Removes Chargeback Liability on Merchant" -"Centinel API URL","Centinel API URL" -"Debug Mode","Debug Mode" -"Sandbox Mode","Sandbox Mode" -1,1 -"Merchant Location","Merchant Location" -"Merchant Country","Merchant Country" -"If not specified, Default Country from General Config will be used","If not specified, Default Country from General Config will be used" -"Website Payments Pro (Includes Express Checkout)","Website Payments Pro (Includes Express Checkout)" -"Accept payments with a completely customizable checkout.","Accept payments with a completely customizable checkout." -"Required PayPal Settings","Required PayPal Settings" -"Website Payments Pro and Express Checkout","Website Payments Pro and Express Checkout" -"Enable this Solution","Enable this Solution" -"Advertise Bill Me Later","Advertise Bill Me Later" -" - Why Advertise Financing?
- Give your sales a boost when you advertise financing.
PayPal helps turn browsers into buyers with financing - from Bill Me Later®. Your customers have more time to pay, while you get paid up front – at no additional cost to you. - Use PayPal’s free banner ads that let you advertise Bill Me Later® financing as a payment option when your customers check out with PayPal. - The PayPal Advertising Program has been shown to generate additional purchases as well as increase consumer's average purchase sizes by 15% - or more. See Details. - "," - Why Advertise Financing?
- Give your sales a boost when you advertise financing.
PayPal helps turn browsers into buyers with financing - from Bill Me Later®. Your customers have more time to pay, while you get paid up front – at no additional cost to you. - Use PayPal’s free banner ads that let you advertise Bill Me Later® financing as a payment option when your customers check out with PayPal. - The PayPal Advertising Program has been shown to generate additional purchases as well as increase consumer's average purchase sizes by 15% - or more. See Details. - " -"Home Page","Home Page" -"Catalog Category Page","Catalog Category Page" -"Catalog Product Page","Catalog Product Page" -"Checkout Cart Page","Checkout Cart Page" -"Basic Settings - PayPal Website Payments Pro","Basic Settings - PayPal Website Payments Pro" -"It is recommended to set this value to ""Debit or Credit Card"" per store views.","It is recommended to set this value to ""Debit or Credit Card"" per store views." -"Credit Card Settings","Credit Card Settings" -"Allowed Credit Card Types","Allowed Credit Card Types" -" - 3D Secure validation is required for Maestro cards. Supporting of American Express cards require additional agreement. Learn more at http://www.paypal.com/amexupdate. - "," - 3D Secure validation is required for Maestro cards. Supporting of American Express cards require additional agreement. Learn more at http://www.paypal.com/amexupdate. - " -"Payment Applicable From","Payment Applicable From" -"Countries Payment Applicable From","Countries Payment Applicable From" -"Enable SSL verification","Enable SSL verification" -"Transfer Cart Line Items","Transfer Cart Line Items" -"Require CVV Entry","Require CVV Entry" -"Centinel Custom API URL","Centinel Custom API URL" -"If empty, a default value will be used. Custom URL may be provided by CardinalCommerce agreement.","If empty, a default value will be used. Custom URL may be provided by CardinalCommerce agreement." -"PayPal Billing Agreement Settings","PayPal Billing Agreement Settings" -"Settlement Report Settings","Settlement Report Settings" -"Frontend Experience Settings","Frontend Experience Settings" -"Basic Settings - PayPal Express Checkout","Basic Settings - PayPal Express Checkout" -"Website Payments Standard","Website Payments Standard" -"Accept credit card and PayPal payments securely.","Accept credit card and PayPal payments securely." -"Basic Settings - PayPal Website Payments Standard","Basic Settings - PayPal Website Payments Standard" -"It is recommended to set this value to ""PayPal"" per store views.","It is recommended to set this value to ""PayPal"" per store views." -"Summary Text for Aggregated Cart","Summary Text for Aggregated Cart" -"Uses store frontend name by default.","Uses store frontend name by default." -"Payflow Pro","Payflow Pro" -"Connect your merchant account with a fully customizable gateway that lets customers pay without leaving your site.","Connect your merchant account with a fully customizable gateway that lets customers pay without leaving your site." -Partner,Partner -Vendor,Vendor -"Use Proxy","Use Proxy" -"Proxy Host","Proxy Host" -"Proxy Port","Proxy Port" -"Basic Settings - PayPal Payflow Pro","Basic Settings - PayPal Payflow Pro" -" - Supporting of American Express cards require additional agreement. Learn more at http://www.paypal.com/amexupdate. - "," - Supporting of American Express cards require additional agreement. Learn more at http://www.paypal.com/amexupdate. - " -"Severe validation removes chargeback liability on merchant.","Severe validation removes chargeback liability on merchant." -"A value is required for live mode. Refer to your CardinalCommerce agreement.","A value is required for live mode. Refer to your CardinalCommerce agreement." -"Payflow Link (Includes Express Checkout)","Payflow Link (Includes Express Checkout)" -"Connect your merchant account with a PCI-compliant gateway that lets customers pay without leaving your site.","Connect your merchant account with a PCI-compliant gateway that lets customers pay without leaving your site." -"Payflow Link and Express Checkout","Payflow Link and Express Checkout" -"Email Associated with PayPal Merchant Account (Optional)","Email Associated with PayPal Merchant Account (Optional)" -"If you do not have multiple users set up on your account, please re-enter your Vendor/Merchant Login here.","If you do not have multiple users set up on your account, please re-enter your Vendor/Merchant Login here." -"Enable Payflow Link","Enable Payflow Link" -"Enable Express Checkout","Enable Express Checkout" -" - Why Advertise Financing?
- Give your sales a boost when you advertise financing.
PayPal helps turn browsers into buyers with financing - from Bill Me Later®. Your customers have more time to pay, while you get paid up front – at no additional cost to you. - Use PayPal’s free banner ads that let you advertise Bill Me Later® financing as a payment option when your customers check out with PayPal. - The PayPal Advertising Program has been shown to generate additional purchases as well as increase consumer's average purchase sizes by 15% - or more. See Details. - "," - Why Advertise Financing?
- Give your sales a boost when you advertise financing.
PayPal helps turn browsers into buyers with financing - from Bill Me Later®. Your customers have more time to pay, while you get paid up front – at no additional cost to you. - Use PayPal’s free banner ads that let you advertise Bill Me Later® financing as a payment option when your customers check out with PayPal. - The PayPal Advertising Program has been shown to generate additional purchases as well as increase consumer's average purchase sizes by 15% - or more. See Details. - " -"Basic Settings - PayPal Payflow Link","Basic Settings - PayPal Payflow Link" -"CVV Entry is Editable","CVV Entry is Editable" -"Send Email Confirmation","Send Email Confirmation" -"URL method for Cancel URL and Return URL","URL method for Cancel URL and Return URL" -"Express Checkout","Express Checkout" -"Add PayPal as an additional payment method to your checkout page.","Add PayPal as an additional payment method to your checkout page." -"Email Associated with PayPal Merchant Account","Email Associated with PayPal Merchant Account" -" - Start accepting payments via PayPal! - "," - Start accepting payments via PayPal! - " -"Don't have a PayPal account? Simply enter your email address.","Don't have a PayPal account? Simply enter your email address." -"API Authentication Methods","API Authentication Methods" -"API Username","API Username" -"API Password","API Password" -"Get Credentials from PayPal","Get Credentials from PayPal" -"Sandbox Credentials","Sandbox Credentials" -"API Uses Proxy","API Uses Proxy" -"Enable Bill Me Later","Enable Bill Me Later" -"PayPal Express Checkout lets you give customers access to financing through Bill Me Later® - at no additional cost to you. - You get paid up front, even though customers have more time to pay. A pre-integrated payment button lets customers pay quickly with Bill Me Later®. - Learn More - ","PayPal Express Checkout lets you give customers access to financing through Bill Me Later® - at no additional cost to you. - You get paid up front, even though customers have more time to pay. A pre-integrated payment button lets customers pay quickly with Bill Me Later®. - Learn More - " -"Publisher ID","Publisher ID" -"Required to display a banner","Required to display a banner" -"Get Publisher ID from PayPal","Get Publisher ID from PayPal" -"It is recommended to set this value to ""Magento_Paypal"" per store views.","It is recommended to set this value to ""Magento_Paypal"" per store views." -"Shortcut on Shopping Cart","Shortcut on Shopping Cart" -"Also affects mini-shopping cart.","Also affects mini-shopping cart." -"Shortcut on Product View","Shortcut on Product View" -"Authorization Honor Period (days)","Authorization Honor Period (days)" -"Specifies what the Authorization Honor Period is on the merchant’s PayPal account. It must mirror the setting in PayPal.","Specifies what the Authorization Honor Period is on the merchant’s PayPal account. It must mirror the setting in PayPal." -"Order Valid Period (days)","Order Valid Period (days)" -"Specifies what the Order Valid Period is on the merchant’s PayPal account. It must mirror the setting in PayPal.","Specifies what the Order Valid Period is on the merchant’s PayPal account. It must mirror the setting in PayPal." -"Number of Child Authorizations","Number of Child Authorizations" -"The default number of child authorizations in your PayPal account is 1. To do multiple authorizations please contact PayPal to request an increase.","The default number of child authorizations in your PayPal account is 1. To do multiple authorizations please contact PayPal to request an increase." -"Transfer Shipping Options","Transfer Shipping Options" -"If this option is enabled, customer can change shipping address and shipping method on PayPal website. In live mode works via HTTPS protocol only.","If this option is enabled, customer can change shipping address and shipping method on PayPal website. In live mode works via HTTPS protocol only." -"Notice that PayPal can handle up to 10 shipping options. That is why Magento will transfer only first 10 cheapest shipping options if there are more than 10 available.","Notice that PayPal can handle up to 10 shipping options. That is why Magento will transfer only first 10 cheapest shipping options if there are more than 10 available." -"Shortcut Buttons Flavor","Shortcut Buttons Flavor" -"Enable PayPal Guest Checkout","Enable PayPal Guest Checkout" -"Ability for buyer to purchase without PayPal account.","Ability for buyer to purchase without PayPal account." -"Require Customer's Billing Address","Require Customer's Billing Address" -"This feature needs be enabled first for the merchant account through PayPal technical support.","This feature needs be enabled first for the merchant account through PayPal technical support." -"Billing Agreement Signup","Billing Agreement Signup" -"Whether to create a billing agreement, if there are no active billing agreements available.","Whether to create a billing agreement, if there are no active billing agreements available." -" - Merchants need to apply to PayPal for enabling billing agreements feature. Do not enable this option until PayPal confirms that billing agreements are enabled for your merchant account. - "," - Merchants need to apply to PayPal for enabling billing agreements feature. Do not enable this option until PayPal confirms that billing agreements are enabled for your merchant account. - " -"Skip Order Review Step","Skip Order Review Step" -" - Will appear as a payment option only for customers who have at least one active billing agreement. - "," - Will appear as a payment option only for customers who have at least one active billing agreement. - " -"Allow in Billing Agreement Wizard","Allow in Billing Agreement Wizard" -"SFTP Credentials","SFTP Credentials" -"Custom Endpoint Hostname or IP-Address","Custom Endpoint Hostname or IP-Address" -"By default it is ""reports.paypal.com"".","By default it is ""reports.paypal.com""." -"Use colon to specify port. For example: ""test.example.com:5224"".","Use colon to specify port. For example: ""test.example.com:5224""." -"Custom Path","Custom Path" -"Scheduled Fetching","Scheduled Fetching" -"Enable Automatic Fetching","Enable Automatic Fetching" -"PayPal retains reports for 45 days.","PayPal retains reports for 45 days." -"Time of Day","Time of Day" -"PayPal Product Logo","PayPal Product Logo" -"Displays on catalog pages and homepage.","Displays on catalog pages and homepage." -"PayPal Merchant Pages Style","PayPal Merchant Pages Style" -"Page Style","Page Style" -" - Allowable values: ""paypal"", ""primary"" (default), your_custom_value (a custom payment page style from your merchant account profile). - "," - Allowable values: ""paypal"", ""primary"" (default), your_custom_value (a custom payment page style from your merchant account profile). - " -"Header Image URL","Header Image URL" -" - The image at the top left of the checkout page. Max size is 750x90-pixel. https is highly encouraged. - "," - The image at the top left of the checkout page. Max size is 750x90-pixel. https is highly encouraged. - " -"Header Background Color","Header Background Color" -" - The background color for the header of the checkout page. Case-insensitive six-character HTML hexadecimal color code in ASCII. - "," - The background color for the header of the checkout page. Case-insensitive six-character HTML hexadecimal color code in ASCII. - " -"Header Border Color","Header Border Color" -"2-pixel perimeter around the header space.","2-pixel perimeter around the header space." -"Page Background Color","Page Background Color" -" - The background color for the checkout page around the header and payment form. - "," - The background color for the checkout page around the header and payment form. - " -"Website Payments Pro Hosted Solution","Website Payments Pro Hosted Solution" -"Accept payments with a PCI compliant checkout that keeps customers on your site.","Accept payments with a PCI compliant checkout that keeps customers on your site." -"Payments Pro Hosted Solution","Payments Pro Hosted Solution" -" - Why Advertise Financing?
- Give your sales a boost when you advertise financing.
PayPal helps turn browsers into buyers with financing - from Bill Me Later®. Your customers have more time to pay, while you get paid up front – at no additional cost to you. - Use PayPal’s free banner ads that let you advertise Bill Me Later® financing as a payment option when your customers check out with PayPal. - The PayPal Advertising Program has been shown to generate additional purchases as well as increase consumer's average purchase sizes by 15% - or more. See Details. - "," - Why Advertise Financing?
- Give your sales a boost when you advertise financing.
PayPal helps turn browsers into buyers with financing - from Bill Me Later®. Your customers have more time to pay, while you get paid up front – at no additional cost to you. - Use PayPal’s free banner ads that let you advertise Bill Me Later® financing as a payment option when your customers check out with PayPal. - The PayPal Advertising Program has been shown to generate additional purchases as well as increase consumer's average purchase sizes by 15% - or more. See Details. - " -"Basic Settings - PayPal Payments Pro Hosted Solution","Basic Settings - PayPal Payments Pro Hosted Solution" -"Display Express Checkout in the Payment Information step","Display Express Checkout in the Payment Information step" -" - PayPal All-in-One Payment Solutions  Accept and process credit cards and PayPal payments. - "," - PayPal All-in-One Payment Solutions  Accept and process credit cards and PayPal payments. - " -"Choose a secure bundled payment solution for your business.","Choose a secure bundled payment solution for your business." -"PayPal Express Checkout","PayPal Express Checkout" -"Add another payment method to your existing solution or as a stand-alone option.","Add another payment method to your existing solution or as a stand-alone option." -"Payments Advanced (Includes Express Checkout)","Payments Advanced (Includes Express Checkout)" -"Accept payments with a PCI-compliant checkout that keeps customers on your site.","Accept payments with a PCI-compliant checkout that keeps customers on your site." -"Payments Advanced and Express Checkout","Payments Advanced and Express Checkout" -"PayPal recommends that you set up an additional User on your account at manager.paypal.com","PayPal recommends that you set up an additional User on your account at manager.paypal.com" -"PayPal recommends you set up an additional User on your account at manager.paypal.com, instead of entering your admin username and password here. This will enhance your security and prevent service interruptions if you later change your password. If you do not want to set up an additional User, you can re-enter your Merchant Login here.","PayPal recommends you set up an additional User on your account at manager.paypal.com, instead of entering your admin username and password here. This will enhance your security and prevent service interruptions if you later change your password. If you do not want to set up an additional User, you can re-enter your Merchant Login here." -" - Why Advertise Financing?
- Give your sales a boost when you advertise financing.
PayPal helps turn browsers into buyers with financing - from Bill Me Later®. Your customers have more time to pay, while you get paid up front – at no additional cost to you. - Use PayPal’s free banner ads that let you advertise Bill Me Later® financing as a payment option when your customers check out with PayPal. - The PayPal Advertising Program has been shown to generate additional purchases as well as increase consumer's average purchase sizes by 15% - or more. See Details. - "," - Why Advertise Financing?
- Give your sales a boost when you advertise financing.
PayPal helps turn browsers into buyers with financing - from Bill Me Later®. Your customers have more time to pay, while you get paid up front – at no additional cost to you. - Use PayPal’s free banner ads that let you advertise Bill Me Later® financing as a payment option when your customers check out with PayPal. - The PayPal Advertising Program has been shown to generate additional purchases as well as increase consumer's average purchase sizes by 15% - or more. See Details. - " -"Basic Settings - PayPal Payments Advanced","Basic Settings - PayPal Payments Advanced" -"Payments Pro (Includes Express Checkout)","Payments Pro (Includes Express Checkout)" -"Payments Pro and Express Checkout","Payments Pro and Express Checkout" -"Basic Settings - PayPal Payments Pro","Basic Settings - PayPal Payments Pro" -"Payments Standard","Payments Standard" -"Basic Settings - PayPal Payments Standard","Basic Settings - PayPal Payments Standard" -"PayPal Payment Gateways","PayPal Payment Gateways" -"Process payments using your own internet merchant account.","Process payments using your own internet merchant account." -"Payflow Pro (Includes Express Checkout)","Payflow Pro (Includes Express Checkout)" -"Payflow Pro and Express Checkout","Payflow Pro and Express Checkout" -" - Why Advertise Financing?
- Give your sales a boost when you advertise financing.
PayPal helps turn browsers into buyers with financing - from Bill Me Later®. Your customers have more time to pay, while you get paid up front – at no additional cost to you. - Use PayPal’s free banner ads that let you advertise Bill Me Later® financing as a payment option when your customers check out with PayPal. - The PayPal Advertising Program has been shown to generate additional purchases as well as increase consumer's average purchase sizes by 15% - or more. See Details. - "," - Why Advertise Financing?
- Give your sales a boost when you advertise financing.
PayPal helps turn browsers into buyers with financing - from Bill Me Later®. Your customers have more time to pay, while you get paid up front – at no additional cost to you. - Use PayPal’s free banner ads that let you advertise Bill Me Later® financing as a payment option when your customers check out with PayPal. - The PayPal Advertising Program has been shown to generate additional purchases as well as increase consumer's average purchase sizes by 15% - or more. See Details. - " -"Accept credit cards, debit cards and PayPal payments securely.","Accept credit cards, debit cards and PayPal payments securely." -"Accept payments with a completely customizable checkout page.","Accept payments with a completely customizable checkout page." -"Website Payments Pro Hosted Solution (Includes Express Checkout)","Website Payments Pro Hosted Solution (Includes Express Checkout)" -"Website Payments Pro Hosted Solution and Express Checkout","Website Payments Pro Hosted Solution and Express Checkout" -"Basic Settings - PayPal Website Payments Pro Hosted Solution","Basic Settings - PayPal Website Payments Pro Hosted Solution" -"PayPal Payment Solutions","PayPal Payment Solutions" diff --git a/app/code/Magento/Paypal/sql/paypal_setup/install-2.0.0.php b/app/code/Magento/Paypal/sql/paypal_setup/install-2.0.0.php deleted file mode 100644 index 0d0ff6e138f3a..0000000000000 --- a/app/code/Magento/Paypal/sql/paypal_setup/install-2.0.0.php +++ /dev/null @@ -1,411 +0,0 @@ -startSetup(); - -/** - * Create table 'paypal_billing_agreement' - */ -$table = $installer->getConnection()->newTable( - $installer->getTable('paypal_billing_agreement') -)->addColumn( - 'agreement_id', - \Magento\Framework\DB\Ddl\Table::TYPE_INTEGER, - null, - ['identity' => true, 'unsigned' => true, 'nullable' => false, 'primary' => true], - 'Agreement Id' -)->addColumn( - 'customer_id', - \Magento\Framework\DB\Ddl\Table::TYPE_INTEGER, - null, - ['unsigned' => true, 'nullable' => false], - 'Customer Id' -)->addColumn( - 'method_code', - \Magento\Framework\DB\Ddl\Table::TYPE_TEXT, - 32, - ['nullable' => false], - 'Method Code' -)->addColumn( - 'reference_id', - \Magento\Framework\DB\Ddl\Table::TYPE_TEXT, - 32, - ['nullable' => false], - 'Reference Id' -)->addColumn( - 'status', - \Magento\Framework\DB\Ddl\Table::TYPE_TEXT, - 20, - ['nullable' => false], - 'Status' -)->addColumn( - 'created_at', - \Magento\Framework\DB\Ddl\Table::TYPE_TIMESTAMP, - null, - ['nullable' => false], - 'Created At' -)->addColumn( - 'updated_at', - \Magento\Framework\DB\Ddl\Table::TYPE_TIMESTAMP, - null, - [], - 'Updated At' -)->addColumn( - 'store_id', - \Magento\Framework\DB\Ddl\Table::TYPE_SMALLINT, - null, - ['unsigned' => true], - 'Store Id' -)->addColumn( - 'agreement_label', - \Magento\Framework\DB\Ddl\Table::TYPE_TEXT, - 255, - [], - 'Agreement Label' -)->addIndex( - $installer->getIdxName('paypal_billing_agreement', ['customer_id']), - ['customer_id'] -)->addIndex( - $installer->getIdxName('paypal_billing_agreement', ['store_id']), - ['store_id'] -)->addForeignKey( - $installer->getFkName('paypal_billing_agreement', 'customer_id', 'customer_entity', 'entity_id'), - 'customer_id', - $installer->getTable('customer_entity'), - 'entity_id', - \Magento\Framework\DB\Ddl\Table::ACTION_CASCADE, - \Magento\Framework\DB\Ddl\Table::ACTION_CASCADE -)->addForeignKey( - $installer->getFkName('paypal_billing_agreement', 'store_id', 'store', 'store_id'), - 'store_id', - $installer->getTable('store'), - 'store_id', - \Magento\Framework\DB\Ddl\Table::ACTION_SET_NULL, - \Magento\Framework\DB\Ddl\Table::ACTION_CASCADE -)->setComment( - 'Sales Billing Agreement' -); -$installer->getConnection()->createTable($table); - -/** - * Create table 'paypal_billing_agreement_order' - */ -$table = $installer->getConnection()->newTable( - $installer->getTable('paypal_billing_agreement_order') -)->addColumn( - 'agreement_id', - \Magento\Framework\DB\Ddl\Table::TYPE_INTEGER, - null, - ['unsigned' => true, 'nullable' => false, 'primary' => true], - 'Agreement Id' -)->addColumn( - 'order_id', - \Magento\Framework\DB\Ddl\Table::TYPE_INTEGER, - null, - ['unsigned' => true, 'nullable' => false, 'primary' => true], - 'Order Id' -)->addIndex( - $installer->getIdxName('paypal_billing_agreement_order', ['order_id']), - ['order_id'] -)->addForeignKey( - $installer->getFkName( - 'paypal_billing_agreement_order', - 'agreement_id', - 'paypal_billing_agreement', - 'agreement_id' - ), - 'agreement_id', - $installer->getTable('paypal_billing_agreement'), - 'agreement_id', - \Magento\Framework\DB\Ddl\Table::ACTION_CASCADE, - \Magento\Framework\DB\Ddl\Table::ACTION_CASCADE -)->addForeignKey( - $installer->getFkName('paypal_billing_agreement_order', 'order_id', 'sales_order', 'entity_id'), - 'order_id', - $installer->getTable('sales_order'), - 'entity_id', - \Magento\Framework\DB\Ddl\Table::ACTION_CASCADE, - \Magento\Framework\DB\Ddl\Table::ACTION_CASCADE -)->setComment( - 'Sales Billing Agreement Order' -); -$installer->getConnection()->createTable($table); - -/** - * Create table 'paypal_settlement_report' - */ -$table = $installer->getConnection()->newTable( - $installer->getTable('paypal_settlement_report') -)->addColumn( - 'report_id', - \Magento\Framework\DB\Ddl\Table::TYPE_INTEGER, - null, - ['identity' => true, 'unsigned' => true, 'nullable' => false, 'primary' => true], - 'Report Id' -)->addColumn( - 'report_date', - \Magento\Framework\DB\Ddl\Table::TYPE_TIMESTAMP, - null, - [], - 'Report Date' -)->addColumn( - 'account_id', - \Magento\Framework\DB\Ddl\Table::TYPE_TEXT, - 64, - [], - 'Account Id' -)->addColumn( - 'filename', - \Magento\Framework\DB\Ddl\Table::TYPE_TEXT, - 24, - [], - 'Filename' -)->addColumn( - 'last_modified', - \Magento\Framework\DB\Ddl\Table::TYPE_TIMESTAMP, - null, - [], - 'Last Modified' -)->addIndex( - $installer->getIdxName( - 'paypal_settlement_report', - ['report_date', 'account_id'], - \Magento\Framework\DB\Adapter\AdapterInterface::INDEX_TYPE_UNIQUE - ), - ['report_date', 'account_id'], - ['type' => \Magento\Framework\DB\Adapter\AdapterInterface::INDEX_TYPE_UNIQUE] -)->setComment( - 'Paypal Settlement Report Table' -); -$installer->getConnection()->createTable($table); - -/** - * Create table 'paypal_settlement_report_row' - */ -$table = $installer->getConnection()->newTable( - $installer->getTable('paypal_settlement_report_row') -)->addColumn( - 'row_id', - \Magento\Framework\DB\Ddl\Table::TYPE_INTEGER, - null, - ['identity' => true, 'unsigned' => true, 'nullable' => false, 'primary' => true], - 'Row Id' -)->addColumn( - 'report_id', - \Magento\Framework\DB\Ddl\Table::TYPE_INTEGER, - null, - ['unsigned' => true, 'nullable' => false], - 'Report Id' -)->addColumn( - 'transaction_id', - \Magento\Framework\DB\Ddl\Table::TYPE_TEXT, - 19, - [], - 'Transaction Id' -)->addColumn( - 'invoice_id', - \Magento\Framework\DB\Ddl\Table::TYPE_TEXT, - 127, - [], - 'Invoice Id' -)->addColumn( - 'paypal_reference_id', - \Magento\Framework\DB\Ddl\Table::TYPE_TEXT, - 19, - [], - 'Paypal Reference Id' -)->addColumn( - 'paypal_reference_id_type', - \Magento\Framework\DB\Ddl\Table::TYPE_TEXT, - 3, - [], - 'Paypal Reference Id Type' -)->addColumn( - 'transaction_event_code', - \Magento\Framework\DB\Ddl\Table::TYPE_TEXT, - 5, - [], - 'Transaction Event Code' -)->addColumn( - 'transaction_initiation_date', - \Magento\Framework\DB\Ddl\Table::TYPE_TIMESTAMP, - null, - [], - 'Transaction Initiation Date' -)->addColumn( - 'transaction_completion_date', - \Magento\Framework\DB\Ddl\Table::TYPE_TIMESTAMP, - null, - [], - 'Transaction Completion Date' -)->addColumn( - 'transaction_debit_or_credit', - \Magento\Framework\DB\Ddl\Table::TYPE_TEXT, - 2, - ['nullable' => false, 'default' => 'CR'], - 'Transaction Debit Or Credit' -)->addColumn( - 'gross_transaction_amount', - \Magento\Framework\DB\Ddl\Table::TYPE_DECIMAL, - '20,6', - ['nullable' => false, 'default' => '0.000000'], - 'Gross Transaction Amount' -)->addColumn( - 'gross_transaction_currency', - \Magento\Framework\DB\Ddl\Table::TYPE_TEXT, - 3, - ['default' => false], - 'Gross Transaction Currency' -)->addColumn( - 'fee_debit_or_credit', - \Magento\Framework\DB\Ddl\Table::TYPE_TEXT, - 2, - [], - 'Fee Debit Or Credit' -)->addColumn( - 'fee_amount', - \Magento\Framework\DB\Ddl\Table::TYPE_DECIMAL, - '20,6', - ['nullable' => false, 'default' => '0.000000'], - 'Fee Amount' -)->addColumn( - 'fee_currency', - \Magento\Framework\DB\Ddl\Table::TYPE_TEXT, - 3, - [], - 'Fee Currency' -)->addColumn( - 'custom_field', - \Magento\Framework\DB\Ddl\Table::TYPE_TEXT, - 255, - [], - 'Custom Field' -)->addColumn( - 'consumer_id', - \Magento\Framework\DB\Ddl\Table::TYPE_TEXT, - 127, - [], - 'Consumer Id' -)->addColumn( - 'payment_tracking_id', - \Magento\Framework\DB\Ddl\Table::TYPE_TEXT, - 255, - [], - 'Payment Tracking ID' -)->addColumn( - 'store_id', - \Magento\Framework\DB\Ddl\Table::TYPE_TEXT, - 50, - [], - 'Store ID' -)->addIndex( - $installer->getIdxName('paypal_settlement_report_row', ['report_id']), - ['report_id'] -)->addForeignKey( - $installer->getFkName('paypal_settlement_report_row', 'report_id', 'paypal_settlement_report', 'report_id'), - 'report_id', - $installer->getTable('paypal_settlement_report'), - 'report_id', - \Magento\Framework\DB\Ddl\Table::ACTION_CASCADE, - \Magento\Framework\DB\Ddl\Table::ACTION_CASCADE -)->setComment( - 'Paypal Settlement Report Row Table' -); -$installer->getConnection()->createTable($table); - -/** - * Create table 'paypal_cert' - */ -$table = $installer->getConnection()->newTable( - $installer->getTable('paypal_cert') -)->addColumn( - 'cert_id', - \Magento\Framework\DB\Ddl\Table::TYPE_SMALLINT, - null, - ['identity' => true, 'unsigned' => true, 'nullable' => false, 'primary' => true], - 'Cert Id' -)->addColumn( - 'website_id', - \Magento\Framework\DB\Ddl\Table::TYPE_SMALLINT, - null, - ['unsigned' => true, 'nullable' => false, 'default' => '0'], - 'Website Id' -)->addColumn( - 'content', - \Magento\Framework\DB\Ddl\Table::TYPE_TEXT, - '64K', - [], - 'Content' -)->addColumn( - 'updated_at', - \Magento\Framework\DB\Ddl\Table::TYPE_TIMESTAMP, - null, - [], - 'Updated At' -)->addIndex( - $installer->getIdxName('paypal_cert', ['website_id']), - ['website_id'] -)->addForeignKey( - $installer->getFkName('paypal_cert', 'website_id', 'store_website', 'website_id'), - 'website_id', - $installer->getTable('store_website'), - 'website_id', - \Magento\Framework\DB\Ddl\Table::ACTION_CASCADE, - \Magento\Framework\DB\Ddl\Table::ACTION_CASCADE -)->setComment( - 'Paypal Certificate Table' -); - -/** - * Create table 'paypal_payment_transaction' - */ -$table = $installer->getConnection()->newTable( - $installer->getTable('paypal_payment_transaction') -)->addColumn( - 'transaction_id', - \Magento\Framework\DB\Ddl\Table::TYPE_INTEGER, - null, - ['identity' => true, 'unsigned' => true, 'nullable' => false, 'primary' => true], - 'Entity Id' -)->addColumn( - 'txn_id', - \Magento\Framework\DB\Ddl\Table::TYPE_TEXT, - 100, - [], - 'Txn Id' -)->addColumn( - 'additional_information', - \Magento\Framework\DB\Ddl\Table::TYPE_BLOB, - '64K', - [], - 'Additional Information' -)->addColumn( - 'created_at', - \Magento\Framework\DB\Ddl\Table::TYPE_TIMESTAMP, - null, - [], - 'Created At' -)->addIndex( - $installer->getIdxName( - 'paypal_payment_transaction', - ['txn_id'], - \Magento\Framework\DB\Adapter\AdapterInterface::INDEX_TYPE_UNIQUE - ), - ['txn_id'], - ['type' => \Magento\Framework\DB\Adapter\AdapterInterface::INDEX_TYPE_UNIQUE] -)->setComment( - 'PayPal Payflow Link Payment Transaction' -); -$installer->getConnection()->createTable($table); -/** - * Prepare database after install - */ -$installer->endSetup(); diff --git a/app/code/Magento/Paypal/view/adminhtml/layout/adminhtml_paypal_reports_block.xml b/app/code/Magento/Paypal/view/adminhtml/layout/adminhtml_paypal_reports_block.xml deleted file mode 100644 index fe1fd168a1bad..0000000000000 --- a/app/code/Magento/Paypal/view/adminhtml/layout/adminhtml_paypal_reports_block.xml +++ /dev/null @@ -1,122 +0,0 @@ - - - - - - - - settlementGrid - Magento\Paypal\Model\Resource\Report\Settlement\Row\Collection - row_id - DESC - 1 - 1 - - - - - - */*/details - - getId - - - - - - Report Date - report_date - date - col-date - col-date - - - - - Merchant Account - account_id - col-merchant - col-merchant - - - - - Transaction ID - transaction_id - col-transaction - col-transaction - - - - - Invoice ID - invoice_id - col-invoice - col-invoice - - - - - PayPal Reference ID - paypal_reference_id - col-reference - col-reference - - - - - Event - transaction_event_code - options - - ol-event - ol-event - - - - - Start Date - transaction_initiation_date - datetime - col-initiation - col-initiation - - - - - Finish Date - transaction_completion_date - datetime - col-completion - col-completion - - - - - Gross Amount - gross_transaction_amount - currency - gross_transaction_currency - col-amount - col-amount - - - - - Fee Amount - fee_amount - currency - gross_transaction_currency - col-fee-amount - col-fee-amount - - - - - - - diff --git a/app/code/Magento/Paypal/view/adminhtml/layout/adminhtml_system_config_edit.xml b/app/code/Magento/Paypal/view/adminhtml/layout/adminhtml_system_config_edit.xml deleted file mode 100644 index d918a5f580e27..0000000000000 --- a/app/code/Magento/Paypal/view/adminhtml/layout/adminhtml_system_config_edit.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - diff --git a/app/code/Magento/Paypal/view/adminhtml/layout/customer_form.xml b/app/code/Magento/Paypal/view/adminhtml/layout/customer_form.xml deleted file mode 100644 index 6c42f28cfd1cd..0000000000000 --- a/app/code/Magento/Paypal/view/adminhtml/layout/customer_form.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - diff --git a/app/code/Magento/Paypal/view/adminhtml/layout/customer_index_edit.xml b/app/code/Magento/Paypal/view/adminhtml/layout/customer_index_edit.xml deleted file mode 100644 index 10a7f9ac41607..0000000000000 --- a/app/code/Magento/Paypal/view/adminhtml/layout/customer_index_edit.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - customer_edit_tab_agreements - Magento\Paypal\Block\Adminhtml\Customer\Edit\Tab\Agreement - - - - diff --git a/app/code/Magento/Paypal/view/adminhtml/layout/paypal_billing_agreement_customergrid.xml b/app/code/Magento/Paypal/view/adminhtml/layout/paypal_billing_agreement_customergrid.xml deleted file mode 100644 index 474253e4fb3ce..0000000000000 --- a/app/code/Magento/Paypal/view/adminhtml/layout/paypal_billing_agreement_customergrid.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - diff --git a/app/code/Magento/Paypal/view/adminhtml/layout/paypal_billing_agreement_grid.xml b/app/code/Magento/Paypal/view/adminhtml/layout/paypal_billing_agreement_grid.xml deleted file mode 100644 index b2895265d93e9..0000000000000 --- a/app/code/Magento/Paypal/view/adminhtml/layout/paypal_billing_agreement_grid.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - diff --git a/app/code/Magento/Paypal/view/adminhtml/layout/paypal_billing_agreement_index.xml b/app/code/Magento/Paypal/view/adminhtml/layout/paypal_billing_agreement_index.xml deleted file mode 100644 index 2eafe8bf09f55..0000000000000 --- a/app/code/Magento/Paypal/view/adminhtml/layout/paypal_billing_agreement_index.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - diff --git a/app/code/Magento/Paypal/view/adminhtml/layout/paypal_billing_agreement_ordersgrid.xml b/app/code/Magento/Paypal/view/adminhtml/layout/paypal_billing_agreement_ordersgrid.xml deleted file mode 100644 index e34c82ea08618..0000000000000 --- a/app/code/Magento/Paypal/view/adminhtml/layout/paypal_billing_agreement_ordersgrid.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - Magento\Paypal\Model\Billing\Agreement\OrdersUpdater - - - - - - - - - - diff --git a/app/code/Magento/Paypal/view/adminhtml/layout/paypal_billing_agreement_view.xml b/app/code/Magento/Paypal/view/adminhtml/layout/paypal_billing_agreement_view.xml deleted file mode 100644 index c701ee8d6c084..0000000000000 --- a/app/code/Magento/Paypal/view/adminhtml/layout/paypal_billing_agreement_view.xml +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - - - Magento\Paypal\Model\Billing\Agreement\OrdersUpdater - - - - - - - - - - - - - billing_agreement_info - Magento\Paypal\Block\Adminhtml\Billing\Agreement\View\Tab\Info - - - - billing_agreement_orders - sales_order.grid.container - - - - - diff --git a/app/code/Magento/Paypal/view/adminhtml/layout/paypal_paypal_reports_grid.xml b/app/code/Magento/Paypal/view/adminhtml/layout/paypal_paypal_reports_grid.xml deleted file mode 100644 index 34b81f8200bd9..0000000000000 --- a/app/code/Magento/Paypal/view/adminhtml/layout/paypal_paypal_reports_grid.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - diff --git a/app/code/Magento/Paypal/view/adminhtml/layout/paypal_paypal_reports_index.xml b/app/code/Magento/Paypal/view/adminhtml/layout/paypal_paypal_reports_index.xml deleted file mode 100644 index 7f9c05b896627..0000000000000 --- a/app/code/Magento/Paypal/view/adminhtml/layout/paypal_paypal_reports_index.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - diff --git a/app/code/Magento/Paypal/view/adminhtml/templates/billing/agreement/form.phtml b/app/code/Magento/Paypal/view/adminhtml/templates/billing/agreement/form.phtml deleted file mode 100644 index 54ca91878e952..0000000000000 --- a/app/code/Magento/Paypal/view/adminhtml/templates/billing/agreement/form.phtml +++ /dev/null @@ -1,19 +0,0 @@ - -getMethodCode() ?> - diff --git a/app/code/Magento/Paypal/view/adminhtml/templates/billing/agreement/view/form.phtml b/app/code/Magento/Paypal/view/adminhtml/templates/billing/agreement/view/form.phtml deleted file mode 100644 index 1d0982d1c9886..0000000000000 --- a/app/code/Magento/Paypal/view/adminhtml/templates/billing/agreement/view/form.phtml +++ /dev/null @@ -1,6 +0,0 @@ - -
diff --git a/app/code/Magento/Paypal/view/adminhtml/templates/billing/agreement/view/tab/info.phtml b/app/code/Magento/Paypal/view/adminhtml/templates/billing/agreement/view/tab/info.phtml deleted file mode 100644 index 7a72abeff0507..0000000000000 --- a/app/code/Magento/Paypal/view/adminhtml/templates/billing/agreement/view/tab/info.phtml +++ /dev/null @@ -1,40 +0,0 @@ - -
-
- -
-
- - - - - - - - - - - - - - - - - - - - - - - -
escapeHtml($this->getReferenceId()) ?>
- - getCustomerEmail() ?> - -
getStatus() ?>
getCreatedAt(); ?>
getUpdatedAt(); ?>
-
-
diff --git a/app/code/Magento/Paypal/view/adminhtml/templates/payment/form/billing/agreement.phtml b/app/code/Magento/Paypal/view/adminhtml/templates/payment/form/billing/agreement.phtml deleted file mode 100644 index 705d0933e283b..0000000000000 --- a/app/code/Magento/Paypal/view/adminhtml/templates/payment/form/billing/agreement.phtml +++ /dev/null @@ -1,20 +0,0 @@ - - -getMethodCode() ?> - diff --git a/app/code/Magento/Paypal/view/adminhtml/templates/system/config/api_wizard.phtml b/app/code/Magento/Paypal/view/adminhtml/templates/system/config/api_wizard.phtml deleted file mode 100644 index cd05f9926cefd..0000000000000 --- a/app/code/Magento/Paypal/view/adminhtml/templates/system/config/api_wizard.phtml +++ /dev/null @@ -1,18 +0,0 @@ - - -
- - -
diff --git a/app/code/Magento/Paypal/view/adminhtml/templates/system/config/bml_api_wizard.phtml b/app/code/Magento/Paypal/view/adminhtml/templates/system/config/bml_api_wizard.phtml deleted file mode 100644 index 8cba4033ef2f5..0000000000000 --- a/app/code/Magento/Paypal/view/adminhtml/templates/system/config/bml_api_wizard.phtml +++ /dev/null @@ -1,15 +0,0 @@ - - -
- -
diff --git a/app/code/Magento/Paypal/view/adminhtml/templates/system/config/fieldset/hint.phtml b/app/code/Magento/Paypal/view/adminhtml/templates/system/config/fieldset/hint.phtml deleted file mode 100644 index f2a336e1e71ea..0000000000000 --- a/app/code/Magento/Paypal/view/adminhtml/templates/system/config/fieldset/hint.phtml +++ /dev/null @@ -1,19 +0,0 @@ - - -getHelpLink()): -?> -
- here to learn more.', $this->getHelpLink()); ?> -
- diff --git a/app/code/Magento/Paypal/view/adminhtml/templates/system/config/payflowlink/advanced.phtml b/app/code/Magento/Paypal/view/adminhtml/templates/system/config/payflowlink/advanced.phtml deleted file mode 100644 index 1694b18ab4b11..0000000000000 --- a/app/code/Magento/Paypal/view/adminhtml/templates/system/config/payflowlink/advanced.phtml +++ /dev/null @@ -1,19 +0,0 @@ - -
- - - -
    -
  • AVS: No
  • -
  • CSC: No
  • -
  • Enable Secure Token: Yes
  • -
-
diff --git a/app/code/Magento/Paypal/view/adminhtml/templates/system/config/payflowlink/info.phtml b/app/code/Magento/Paypal/view/adminhtml/templates/system/config/payflowlink/info.phtml deleted file mode 100644 index 6c297559c4c88..0000000000000 --- a/app/code/Magento/Paypal/view/adminhtml/templates/system/config/payflowlink/info.phtml +++ /dev/null @@ -1,20 +0,0 @@ - - -
- - - -
    -
  • AVS: No
  • -
  • CSC: No
  • -
  • Enable Secure Token: Yes
  • -
-
diff --git a/app/code/Magento/Paypal/view/adminhtml/web/images/logo-paypal.png b/app/code/Magento/Paypal/view/adminhtml/web/images/logo-paypal.png deleted file mode 100644 index ecded2652a3fb..0000000000000 Binary files a/app/code/Magento/Paypal/view/adminhtml/web/images/logo-paypal.png and /dev/null differ diff --git a/app/code/Magento/Paypal/view/adminhtml/web/images/paypal-logo.png b/app/code/Magento/Paypal/view/adminhtml/web/images/paypal-logo.png deleted file mode 100644 index 8714f9f01c0ff..0000000000000 Binary files a/app/code/Magento/Paypal/view/adminhtml/web/images/paypal-logo.png and /dev/null differ diff --git a/app/code/Magento/Paypal/view/adminhtml/web/images/pp-allinone.png b/app/code/Magento/Paypal/view/adminhtml/web/images/pp-allinone.png deleted file mode 100644 index c95d0d9132dc2..0000000000000 Binary files a/app/code/Magento/Paypal/view/adminhtml/web/images/pp-allinone.png and /dev/null differ diff --git a/app/code/Magento/Paypal/view/adminhtml/web/images/pp-alt.png b/app/code/Magento/Paypal/view/adminhtml/web/images/pp-alt.png deleted file mode 100644 index 1fa37aded93b6..0000000000000 Binary files a/app/code/Magento/Paypal/view/adminhtml/web/images/pp-alt.png and /dev/null differ diff --git a/app/code/Magento/Paypal/view/adminhtml/web/images/pp-gateways.png b/app/code/Magento/Paypal/view/adminhtml/web/images/pp-gateways.png deleted file mode 100644 index ed8a136f66eac..0000000000000 Binary files a/app/code/Magento/Paypal/view/adminhtml/web/images/pp-gateways.png and /dev/null differ diff --git a/app/code/Magento/Paypal/view/adminhtml/web/images/pp-uk.png b/app/code/Magento/Paypal/view/adminhtml/web/images/pp-uk.png deleted file mode 100644 index ac67756a860d4..0000000000000 Binary files a/app/code/Magento/Paypal/view/adminhtml/web/images/pp-uk.png and /dev/null differ diff --git a/app/code/Magento/Paypal/view/adminhtml/web/logo.gif b/app/code/Magento/Paypal/view/adminhtml/web/logo.gif deleted file mode 100644 index aeb34c7f28b06..0000000000000 Binary files a/app/code/Magento/Paypal/view/adminhtml/web/logo.gif and /dev/null differ diff --git a/app/code/Magento/Paypal/view/adminhtml/web/section.png b/app/code/Magento/Paypal/view/adminhtml/web/section.png deleted file mode 100644 index ecded2652a3fb..0000000000000 Binary files a/app/code/Magento/Paypal/view/adminhtml/web/section.png and /dev/null differ diff --git a/app/code/Magento/Paypal/view/adminhtml/web/styles.css b/app/code/Magento/Paypal/view/adminhtml/web/styles.css deleted file mode 100644 index 6462d8d14fe4f..0000000000000 --- a/app/code/Magento/Paypal/view/adminhtml/web/styles.css +++ /dev/null @@ -1,15 +0,0 @@ -/** - * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) - */ - -.pp-general-uk > .entry-edit-head > .config-heading .heading strong, -.pp-method-payflow > .entry-edit-head > .config-heading .heading strong, -.pp-method-express > .entry-edit-head > .config-heading .heading strong, -.pp-method-general > .entry-edit-head > .config-heading .heading strong { padding-left:90px; background:url(images/paypal-logo.png) no-repeat 0 0px; line-height: 23px; } -.pp-method-general > .entry-edit-head > .config-heading:before { content:url(images/pp-allinone.png); float:right; } -.pp-method-express > .entry-edit-head > .config-heading:before { content:url(images/pp-alt.png); float:right; } -.pp-method-payflow > .entry-edit-head > .config-heading:before { content:url(images/pp-gateways.png); float:right; } -.pp-general-uk > .entry-edit-head > .config-heading:before { content:url(images/pp-uk.png); float:right; } -.payflow-settings-notice {padding-bottom: 1em;max-width: 660px;} -.payflow-settings-notice .important-label {color:red;} -.payflow-settings-notice ul.options-list {list-style:disc;padding:0 2em;} diff --git a/app/code/Magento/Paypal/view/frontend/layout/catalog_category_view.xml b/app/code/Magento/Paypal/view/frontend/layout/catalog_category_view.xml deleted file mode 100644 index c7f4a78ba2144..0000000000000 --- a/app/code/Magento/Paypal/view/frontend/layout/catalog_category_view.xml +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - - - - categorypage - 0 - - - - - diff --git a/app/code/Magento/Paypal/view/frontend/layout/catalog_product_view.xml b/app/code/Magento/Paypal/view/frontend/layout/catalog_product_view.xml deleted file mode 100644 index d78c6502938d7..0000000000000 --- a/app/code/Magento/Paypal/view/frontend/layout/catalog_product_view.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - productpage - 0 - - - - - - - productpage - 1 - - - - - diff --git a/app/code/Magento/Paypal/view/frontend/layout/checkout_cart_index.xml b/app/code/Magento/Paypal/view/frontend/layout/checkout_cart_index.xml deleted file mode 100644 index 028d3c8a2df02..0000000000000 --- a/app/code/Magento/Paypal/view/frontend/layout/checkout_cart_index.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - checkout - 0 - - - - - - - checkout - 1 - - - - - diff --git a/app/code/Magento/Paypal/view/frontend/layout/checkout_onepage_index.xml b/app/code/Magento/Paypal/view/frontend/layout/checkout_onepage_index.xml deleted file mode 100644 index f97b572babb53..0000000000000 --- a/app/code/Magento/Paypal/view/frontend/layout/checkout_onepage_index.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - - - - - - - checkout - 0 - - - - - diff --git a/app/code/Magento/Paypal/view/frontend/layout/checkout_onepage_review.xml b/app/code/Magento/Paypal/view/frontend/layout/checkout_onepage_review.xml deleted file mode 100644 index 6fbce0ea3660c..0000000000000 --- a/app/code/Magento/Paypal/view/frontend/layout/checkout_onepage_review.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - - - - Magento_Paypal::hss/review/button.phtml - - - - - diff --git a/app/code/Magento/Paypal/view/frontend/layout/checkout_onepage_success.xml b/app/code/Magento/Paypal/view/frontend/layout/checkout_onepage_success.xml deleted file mode 100644 index a62ba166bc70c..0000000000000 --- a/app/code/Magento/Paypal/view/frontend/layout/checkout_onepage_success.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - diff --git a/app/code/Magento/Paypal/view/frontend/layout/cms_index_index.xml b/app/code/Magento/Paypal/view/frontend/layout/cms_index_index.xml deleted file mode 100644 index 445a59db29f61..0000000000000 --- a/app/code/Magento/Paypal/view/frontend/layout/cms_index_index.xml +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - - - - homepage - 0 - - - - - diff --git a/app/code/Magento/Paypal/view/frontend/layout/customer_account.xml b/app/code/Magento/Paypal/view/frontend/layout/customer_account.xml deleted file mode 100644 index 5382e9da041ba..0000000000000 --- a/app/code/Magento/Paypal/view/frontend/layout/customer_account.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - Billing Agreements - - - - - - paypal/billing_agreement - Billing Agreements - - - - - diff --git a/app/code/Magento/Paypal/view/frontend/layout/paypal_billing_agreement_index.xml b/app/code/Magento/Paypal/view/frontend/layout/paypal_billing_agreement_index.xml deleted file mode 100644 index efcc98c59f5be..0000000000000 --- a/app/code/Magento/Paypal/view/frontend/layout/paypal_billing_agreement_index.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - diff --git a/app/code/Magento/Paypal/view/frontend/layout/paypal_billing_agreement_view.xml b/app/code/Magento/Paypal/view/frontend/layout/paypal_billing_agreement_view.xml deleted file mode 100644 index 1c5c3d0bdc378..0000000000000 --- a/app/code/Magento/Paypal/view/frontend/layout/paypal_billing_agreement_view.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - 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 deleted file mode 100644 index 47dba46a61d8b..0000000000000 --- a/app/code/Magento/Paypal/view/frontend/layout/paypal_express_review.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - diff --git a/app/code/Magento/Paypal/view/frontend/layout/paypal_express_review_details.xml b/app/code/Magento/Paypal/view/frontend/layout/paypal_express_review_details.xml deleted file mode 100644 index e65c8933b296d..0000000000000 --- a/app/code/Magento/Paypal/view/frontend/layout/paypal_express_review_details.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - - diff --git a/app/code/Magento/Paypal/view/frontend/layout/paypal_hostedpro_cancel.xml b/app/code/Magento/Paypal/view/frontend/layout/paypal_hostedpro_cancel.xml deleted file mode 100644 index 7b19a00006316..0000000000000 --- a/app/code/Magento/Paypal/view/frontend/layout/paypal_hostedpro_cancel.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - diff --git a/app/code/Magento/Paypal/view/frontend/layout/paypal_payflow_cancelpayment.xml b/app/code/Magento/Paypal/view/frontend/layout/paypal_payflow_cancelpayment.xml deleted file mode 100644 index 65f85516f7516..0000000000000 --- a/app/code/Magento/Paypal/view/frontend/layout/paypal_payflow_cancelpayment.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - diff --git a/app/code/Magento/Paypal/view/frontend/layout/paypal_payflow_form.xml b/app/code/Magento/Paypal/view/frontend/layout/paypal_payflow_form.xml deleted file mode 100644 index 88927fcda534c..0000000000000 --- a/app/code/Magento/Paypal/view/frontend/layout/paypal_payflow_form.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - diff --git a/app/code/Magento/Paypal/view/frontend/layout/paypal_payflow_returnurl.xml b/app/code/Magento/Paypal/view/frontend/layout/paypal_payflow_returnurl.xml deleted file mode 100644 index 65f85516f7516..0000000000000 --- a/app/code/Magento/Paypal/view/frontend/layout/paypal_payflow_returnurl.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - diff --git a/app/code/Magento/Paypal/view/frontend/layout/paypal_payflowadvanced_cancelpayment.xml b/app/code/Magento/Paypal/view/frontend/layout/paypal_payflowadvanced_cancelpayment.xml deleted file mode 100644 index 7f041ed9cc997..0000000000000 --- a/app/code/Magento/Paypal/view/frontend/layout/paypal_payflowadvanced_cancelpayment.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - diff --git a/app/code/Magento/Paypal/view/frontend/layout/paypal_payflowadvanced_form.xml b/app/code/Magento/Paypal/view/frontend/layout/paypal_payflowadvanced_form.xml deleted file mode 100644 index 4b16f7a2f7d3a..0000000000000 --- a/app/code/Magento/Paypal/view/frontend/layout/paypal_payflowadvanced_form.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - diff --git a/app/code/Magento/Paypal/view/frontend/layout/paypal_payflowadvanced_returnurl.xml b/app/code/Magento/Paypal/view/frontend/layout/paypal_payflowadvanced_returnurl.xml deleted file mode 100644 index 7f041ed9cc997..0000000000000 --- a/app/code/Magento/Paypal/view/frontend/layout/paypal_payflowadvanced_returnurl.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - 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 deleted file mode 100644 index e3704997f8c75..0000000000000 --- a/app/code/Magento/Paypal/view/frontend/layout/paypal_payflowexpress_review.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - paypal/payflowexpress - - - - - - - - - - - - - diff --git a/app/code/Magento/Paypal/view/frontend/layout/paypal_standard_redirect.xml b/app/code/Magento/Paypal/view/frontend/layout/paypal_standard_redirect.xml deleted file mode 100644 index 673ef89a66551..0000000000000 --- a/app/code/Magento/Paypal/view/frontend/layout/paypal_standard_redirect.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - diff --git a/app/code/Magento/Paypal/view/frontend/requirejs-config.js b/app/code/Magento/Paypal/view/frontend/requirejs-config.js deleted file mode 100644 index 3414934cdb047..0000000000000 --- a/app/code/Magento/Paypal/view/frontend/requirejs-config.js +++ /dev/null @@ -1,12 +0,0 @@ -/** - * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) - */ - -var config = { - map: { - '*': { - opcheckoutPaypalIframe: 'Magento_Paypal/js/opcheckout', - orderReview: 'Magento_Paypal/order-review' - } - } -}; \ No newline at end of file diff --git a/app/code/Magento/Paypal/view/frontend/templates/billing/agreement/view.phtml b/app/code/Magento/Paypal/view/frontend/templates/billing/agreement/view.phtml deleted file mode 100644 index cc9f6b42d48dd..0000000000000 --- a/app/code/Magento/Paypal/view/frontend/templates/billing/agreement/view.phtml +++ /dev/null @@ -1,100 +0,0 @@ - - -
-
- escapeHtml($this->getReferenceId())) ?> - getCanCancel()): ?> - - -
-
-
-
- - - - - - - - getAgreementUpdatedAt()): ?> - - - - - - - - - - - getAgreementUpdatedAt()): ?> - - - - - -
escapeHtml($this->getReferenceId()); ?>getAgreementStatus() ?>escapeHtml($this->getAgreementCreatedAt()) ?>escapeHtml($this->getAgreementUpdatedAt()); ?>getPaymentMethodTitle() ?>
-
-
-
- getRelatedOrders() ?> - 0): ?> -
- getChildHtml('pager'); ?> -
-
- -
-
- - -
-
- -
-
diff --git a/app/code/Magento/Paypal/view/frontend/templates/billing/agreements.phtml b/app/code/Magento/Paypal/view/frontend/templates/billing/agreements.phtml deleted file mode 100644 index 2092783b408b2..0000000000000 --- a/app/code/Magento/Paypal/view/frontend/templates/billing/agreements.phtml +++ /dev/null @@ -1,83 +0,0 @@ - - - diff --git a/app/code/Magento/Paypal/view/frontend/templates/bml.phtml b/app/code/Magento/Paypal/view/frontend/templates/bml.phtml deleted file mode 100644 index e72c16f006e23..0000000000000 --- a/app/code/Magento/Paypal/view/frontend/templates/bml.phtml +++ /dev/null @@ -1,19 +0,0 @@ - - - diff --git a/app/code/Magento/Paypal/view/frontend/templates/checkout/onepage/success/billing_agreement.phtml b/app/code/Magento/Paypal/view/frontend/templates/checkout/onepage/success/billing_agreement.phtml deleted file mode 100644 index 03411f7d0248e..0000000000000 --- a/app/code/Magento/Paypal/view/frontend/templates/checkout/onepage/success/billing_agreement.phtml +++ /dev/null @@ -1,7 +0,0 @@ - - -

%s', $this->escapeHtml($this->getAgreementUrl()), $this->escapeHtml($this->getAgreementRefId())))?>

diff --git a/app/code/Magento/Paypal/view/frontend/templates/express/review.phtml b/app/code/Magento/Paypal/view/frontend/templates/express/review.phtml deleted file mode 100644 index 03c575b0dc711..0000000000000 --- a/app/code/Magento/Paypal/view/frontend/templates/express/review.phtml +++ /dev/null @@ -1,127 +0,0 @@ - -
-

-
-
-
-
- getShippingAddress()): ?> -
- -
-
- getCanEditShippingMethod() || !$this->getCurrentShippingRate()): ?> - getShippingRateGroups()): ?> - getCurrentShippingRate(); ?> -
- -
-
-
- -
-
- -

- - -

renderShippingRateOption($this->getCurrentShippingRate()) ?>

- -
-
-
-
- -
-
renderAddress($this->getShippingAddress()) ?>
-
- getCanEditShippingAddress()): ?> -
- -
- -
- -
- -
- escapeHtml($this->getPaymentMethodTitle()) ?> -
- getEditUrl()): ?> -
- - - -
- -
-
-
- -
-
- - -
- -
- getChildHtml('details') ?> -
- -
- getChildHtml('agreements'); ?> -
-
- - -
- -
-
-
-
- diff --git a/app/code/Magento/Paypal/view/frontend/templates/express/review/details.phtml b/app/code/Magento/Paypal/view/frontend/templates/express/review/details.phtml deleted file mode 100644 index 7e6d811aedbd3..0000000000000 --- a/app/code/Magento/Paypal/view/frontend/templates/express/review/details.phtml +++ /dev/null @@ -1,30 +0,0 @@ - -
- - - - - - - - - - - - getItems() as $_item): ?> - getItemHtml($_item) ?> - - - - getChildHtml('totals'); ?> - -
-
diff --git a/app/code/Magento/Paypal/view/frontend/templates/express/review/shipping/method.phtml b/app/code/Magento/Paypal/view/frontend/templates/express/review/shipping/method.phtml deleted file mode 100644 index 337711c3cd893..0000000000000 --- a/app/code/Magento/Paypal/view/frontend/templates/express/review/shipping/method.phtml +++ /dev/null @@ -1,36 +0,0 @@ - -
- getCanEditShippingMethod() || !$this->getCurrentShippingRate()): ?> - getShippingRateGroups()): ?> - getCurrentShippingRate(); ?> - - -

- - -

renderShippingRateOption($this->getCurrentShippingRate()) ?>

- -
- diff --git a/app/code/Magento/Paypal/view/frontend/templates/express/shortcut.phtml b/app/code/Magento/Paypal/view/frontend/templates/express/shortcut.phtml deleted file mode 100644 index a70f995cb8fff..0000000000000 --- a/app/code/Magento/Paypal/view/frontend/templates/express/shortcut.phtml +++ /dev/null @@ -1,47 +0,0 @@ - - -isOrPositionBefore()) { - $labelPosition = ' before'; -} elseif ($this->isOrPositionAfter()) { - $labelPosition = ' after'; -} -?> -getShortcutHtmlId() ?> - diff --git a/app/code/Magento/Paypal/view/frontend/templates/express/shortcut/container.phtml b/app/code/Magento/Paypal/view/frontend/templates/express/shortcut/container.phtml deleted file mode 100644 index 45f1237a9350b..0000000000000 --- a/app/code/Magento/Paypal/view/frontend/templates/express/shortcut/container.phtml +++ /dev/null @@ -1,13 +0,0 @@ - - -getIsInCatalogProduct()): ?> - - diff --git a/app/code/Magento/Paypal/view/frontend/templates/hss/form.phtml b/app/code/Magento/Paypal/view/frontend/templates/hss/form.phtml deleted file mode 100644 index e637c036f5a55..0000000000000 --- a/app/code/Magento/Paypal/view/frontend/templates/hss/form.phtml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - -
- - - -
- - - diff --git a/app/code/Magento/Paypal/view/frontend/templates/hss/iframe.phtml b/app/code/Magento/Paypal/view/frontend/templates/hss/iframe.phtml deleted file mode 100644 index 9f3d51d1e019c..0000000000000 --- a/app/code/Magento/Paypal/view/frontend/templates/hss/iframe.phtml +++ /dev/null @@ -1,11 +0,0 @@ - -
-
-
- diff --git a/app/code/Magento/Paypal/view/frontend/templates/hss/info.phtml b/app/code/Magento/Paypal/view/frontend/templates/hss/info.phtml deleted file mode 100644 index 786a24b1f48e5..0000000000000 --- a/app/code/Magento/Paypal/view/frontend/templates/hss/info.phtml +++ /dev/null @@ -1,12 +0,0 @@ - - diff --git a/app/code/Magento/Paypal/view/frontend/templates/hss/js.phtml b/app/code/Magento/Paypal/view/frontend/templates/hss/js.phtml deleted file mode 100644 index 73d09b73e51d7..0000000000000 --- a/app/code/Magento/Paypal/view/frontend/templates/hss/js.phtml +++ /dev/null @@ -1,10 +0,0 @@ - -
diff --git a/app/code/Magento/Paypal/view/frontend/templates/hss/redirect.phtml b/app/code/Magento/Paypal/view/frontend/templates/hss/redirect.phtml deleted file mode 100644 index 2606e3e3da15b..0000000000000 --- a/app/code/Magento/Paypal/view/frontend/templates/hss/redirect.phtml +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - - - - diff --git a/app/code/Magento/Paypal/view/frontend/templates/hss/review/button.phtml b/app/code/Magento/Paypal/view/frontend/templates/hss/review/button.phtml deleted file mode 100644 index e17ab071ecf7c..0000000000000 --- a/app/code/Magento/Paypal/view/frontend/templates/hss/review/button.phtml +++ /dev/null @@ -1,7 +0,0 @@ - - diff --git a/app/code/Magento/Paypal/view/frontend/templates/js/components.phtml b/app/code/Magento/Paypal/view/frontend/templates/js/components.phtml deleted file mode 100644 index 5c84082b62f01..0000000000000 --- a/app/code/Magento/Paypal/view/frontend/templates/js/components.phtml +++ /dev/null @@ -1,6 +0,0 @@ - -getChildHtml() ?> diff --git a/app/code/Magento/Paypal/view/frontend/templates/onepage.phtml b/app/code/Magento/Paypal/view/frontend/templates/onepage.phtml deleted file mode 100644 index d0d0c8d78a96e..0000000000000 --- a/app/code/Magento/Paypal/view/frontend/templates/onepage.phtml +++ /dev/null @@ -1,13 +0,0 @@ - - diff --git a/app/code/Magento/Paypal/view/frontend/templates/partner/logo.phtml b/app/code/Magento/Paypal/view/frontend/templates/partner/logo.phtml deleted file mode 100644 index ed800fa93cc0b..0000000000000 --- a/app/code/Magento/Paypal/view/frontend/templates/partner/logo.phtml +++ /dev/null @@ -1,19 +0,0 @@ - - -
-
- - <?php echo __('Additional Options') ?> - -
-
diff --git a/app/code/Magento/Paypal/view/frontend/templates/payflowadvanced/form.phtml b/app/code/Magento/Paypal/view/frontend/templates/payflowadvanced/form.phtml deleted file mode 100644 index 04e9e285d1616..0000000000000 --- a/app/code/Magento/Paypal/view/frontend/templates/payflowadvanced/form.phtml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - -
- - - -
- - - diff --git a/app/code/Magento/Paypal/view/frontend/templates/payflowadvanced/iframe.phtml b/app/code/Magento/Paypal/view/frontend/templates/payflowadvanced/iframe.phtml deleted file mode 100644 index 920715f4505da..0000000000000 --- a/app/code/Magento/Paypal/view/frontend/templates/payflowadvanced/iframe.phtml +++ /dev/null @@ -1,11 +0,0 @@ - -
-
-
- diff --git a/app/code/Magento/Paypal/view/frontend/templates/payflowadvanced/info.phtml b/app/code/Magento/Paypal/view/frontend/templates/payflowadvanced/info.phtml deleted file mode 100644 index 0b4efb8e725c3..0000000000000 --- a/app/code/Magento/Paypal/view/frontend/templates/payflowadvanced/info.phtml +++ /dev/null @@ -1,12 +0,0 @@ - - diff --git a/app/code/Magento/Paypal/view/frontend/templates/payflowadvanced/redirect.phtml b/app/code/Magento/Paypal/view/frontend/templates/payflowadvanced/redirect.phtml deleted file mode 100644 index a5bcd901bb34a..0000000000000 --- a/app/code/Magento/Paypal/view/frontend/templates/payflowadvanced/redirect.phtml +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - - - - diff --git a/app/code/Magento/Paypal/view/frontend/templates/payflowlink/form.phtml b/app/code/Magento/Paypal/view/frontend/templates/payflowlink/form.phtml deleted file mode 100644 index e637c036f5a55..0000000000000 --- a/app/code/Magento/Paypal/view/frontend/templates/payflowlink/form.phtml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - -
- - - -
- - - diff --git a/app/code/Magento/Paypal/view/frontend/templates/payflowlink/iframe.phtml b/app/code/Magento/Paypal/view/frontend/templates/payflowlink/iframe.phtml deleted file mode 100644 index 9b2fdae51dc0d..0000000000000 --- a/app/code/Magento/Paypal/view/frontend/templates/payflowlink/iframe.phtml +++ /dev/null @@ -1,11 +0,0 @@ - -
-
-
- diff --git a/app/code/Magento/Paypal/view/frontend/templates/payflowlink/info.phtml b/app/code/Magento/Paypal/view/frontend/templates/payflowlink/info.phtml deleted file mode 100644 index 4c62796ceb5fa..0000000000000 --- a/app/code/Magento/Paypal/view/frontend/templates/payflowlink/info.phtml +++ /dev/null @@ -1,12 +0,0 @@ - - diff --git a/app/code/Magento/Paypal/view/frontend/templates/payflowlink/redirect.phtml b/app/code/Magento/Paypal/view/frontend/templates/payflowlink/redirect.phtml deleted file mode 100644 index a11df0afebb29..0000000000000 --- a/app/code/Magento/Paypal/view/frontend/templates/payflowlink/redirect.phtml +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - - - diff --git a/app/code/Magento/Paypal/view/frontend/templates/payment/form/billing/agreement.phtml b/app/code/Magento/Paypal/view/frontend/templates/payment/form/billing/agreement.phtml deleted file mode 100644 index e3d61cb1f87cf..0000000000000 --- a/app/code/Magento/Paypal/view/frontend/templates/payment/form/billing/agreement.phtml +++ /dev/null @@ -1,18 +0,0 @@ - - -getMethodCode() ?> - diff --git a/app/code/Magento/Paypal/view/frontend/templates/payment/mark.phtml b/app/code/Magento/Paypal/view/frontend/templates/payment/mark.phtml deleted file mode 100644 index e07fa59059951..0000000000000 --- a/app/code/Magento/Paypal/view/frontend/templates/payment/mark.phtml +++ /dev/null @@ -1,24 +0,0 @@ - - - -<?php echo __('Acceptance Mark') ?> - - getPaymentWhatIs()) { - echo __($this->getPaymentWhatIs()); -} else { - echo __('What is PayPal?'); -} ?> - - diff --git a/app/code/Magento/Paypal/view/frontend/templates/payment/redirect.phtml b/app/code/Magento/Paypal/view/frontend/templates/payment/redirect.phtml deleted file mode 100644 index abe05a940e106..0000000000000 --- a/app/code/Magento/Paypal/view/frontend/templates/payment/redirect.phtml +++ /dev/null @@ -1,21 +0,0 @@ - - - diff --git a/app/code/Magento/Paypal/view/frontend/web/js/opcheckout.js b/app/code/Magento/Paypal/view/frontend/web/js/opcheckout.js deleted file mode 100644 index 36d75ad501c76..0000000000000 --- a/app/code/Magento/Paypal/view/frontend/web/js/opcheckout.js +++ /dev/null @@ -1,34 +0,0 @@ -/** - * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) - */ -/*jshint browser:true jquery:true*/ -define([ - "jquery", - "Magento_Checkout/js/opc-order-review", - "jquery/ui" -], function($, opcOrderReview){ - "use strict"; - - $.widget('mage.opcheckoutPaypalIframe', opcOrderReview, { - options: { - review: { - submitContainer: '#checkout-review-submit' - } - }, - - _create: function() { - var events = {}; - events['contentUpdated' + this.options.review.container] = function() { - var paypalIframe = this.element.find(this.options.review.container) - .find('[data-container="paypal-iframe"]'); - if (paypalIframe.length) { - paypalIframe.show(); - $(this.options.review.submitContainer).hide(); - } - }; - this._on(events); - } - }); - - return $.mage.opcheckoutPaypalIframe; -}); \ No newline at end of file diff --git a/app/code/Magento/Paypal/view/frontend/web/js/paypal-checkout.js b/app/code/Magento/Paypal/view/frontend/web/js/paypal-checkout.js deleted file mode 100644 index e35465d739c8f..0000000000000 --- a/app/code/Magento/Paypal/view/frontend/web/js/paypal-checkout.js +++ /dev/null @@ -1,36 +0,0 @@ -/** - * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) - */ -/*jshint browser:true jquery:true*/ -define([ - "jquery", - "jquery/ui", - "mage/mage" -], function($){ - "use strict"; - - $.widget('mage.paypalCheckout', { - /** - * Initialize store credit events - * @private - */ - _create: function () { - this.element.on('click', '[data-action="checkout-form-submit"]', $.proxy(function (e) { - var returnUrl = $(e.target).data('checkout-url'); - if (this.options.confirmUrl && this.options.confirmMessage) { - if (window.confirm(this.options.confirmMessage)) { - returnUrl = this.options.confirmUrl; - } - } - if (this.options.isCatalogProduct) { - // find the form from which the button was clicked - var form = $(this.options.shortcutContainerClass).closest("form"); - $(form).find(this.options.paypalCheckoutSelector).val(returnUrl); - $(form).submit(); - } else { - $.mage.redirect(returnUrl); - } - }, this)); - } - }); -}); \ No newline at end of file diff --git a/app/code/Magento/Paypal/view/frontend/web/order-review.js b/app/code/Magento/Paypal/view/frontend/web/order-review.js deleted file mode 100644 index a88a7c85805c9..0000000000000 --- a/app/code/Magento/Paypal/view/frontend/web/order-review.js +++ /dev/null @@ -1,294 +0,0 @@ -/** - * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) - */ -/*jshint browser:true jquery:true*/ -/*global alert*/ -define([ - "jquery", - "jquery/ui", - "mage/translate", - "mage/mage", - "mage/validation" -], function($){ - "use strict"; - - $.widget('mage.orderReview', { - options: { - orderReviewSubmitSelector: '#review-button', - shippingSelector: '#shipping_method', - shippingSubmitFormSelector: null, - updateOrderSelector: '#update-order', - billingAsShippingSelector: '#billing\\:as_shipping', - updateContainerSelector: '#details-reload', - waitLoadingContainer: '#review-please-wait', - shippingMethodContainer: '#shipping-method-container', - isAjax: false, - updateShippingMethodSubmitSelector: "#update-shipping-method-submit", - reviewSubmitSelector: "#review-submit", - shippingMethodUpdateUrl: null, - updateOrderSubmitUrl: null - }, - - /** - * Widget instance properties - */ - triggerPropertyChange: true, - isShippingSubmitForm: false, - - _create: function () { - //change handler for ajaxEnabled - if (this.options.isAjax) { - this._submitOrder = this._ajaxSubmitOrder; - } - - this.element.on('click', this.options.orderReviewSubmitSelector, $.proxy(this._submitOrder, this)) - .on('click', this.options.billingAsShippingSelector, $.proxy(this._shippingTobilling, this)) - .on('change', this.options.shippingSelector, $.proxy(this._submitUpdateOrder, this, this.options.updateOrderSubmitUrl, this.options.updateContainerSelector)) - .find(this.options.updateOrderSelector).on('click', $.proxy(this._updateOrderHandler, this)).end() - .find(this.options.updateShippingMethodSubmitSelector).hide().end() - .find(this.options.reviewSubmitSelector).hide(); - this._shippingTobilling(); - if ($(this.options.shippingSubmitFormSelector).length) { - this.isShippingSubmitForm = true; - $(this.options.shippingSubmitFormSelector).find(this.options.updateShippingMethodSubmitSelector).hide().end() - .on('change', - this.options.shippingSelector, $.proxy(this._submitUpdateOrder, this, $(this.options.shippingSubmitFormSelector).prop('action'), this.options.updateContainerSelector)); - this._updateOrderSubmit(!$(this.options.shippingSubmitFormSelector).find(this.options.shippingSelector).val()); - } else { - var isDisable = (this.isShippingSubmitForm && this.element.find(this.options.shippingSelector).val()); - this.element.on('input propertychange', ":input[name]", $.proxy(this._updateOrderSubmit, this, isDisable, this._onShippingChange)) - .find('select').not(this.options.shippingSelector).on('change', this._propertyChange); - this._updateOrderSubmit(isDisable); - } - - }, - - /** - * show ajax loader - */ - _ajaxBeforeSend: function () { - this.element.find(this.options.waitLoadingContainer).show(); - }, - - /** - * hide ajax loader - */ - _ajaxComplete: function () { - this.element.find(this.options.waitLoadingContainer).hide(); - }, - - /** - * trigger propertychange for input type select - */ - _propertyChange: function () { - $(this).trigger('propertychange'); - }, - - /** - * trigger change for the update of shippping methods from server - */ - _updateOrderHandler: function () { - $(this.options.shippingSelector).trigger('change'); - }, - - /** - * Attempt to submit order - */ - _submitOrder: function () { - if (this._validateForm()) { - this.element.find(this.options.updateOrderSelector).fadeTo(0, 0.5) - .end().find(this.options.waitLoadingContainer).show() - .end().submit(); - } - this._updateOrderSubmit(true); - }, - - /** - * Attempt to ajax submit order - */ - _ajaxSubmitOrder: function () { - if (this.element.find(this.options.waitLoadingContainer).is(":visible")) { - return false; - } - $.ajax({ - url: this.element.prop('action'), - type: 'post', - context: this, - data: {isAjax: 1}, - dataType: 'json', - beforeSend: this._ajaxBeforeSend, - complete: this._ajaxComplete, - success: function (response) { - if ($.type(response) === 'object' && !$.isEmptyObject(response)) { - if (response.error_messages) { - this._ajaxComplete(); - var msg = response.error_messages; - if (msg) { - if ($.type(msg) === 'array') { - msg = msg.join("\n"); - } - } - alert($.mage.__(msg)); - return false; - } - if (response.redirect) { - $.mage.redirect(response.redirect); - return false; - } - else if (response.success) { - $.mage.redirect(this.options.successUrl); - return false; - } - this._ajaxComplete(); - alert($.mage.__('Sorry, something went wrong.')); - } - }, - error: function () { - alert($.mage.__('Sorry, something went wrong. Please try again later.')); - this._ajaxComplete(); - } - }); - }, - - /** - * Validate Order form - */ - _validateForm: function () { - if (this.element.data('mageValidation')) { - return this.element.validation().valid(); - } - return true; - }, - - /** - * Check/Set whether order can be submitted - * Also disables form submission element, if any - * @param shouldDisable - whether should prevent order submission explicitly - * @param optional function for shipping change handler - * @param optional if true the property change will be set to true - */ - _updateOrderSubmit: function (shouldDisable, fn) { - this._toggleButton(this.options.orderReviewSubmitSelector, shouldDisable); - if ($.type(fn) === 'function') { - fn.call(this); - } - }, - - /** - * Enable/Disable button - * @param button button selector to be toggled - * @param disable boolean for toggling - */ - _toggleButton: function (button, disable) { - $(button).prop({"disabled": disable}).toggleClass('no-checkout', disable).fadeTo(0, disable ? 0.5 : 1); - }, - - /** - * Copy element value from shipping to billing address - * @param e optional - */ - _shippingTobilling: function (e) { - if (this.options.shippingSubmitFormSelector) { - return false; - } - var isChecked = $(this.options.billingAsShippingSelector).is(':checked'), - opacity = isChecked ? 0.5 : 1; - if (isChecked) { - this.element.validation("clearError", ':input[name^="billing"]'); - } - $(':input[name^="shipping"]', this.element).each($.proxy(function (key, value) { - var fieldObj = $(value.id.replace('shipping:', '#billing\\:')); - if (isChecked) { - fieldObj = fieldObj.val($(value).val()); - } - fieldObj.prop({"readonly": isChecked, "disabled": isChecked}).fadeTo(0, opacity); - if (fieldObj.is("select")) { - this.triggerPropertyChange = false; - fieldObj.trigger('change'); - } - }, this)); - if (isChecked || e) { - this._updateOrderSubmit(true); - } - this.triggerPropertyChange = true; - }, - - /** - * Dispatch an ajax request of Update Order submission - * @param url - url where to submit shipping method - * @param resultId - id of element to be updated - */ - _submitUpdateOrder: function (url, resultId) { - if (this.element.find(this.options.waitLoadingContainer).is(":visible")) { - return false; - } - var isChecked = $(this.options.billingAsShippingSelector).is(':checked'), - formData = null, - callBackResponseHandler = null, - shippingMethod = $.trim($(this.options.shippingSelector).val()); - this._shippingTobilling(); - if (url && resultId && this._validateForm() && shippingMethod) { - this._updateOrderSubmit(true); - this._toggleButton(this.options.updateOrderSelector, true); - // form data and callBack updated based on the shippping Form element - if (this.isShippingSubmitForm) { - formData = $(this.options.shippingSubmitFormSelector).serialize() + "&isAjax=true"; - callBackResponseHandler = function (response) { - $(resultId).html(response); - this._updateOrderSubmit(false); - this._ajaxComplete(); - }; - } else { - formData = this.element.serialize() + "&isAjax=true"; - callBackResponseHandler = function (response) { - $(resultId).html(response); - this._ajaxShippingUpdate(shippingMethod); - }; - } - if (isChecked) { - $(this.options.shippingSelect).prop('disabled', true); - } - $.ajax({ - url: url, - type: 'post', - context: this, - beforeSend: this._ajaxBeforeSend, - data: formData, - success: callBackResponseHandler - }); - } - }, - - /** - * Update Shipping Methods Element from server - * @param shippingMethod - */ - _ajaxShippingUpdate: function (shippingMethod) { - $.ajax({ - url: this.options.shippingMethodUpdateUrl, - data: {isAjax: true, shipping_method: shippingMethod}, - type: 'post', - context: this, - success: function (response) { - $(this.options.shippingMethodContainer).parent().html(response); - this._toggleButton(this.options.updateOrderSelector, false); - this._updateOrderSubmit(false); - }, - complete: this._ajaxComplete - } - ); - }, - - /** - * Actions on change Shipping Address data - */ - _onShippingChange: function () { - if (this.triggerPropertyChange && $.trim($(this.options.shippingSelector).val())) { - this.element.find(this.options.shippingSelector).hide().end() - .find(this.options.shippingSelector + '_update').show(); - } - } - }); - - return $.mage.orderReview; -}); \ No newline at end of file diff --git a/app/code/Magento/Persistent/composer.json b/app/code/Magento/Persistent/composer.json index adedb09775a1b..f875228c95812 100644 --- a/app/code/Magento/Persistent/composer.json +++ b/app/code/Magento/Persistent/composer.json @@ -3,17 +3,17 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha108", - "magento/module-checkout": "0.1.0-alpha108", - "magento/module-core": "0.1.0-alpha108", - "magento/module-customer": "0.1.0-alpha108", - "magento/module-sales": "0.1.0-alpha108", - "magento/module-cron": "0.1.0-alpha108", - "magento/framework": "0.1.0-alpha108", + "magento/module-store": "0.42.0-beta1", + "magento/module-checkout": "0.42.0-beta1", + "magento/module-core": "0.42.0-beta1", + "magento/module-customer": "0.42.0-beta1", + "magento/module-sales": "0.42.0-beta1", + "magento/module-cron": "0.42.0-beta1", + "magento/framework": "0.42.0-beta1", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha108", + "version": "0.42.0-beta1", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/ProductAlert/Block/Product/View.php b/app/code/Magento/ProductAlert/Block/Product/View.php index 140fd950fbdc4..4e0058dffddf0 100644 --- a/app/code/Magento/ProductAlert/Block/Product/View.php +++ b/app/code/Magento/ProductAlert/Block/Product/View.php @@ -21,21 +21,29 @@ class View extends \Magento\Framework\View\Element\Template */ protected $_helper; + /** + * @var \Magento\Core\Helper\PostData + */ + protected $coreHelper; + /** * @param \Magento\Framework\View\Element\Template\Context $context * @param \Magento\ProductAlert\Helper\Data $helper * @param \Magento\Framework\Registry $registry + * @param \Magento\Core\Helper\PostData $coreHelper * @param array $data */ public function __construct( \Magento\Framework\View\Element\Template\Context $context, \Magento\ProductAlert\Helper\Data $helper, \Magento\Framework\Registry $registry, + \Magento\Core\Helper\PostData $coreHelper, array $data = [] ) { parent::__construct($context, $data); $this->_registry = $registry; $this->_helper = $helper; + $this->coreHelper = $coreHelper; } /** @@ -51,4 +59,14 @@ protected function getProduct() } return false; } + + /** + * Retrieve post action config + * + * @return string + */ + public function getPostAction() + { + return $this->coreHelper->getPostData($this->getSignupUrl()); + } } diff --git a/app/code/Magento/ProductAlert/composer.json b/app/code/Magento/ProductAlert/composer.json index d6810509eb8e4..5779c04264608 100644 --- a/app/code/Magento/ProductAlert/composer.json +++ b/app/code/Magento/ProductAlert/composer.json @@ -3,15 +3,15 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha108", - "magento/module-catalog": "0.1.0-alpha108", - "magento/module-customer": "0.1.0-alpha108", - "magento/module-core": "0.1.0-alpha108", - "magento/framework": "0.1.0-alpha108", + "magento/module-store": "0.42.0-beta1", + "magento/module-catalog": "0.42.0-beta1", + "magento/module-customer": "0.42.0-beta1", + "magento/module-core": "0.42.0-beta1", + "magento/framework": "0.42.0-beta1", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha108", + "version": "0.42.0-beta1", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/ProductAlert/view/frontend/templates/product/view.phtml b/app/code/Magento/ProductAlert/view/frontend/templates/product/view.phtml index 656ea03cc3ebf..82e868064eecc 100644 --- a/app/code/Magento/ProductAlert/view/frontend/templates/product/view.phtml +++ b/app/code/Magento/ProductAlert/view/frontend/templates/product/view.phtml @@ -5,7 +5,7 @@ ?>
- escapeHtml(__($this->getSignupLabel())); ?> diff --git a/app/code/Magento/Reports/Model/Event/Observer.php b/app/code/Magento/Reports/Model/Event/Observer.php index 828387e24ef3e..29a7c544c17b3 100644 --- a/app/code/Magento/Reports/Model/Event/Observer.php +++ b/app/code/Magento/Reports/Model/Event/Observer.php @@ -85,19 +85,17 @@ protected function _event($eventTypeId, $objectId, $subjectId = null, $subtype = } } + /** @var \Magento\Reports\Model\Event $eventModel */ $eventModel = $this->_eventFactory->create(); $storeId = $this->_storeManager->getStore()->getId(); - $eventModel->setEventTypeId( - $eventTypeId - )->setObjectId( - $objectId - )->setSubjectId( - $subjectId - )->setSubtype( - $subtype - )->setStoreId( - $storeId - ); + $eventModel->setData([ + 'event_type_id' => $eventTypeId, + 'object_id' => $objectId, + 'subject_id' => $subjectId, + 'subtype' => $subtype, + 'store_id' => $storeId, + ]); + $eventModel->save(); return $this; @@ -149,7 +147,15 @@ public function catalogProductView(\Magento\Framework\Event\Observer $observer) { $productId = $observer->getEvent()->getProduct()->getId(); - $this->_productIndxFactory->create()->setProductId($productId)->save()->calculate(); + $viewData['product_id'] = $productId; + + if ($this->_customerSession->isLoggedIn()) { + $viewData['customer_id'] = $this->_customerSession->getCustomerId(); + } else { + $viewData['visitor_id'] = $this->_customerVisitor->getId(); + } + + $this->_productIndxFactory->create()->setData($viewData)->save()->calculate(); return $this->_event(\Magento\Reports\Model\Event::EVENT_PRODUCT_VIEW, $productId); } diff --git a/app/code/Magento/Reports/composer.json b/app/code/Magento/Reports/composer.json index 67c3875efcf78..7216114373260 100644 --- a/app/code/Magento/Reports/composer.json +++ b/app/code/Magento/Reports/composer.json @@ -3,27 +3,27 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha108", - "magento/module-eav": "0.1.0-alpha108", - "magento/module-customer": "0.1.0-alpha108", - "magento/module-catalog": "0.1.0-alpha108", - "magento/module-sales": "0.1.0-alpha108", - "magento/module-cms": "0.1.0-alpha108", - "magento/module-backend": "0.1.0-alpha108", - "magento/module-core": "0.1.0-alpha108", - "magento/module-widget": "0.1.0-alpha108", - "magento/module-log": "0.1.0-alpha108", - "magento/module-wishlist": "0.1.0-alpha108", - "magento/module-review": "0.1.0-alpha108", - "magento/module-catalog-inventory": "0.1.0-alpha108", - "magento/module-tax": "0.1.0-alpha108", - "magento/module-downloadable": "0.1.0-alpha108", - "magento/module-sales-rule": "0.1.0-alpha108", - "magento/framework": "0.1.0-alpha108", + "magento/module-store": "0.42.0-beta1", + "magento/module-eav": "0.42.0-beta1", + "magento/module-customer": "0.42.0-beta1", + "magento/module-catalog": "0.42.0-beta1", + "magento/module-sales": "0.42.0-beta1", + "magento/module-cms": "0.42.0-beta1", + "magento/module-backend": "0.42.0-beta1", + "magento/module-core": "0.42.0-beta1", + "magento/module-widget": "0.42.0-beta1", + "magento/module-log": "0.42.0-beta1", + "magento/module-wishlist": "0.42.0-beta1", + "magento/module-review": "0.42.0-beta1", + "magento/module-catalog-inventory": "0.42.0-beta1", + "magento/module-tax": "0.42.0-beta1", + "magento/module-downloadable": "0.42.0-beta1", + "magento/module-sales-rule": "0.42.0-beta1", + "magento/framework": "0.42.0-beta1", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha108", + "version": "0.42.0-beta1", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/RequireJs/composer.json b/app/code/Magento/RequireJs/composer.json index 335ef79628263..e212cc993b314 100644 --- a/app/code/Magento/RequireJs/composer.json +++ b/app/code/Magento/RequireJs/composer.json @@ -3,11 +3,11 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/framework": "0.1.0-alpha108", + "magento/framework": "0.42.0-beta1", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha108", + "version": "0.42.0-beta1", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Review/Block/Adminhtml/Add/Form.php b/app/code/Magento/Review/Block/Adminhtml/Add/Form.php index 5f864e58bfb86..829789a368dd9 100644 --- a/app/code/Magento/Review/Block/Adminhtml/Add/Form.php +++ b/app/code/Magento/Review/Block/Adminhtml/Add/Form.php @@ -134,7 +134,6 @@ protected function _prepareForm() 'name' => 'detail', 'title' => __('Review'), 'label' => __('Review'), - 'style' => 'height: 600px;', 'required' => true ] ); diff --git a/app/code/Magento/Review/Block/Adminhtml/Rating/Edit/Tab/Form.php b/app/code/Magento/Review/Block/Adminhtml/Rating/Edit/Tab/Form.php index abd21e1e1be82..1e1ee3352df1e 100644 --- a/app/code/Magento/Review/Block/Adminhtml/Rating/Edit/Tab/Form.php +++ b/app/code/Magento/Review/Block/Adminhtml/Rating/Edit/Tab/Form.php @@ -13,6 +13,11 @@ class Form extends \Magento\Backend\Block\Widget\Form\Generic */ protected $_systemStore; + /** + * @var string + */ + protected $_template = 'rating/form.phtml'; + /** * Session * @@ -176,26 +181,4 @@ protected function _setRatingCodes($ratingCodes) } } } - - /** - * @return string - */ - protected function _toHtml() - { - return $this->_getWarningHtml() . parent::_toHtml(); - } - - /** - * @return string - */ - protected function _getWarningHtml() - { - return ' -
-
' . - __( - 'Please specify a rating title for a store, or we\'ll just use the default value.' - ) . '
-
'; - } } diff --git a/app/code/Magento/Review/composer.json b/app/code/Magento/Review/composer.json index c0d1ce3385bab..3a4cc6f7ba698 100644 --- a/app/code/Magento/Review/composer.json +++ b/app/code/Magento/Review/composer.json @@ -3,20 +3,20 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha108", - "magento/module-catalog": "0.1.0-alpha108", - "magento/module-core": "0.1.0-alpha108", - "magento/module-customer": "0.1.0-alpha108", - "magento/module-eav": "0.1.0-alpha108", - "magento/module-theme": "0.1.0-alpha108", - "magento/module-backend": "0.1.0-alpha108", - "magento/module-newsletter": "0.1.0-alpha108", - "magento/framework": "0.1.0-alpha108", - "magento/module-ui": "0.1.0-alpha108", + "magento/module-store": "0.42.0-beta1", + "magento/module-catalog": "0.42.0-beta1", + "magento/module-core": "0.42.0-beta1", + "magento/module-customer": "0.42.0-beta1", + "magento/module-eav": "0.42.0-beta1", + "magento/module-theme": "0.42.0-beta1", + "magento/module-backend": "0.42.0-beta1", + "magento/module-newsletter": "0.42.0-beta1", + "magento/framework": "0.42.0-beta1", + "magento/module-ui": "0.42.0-beta1", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha108", + "version": "0.42.0-beta1", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Review/view/adminhtml/templates/rating/form.phtml b/app/code/Magento/Review/view/adminhtml/templates/rating/form.phtml new file mode 100644 index 0000000000000..0f4b8c6bd6dd8 --- /dev/null +++ b/app/code/Magento/Review/view/adminhtml/templates/rating/form.phtml @@ -0,0 +1,10 @@ + +
+
+
+ +getFormHtml() ?> diff --git a/app/code/Magento/Rss/App/Action/Plugin/BackendAuthentication.php b/app/code/Magento/Rss/App/Action/Plugin/BackendAuthentication.php index b4b901d6673c2..7e8d7dfefe005 100644 --- a/app/code/Magento/Rss/App/Action/Plugin/BackendAuthentication.php +++ b/app/code/Magento/Rss/App/Action/Plugin/BackendAuthentication.php @@ -34,9 +34,7 @@ class BackendAuthentication extends \Magento\Backend\App\Action\Plugin\Authentic /** * @var array */ - protected $aclResources = [ - 'feed' => 'Magento_Rss::rss', - ]; + protected $aclResources; /** * @param \Magento\Backend\Model\Auth $auth @@ -47,6 +45,7 @@ class BackendAuthentication extends \Magento\Backend\App\Action\Plugin\Authentic * @param \Magento\Framework\HTTP\Authentication $httpAuthentication * @param \Magento\Framework\Logger $logger * @param \Magento\Framework\AuthorizationInterface $authorization + * @param array $aclResources */ public function __construct( \Magento\Backend\Model\Auth $auth, @@ -56,11 +55,13 @@ public function __construct( \Magento\Framework\Message\ManagerInterface $messageManager, \Magento\Framework\HTTP\Authentication $httpAuthentication, \Magento\Framework\Logger $logger, - \Magento\Framework\AuthorizationInterface $authorization + \Magento\Framework\AuthorizationInterface $authorization, + array $aclResources ) { $this->httpAuthentication = $httpAuthentication; $this->logger = $logger; $this->authorization = $authorization; + $this->aclResources = $aclResources; parent::__construct($auth, $url, $response, $actionFlag, $messageManager); } @@ -72,6 +73,8 @@ public function __construct( * @param RequestInterface $request * @return ResponseInterface * @SuppressWarnings(PHPMD.UnusedFormalParameter) + * @SuppressWarnings(PHPMD.CyclomaticComplexity) + * @SuppressWarnings(PHPMD.NPathComplexity) */ public function aroundDispatch(AbstractAction $subject, \Closure $proceed, RequestInterface $request) { @@ -81,7 +84,10 @@ public function aroundDispatch(AbstractAction $subject, \Closure $proceed, Reque : $this->aclResources[$request->getControllerName()] : null; - if (!$resource) { + $type = $request->getParam('type'); + $resourceType = isset($this->aclResources[$type]) ? $this->aclResources[$type] : null; + + if (!$resource || !$resourceType) { return parent::aroundDispatch($subject, $proceed, $request); } @@ -98,7 +104,8 @@ public function aroundDispatch(AbstractAction $subject, \Closure $proceed, Reque } // Verify if logged in and authorized - if (!$session->isLoggedIn() || !$this->authorization->isAllowed($resource)) { + if (!$session->isLoggedIn() || !$this->authorization->isAllowed($resource) + || !$this->authorization->isAllowed($resourceType)) { $this->httpAuthentication->setAuthenticationFailed('RSS Feeds'); return $this->_response; } diff --git a/app/code/Magento/Rss/composer.json b/app/code/Magento/Rss/composer.json index 7c32665a8450b..d3731ff12a161 100644 --- a/app/code/Magento/Rss/composer.json +++ b/app/code/Magento/Rss/composer.json @@ -3,14 +3,14 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha108", - "magento/module-backend": "0.1.0-alpha108", - "magento/framework": "0.1.0-alpha108", - "magento/module-customer": "0.1.0-alpha108", + "magento/module-store": "0.42.0-beta1", + "magento/module-backend": "0.42.0-beta1", + "magento/framework": "0.42.0-beta1", + "magento/module-customer": "0.42.0-beta1", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha108", + "version": "0.42.0-beta1", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Rss/etc/adminhtml/di.xml b/app/code/Magento/Rss/etc/adminhtml/di.xml index f25790e4275fa..dd3194d60a8b0 100644 --- a/app/code/Magento/Rss/etc/adminhtml/di.xml +++ b/app/code/Magento/Rss/etc/adminhtml/di.xml @@ -8,4 +8,14 @@ + + + + Magento_Rss::rss + Magento_Catalog::catalog_inventory + Magento_Sales::actions_view + Magento_Reports::review_product + + + diff --git a/app/code/Magento/Rule/composer.json b/app/code/Magento/Rule/composer.json index 2d66f205d8d8f..523a353b85802 100644 --- a/app/code/Magento/Rule/composer.json +++ b/app/code/Magento/Rule/composer.json @@ -3,16 +3,16 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha108", - "magento/module-eav": "0.1.0-alpha108", - "magento/module-catalog": "0.1.0-alpha108", - "magento/module-backend": "0.1.0-alpha108", - "magento/framework": "0.1.0-alpha108", + "magento/module-store": "0.42.0-beta1", + "magento/module-eav": "0.42.0-beta1", + "magento/module-catalog": "0.42.0-beta1", + "magento/module-backend": "0.42.0-beta1", + "magento/framework": "0.42.0-beta1", "lib-libxml": "*", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha108", + "version": "0.42.0-beta1", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Sales/Api/CreditmemoCommentRepositoryInterface.php b/app/code/Magento/Sales/Api/CreditmemoCommentRepositoryInterface.php index 89de16b5acd01..767f850e2ec15 100644 --- a/app/code/Magento/Sales/Api/CreditmemoCommentRepositoryInterface.php +++ b/app/code/Magento/Sales/Api/CreditmemoCommentRepositoryInterface.php @@ -5,37 +5,46 @@ namespace Magento\Sales\Api; /** - * Interface RepositoryInterface + * Credit memo comment repository interface. + * + * After a customer places and pays for an order and an invoice has been issued, the merchant can create a credit memo + * to refund all or part of the amount paid for any returned or undelivered items. The memo restores funds to the + * customer account so that the customer can make future purchases. A credit memo usually includes comments that detail + * why the credit memo amount was credited to the customer. */ interface CreditmemoCommentRepositoryInterface { /** - * Load entity + * Loads a specified credit memo comment. * - * @param int $id - * @return \Magento\Sales\Api\Data\CreditmemoCommentInterface + * @param int $id The credit memo comment ID. + * @return \Magento\Sales\Api\Data\CreditmemoCommentInterface Credit memo comment interface. */ public function get($id); /** - * @param \Magento\Framework\Api\SearchCriteria $criteria - * @return \Magento\Sales\Api\Data\CreditmemoCommentSearchResultInterface + * Lists credit memo comments that match specified search criteria. + * + * Returns a credit memo comment search results interface. + * + * @param \Magento\Framework\Api\SearchCriteria $criteria The search criteria. + * @return \Magento\Sales\Api\Data\CreditmemoCommentSearchResultInterface Credit memo comment search results interface. */ public function getList(\Magento\Framework\Api\SearchCriteria $criteria); /** - * Delete entity + * Deletes a specified credit memo comment. * - * @param \Magento\Sales\Api\Data\CreditmemoCommentInterface $entity + * @param \Magento\Sales\Api\Data\CreditmemoCommentInterface $entity The credit memo comment. * @return bool */ public function delete(\Magento\Sales\Api\Data\CreditmemoCommentInterface $entity); /** - * Perform persist operations for one entity + * Performs persist operations for a specified entity. * - * @param \Magento\Sales\Api\Data\CreditmemoCommentInterface $entity - * @return \Magento\Sales\Api\Data\CreditmemoCommentInterface + * @param \Magento\Sales\Api\Data\CreditmemoCommentInterface $entity The credit memo comment. + * @return \Magento\Sales\Api\Data\CreditmemoCommentInterface Credit memo comment interface. */ public function save(\Magento\Sales\Api\Data\CreditmemoCommentInterface $entity); } diff --git a/app/code/Magento/Sales/Api/CreditmemoItemRepositoryInterface.php b/app/code/Magento/Sales/Api/CreditmemoItemRepositoryInterface.php index 77daa7cd93e32..f442873f61dc7 100644 --- a/app/code/Magento/Sales/Api/CreditmemoItemRepositoryInterface.php +++ b/app/code/Magento/Sales/Api/CreditmemoItemRepositoryInterface.php @@ -5,37 +5,44 @@ namespace Magento\Sales\Api; /** - * Interface RepositoryInterface + * Credit memo item repository interface. + * + * After a customer places and pays for an order and an invoice has been issued, the merchant can create a credit memo + * to refund all or part of the amount paid for any returned or undelivered items. The memo restores funds to the + * customer account so that the customer can make future purchases. A credit memo item is an invoiced item for which + * a merchant creates a credit memo. */ interface CreditmemoItemRepositoryInterface { /** - * Load entity + * Loads a specified credit memo item. * - * @param int $id - * @return \Magento\Sales\Api\Data\CreditmemoItemInterface + * @param int $id The credit memo item ID. + * @return \Magento\Sales\Api\Data\CreditmemoItemInterface Credit memo item interface. */ public function get($id); /** - * @param \Magento\Framework\Api\SearchCriteria $criteria - * @return \Magento\Sales\Api\Data\CreditmemoItemSearchResultInterface + * Lists credit memo items that match specified search criteria. + * + * @param \Magento\Framework\Api\SearchCriteria $criteria The search criteria. + * @return \Magento\Sales\Api\Data\CreditmemoItemSearchResultInterface Credit memo item search results interface. */ public function getList(\Magento\Framework\Api\SearchCriteria $criteria); /** - * Delete entity + * Deletes a specified credit memo item. * - * @param \Magento\Sales\Api\Data\CreditmemoInterface $entity + * @param \Magento\Sales\Api\Data\CreditmemoInterface $entity The credit memo item. * @return bool */ public function delete(\Magento\Sales\Api\Data\CreditmemoInterface $entity); /** - * Perform persist operations for one entity + * Performs persist operations for a specified credit memo item. * - * @param \Magento\Sales\Api\Data\CreditmemoInterface $entity - * @return \Magento\Sales\Api\Data\CreditmemoInterface + * @param \Magento\Sales\Api\Data\CreditmemoInterface $entity The credit memo item. + * @return \Magento\Sales\Api\Data\CreditmemoInterface Credit memo interface. */ public function save(\Magento\Sales\Api\Data\CreditmemoInterface $entity); } diff --git a/app/code/Magento/Sales/Api/CreditmemoManagementInterface.php b/app/code/Magento/Sales/Api/CreditmemoManagementInterface.php index a1bfd98fa6a48..5b647f2886cb4 100644 --- a/app/code/Magento/Sales/Api/CreditmemoManagementInterface.php +++ b/app/code/Magento/Sales/Api/CreditmemoManagementInterface.php @@ -5,29 +5,34 @@ namespace Magento\Sales\Api; /** - * Interface CreditmemoAddCommentInterface + * Credit memo add comment interface. + * + * After a customer places and pays for an order and an invoice has been issued, the merchant can create a credit memo + * to refund all or part of the amount paid for any returned or undelivered items. The memo restores funds to the + * customer account so that the customer can make future purchases. */ interface CreditmemoManagementInterface { /** - * Cancel an existing creditimemo + * Cancels a specified credit memo. * - * @param int $id + * @param int $id The credit memo ID. * @return bool */ public function cancel($id); /** - * Returns list of comments attached to creditmemo - * @param int $id - * @return \Magento\Sales\Api\Data\CreditmemoCommentSearchResultInterface + * Lists comments for a specified credit memo. + * + * @param int $id The credit memo ID. + * @return \Magento\Sales\Api\Data\CreditmemoCommentSearchResultInterface Credit memo comment search results interface. */ public function getCommentsList($id); /** - * Notify user + * Emails a user a specified credit memo. * - * @param int $id + * @param int $id The credit memo ID. * @return bool */ public function notify($id); diff --git a/app/code/Magento/Sales/Api/CreditmemoRepositoryInterface.php b/app/code/Magento/Sales/Api/CreditmemoRepositoryInterface.php index a2cd4db79866a..a3cc19e811486 100644 --- a/app/code/Magento/Sales/Api/CreditmemoRepositoryInterface.php +++ b/app/code/Magento/Sales/Api/CreditmemoRepositoryInterface.php @@ -5,37 +5,43 @@ namespace Magento\Sales\Api; /** - * Interface RepositoryInterface + * Credit memo repository interface. + * + * After a customer places and pays for an order and an invoice has been issued, the merchant can create a credit memo + * to refund all or part of the amount paid for any returned or undelivered items. The memo restores funds to the + * customer account so that the customer can make future purchases. */ interface CreditmemoRepositoryInterface { /** - * @param \Magento\Framework\Api\SearchCriteria $criteria - * @return \Magento\Sales\Api\Data\CreditmemoSearchResultInterface + * Lists credit memos that match specified search criteria. + * + * @param \Magento\Framework\Api\SearchCriteria $criteria The search criteria. + * @return \Magento\Sales\Api\Data\CreditmemoSearchResultInterface Credit memo search result interface. */ public function getList(\Magento\Framework\Api\SearchCriteria $criteria); /** - * Load entity + * Loads a specified credit memo. * - * @param int $id - * @return \Magento\Sales\Api\Data\CreditmemoInterface + * @param int $id The credit memo ID. + * @return \Magento\Sales\Api\Data\CreditmemoInterface Credit memo interface. */ public function get($id); /** - * Delete entity + * Deletes a specified credit memo. * - * @param \Magento\Sales\Api\Data\CreditmemoInterface $entity + * @param \Magento\Sales\Api\Data\CreditmemoInterface $entity The credit memo. * @return bool */ public function delete(\Magento\Sales\Api\Data\CreditmemoInterface $entity); /** - * Perform persist operations for one entity + * Performs persist operations for a specified credit memo. * - * @param \Magento\Sales\Api\Data\CreditmemoInterface $entity - * @return \Magento\Sales\Api\Data\CreditmemoInterface + * @param \Magento\Sales\Api\Data\CreditmemoInterface $entity The credit memo. + * @return \Magento\Sales\Api\Data\CreditmemoInterface Credit memo interface. */ public function save(\Magento\Sales\Api\Data\CreditmemoInterface $entity); } diff --git a/app/code/Magento/Sales/Api/Data/CreditmemoCommentInterface.php b/app/code/Magento/Sales/Api/Data/CreditmemoCommentInterface.php index 56e375eee5dda..66eaabc4d6856 100644 --- a/app/code/Magento/Sales/Api/Data/CreditmemoCommentInterface.php +++ b/app/code/Magento/Sales/Api/Data/CreditmemoCommentInterface.php @@ -5,59 +5,82 @@ namespace Magento\Sales\Api\Data; /** - * Interface CreditmemoCommentInterface + * Credit memo comment interface. + * + * After a customer places and pays for an order and an invoice has been issued, the merchant can create a credit memo + * to refund all or part of the amount paid for any returned or undelivered items. The memo restores funds to the + * customer account so that the customer can make future purchases. A credit memo usually includes comments that detail + * why the credit memo amount was credited to the customer. */ interface CreditmemoCommentInterface extends \Magento\Framework\Api\ExtensibleDataInterface { /**#@+ - * Constants for keys of data array. Identical to the name of the getter in snake case + * Constants for keys of data array. Identical to the name of the getter in snake case. + */ + /* + * Entity ID. */ const ENTITY_ID = 'entity_id'; + /* + * Parent ID. + */ const PARENT_ID = 'parent_id'; + /* + * Is-customer-notified flag. + */ const IS_CUSTOMER_NOTIFIED = 'is_customer_notified'; + /* + * Is-visible-on-storefront flag. + */ const IS_VISIBLE_ON_FRONT = 'is_visible_on_front'; + /* + * Comment. + */ const COMMENT = 'comment'; + /* + * Created-at timestamp. + */ const CREATED_AT = 'created_at'; /** - * Returns comment + * Gets the credit memo comment. * - * @return string + * @return string Comment. */ public function getComment(); /** - * Returns created_at + * Gets the credit memo created-at timestamp. * - * @return string + * @return string Created-at timestamp. */ public function getCreatedAt(); /** - * Returns entity_id + * Gets the credit memo ID. * - * @return int + * @return int Credit memo ID. */ public function getEntityId(); /** - * Returns is_customer_notified + * Gets the is-customer-notified flag value for the credit memo. * - * @return int + * @return int Is-customer-notified flag value. */ public function getIsCustomerNotified(); /** - * Returns is_visible_on_front + * Gets the is-visible-on-storefront flag value for the credit memo. * - * @return int + * @return int Is-visible-on-storefront flag value. */ public function getIsVisibleOnFront(); /** - * Returns parent_id + * Gets the parent ID for the credit memo. * - * @return int + * @return int Parent ID. */ public function getParentId(); } diff --git a/app/code/Magento/Sales/Api/Data/CreditmemoCommentSearchResultInterface.php b/app/code/Magento/Sales/Api/Data/CreditmemoCommentSearchResultInterface.php index 7c4a72f28e1be..8304c70c182fa 100644 --- a/app/code/Magento/Sales/Api/Data/CreditmemoCommentSearchResultInterface.php +++ b/app/code/Magento/Sales/Api/Data/CreditmemoCommentSearchResultInterface.php @@ -5,14 +5,19 @@ namespace Magento\Sales\Api\Data; /** - * Interface CreditmemoCommentSearchResultInterface + * Credit memo comment search result interface. + * + * After a customer places and pays for an order and an invoice has been issued, the merchant can create a credit memo + * to refund all or part of the amount paid for any returned or undelivered items. The memo restores funds to the + * customer account so that the customer can make future purchases. A credit memo usually includes comments that detail + * why the credit memo amount was credited to the customer. */ interface CreditmemoCommentSearchResultInterface extends \Magento\Framework\Api\SearchResultsInterface { /** - * Get collection items + * Gets collection items. * - * @return \Magento\Sales\Api\Data\CreditmemoCommentInterface[] + * @return \Magento\Sales\Api\Data\CreditmemoCommentInterface[] Array of collection items. */ public function getItems(); } diff --git a/app/code/Magento/Sales/Api/Data/CreditmemoInterface.php b/app/code/Magento/Sales/Api/Data/CreditmemoInterface.php index 5e8c9a4acba7f..b2b02ee6b001a 100644 --- a/app/code/Magento/Sales/Api/Data/CreditmemoInterface.php +++ b/app/code/Magento/Sales/Api/Data/CreditmemoInterface.php @@ -5,408 +5,562 @@ namespace Magento\Sales\Api\Data; /** - * Interface CreditmemoInterface + * Credit memo interface. + * + * After a customer places and pays for an order and an invoice has been issued, the merchant can create a credit memo + * to refund all or part of the amount paid for any returned or undelivered items. The memo restores funds to the + * customer account so that the customer can make future purchases. */ interface CreditmemoInterface extends \Magento\Framework\Api\ExtensibleDataInterface { /**#@+ - * Constants for keys of data array. Identical to the name of the getter in snake case + * Constants for keys of data array. Identical to the name of the getter in snake case. + */ + /* + * Entity ID. */ const ENTITY_ID = 'entity_id'; + /* + * Store ID. + */ const STORE_ID = 'store_id'; + /* + * Positive adjustment. + */ const ADJUSTMENT_POSITIVE = 'adjustment_positive'; + /* + * Base shipping tax amount. + */ const BASE_SHIPPING_TAX_AMOUNT = 'base_shipping_tax_amount'; + /* + * Store-to-order rate. + */ const STORE_TO_ORDER_RATE = 'store_to_order_rate'; + /* + * Base discount rate. + */ const BASE_DISCOUNT_AMOUNT = 'base_discount_amount'; + /* + * Base-to-order rate. + */ const BASE_TO_ORDER_RATE = 'base_to_order_rate'; + /* + * Grand total. + */ const GRAND_TOTAL = 'grand_total'; + /* + * Negative base adjustment. + */ const BASE_ADJUSTMENT_NEGATIVE = 'base_adjustment_negative'; + /* + * Base subtotal including tax. + */ const BASE_SUBTOTAL_INCL_TAX = 'base_subtotal_incl_tax'; + /* + * Shipping amount. + */ const SHIPPING_AMOUNT = 'shipping_amount'; + /* + * Subtotal including tax. + */ const SUBTOTAL_INCL_TAX = 'subtotal_incl_tax'; + /* + * Negative adjustment. + */ const ADJUSTMENT_NEGATIVE = 'adjustment_negative'; + /* + * Base shipping amount. + */ const BASE_SHIPPING_AMOUNT = 'base_shipping_amount'; + /* + * Store-to-base rate. + */ const STORE_TO_BASE_RATE = 'store_to_base_rate'; + /* + * Base-to-global rate. + */ const BASE_TO_GLOBAL_RATE = 'base_to_global_rate'; + /* + * Base adjustment. + */ const BASE_ADJUSTMENT = 'base_adjustment'; + /* + * Base subtotal. + */ const BASE_SUBTOTAL = 'base_subtotal'; + /* + * Discount amount. + */ const DISCOUNT_AMOUNT = 'discount_amount'; + /* + * Subtotal. + */ const SUBTOTAL = 'subtotal'; + /* + * Subtotal. + */ const ADJUSTMENT = 'adjustment'; + /* + * Base grand total. + */ const BASE_GRAND_TOTAL = 'base_grand_total'; + /* + * Positive base adjustment. + */ const BASE_ADJUSTMENT_POSITIVE = 'base_adjustment_positive'; + /* + * Base tax amount. + */ const BASE_TAX_AMOUNT = 'base_tax_amount'; + /* + * Shipping tax amount. + */ const SHIPPING_TAX_AMOUNT = 'shipping_tax_amount'; + /* + * Tax amount. + */ const TAX_AMOUNT = 'tax_amount'; + /* + * Order ID. + */ const ORDER_ID = 'order_id'; + /* + * Email sent flag. + */ const EMAIL_SENT = 'email_sent'; + /* + * Credit memo status. + */ const CREDITMEMO_STATUS = 'creditmemo_status'; + /* + * Credit memo state. + */ const STATE = 'state'; + /* + * Shipping address ID. + */ const SHIPPING_ADDRESS_ID = 'shipping_address_id'; + /* + * Billing address ID. + */ const BILLING_ADDRESS_ID = 'billing_address_id'; + /* + * Invoice ID. + */ const INVOICE_ID = 'invoice_id'; + /* + * Store currency code. + */ const STORE_CURRENCY_CODE = 'store_currency_code'; + /* + * Order currency code. + */ const ORDER_CURRENCY_CODE = 'order_currency_code'; + /* + * Base currency code. + */ const BASE_CURRENCY_CODE = 'base_currency_code'; + /* + * Global currency code. + */ const GLOBAL_CURRENCY_CODE = 'global_currency_code'; + /* + * Transaction ID. + */ const TRANSACTION_ID = 'transaction_id'; + /* + * Increment ID. + */ const INCREMENT_ID = 'increment_id'; + /* + * Created-at timestamp. + */ const CREATED_AT = 'created_at'; + /* + * Updated-at timestamp. + */ const UPDATED_AT = 'updated_at'; + /* + * Hidden tax amount. + */ const HIDDEN_TAX_AMOUNT = 'hidden_tax_amount'; + /* + * Base hidden tax amount. + */ const BASE_HIDDEN_TAX_AMOUNT = 'base_hidden_tax_amount'; + /* + * Shipping hidden tax amount. + */ const SHIPPING_HIDDEN_TAX_AMOUNT = 'shipping_hidden_tax_amount'; + /* + * Base shipping hidden tax amount. + */ const BASE_SHIPPING_HIDDEN_TAX_AMNT = 'base_shipping_hidden_tax_amnt'; + /* + * Shipping including tax. + */ const SHIPPING_INCL_TAX = 'shipping_incl_tax'; + /* + * Base shipping including tax. + */ const BASE_SHIPPING_INCL_TAX = 'base_shipping_incl_tax'; + /* + * Discount description. + */ const DISCOUNT_DESCRIPTION = 'discount_description'; + /* + * Credit memo items. + */ const ITEMS = 'items'; + /* + * Credit memo comments. + */ const COMMENTS = 'comments'; /** - * Returns adjustment + * Gets the credit memo adjustment. * - * @return float + * @return float Credit memo adjustment. */ public function getAdjustment(); /** - * Returns adjustment_negative + * Gets the credit memo negative adjustment. * - * @return float + * @return float Credit memo negative adjustment. */ public function getAdjustmentNegative(); /** - * Returns adjustment_positive + * Gets the credit memo positive adjustment. * - * @return float + * @return float Credit memo positive adjustment. */ public function getAdjustmentPositive(); /** - * Returns base_adjustment + * Gets the credit memo base adjustment. * - * @return float + * @return float Credit memo base adjustment. */ public function getBaseAdjustment(); /** - * Returns base_adjustment_negative + * Gets the credit memo negative base adjustment. * - * @return float + * @return float Credit memo negative base adjustment. */ public function getBaseAdjustmentNegative(); /** - * Returns base_adjustment_positive + * Gets the credit memo positive base adjustment. * - * @return float + * @return float Credit memo positive base adjustment. */ public function getBaseAdjustmentPositive(); /** - * Returns base_currency_code + * Gets the credit memo base currency code. * - * @return string + * @return string Credit memo base currency code. */ public function getBaseCurrencyCode(); /** - * Returns base_discount_amount + * Gets the credit memo base discount amount. * - * @return float + * @return float Credit memo base discount amount. */ public function getBaseDiscountAmount(); /** - * Returns base_grand_total + * Gets the credit memo base grand total. * - * @return float + * @return float Credit memo base grand total. */ public function getBaseGrandTotal(); /** - * Returns base_hidden_tax_amount + * Gets the credit memo base hidden tax amount. * - * @return float + * @return float Credit memo base hidden tax amount. */ public function getBaseHiddenTaxAmount(); /** - * Returns base_shipping_amount + * Gets the credit memo base shipping amount. * - * @return float + * @return float Credit memo base shipping amount. */ public function getBaseShippingAmount(); /** - * Returns base_shipping_hidden_tax_amnt + * Gets the credit memo base shipping hidden tax amount. * - * @return float + * @return float Credit memo base shipping hidden tax amount. */ public function getBaseShippingHiddenTaxAmnt(); /** - * Returns base_shipping_incl_tax + * Gets the credit memo base shipping including tax. * - * @return float + * @return float Credit memo base shipping including tax. */ public function getBaseShippingInclTax(); /** - * Returns base_shipping_tax_amount + * Gets the credit memo base shipping tax amount. * - * @return float + * @return float Credit memo base shipping tax amount. */ public function getBaseShippingTaxAmount(); /** - * Returns base_subtotal + * Gets the credit memo base subtotal. * - * @return float + * @return float Credit memo base subtotal. */ public function getBaseSubtotal(); /** - * Returns base_subtotal_incl_tax + * Gets the credit memo base subtotal including tax. * - * @return float + * @return float Credit memo base subtotal including tax. */ public function getBaseSubtotalInclTax(); /** - * Returns base_tax_amount + * Gets the credit memo base tax amount. * - * @return float + * @return float Credit memo base tax amount. */ public function getBaseTaxAmount(); /** - * Returns base_to_global_rate + * Gets the credit memo base-to-global rate. * - * @return float + * @return float Credit memo base-to-global rate. */ public function getBaseToGlobalRate(); /** - * Returns base_to_order_rate + * Gets the credit memo base-to-order rate. * - * @return float + * @return float Credit memo base-to-order rate. */ public function getBaseToOrderRate(); /** - * Returns billing_address_id + * Gets the credit memo billing address ID. * - * @return int + * @return int Credit memo billing address ID. */ public function getBillingAddressId(); /** - * Returns created_at + * Gets the credit memo created-at timestamp. * - * @return string + * @return string Credit memo created-at timestamp. */ public function getCreatedAt(); /** - * Returns creditmemo_status + * Gets the credit memo status. * - * @return int + * @return int Credit memo status. */ public function getCreditmemoStatus(); /** - * Returns discount_amount + * Gets the credit memo discount amount. * - * @return float + * @return float Credit memo discount amount. */ public function getDiscountAmount(); /** - * Returns discount_description + * Gets the credit memo discount description. * - * @return string + * @return string Credit memo discount description. */ public function getDiscountDescription(); /** - * Returns email_sent + * Gets the credit memo email sent flag value. * - * @return int + * @return int Credit memo email sent flag value. */ public function getEmailSent(); /** - * Returns entity_id + * Gets the credit memo ID. * - * @return int + * @return int Credit memo ID. */ public function getEntityId(); /** - * Returns global_currency_code + * Gets the credit memo global currency code. * - * @return string + * @return string Credit memo global currency code. */ public function getGlobalCurrencyCode(); /** - * Returns grand_total + * Gets the credit memo grand total. * - * @return float + * @return float Credit memo grand total. */ public function getGrandTotal(); /** - * Returns hidden_tax_amount + * Gets the credit memo hidden tax amount. * - * @return float + * @return float Credit memo hidden tax amount. */ public function getHiddenTaxAmount(); /** - * Returns increment_id + * Gets the credit memo increment ID. * - * @return string + * @return string Credit memo increment ID. */ public function getIncrementId(); /** - * Returns invoice_id + * Gets the credit memo invoice ID. * - * @return int + * @return int Credit memo invoice ID. */ public function getInvoiceId(); /** - * Returns order_currency_code + * Gets the credit memo order currency code. * - * @return string + * @return string Credit memo order currency code. */ public function getOrderCurrencyCode(); /** - * Returns order_id + * Gets the credit memo order ID. * - * @return int + * @return int Credit memo order ID. */ public function getOrderId(); /** - * Returns shipping_address_id + * Gets the credit memo shipping address ID. * - * @return int + * @return int Credit memo shipping address ID. */ public function getShippingAddressId(); /** - * Returns shipping_amount + * Gets the credit memo shipping amount. * - * @return float + * @return float Credit memo shipping amount. */ public function getShippingAmount(); /** - * Returns shipping_hidden_tax_amount + * Gets the credit memo shipping hidden tax amount. * - * @return float + * @return float Credit memo shipping hidden tax amount. */ public function getShippingHiddenTaxAmount(); /** - * Returns shipping_incl_tax + * Gets the credit memo shipping including tax. * - * @return float + * @return float Credit memo shipping including tax. */ public function getShippingInclTax(); /** - * Returns shipping_tax_amount + * Gets the credit memo shipping tax amount. * - * @return float + * @return float Credit memo shipping tax amount. */ public function getShippingTaxAmount(); /** - * Returns state + * Gets the credit memo state. * - * @return int + * @return int Credit memo state. */ public function getState(); /** - * Returns store_currency_code + * Gets the credit memo store currency code. * - * @return string + * @return string Credit memo store currency code. */ public function getStoreCurrencyCode(); /** - * Returns store_id + * Gets the credit memo store ID. * - * @return int + * @return int Credit memo store ID. */ public function getStoreId(); /** - * Returns store_to_base_rate + * Gets the credit memo store-to-base rate. * - * @return float + * @return float Credit memo store-to-base rate. */ public function getStoreToBaseRate(); /** - * Returns store_to_order_rate + * Gets the credit memo store-to-order rate. * - * @return float + * @return float Credit memo store-to-order rate. */ public function getStoreToOrderRate(); /** - * Returns subtotal + * Gets the credit memo subtotal. * - * @return float + * @return float Credit memo subtotal. */ public function getSubtotal(); /** - * Returns subtotal_incl_tax + * Gets the credit memo subtotal including tax. * - * @return float + * @return float Credit memo subtotal including tax. */ public function getSubtotalInclTax(); /** - * Returns tax_amount + * Gets the credit memo tax amount. * - * @return float + * @return float Credit memo tax amount. */ public function getTaxAmount(); /** - * Returns transaction_id + * Gets the credit memo transaction ID. * - * @return string + * @return string Credit memo transaction ID. */ public function getTransactionId(); /** - * Returns updated_at + * Gets the credit memo updated-at timestamp. * - * @return string + * @return string Credit memo updated-at timestamp. */ public function getUpdatedAt(); /** - * Return creditmemo items + * Gets credit memo items. * - * @return \Magento\Sales\Api\Data\CreditmemoItemInterface[] + * @return \Magento\Sales\Api\Data\CreditmemoItemInterface[] Array of credit memo items. */ public function getItems(); /** - * Return creditmemo comments + * Gets credit memo comments. * - * @return \Magento\Sales\Api\Data\CreditmemoCommentInterface[]|null + * @return \Magento\Sales\Api\Data\CreditmemoCommentInterface[]|null Array of any credit memo comments. Otherwise, null. */ public function getComments(); } diff --git a/app/code/Magento/Sales/Api/Data/CreditmemoItemInterface.php b/app/code/Magento/Sales/Api/Data/CreditmemoItemInterface.php index 7caafa8ee44c2..aa506840c147d 100644 --- a/app/code/Magento/Sales/Api/Data/CreditmemoItemInterface.php +++ b/app/code/Magento/Sales/Api/Data/CreditmemoItemInterface.php @@ -5,275 +5,379 @@ namespace Magento\Sales\Api\Data; /** - * Interface CreditmemoItemInterface + * Credit memo item interface. + * + * After a customer places and pays for an order and an invoice has been issued, the merchant can create a credit memo + * to refund all or part of the amount paid for any returned or undelivered items. The memo restores funds to the + * customer account so that the customer can make future purchases. A credit memo item is an invoiced item for which + * a merchant creates a credit memo. */ interface CreditmemoItemInterface extends \Magento\Framework\Api\ExtensibleDataInterface { /**#@+ - * Constants for keys of data array. Identical to the name of the getter in snake case + * Constants for keys of data array. Identical to the name of the getter in snake case. + */ + /* + * Credit memo item ID. */ const ENTITY_ID = 'entity_id'; + /* + * Parent ID. + */ const PARENT_ID = 'parent_id'; + /* + * Base price. + */ const BASE_PRICE = 'base_price'; + /* + * Tax amount. + */ const TAX_AMOUNT = 'tax_amount'; + /* + * Base row total. + */ const BASE_ROW_TOTAL = 'base_row_total'; + /* + * Base row total. + */ const DISCOUNT_AMOUNT = 'discount_amount'; + /* + * Row total. + */ const ROW_TOTAL = 'row_total'; + /* + * Base discount amount. + */ const BASE_DISCOUNT_AMOUNT = 'base_discount_amount'; + /* + * Price including tax. + */ const PRICE_INCL_TAX = 'price_incl_tax'; + /* + * Base tax amount. + */ const BASE_TAX_AMOUNT = 'base_tax_amount'; + /* + * Base price including tax. + */ const BASE_PRICE_INCL_TAX = 'base_price_incl_tax'; + /* + * Quantity. + */ const QTY = 'qty'; + /* + * Base cost. + */ const BASE_COST = 'base_cost'; + /* + * Price. + */ const PRICE = 'price'; + /* + * Base row total including tax. + */ const BASE_ROW_TOTAL_INCL_TAX = 'base_row_total_incl_tax'; + /* + * Row total including tax. + */ const ROW_TOTAL_INCL_TAX = 'row_total_incl_tax'; + /* + * Product ID. + */ const PRODUCT_ID = 'product_id'; + /* + * Order item ID. + */ const ORDER_ITEM_ID = 'order_item_id'; + /* + * Additional data. + */ const ADDITIONAL_DATA = 'additional_data'; + /* + * Description. + */ const DESCRIPTION = 'description'; + /* + * SKU. + */ const SKU = 'sku'; + /* + * Name. + */ const NAME = 'name'; + /* + * Hidden tax amount. + */ const HIDDEN_TAX_AMOUNT = 'hidden_tax_amount'; + /* + * Base hidden tax amount. + */ const BASE_HIDDEN_TAX_AMOUNT = 'base_hidden_tax_amount'; + /* + * WEEE tax disposition. + */ const WEEE_TAX_DISPOSITION = 'weee_tax_disposition'; + /* + * WEEE tax row disposition. + */ const WEEE_TAX_ROW_DISPOSITION = 'weee_tax_row_disposition'; + /* + * Base WEEE tax disposition. + */ const BASE_WEEE_TAX_DISPOSITION = 'base_weee_tax_disposition'; + /* + * Base WEEE tax row disposition. + */ const BASE_WEEE_TAX_ROW_DISPOSITION = 'base_weee_tax_row_disposition'; + /* + * WEEE tax applied. + */ const WEEE_TAX_APPLIED = 'weee_tax_applied'; + /* + * Base WEEE tax applied amount. + */ const BASE_WEEE_TAX_APPLIED_AMOUNT = 'base_weee_tax_applied_amount'; + /* + * Base WEEE tax applied row amount. + */ const BASE_WEEE_TAX_APPLIED_ROW_AMNT = 'base_weee_tax_applied_row_amnt'; + /* + * WEEE tax applied amount. + */ const WEEE_TAX_APPLIED_AMOUNT = 'weee_tax_applied_amount'; + /* + * WEEE tax applied row amount. + */ const WEEE_TAX_APPLIED_ROW_AMOUNT = 'weee_tax_applied_row_amount'; /** - * Returns additional_data + * Gets the additional data for a credit memo item. * - * @return string + * @return string Additional data. */ public function getAdditionalData(); /** - * Returns base_cost + * Gets the base cost for a credit memo item. * * @return float */ public function getBaseCost(); /** - * Returns base_discount_amount + * Gets the base discount amount for a credit memo item. * * @return float */ public function getBaseDiscountAmount(); /** - * Returns base_hidden_tax_amount + * Gets the base hidden tax amount for a credit memo item. * * @return float */ public function getBaseHiddenTaxAmount(); /** - * Returns base_price + * Gets the base price for a credit memo item. * * @return float */ public function getBasePrice(); /** - * Returns base_price_incl_tax + * Gets the base price including tax for a credit memo item. * - * @return float + * @return float Base price including tax. */ public function getBasePriceInclTax(); /** - * Returns base_row_total + * Gets the base row total for a credit memo item. * - * @return float + * @return float Base row total. */ public function getBaseRowTotal(); /** - * Returns base_row_total_incl_tax + * Gets the base row total including tax for a credit memo item. * - * @return float + * @return float Base row total including tax. */ public function getBaseRowTotalInclTax(); /** - * Returns base_tax_amount + * Gets the base tax amount for a credit memo item. * - * @return float + * @return float Base tax amount. */ public function getBaseTaxAmount(); /** - * Returns base_weee_tax_applied_amount + * Gets the base WEEE tax applied amount for a credit memo item. * - * @return float + * @return float Base WEEE tax applied amount. */ public function getBaseWeeeTaxAppliedAmount(); /** - * Returns base_weee_tax_applied_row_amnt + * Gets the base WEEE tax applied row amount for a credit memo item. * - * @return float + * @return float Base WEEE tax applied row amount. */ public function getBaseWeeeTaxAppliedRowAmnt(); /** - * Returns base_weee_tax_disposition + * Gets the base WEEE tax disposition for a credit memo item. * - * @return float + * @return float Base WEEE tax disposition. */ public function getBaseWeeeTaxDisposition(); /** - * Returns base_weee_tax_row_disposition + * Gets the base WEEE tax row disposition for a credit memo item. * - * @return float + * @return float Base WEEE tax row disposition. */ public function getBaseWeeeTaxRowDisposition(); /** - * Returns description + * Gets the description for a credit memo item. * - * @return string + * @return string Description. */ public function getDescription(); /** - * Returns discount_amount + * Gets the discount amount for a credit memo item. * - * @return float + * @return float Discount amount. */ public function getDiscountAmount(); /** - * Returns entity_id + * Gets the ID for a credit memo item. * - * @return int + * @return int Credit memo item ID. */ public function getEntityId(); /** - * Returns hidden_tax_amount + * Gets the hidden tax amount for a credit memo item. * - * @return float + * @return float Hidden tax amount. */ public function getHiddenTaxAmount(); /** - * Returns name + * Gets the name for a credit memo item. * - * @return string + * @return string Name. */ public function getName(); /** - * Returns order_item_id + * Gets the order item ID for a credit memo item. * - * @return int + * @return int Order item ID. */ public function getOrderItemId(); /** - * Returns parent_id + * Gets the parent ID for a credit memo item. * - * @return int + * @return int Parent ID. */ public function getParentId(); /** - * Returns price + * Gets the price for a credit memo item. * - * @return float + * @return float Price. */ public function getPrice(); /** - * Returns price_incl_tax + * Gets the price including tax for a credit memo item. * - * @return float + * @return float Price including tax. */ public function getPriceInclTax(); /** - * Returns product_id + * Gets the product ID for a credit memo item. * - * @return int + * @return int Product ID. */ public function getProductId(); /** - * Returns qty + * Gets the quantity for a credit memo item. * - * @return float + * @return float Quantity. */ public function getQty(); /** - * Returns row_total + * Gets the row total for a credit memo item. * - * @return float + * @return float Row total. */ public function getRowTotal(); /** - * Returns row_total_incl_tax + * Gets the row total including tax for a credit memo item. * - * @return float + * @return float Row total including tax. */ public function getRowTotalInclTax(); /** - * Returns sku + * Gets the SKU for a credit memo item. * - * @return string + * @return string SKU. */ public function getSku(); /** - * Returns tax_amount + * Gets the tax amount for a credit memo item. * - * @return float + * @return float Tax amount. */ public function getTaxAmount(); /** - * Returns weee_tax_applied + * Gets the WEEE tax applied for a credit memo item. * - * @return string + * @return string WEEE tax applied. */ public function getWeeeTaxApplied(); /** - * Returns weee_tax_applied_amount + * Gets the WEEE tax applied amount for a credit memo item. * - * @return float + * @return float WEEE tax applied amount. */ public function getWeeeTaxAppliedAmount(); /** - * Returns weee_tax_applied_row_amount + * Gets the WEEE tax applied row amount for a credit memo item. * - * @return float + * @return float WEEE tax applied row amount. */ public function getWeeeTaxAppliedRowAmount(); /** - * Returns weee_tax_disposition + * Gets the WEEE tax disposition for a credit memo item. * - * @return float + * @return float WEEE tax disposition. */ public function getWeeeTaxDisposition(); /** - * Returns weee_tax_row_disposition + * Gets the WEEE tax row disposition for a credit memo item. * - * @return float + * @return float WEEE tax row disposition. */ public function getWeeeTaxRowDisposition(); } diff --git a/app/code/Magento/Sales/Api/Data/CreditmemoItemSearchResultInterface.php b/app/code/Magento/Sales/Api/Data/CreditmemoItemSearchResultInterface.php index c9bc2c2ce8d00..c24a507fff83c 100644 --- a/app/code/Magento/Sales/Api/Data/CreditmemoItemSearchResultInterface.php +++ b/app/code/Magento/Sales/Api/Data/CreditmemoItemSearchResultInterface.php @@ -5,14 +5,19 @@ namespace Magento\Sales\Api\Data; /** - * Interface CreditmemoItemSearchResultInterface + * Credit memo item search result interface. + * + * After a customer places and pays for an order and an invoice has been issued, the merchant can create a credit memo + * to refund all or part of the amount paid for any returned or undelivered items. The memo restores funds to the + * customer account so that the customer can make future purchases. A credit memo item is an invoiced item for which + * a merchant creates a credit memo. */ interface CreditmemoItemSearchResultInterface extends \Magento\Framework\Api\SearchResultsInterface { /** - * Get collection items + * Gets collection items. * - * @return \Magento\Sales\Api\Data\CreditmemoItemInterface[] + * @return \Magento\Sales\Api\Data\CreditmemoItemInterface[] Array of collection items. */ public function getItems(); } diff --git a/app/code/Magento/Sales/Api/Data/CreditmemoSearchResultInterface.php b/app/code/Magento/Sales/Api/Data/CreditmemoSearchResultInterface.php index 983456a8b4d14..b559e8c74fc94 100644 --- a/app/code/Magento/Sales/Api/Data/CreditmemoSearchResultInterface.php +++ b/app/code/Magento/Sales/Api/Data/CreditmemoSearchResultInterface.php @@ -5,14 +5,18 @@ namespace Magento\Sales\Api\Data; /** - * Interface CreditmemoSearchResultInterface + * Credit memo search result interface. + * + * After a customer places and pays for an order and an invoice has been issued, the merchant can create a credit memo + * to refund all or part of the amount paid for any returned or undelivered items. The memo restores funds to the + * customer account so that the customer can make future purchases. */ interface CreditmemoSearchResultInterface extends \Magento\Framework\Api\SearchResultsInterface { /** - * Get collection items + * Gets collection items. * - * @return \Magento\Sales\Api\Data\CreditmemoInterface[] + * @return \Magento\Sales\Api\Data\CreditmemoInterface[] Array of collection items. */ public function getItems(); } diff --git a/app/code/Magento/Sales/Api/Data/InvoiceCommentInterface.php b/app/code/Magento/Sales/Api/Data/InvoiceCommentInterface.php index 2104f80f68293..491c512a70dde 100644 --- a/app/code/Magento/Sales/Api/Data/InvoiceCommentInterface.php +++ b/app/code/Magento/Sales/Api/Data/InvoiceCommentInterface.php @@ -5,59 +5,80 @@ namespace Magento\Sales\Api\Data; /** - * Interface InvoiceCommentInterface + * Invoice comment interface. + * + * An invoice is a record of the receipt of payment for an order. An invoice can include comments that detail the + * invoice history. */ interface InvoiceCommentInterface extends \Magento\Framework\Api\ExtensibleDataInterface { /**#@+ - * Constants for keys of data array. Identical to the name of the getter in snake case + * Constants for keys of data array. Identical to the name of the getter in snake case. + */ + /* + * Entity ID. */ const ENTITY_ID = 'entity_id'; + /* + * Parent ID. + */ const PARENT_ID = 'parent_id'; + /* + * Is-customer-notified flag. + */ const IS_CUSTOMER_NOTIFIED = 'is_customer_notified'; + /* + * Is-visible-on-storefront flag. + */ const IS_VISIBLE_ON_FRONT = 'is_visible_on_front'; + /* + * Comment. + */ const COMMENT = 'comment'; + /* + * Created-at timestamp. + */ const CREATED_AT = 'created_at'; /** - * Returns comment + * Gets the comment for the invoice. * - * @return string + * @return string Comment. */ public function getComment(); /** - * Returns created_at + * Gets the created-at timestamp for the invoice. * - * @return string + * @return string Created-at timestamp. */ public function getCreatedAt(); /** - * Returns entity_id + * Gets the ID for the invoice. * - * @return int + * @return int Invoice ID. */ public function getEntityId(); /** - * Returns is_customer_notified + * Gets the is-customer-notified flag value for the invoice. * - * @return int + * @return int Is-customer-notified flag value. */ public function getIsCustomerNotified(); /** - * Returns is_visible_on_front + * Gets the is-visible-on-storefront flag value for the invoice. * - * @return int + * @return int Is-visible-on-storefront flag value. */ public function getIsVisibleOnFront(); /** - * Returns parent_id + * Gets the parent ID for the invoice. * - * @return int + * @return int Parent ID. */ public function getParentId(); } diff --git a/app/code/Magento/Sales/Api/Data/InvoiceCommentSearchResultInterface.php b/app/code/Magento/Sales/Api/Data/InvoiceCommentSearchResultInterface.php index 919df9d24cc60..7a194a2351361 100644 --- a/app/code/Magento/Sales/Api/Data/InvoiceCommentSearchResultInterface.php +++ b/app/code/Magento/Sales/Api/Data/InvoiceCommentSearchResultInterface.php @@ -2,18 +2,20 @@ /** * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) */ - namespace Magento\Sales\Api\Data; /** - * Interface InvoiceCommentSearchResultInterface + * Invoice comment search result interface. + * + * An invoice is a record of the receipt of payment for an order. An invoice can include comments that detail the + * invoice history. */ interface InvoiceCommentSearchResultInterface extends \Magento\Framework\Api\SearchResultsInterface { /** - * Get collection items + * Gets collection items. * - * @return \Magento\Sales\Api\Data\InvoiceCommentInterface[] + * @return \Magento\Sales\Api\Data\InvoiceCommentInterface[] Array of collection items. */ public function getItems(); } diff --git a/app/code/Magento/Sales/Api/Data/InvoiceInterface.php b/app/code/Magento/Sales/Api/Data/InvoiceInterface.php index 7ee4f92e16df4..dc203724850ca 100644 --- a/app/code/Magento/Sales/Api/Data/InvoiceInterface.php +++ b/app/code/Magento/Sales/Api/Data/InvoiceInterface.php @@ -5,379 +5,519 @@ namespace Magento\Sales\Api\Data; /** - * Interface InvoiceInterface + * Invoice interface. + * + * An invoice is a record of the receipt of payment for an order. */ interface InvoiceInterface extends \Magento\Framework\Api\ExtensibleDataInterface { /**#@+ * Constants for keys of data array. Identical to the name of the getter in snake case */ + /* + * Entity ID. + */ const ENTITY_ID = 'entity_id'; + /* + * Store ID. + */ const STORE_ID = 'store_id'; + /* + * Base grand total. + */ const BASE_GRAND_TOTAL = 'base_grand_total'; + /* + * Shipping tax amount. + */ const SHIPPING_TAX_AMOUNT = 'shipping_tax_amount'; + /* + * Tax amount. + */ const TAX_AMOUNT = 'tax_amount'; + /* + * Base tax amount. + */ const BASE_TAX_AMOUNT = 'base_tax_amount'; + /* + * Store-to-order rate. + */ const STORE_TO_ORDER_RATE = 'store_to_order_rate'; + /* + * Base shipping tax amount. + */ const BASE_SHIPPING_TAX_AMOUNT = 'base_shipping_tax_amount'; + /* + * Base discount amount. + */ const BASE_DISCOUNT_AMOUNT = 'base_discount_amount'; + /* + * Base-to-order rate. + */ const BASE_TO_ORDER_RATE = 'base_to_order_rate'; + /* + * Grand total. + */ const GRAND_TOTAL = 'grand_total'; + /* + * Shipping amount. + */ const SHIPPING_AMOUNT = 'shipping_amount'; + /* + * Subtotal including tax. + */ const SUBTOTAL_INCL_TAX = 'subtotal_incl_tax'; + /* + * Base subtotal including tax. + */ const BASE_SUBTOTAL_INCL_TAX = 'base_subtotal_incl_tax'; + /* + * Store-to-base rate. + */ const STORE_TO_BASE_RATE = 'store_to_base_rate'; + /* + * Base shipping amount. + */ const BASE_SHIPPING_AMOUNT = 'base_shipping_amount'; + /* + * Total quantity. + */ const TOTAL_QTY = 'total_qty'; + /* + * Base-to-global rate. + */ const BASE_TO_GLOBAL_RATE = 'base_to_global_rate'; + /* + * Subtotal. + */ const SUBTOTAL = 'subtotal'; + /* + * Base subtotal. + */ const BASE_SUBTOTAL = 'base_subtotal'; + /* + * Discount amount. + */ const DISCOUNT_AMOUNT = 'discount_amount'; + /* + * Billing address ID. + */ const BILLING_ADDRESS_ID = 'billing_address_id'; + /* + * Is used for refund. + */ const IS_USED_FOR_REFUND = 'is_used_for_refund'; + /* + * Order ID. + */ const ORDER_ID = 'order_id'; + /* + * Email sent flag. + */ const EMAIL_SENT = 'email_sent'; + /* + * Can void flag. + */ const CAN_VOID_FLAG = 'can_void_flag'; + /* + * State. + */ const STATE = 'state'; + /* + * Shipping address ID. + */ const SHIPPING_ADDRESS_ID = 'shipping_address_id'; + /* + * Store currency code. + */ const STORE_CURRENCY_CODE = 'store_currency_code'; + /* + * Transaction ID. + */ const TRANSACTION_ID = 'transaction_id'; + /* + * Order currency code. + */ const ORDER_CURRENCY_CODE = 'order_currency_code'; + /* + * Base currency code. + */ const BASE_CURRENCY_CODE = 'base_currency_code'; + /* + * Global currency code. + */ const GLOBAL_CURRENCY_CODE = 'global_currency_code'; + /* + * Increment ID. + */ const INCREMENT_ID = 'increment_id'; + /* + * Created-at timestamp. + */ const CREATED_AT = 'created_at'; + /* + * Updated-at timestamp. + */ const UPDATED_AT = 'updated_at'; + /* + * Hidden tax amount. + */ const HIDDEN_TAX_AMOUNT = 'hidden_tax_amount'; + /* + * Base hidden tax amount. + */ const BASE_HIDDEN_TAX_AMOUNT = 'base_hidden_tax_amount'; + /* + * Shipping hidden tax amount. + */ const SHIPPING_HIDDEN_TAX_AMOUNT = 'shipping_hidden_tax_amount'; + /* + * Base shipping hidden tax amount. + */ const BASE_SHIPPING_HIDDEN_TAX_AMNT = 'base_shipping_hidden_tax_amnt'; + /* + * Shipping including tax. + */ const SHIPPING_INCL_TAX = 'shipping_incl_tax'; + /* + * Base shipping including tax. + */ const BASE_SHIPPING_INCL_TAX = 'base_shipping_incl_tax'; + /* + * Base total refunded. + */ const BASE_TOTAL_REFUNDED = 'base_total_refunded'; + /* + * Discount description. + */ const DISCOUNT_DESCRIPTION = 'discount_description'; + /* + * Items. + */ const ITEMS = 'items'; + /* + * Comments. + */ const COMMENTS = 'comments'; /** - * Returns base_currency_code + * Gets the base currency code for the invoice. * - * @return string + * @return string Base currency code. */ public function getBaseCurrencyCode(); /** - * Returns base_discount_amount + * Gets the base discount amount for the invoice. * - * @return float + * @return float Base discount amount. */ public function getBaseDiscountAmount(); /** - * Returns base_grand_total + * Gets the base grand total for the invoice. * - * @return float + * @return float Base grand total. */ public function getBaseGrandTotal(); /** - * Returns base_hidden_tax_amount + * Gets the base hidden tax amount for the invoice. * - * @return float + * @return float Base hidden tax amount. */ public function getBaseHiddenTaxAmount(); /** - * Returns base_shipping_amount + * Gets the base shipping amount for the invoice. * - * @return float + * @return float Base shipping amount. */ public function getBaseShippingAmount(); /** - * Returns base_shipping_hidden_tax_amnt + * Gets the base shipping hidden tax amount for the invoice. * - * @return float + * @return float Base shipping hidden tax amount. */ public function getBaseShippingHiddenTaxAmnt(); /** - * Returns base_shipping_incl_tax + * Gets the base shipping including tax for the invoice. * - * @return float + * @return float Base shipping including tax. */ public function getBaseShippingInclTax(); /** - * Returns base_shipping_tax_amount + * Gets the base shipping tax amount for the invoice. * - * @return float + * @return float Base shipping tax amount. */ public function getBaseShippingTaxAmount(); /** - * Returns base_subtotal + * Gets the base subtotal for the invoice. * - * @return float + * @return float Base subtotal. */ public function getBaseSubtotal(); /** - * Returns base_subtotal_incl_tax + * Gets the base subtotal including tax for the invoice. * - * @return float + * @return float Base subtotal including tax. */ public function getBaseSubtotalInclTax(); /** - * Returns base_tax_amount + * Gets the base tax amount for the invoice. * - * @return float + * @return float Base tax amount. */ public function getBaseTaxAmount(); /** - * Returns base_total_refunded + * Gets the base total refunded for the invoice. * - * @return float + * @return float Base total refunded. */ public function getBaseTotalRefunded(); /** - * Returns base_to_global_rate + * Gets the base-to-global rate for the invoice. * - * @return float + * @return float Base-to-global rate. */ public function getBaseToGlobalRate(); /** - * Returns base_to_order_rate + * Gets the base-to-order rate for the invoice. * - * @return float + * @return float Base-to-order rate. */ public function getBaseToOrderRate(); /** - * Returns billing_address_id + * Gets the billing address ID for the invoice. * - * @return int + * @return int Billing address ID. */ public function getBillingAddressId(); /** - * Returns can_void_flag + * Gets the can void flag value for the invoice. * - * @return int + * @return int Can void flag value. */ public function getCanVoidFlag(); /** - * Returns created_at + * Gets the created-at timestamp for the invoice. * - * @return string + * @return string Created-at timestamp. */ public function getCreatedAt(); /** - * Returns discount_amount + * Gets the discount amount for the invoice. * - * @return float + * @return float Discount amount. */ public function getDiscountAmount(); /** - * Returns discount_description + * Gets the discount description for the invoice. * - * @return string + * @return string Discount description. */ public function getDiscountDescription(); /** - * Returns email_sent + * Gets the email-sent flag value for the invoice. * - * @return int + * @return int Email-sent flag value. */ public function getEmailSent(); /** - * Returns entity_id + * Gets the ID for the invoice. * - * @return int + * @return int Invoice ID. */ public function getEntityId(); /** - * Returns global_currency_code + * Gets the global currency code for the invoice. * - * @return string + * @return string Global currency code. */ public function getGlobalCurrencyCode(); /** - * Returns grand_total + * Gets the grand total for the invoice. * - * @return float + * @return float Grand total. */ public function getGrandTotal(); /** - * Returns hidden_tax_amount + * Gets the hidden tax amount for the invoice. * - * @return float + * @return float Hidden tax amount. */ public function getHiddenTaxAmount(); /** - * Returns increment_id + * Gets the increment ID for the invoice. * - * @return string + * @return string Increment ID. */ public function getIncrementId(); /** - * Returns is_used_for_refund + * Gets the is-used-for-refund flag value for the invoice. * - * @return int + * @return int Is-used-for-refund flag value. */ public function getIsUsedForRefund(); /** - * Returns order_currency_code + * Gets the order currency code for the invoice. * - * @return string + * @return string Order currency code. */ public function getOrderCurrencyCode(); /** - * Returns order_id + * Gets the order ID for the invoice. * - * @return int + * @return int Order ID. */ public function getOrderId(); /** - * Returns shipping_address_id + * Gets the shipping address ID for the invoice. * - * @return int + * @return int Shipping address ID. */ public function getShippingAddressId(); /** - * Returns shipping_amount + * Gets the shipping amount for the invoice. * - * @return float + * @return float Shipping amount. */ public function getShippingAmount(); /** - * Returns shipping_hidden_tax_amount + * Gets the shipping hidden tax amount for the invoice. * - * @return float + * @return float Shipping hidden tax amount. */ public function getShippingHiddenTaxAmount(); /** - * Returns shipping_incl_tax + * Gets the shipping including tax for the invoice. * - * @return float + * @return float Shipping including tax. */ public function getShippingInclTax(); /** - * Returns shipping_tax_amount + * Gets the shipping tax amount for the invoice. * - * @return float + * @return float Shipping tax amount. */ public function getShippingTaxAmount(); /** - * Returns state + * Gets the state for the invoice. * - * @return int + * @return int State. */ public function getState(); /** - * Returns store_currency_code + * Gets the store currency code for the invoice. * - * @return string + * @return string Store currency code. */ public function getStoreCurrencyCode(); /** - * Returns store_id + * Gets the store ID for the invoice. * - * @return int + * @return int Store ID. */ public function getStoreId(); /** - * Returns store_to_base_rate + * Gets the store-to-base rate for the invoice. * - * @return float + * @return float Store-to-base rate. */ public function getStoreToBaseRate(); /** - * Returns store_to_order_rate + * Gets the store-to-order rate for the invoice. * - * @return float + * @return float Store-to-order rate. */ public function getStoreToOrderRate(); /** - * Returns subtotal + * Gets the subtotal for the invoice. * - * @return float + * @return float Subtotal. */ public function getSubtotal(); /** - * Returns subtotal_incl_tax + * Gets the subtotal including tax for the invoice. * - * @return float + * @return float Subtotal including tax. */ public function getSubtotalInclTax(); /** - * Returns tax_amount + * Gets the tax amount for the invoice. * - * @return float + * @return float Tax amount. */ public function getTaxAmount(); /** - * Returns total_qty + * Gets the total quantity for the invoice. * - * @return float + * @return float Total quantity. */ public function getTotalQty(); /** - * Returns transaction_id + * Gets the transaction ID for the invoice. * - * @return string + * @return string Transaction ID. */ public function getTransactionId(); /** - * Returns updated_at + * Gets the updated-at timestamp for the invoice. * - * @return string + * @return string Updated-at timestamp. */ public function getUpdatedAt(); /** - * Returns invoice items + * Gets the items in the invoice. * - * @return \Magento\Sales\Api\Data\InvoiceItemInterface[] + * @return \Magento\Sales\Api\Data\InvoiceItemInterface[] Array of invoice items. */ public function getItems(); /** - * Return invoice comments + * Gets the comments, if any, for the invoice. * - * @return \Magento\Sales\Api\Data\InvoiceCommentInterface[]|null + * @return \Magento\Sales\Api\Data\InvoiceCommentInterface[]|null Array of any invoice comments. Otherwise, null. */ public function getComments(); } diff --git a/app/code/Magento/Sales/Api/Data/InvoiceItemInterface.php b/app/code/Magento/Sales/Api/Data/InvoiceItemInterface.php index 3b8a0e054e172..74364347d4393 100644 --- a/app/code/Magento/Sales/Api/Data/InvoiceItemInterface.php +++ b/app/code/Magento/Sales/Api/Data/InvoiceItemInterface.php @@ -5,203 +5,277 @@ namespace Magento\Sales\Api\Data; /** - * Interface InvoiceItemInterface + * Invoice item interface. + * + * An invoice is a record of the receipt of payment for an order. An invoice item is a purchased item in an invoice. */ interface InvoiceItemInterface extends \Magento\Framework\Api\ExtensibleDataInterface { /**#@+ - * Constants for keys of data array. Identical to the name of the getter in snake case + * Constants for keys of data array. Identical to the name of the getter in snake case. + */ + /* + * Entity ID. */ const ENTITY_ID = 'entity_id'; + /* + * Parent ID. + */ const PARENT_ID = 'parent_id'; + /* + * Base price. + */ const BASE_PRICE = 'base_price'; + /* + * Tax amount. + */ const TAX_AMOUNT = 'tax_amount'; + /* + * Base row total. + */ const BASE_ROW_TOTAL = 'base_row_total'; + /* + * Discount amount. + */ const DISCOUNT_AMOUNT = 'discount_amount'; + /* + * Row total. + */ const ROW_TOTAL = 'row_total'; + /* + * Base discount amount. + */ const BASE_DISCOUNT_AMOUNT = 'base_discount_amount'; + /* + * Price including tax. + */ const PRICE_INCL_TAX = 'price_incl_tax'; + /* + * Base tax amount. + */ const BASE_TAX_AMOUNT = 'base_tax_amount'; + /* + * Base price including tax. + */ const BASE_PRICE_INCL_TAX = 'base_price_incl_tax'; + /* + * Quantity. + */ const QTY = 'qty'; + /* + * Base cost. + */ const BASE_COST = 'base_cost'; + /* + * Price. + */ const PRICE = 'price'; + /* + * Base row total including tax. + */ const BASE_ROW_TOTAL_INCL_TAX = 'base_row_total_incl_tax'; + /* + * Row total including tax. + */ const ROW_TOTAL_INCL_TAX = 'row_total_incl_tax'; + /* + * Product ID. + */ const PRODUCT_ID = 'product_id'; + /* + * Order item ID. + */ const ORDER_ITEM_ID = 'order_item_id'; + /* + * Additional data. + */ const ADDITIONAL_DATA = 'additional_data'; + /* + * Description. + */ const DESCRIPTION = 'description'; + /* + * SKU. + */ const SKU = 'sku'; + /* + * Name. + */ const NAME = 'name'; + /* + * Hidden tax amount. + */ const HIDDEN_TAX_AMOUNT = 'hidden_tax_amount'; + /* + * Base hidden tax amount. + */ const BASE_HIDDEN_TAX_AMOUNT = 'base_hidden_tax_amount'; /** - * Returns additional_data + * Gets the additional data for the invoice item. * - * @return string + * @return string Additional data. */ public function getAdditionalData(); /** - * Returns base_cost + * Gets the base cost for the invoice item. * - * @return float + * @return float Base cost. */ public function getBaseCost(); /** - * Returns base_discount_amount + * Gets the base discount amount for the invoice item. * - * @return float + * @return float Base discount amount. */ public function getBaseDiscountAmount(); /** - * Returns base_hidden_tax_amount + * Gets the base hidden tax amount for the invoice item. * - * @return float + * @return float Base hidden tax amount. */ public function getBaseHiddenTaxAmount(); /** - * Returns base_price + * Gets the base price for the invoice item. * - * @return float + * @return float Base price. */ public function getBasePrice(); /** - * Returns base_price_incl_tax + * Gets the base price including tax for the invoice item. * - * @return float + * @return float Base price including tax. */ public function getBasePriceInclTax(); /** - * Returns base_row_total + * Gets the base row total for the invoice item. * - * @return float + * @return float Base row total. */ public function getBaseRowTotal(); /** - * Returns base_row_total_incl_tax + * Gets the base row total including tax for the invoice item. * - * @return float + * @return float Base row total including tax. */ public function getBaseRowTotalInclTax(); /** - * Returns base_tax_amount + * Gets the base tax amount for the invoice item. * - * @return float + * @return float Base tax amount. */ public function getBaseTaxAmount(); /** - * Returns description + * Gets the description for the invoice item. * - * @return string + * @return string Description. */ public function getDescription(); /** - * Returns discount_amount + * Gets the discount amount for the invoice item. * - * @return float + * @return float Discount amount. */ public function getDiscountAmount(); /** - * Returns entity_id + * Gets the ID for the invoice item. * - * @return int + * @return int Invoice item ID. */ public function getEntityId(); /** - * Returns hidden_tax_amount + * Gets the hidden tax amount for the invoice item. * - * @return float + * @return float Hidden tax amount. */ public function getHiddenTaxAmount(); /** - * Returns name + * Gets the name for the invoice item. * - * @return string + * @return string Name. */ public function getName(); /** - * Returns order_item_id + * Gets the order item ID for the invoice item. * - * @return int + * @return int Order item ID. */ public function getOrderItemId(); /** - * Returns parent_id + * Gets the parent ID for the invoice item. * - * @return int + * @return int Parent ID. */ public function getParentId(); /** - * Returns price + * Gets the price for the invoice item. * - * @return float + * @return float Price. */ public function getPrice(); /** - * Returns price_incl_tax + * Gets the price including tax for the invoice item. * - * @return float + * @return float Price including tax. */ public function getPriceInclTax(); /** - * Returns product_id + * Gets the product ID for the invoice item. * - * @return int + * @return int Product ID. */ public function getProductId(); /** - * Returns qty + * Gets the quantity for the invoice item. * - * @return float + * @return float Quantity. */ public function getQty(); /** - * Returns row_total + * Gets the row total for the invoice item. * - * @return float + * @return float Row total. */ public function getRowTotal(); /** - * Returns row_total_incl_tax + * Gets the row total including tax for the invoice item. * - * @return float + * @return float Row total including tax. */ public function getRowTotalInclTax(); /** - * Returns sku + * Gets the SKU for the invoice item. * - * @return string + * @return string SKU. */ public function getSku(); /** - * Returns tax_amount + * Gets the tax amount for the invoice item. * - * @return float + * @return float Tax amount. */ public function getTaxAmount(); } diff --git a/app/code/Magento/Sales/Api/Data/InvoiceItemSearchResultInterface.php b/app/code/Magento/Sales/Api/Data/InvoiceItemSearchResultInterface.php index 6b0acc35a51a5..1d5e7a845f395 100644 --- a/app/code/Magento/Sales/Api/Data/InvoiceItemSearchResultInterface.php +++ b/app/code/Magento/Sales/Api/Data/InvoiceItemSearchResultInterface.php @@ -2,18 +2,19 @@ /** * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) */ - namespace Magento\Sales\Api\Data; /** - * Interface InvoiceItemSearchResultInterface + * Invoice item search result interface. + * + * An invoice is a record of the receipt of payment for an order. An invoice item is a purchased item in an invoice. */ interface InvoiceItemSearchResultInterface extends \Magento\Framework\Api\SearchResultsInterface { /** - * Get collection items + * Gets collection items. * - * @return \Magento\Sales\Api\Data\InvoiceItemInterface[] + * @return \Magento\Sales\Api\Data\InvoiceItemInterface[] Array of collection items. */ public function getItems(); } diff --git a/app/code/Magento/Sales/Api/Data/InvoiceSearchResultInterface.php b/app/code/Magento/Sales/Api/Data/InvoiceSearchResultInterface.php index 6f7763ac68ca7..7001bd9a435cd 100644 --- a/app/code/Magento/Sales/Api/Data/InvoiceSearchResultInterface.php +++ b/app/code/Magento/Sales/Api/Data/InvoiceSearchResultInterface.php @@ -2,18 +2,19 @@ /** * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) */ - namespace Magento\Sales\Api\Data; /** - * Interface InvoiceSearchResultInterface + * Invoice search result interface. + * + * An invoice is a record of the receipt of payment for an order. */ interface InvoiceSearchResultInterface extends \Magento\Framework\Api\SearchResultsInterface { /** - * Get collection items + * Gets collection items. * - * @return \Magento\Sales\Api\Data\InvoiceInterface[] + * @return \Magento\Sales\Api\Data\InvoiceInterface[] Array of collection items. */ public function getItems(); } diff --git a/app/code/Magento/Sales/Api/Data/OrderAddressInterface.php b/app/code/Magento/Sales/Api/Data/OrderAddressInterface.php index d4f61da3b0000..9507863be9b45 100644 --- a/app/code/Magento/Sales/Api/Data/OrderAddressInterface.php +++ b/app/code/Magento/Sales/Api/Data/OrderAddressInterface.php @@ -5,216 +5,298 @@ namespace Magento\Sales\Api\Data; /** - * Interface OrderAddressInterface + * Order address interface. + * + * An order is a document that a web store issues to a customer. Magento generates a sales order that lists the product + * items, billing and shipping addresses, and shipping and payment methods. A corresponding external document, known as + * a purchase order, is emailed to the customer. */ interface OrderAddressInterface extends \Magento\Framework\Api\ExtensibleDataInterface { + /* + * Entity ID. + */ const ENTITY_ID = 'entity_id'; + /* + * Parent ID. + */ const PARENT_ID = 'parent_id'; + /* + * Customer address ID. + */ const CUSTOMER_ADDRESS_ID = 'customer_address_id'; + /* + * Quote address ID. + */ const QUOTE_ADDRESS_ID = 'quote_address_id'; + /* + * Region ID. + */ const REGION_ID = 'region_id'; - const CUSTOMER_ID = 'customer_id'; + /* + * Customer ID. + */ + const CUSTOMER_ID = 'customer_id'; + /* + * Fax. + */ const FAX = 'fax'; + /* + * Region. + */ const REGION = 'region'; + /* + * Postal code. + */ const POSTCODE = 'postcode'; + /* + * Last name. + */ const LASTNAME = 'lastname'; + /* + * Street. + */ const STREET = 'street'; + /* + * City. + */ const CITY = 'city'; + /* + * Email address. + */ const EMAIL = 'email'; + /* + * Telephone number. + */ const TELEPHONE = 'telephone'; + /* + * Country ID. + */ const COUNTRY_ID = 'country_id'; + /* + * First name. + */ const FIRSTNAME = 'firstname'; + /* + * Address type. + */ const ADDRESS_TYPE = 'address_type'; + /* + * Prefix. + */ const PREFIX = 'prefix'; + /* + * Middle name. + */ const MIDDLENAME = 'middlename'; + /* + * Suffix. + */ const SUFFIX = 'suffix'; + /* + * Company. + */ const COMPANY = 'company'; + /* + * Value-added tax (VAT) ID. + */ const VAT_ID = 'vat_id'; + /* + * VAT-is-valid flag. + */ const VAT_IS_VALID = 'vat_is_valid'; + /* + * VAT request ID. + */ const VAT_REQUEST_ID = 'vat_request_id'; + /* + * VAT request date. + */ const VAT_REQUEST_DATE = 'vat_request_date'; + /* + * VAT-request-success flag. + */ const VAT_REQUEST_SUCCESS = 'vat_request_success'; /** - * Returns address_type + * Gets the address type for the order address. * - * @return string + * @return string Address type. */ public function getAddressType(); /** - * Returns city + * Gets the city for the order address. * - * @return string + * @return string City. */ public function getCity(); /** - * Returns company + * Gets the company for the order address. * - * @return string + * @return string Company. */ public function getCompany(); /** - * Returns country_id + * Gets the country ID for the order address. * - * @return string + * @return string Country ID. */ public function getCountryId(); /** - * Returns customer_address_id + * Gets the country address ID for the order address. * - * @return int + * @return int Country address ID. */ public function getCustomerAddressId(); /** - * Returns customer_id + * Gets the customer ID for the order address. * - * @return int + * @return int Customer ID. */ public function getCustomerId(); /** - * Returns email + * Gets the email address for the order address. * - * @return string + * @return string Email address. */ public function getEmail(); /** - * Returns entity_id + * Gets the ID for the order address. * - * @return int + * @return int Order address ID. */ public function getEntityId(); /** - * Returns fax + * Gets the fax number for the order address. * - * @return string + * @return string Fax number. */ public function getFax(); /** - * Returns firstname + * Gets the first name for the order address. * - * @return string + * @return string First name. */ public function getFirstname(); /** - * Returns lastname + * Gets the last name for the order address. * - * @return string + * @return string Last name. */ public function getLastname(); /** - * Returns middlename + * Gets the middle name for the order address. * - * @return string + * @return string Middle name. */ public function getMiddlename(); /** - * Returns parent_id + * Gets the parent ID for the order address. * - * @return int + * @return int Parent ID. */ public function getParentId(); /** - * Returns postcode + * Gets the postal code for the order address. * - * @return string + * @return string Postal code. */ public function getPostcode(); /** - * Returns prefix + * Gets the prefix for the order address. * - * @return string + * @return string Prefix. */ public function getPrefix(); /** - * Returns quote_address_id + * Gets the quote address ID for the order address. * - * @return int + * @return int Quote address ID. */ public function getQuoteAddressId(); /** - * Returns region + * Gets the region for the order address. * - * @return string + * @return string Region. */ public function getRegion(); /** - * Returns region_id + * Gets the region ID for the order address. * - * @return int + * @return int Region ID. */ public function getRegionId(); /** - * Get street + * Gets the street values, if any, for the order address. * - * @return string[]|null + * @return string[]|null Array of any street values. Otherwise, null. */ public function getStreet(); /** - * Returns suffix + * Gets the suffix for the order address. * - * @return string + * @return string Suffix. */ public function getSuffix(); /** - * Returns telephone + * Gets the telephone number for the order address. * - * @return string + * @return string Telephone number. */ public function getTelephone(); /** - * Returns vat_id + * Gets the VAT ID for the order address. * - * @return string + * @return string VAT ID. */ public function getVatId(); /** - * Returns vat_is_valid + * Gets the VAT-is-valid flag value for the order address. * - * @return int + * @return int VAT-is-valid flag value. */ public function getVatIsValid(); /** - * Returns vat_request_date + * Gets the VAT request date for the order address. * - * @return string + * @return string VAT request date. */ public function getVatRequestDate(); /** - * Returns vat_request_id + * Gets the VAT request ID for the order address. * - * @return string + * @return string VAT request ID. */ public function getVatRequestId(); /** - * Returns vat_request_success + * Gets the VAT-request-success flag value for the order address. * - * @return int + * @return int VAT-request-success flag value. */ public function getVatRequestSuccess(); } diff --git a/app/code/Magento/Sales/Api/Data/OrderAddressSearchResultInterface.php b/app/code/Magento/Sales/Api/Data/OrderAddressSearchResultInterface.php index 25fb8dfb6f4bf..32cb43e85c4f5 100644 --- a/app/code/Magento/Sales/Api/Data/OrderAddressSearchResultInterface.php +++ b/app/code/Magento/Sales/Api/Data/OrderAddressSearchResultInterface.php @@ -2,18 +2,21 @@ /** * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) */ - namespace Magento\Sales\Api\Data; /** - * Interface OrderAddressSearchResultInterface + * Order address search result interface. + * + * An order is a document that a web store issues to a customer. Magento generates a sales order that lists the product + * items, billing and shipping addresses, and shipping and payment methods. A corresponding external document, known as + * a purchase order, is emailed to the customer. */ interface OrderAddressSearchResultInterface extends \Magento\Framework\Api\SearchResultsInterface { /** - * Get collection items + * Gets collection items. * - * @return \Magento\Sales\Api\Data\OrderAddressInterface[] + * @return \Magento\Sales\Api\Data\OrderAddressInterface[] Array of collection items. */ public function getItems(); } diff --git a/app/code/Magento/Sales/Api/Data/OrderInterface.php b/app/code/Magento/Sales/Api/Data/OrderInterface.php index deb99f11b8b6c..2a7204cd1d063 100644 --- a/app/code/Magento/Sales/Api/Data/OrderInterface.php +++ b/app/code/Magento/Sales/Api/Data/OrderInterface.php @@ -5,1119 +5,1558 @@ namespace Magento\Sales\Api\Data; /** - * Interface OrderInterface + * Order interface. + * + * An order is a document that a web store issues to a customer. Magento generates a sales order that lists the product + * items, billing and shipping addresses, and shipping and payment methods. A corresponding external document, known as + * a purchase order, is emailed to the customer. */ interface OrderInterface extends \Magento\Framework\Api\ExtensibleDataInterface { /**#@+ - * Constants for keys of data array. Identical to the name of the getter in snake case + * Constants for keys of data array. Identical to the name of the getter in snake case. + */ + /* + * Entity ID. */ const ENTITY_ID = 'entity_id'; + /* + * State. + */ const STATE = 'state'; + /* + * Status. + */ const STATUS = 'status'; + /* + * Coupon code. + */ const COUPON_CODE = 'coupon_code'; + /* + * Protect code. + */ const PROTECT_CODE = 'protect_code'; + /* + * Shipping description. + */ const SHIPPING_DESCRIPTION = 'shipping_description'; + /* + * Is-virtual flag. + */ const IS_VIRTUAL = 'is_virtual'; + /* + * Store ID. + */ const STORE_ID = 'store_id'; + /* + * Customer ID. + */ const CUSTOMER_ID = 'customer_id'; + /* + * Base discount amount. + */ const BASE_DISCOUNT_AMOUNT = 'base_discount_amount'; + /* + * Base discount canceled. + */ const BASE_DISCOUNT_CANCELED = 'base_discount_canceled'; + /* + * Base discount invoiced. + */ const BASE_DISCOUNT_INVOICED = 'base_discount_invoiced'; + /* + * Base discount refunded. + */ const BASE_DISCOUNT_REFUNDED = 'base_discount_refunded'; + /* + * Base grand total. + */ const BASE_GRAND_TOTAL = 'base_grand_total'; + /* + * Base shipping amount. + */ const BASE_SHIPPING_AMOUNT = 'base_shipping_amount'; + /* + * Base shipping canceled. + */ const BASE_SHIPPING_CANCELED = 'base_shipping_canceled'; + /* + * Base shipping invoiced. + */ const BASE_SHIPPING_INVOICED = 'base_shipping_invoiced'; + /* + * Base shipping refunded. + */ const BASE_SHIPPING_REFUNDED = 'base_shipping_refunded'; + /* + * Base shipping tax amount. + */ const BASE_SHIPPING_TAX_AMOUNT = 'base_shipping_tax_amount'; + /* + * Base shipping tax refunded. + */ const BASE_SHIPPING_TAX_REFUNDED = 'base_shipping_tax_refunded'; + /* + * Base subtotal. + */ const BASE_SUBTOTAL = 'base_subtotal'; + /* + * Base subtotal canceled. + */ const BASE_SUBTOTAL_CANCELED = 'base_subtotal_canceled'; + /* + * Base subtotal invoiced. + */ const BASE_SUBTOTAL_INVOICED = 'base_subtotal_invoiced'; + /* + * Base subtotal refunded. + */ const BASE_SUBTOTAL_REFUNDED = 'base_subtotal_refunded'; + /* + * Base tax amount. + */ const BASE_TAX_AMOUNT = 'base_tax_amount'; + /* + * Base tax canceled. + */ const BASE_TAX_CANCELED = 'base_tax_canceled'; + /* + * Base tax invoiced. + */ const BASE_TAX_INVOICED = 'base_tax_invoiced'; + /* + * Base tax refunded. + */ const BASE_TAX_REFUNDED = 'base_tax_refunded'; + /* + * Base-to-global rate. + */ const BASE_TO_GLOBAL_RATE = 'base_to_global_rate'; + /* + * Base-to-order rate. + */ const BASE_TO_ORDER_RATE = 'base_to_order_rate'; + /* + * Base total canceled. + */ const BASE_TOTAL_CANCELED = 'base_total_canceled'; + /* + * Base total invoiced. + */ const BASE_TOTAL_INVOICED = 'base_total_invoiced'; + /* + * Base total invoiced cost. + */ const BASE_TOTAL_INVOICED_COST = 'base_total_invoiced_cost'; + /* + * Base total offline refunded. + */ const BASE_TOTAL_OFFLINE_REFUNDED = 'base_total_offline_refunded'; + /* + * Base total online refunded. + */ const BASE_TOTAL_ONLINE_REFUNDED = 'base_total_online_refunded'; + /* + * Base total paid. + */ const BASE_TOTAL_PAID = 'base_total_paid'; + /* + * Base total quantity ordered. + */ const BASE_TOTAL_QTY_ORDERED = 'base_total_qty_ordered'; + /* + * Base total refunded. + */ const BASE_TOTAL_REFUNDED = 'base_total_refunded'; + /* + * Discount amount. + */ const DISCOUNT_AMOUNT = 'discount_amount'; + /* + * Discount canceled. + */ const DISCOUNT_CANCELED = 'discount_canceled'; + /* + * Discount invoiced. + */ const DISCOUNT_INVOICED = 'discount_invoiced'; + /* + * Discount refunded. + */ const DISCOUNT_REFUNDED = 'discount_refunded'; + /* + * Grand total. + */ const GRAND_TOTAL = 'grand_total'; + /* + * Shipping amount. + */ const SHIPPING_AMOUNT = 'shipping_amount'; + /* + * Shipping canceled. + */ const SHIPPING_CANCELED = 'shipping_canceled'; + /* + * Shipping invoiced. + */ const SHIPPING_INVOICED = 'shipping_invoiced'; + /* + * Shipping refunded. + */ const SHIPPING_REFUNDED = 'shipping_refunded'; + /* + * Shipping tax amount. + */ const SHIPPING_TAX_AMOUNT = 'shipping_tax_amount'; + /* + * Shipping tax refunded. + */ const SHIPPING_TAX_REFUNDED = 'shipping_tax_refunded'; + /* + * Store-to-base rate. + */ const STORE_TO_BASE_RATE = 'store_to_base_rate'; + /* + * Store-to-order rate. + */ const STORE_TO_ORDER_RATE = 'store_to_order_rate'; + /* + * Subtotal. + */ const SUBTOTAL = 'subtotal'; + /* + * Subtotal canceled. + */ const SUBTOTAL_CANCELED = 'subtotal_canceled'; + /* + * Subtotal invoiced. + */ const SUBTOTAL_INVOICED = 'subtotal_invoiced'; + /* + * Subtotal refunded. + */ const SUBTOTAL_REFUNDED = 'subtotal_refunded'; + /* + * Tax amount. + */ const TAX_AMOUNT = 'tax_amount'; + /* + * Tax canceled. + */ const TAX_CANCELED = 'tax_canceled'; + /* + * Tax invoiced. + */ const TAX_INVOICED = 'tax_invoiced'; + /* + * Tax refunded. + */ const TAX_REFUNDED = 'tax_refunded'; + /* + * Total canceled. + */ const TOTAL_CANCELED = 'total_canceled'; + /* + * Total invoiced. + */ const TOTAL_INVOICED = 'total_invoiced'; + /* + * Total refunded offline. + */ const TOTAL_OFFLINE_REFUNDED = 'total_offline_refunded'; + /* + * Total refunded online. + */ const TOTAL_ONLINE_REFUNDED = 'total_online_refunded'; + /* + * Total paid. + */ const TOTAL_PAID = 'total_paid'; + /* + * Total quantity ordered. + */ const TOTAL_QTY_ORDERED = 'total_qty_ordered'; + /* + * Total refunded. + */ const TOTAL_REFUNDED = 'total_refunded'; + /* + * Can-ship-partially flag. + */ const CAN_SHIP_PARTIALLY = 'can_ship_partially'; + /* + * Can-ship-item-partially flag. + */ const CAN_SHIP_PARTIALLY_ITEM = 'can_ship_partially_item'; + /* + * Customer-is-guest flag. + */ const CUSTOMER_IS_GUEST = 'customer_is_guest'; + /* + * Customer-note-notify flag. + */ const CUSTOMER_NOTE_NOTIFY = 'customer_note_notify'; + /* + * Billing address ID. + */ const BILLING_ADDRESS_ID = 'billing_address_id'; + /* + * Customer group ID. + */ const CUSTOMER_GROUP_ID = 'customer_group_id'; + /* + * Edit increment value. + */ const EDIT_INCREMENT = 'edit_increment'; + /* + * Email-sent flag. + */ const EMAIL_SENT = 'email_sent'; + /* + * Forced-shipment-with-invoice flag. + */ const FORCED_SHIPMENT_WITH_INVOICE = 'forced_shipment_with_invoice'; + /* + * Payment authorization expiration date. + */ const PAYMENT_AUTH_EXPIRATION = 'payment_auth_expiration'; + /* + * Quote address ID. + */ const QUOTE_ADDRESS_ID = 'quote_address_id'; + /* + * Quote ID. + */ const QUOTE_ID = 'quote_id'; + /* + * Shipping address ID. + */ const SHIPPING_ADDRESS_ID = 'shipping_address_id'; + /* + * Negative adjustment. + */ const ADJUSTMENT_NEGATIVE = 'adjustment_negative'; + /* + * Positive adjustment. + */ const ADJUSTMENT_POSITIVE = 'adjustment_positive'; + /* + * Base negative adjustment. + */ const BASE_ADJUSTMENT_NEGATIVE = 'base_adjustment_negative'; + /* + * Base positive adjustment. + */ const BASE_ADJUSTMENT_POSITIVE = 'base_adjustment_positive'; + /* + * Base shipping discount amount. + */ const BASE_SHIPPING_DISCOUNT_AMOUNT = 'base_shipping_discount_amount'; + /* + * Base subtotal including tax. + */ const BASE_SUBTOTAL_INCL_TAX = 'base_subtotal_incl_tax'; + /* + * Base total due. + */ const BASE_TOTAL_DUE = 'base_total_due'; + /* + * Payment authorization amount. + */ const PAYMENT_AUTHORIZATION_AMOUNT = 'payment_authorization_amount'; + /* + * Shipping discount amount. + */ const SHIPPING_DISCOUNT_AMOUNT = 'shipping_discount_amount'; + /* + * Subtotal including tax. + */ const SUBTOTAL_INCL_TAX = 'subtotal_incl_tax'; + /* + * Total due. + */ const TOTAL_DUE = 'total_due'; + /* + * Weight. + */ const WEIGHT = 'weight'; + /* + * Customer date-of-birth (DOB). + */ const CUSTOMER_DOB = 'customer_dob'; + /* + * Increment ID. + */ const INCREMENT_ID = 'increment_id'; + /* + * Applied rule IDs. + */ const APPLIED_RULE_IDS = 'applied_rule_ids'; + /* + * Base currency code. + */ const BASE_CURRENCY_CODE = 'base_currency_code'; + /* + * Customer email address. + */ const CUSTOMER_EMAIL = 'customer_email'; + /* + * Customer first name. + */ const CUSTOMER_FIRSTNAME = 'customer_firstname'; + /* + * Customer last name. + */ const CUSTOMER_LASTNAME = 'customer_lastname'; + /* + * Customer middle name. + */ const CUSTOMER_MIDDLENAME = 'customer_middlename'; + /* + * Customer prefix. + */ const CUSTOMER_PREFIX = 'customer_prefix'; + /* + * Customer suffix. + */ const CUSTOMER_SUFFIX = 'customer_suffix'; + /* + * Customer value-added tax (VAT). + */ const CUSTOMER_TAXVAT = 'customer_taxvat'; + /* + * Discount description. + */ const DISCOUNT_DESCRIPTION = 'discount_description'; + /* + * External customer ID. + */ const EXT_CUSTOMER_ID = 'ext_customer_id'; + /* + * External order ID. + */ const EXT_ORDER_ID = 'ext_order_id'; + /* + * Global currency code. + */ const GLOBAL_CURRENCY_CODE = 'global_currency_code'; + /* + * Hold before state. + */ const HOLD_BEFORE_STATE = 'hold_before_state'; + /* + * Hold before status. + */ const HOLD_BEFORE_STATUS = 'hold_before_status'; + /* + * Order currency code. + */ const ORDER_CURRENCY_CODE = 'order_currency_code'; + /* + * Original increment ID. + */ const ORIGINAL_INCREMENT_ID = 'original_increment_id'; + /* + * Relation child ID. + */ const RELATION_CHILD_ID = 'relation_child_id'; + /* + * Relation child real ID. + */ const RELATION_CHILD_REAL_ID = 'relation_child_real_id'; + /* + * Relation parent ID. + */ const RELATION_PARENT_ID = 'relation_parent_id'; + /* + * Relation parent real ID. + */ const RELATION_PARENT_REAL_ID = 'relation_parent_real_id'; + /* + * Remote IP address. + */ const REMOTE_IP = 'remote_ip'; + /* + * Shipping method. + */ const SHIPPING_METHOD = 'shipping_method'; + /* + * Store currency code. + */ const STORE_CURRENCY_CODE = 'store_currency_code'; + /* + * Store name. + */ const STORE_NAME = 'store_name'; + /* + * X-Forwarded-For HTTP header field. + */ const X_FORWARDED_FOR = 'x_forwarded_for'; + /* + * Customer note. + */ const CUSTOMER_NOTE = 'customer_note'; + /* + * Created-at timestamp. + */ const CREATED_AT = 'created_at'; + /* + * Updated-at timestamp. + */ const UPDATED_AT = 'updated_at'; + /* + * Total item count. + */ const TOTAL_ITEM_COUNT = 'total_item_count'; + /* + * Customer gender. + */ const CUSTOMER_GENDER = 'customer_gender'; + /* + * Hidden tax amount. + */ const HIDDEN_TAX_AMOUNT = 'hidden_tax_amount'; + /* + * Base hidden tax amount. + */ const BASE_HIDDEN_TAX_AMOUNT = 'base_hidden_tax_amount'; + /* + * Shipping hidden tax amount. + */ const SHIPPING_HIDDEN_TAX_AMOUNT = 'shipping_hidden_tax_amount'; + /* + * Base shipping hidden tax amount. + */ const BASE_SHIPPING_HIDDEN_TAX_AMNT = 'base_shipping_hidden_tax_amnt'; + /* + * Hidden tax invoiced. + */ const HIDDEN_TAX_INVOICED = 'hidden_tax_invoiced'; + /* + * Base hidden tax invoiced. + */ const BASE_HIDDEN_TAX_INVOICED = 'base_hidden_tax_invoiced'; + /* + * Hidden tax refunded. + */ const HIDDEN_TAX_REFUNDED = 'hidden_tax_refunded'; + /* + * Base hidden tax refunded. + */ const BASE_HIDDEN_TAX_REFUNDED = 'base_hidden_tax_refunded'; + /* + * Shipping including tax. + */ const SHIPPING_INCL_TAX = 'shipping_incl_tax'; + /* + * Base shipping including tax. + */ const BASE_SHIPPING_INCL_TAX = 'base_shipping_incl_tax'; + /* + * Items. + */ const ITEMS = 'items'; + /* + * Billing address. + */ const BILLING_ADDRESS = 'billing_address'; + /* + * Shipping address. + */ const SHIPPING_ADDRESS = 'shipping_address'; + /* + * Payments. + */ const PAYMENTS = 'payments'; + /* + * Addresses. + */ const ADDRESSES = 'addresses'; + /* + * Status histories. + */ const STATUS_HISTORIES = 'status_histories'; /** - * Returns adjustment_negative + * Gets the negative adjustment value for the order. * - * @return float + * @return float Negative adjustment value. */ public function getAdjustmentNegative(); /** - * Returns adjustment_positive + * Gets the positive adjustment value for the order. * - * @return float + * @return float Positive adjustment value. */ public function getAdjustmentPositive(); /** - * Returns applied_rule_ids + * Gets the applied rule IDs for the order. * - * @return string + * @return string Applied rule IDs. */ public function getAppliedRuleIds(); /** - * Returns base_adjustment_negative + * Gets the base negative adjustment value for the order. * - * @return float + * @return float Base negative adjustment value. */ public function getBaseAdjustmentNegative(); /** - * Returns base_adjustment_positive + * Gets the base positive adjustment value for the order. * - * @return float + * @return float Base positive adjustment value. */ public function getBaseAdjustmentPositive(); /** - * Returns base_currency_code + * Gets the base currency code for the order. * - * @return string + * @return string Base currency code. */ public function getBaseCurrencyCode(); /** - * Returns base_discount_amount + * Gets the base discount amount for the order. * - * @return float + * @return float Base discount amount. */ public function getBaseDiscountAmount(); /** - * Returns base_discount_canceled + * Gets the base discount canceled for the order. * - * @return float + * @return float Base discount canceled. */ public function getBaseDiscountCanceled(); /** - * Returns base_discount_invoiced + * Gets the base discount invoiced amount for the order. * - * @return float + * @return float Base discount invoiced. */ public function getBaseDiscountInvoiced(); /** - * Returns base_discount_refunded + * Gets the base discount refunded amount for the order. * - * @return float + * @return float Base discount refunded. */ public function getBaseDiscountRefunded(); /** - * Returns base_grand_total + * Gets the base grand total for the order. * - * @return float + * @return float Base grand total. */ public function getBaseGrandTotal(); /** - * Returns base_hidden_tax_amount + * Gets the base hidden tax amount for the order. * - * @return float + * @return float Base hidden tax amount. */ public function getBaseHiddenTaxAmount(); /** - * Returns base_hidden_tax_invoiced + * Gets the base hidden tax invoiced amount for the order. * - * @return float + * @return float Base hidden tax invoiced. */ public function getBaseHiddenTaxInvoiced(); /** - * Returns base_hidden_tax_refunded + * Gets the base hidden tax refunded amount for the order. * - * @return float + * @return float Base hidden tax refunded. */ public function getBaseHiddenTaxRefunded(); /** - * Returns base_shipping_amount + * Gets the base shipping amount for the order. * - * @return float + * @return float Base shipping amount. */ public function getBaseShippingAmount(); /** - * Returns base_shipping_canceled + * Gets the base shipping canceled for the order. * - * @return float + * @return float Base shipping canceled. */ public function getBaseShippingCanceled(); /** - * Returns base_shipping_discount_amount + * Gets the base shipping discount amount for the order. * - * @return float + * @return float Base shipping discount amount. */ public function getBaseShippingDiscountAmount(); /** - * Returns base_shipping_hidden_tax_amnt + * Gets the base shipping hidden tax amount for the order. * - * @return float + * @return float Base shipping hidden tax amount. */ public function getBaseShippingHiddenTaxAmnt(); /** - * Returns base_shipping_incl_tax + * Gets the base shipping including tax for the order. * - * @return float + * @return float Base shipping including tax. */ public function getBaseShippingInclTax(); /** - * Returns base_shipping_invoiced + * Gets the base shipping invoiced amount for the order. * - * @return float + * @return float Base shipping invoiced. */ public function getBaseShippingInvoiced(); /** - * Returns base_shipping_refunded + * Gets the base shipping refunded amount for the order. * - * @return float + * @return float Base shipping refunded. */ public function getBaseShippingRefunded(); /** - * Returns base_shipping_tax_amount + * Gets the base shipping tax amount for the order. * - * @return float + * @return float Base shipping tax amount. */ public function getBaseShippingTaxAmount(); /** - * Returns base_shipping_tax_refunded + * Gets the base shipping tax refunded amount for the order. * - * @return float + * @return float Base shipping tax refunded. */ public function getBaseShippingTaxRefunded(); /** - * Returns base_subtotal + * Gets the base subtotal for the order. * - * @return float + * @return float Base subtotal. */ public function getBaseSubtotal(); /** - * Returns base_subtotal_canceled + * Gets the base subtotal canceled for the order. * - * @return float + * @return float Base subtotal canceled. */ public function getBaseSubtotalCanceled(); /** - * Returns base_subtotal_incl_tax + * Gets the base subtotal including tax for the order. * - * @return float + * @return float Base subtotal including tax. */ public function getBaseSubtotalInclTax(); /** - * Returns base_subtotal_invoiced + * Gets the base subtotal invoiced amount for the order. * - * @return float + * @return float Base subtotal invoiced. */ public function getBaseSubtotalInvoiced(); /** - * Returns base_subtotal_refunded + * Gets the base subtotal refunded amount for the order. * - * @return float + * @return float Base subtotal refunded. */ public function getBaseSubtotalRefunded(); /** - * Returns base_tax_amount + * Gets the base tax amount for the order. * - * @return float + * @return float Base tax amount. */ public function getBaseTaxAmount(); /** - * Returns base_tax_canceled + * Gets the base tax canceled for the order. * - * @return float + * @return float Base tax canceled. */ public function getBaseTaxCanceled(); /** - * Returns base_tax_invoiced + * Gets the base tax invoiced amount for the order. * - * @return float + * @return float Base tax invoiced. */ public function getBaseTaxInvoiced(); /** - * Returns base_tax_refunded + * Gets the base tax refunded amount for the order. * - * @return float + * @return float Base tax refunded. */ public function getBaseTaxRefunded(); /** - * Returns base_total_canceled + * Gets the base total canceled for the order. * - * @return float + * @return float Base total canceled. */ public function getBaseTotalCanceled(); /** - * Returns base_total_due + * Gets the base total due for the order. * - * @return float + * @return float Base total due. */ public function getBaseTotalDue(); /** - * Returns base_total_invoiced + * Gets the base total invoiced amount for the order. * - * @return float + * @return float Base total invoiced. */ public function getBaseTotalInvoiced(); /** - * Returns base_total_invoiced_cost + * Gets the base total invoiced cost for the order. * - * @return float + * @return float Base total invoiced cost. */ public function getBaseTotalInvoicedCost(); /** - * Returns base_total_offline_refunded + * Gets the base total offline refunded amount for the order. * - * @return float + * @return float Base total offline refunded. */ public function getBaseTotalOfflineRefunded(); /** - * Returns base_total_online_refunded + * Gets the base total online refunded amount for the order. * - * @return float + * @return float Base total online refunded. */ public function getBaseTotalOnlineRefunded(); /** - * Returns base_total_paid + * Gets the base total paid for the order. * - * @return float + * @return float Base total paid. */ public function getBaseTotalPaid(); /** - * Returns base_total_qty_ordered + * Gets the base total quantity ordered for the order. * - * @return float + * @return float Base total quantity ordered. */ public function getBaseTotalQtyOrdered(); /** - * Returns base_total_refunded + * Gets the base total refunded amount for the order. * - * @return float + * @return float Base total refunded. */ public function getBaseTotalRefunded(); /** - * Returns base_to_global_rate + * Gets the base-to-global rate for the order. * - * @return float + * @return float Base-to-global rate. */ public function getBaseToGlobalRate(); /** - * Returns base_to_order_rate + * Gets the base-to-order rate for the order. * - * @return float + * @return float Base-to-order rate. */ public function getBaseToOrderRate(); /** - * Returns billing_address_id + * Gets the billing address ID for the order. * - * @return int + * @return int Billing address ID. */ public function getBillingAddressId(); /** - * Returns can_ship_partially + * Gets the can-ship-partially flag value for the order. * - * @return int + * @return int Can-ship-partially flag value. */ public function getCanShipPartially(); /** - * Returns can_ship_partially_item + * Gets the can-ship-partially-item flag value for the order. * - * @return int + * @return int Can-ship-partially-item flag value. */ public function getCanShipPartiallyItem(); /** - * Returns coupon_code + * Gets the coupon code for the order. * - * @return string + * @return string Coupon code. */ public function getCouponCode(); /** - * Returns created_at + * Gets the created-at timestamp for the order. * - * @return string + * @return string Created-at timestamp. */ public function getCreatedAt(); /** - * Returns customer_dob + * Gets the customer date-of-birth (DOB) for the order. * - * @return string + * @return string Customer date-of-birth (DOB). */ public function getCustomerDob(); /** - * Returns customer_email + * Gets the customer email address for the order. * - * @return string + * @return string Customer email address. */ public function getCustomerEmail(); /** - * Returns customer_firstname + * Gets the customer first name for the order. * - * @return string + * @return string Customer first name. */ public function getCustomerFirstname(); /** - * Returns customer_gender + * Gets the customer gender for the order. * - * @return int + * @return int Customer gender. */ public function getCustomerGender(); /** - * Returns customer_group_id + * Gets the customer group ID for the order. * - * @return int + * @return int Customer group ID. */ public function getCustomerGroupId(); /** - * Returns customer_id + * Gets the customer ID for the order. * - * @return int + * @return int Customer ID. */ public function getCustomerId(); /** - * Returns customer_is_guest + * Gets the customer-is-guest flag value for the order. * - * @return int + * @return int Customer-is-guest flag value. */ public function getCustomerIsGuest(); /** - * Returns customer_lastname + * Gets the customer last name for the order. * - * @return string + * @return string Customer last name. */ public function getCustomerLastname(); /** - * Returns customer_middlename + * Gets the customer middle name for the order. * - * @return string + * @return string Customer middle name. */ public function getCustomerMiddlename(); /** - * Returns customer_note + * Gets the customer note for the order. * - * @return string + * @return string Customer note. */ public function getCustomerNote(); /** - * Returns customer_note_notify + * Gets the customer-note-notify flag value for the order. * - * @return int + * @return int Customer-note-notify flag value. */ public function getCustomerNoteNotify(); /** - * Returns customer_prefix + * Gets the customer prefix for the order. * - * @return string + * @return string Customer prefix. */ public function getCustomerPrefix(); /** - * Returns customer_suffix + * Gets the customer suffix for the order. * - * @return string + * @return string Customer suffix. */ public function getCustomerSuffix(); /** - * Returns customer_taxvat + * Gets the customer value-added tax (VAT) for the order. * - * @return string + * @return string Customer value-added tax (VAT). */ public function getCustomerTaxvat(); /** - * Returns discount_amount + * Gets the discount amount for the order. * - * @return float + * @return float Discount amount. */ public function getDiscountAmount(); /** - * Returns discount_canceled + * Gets the discount canceled for the order. * - * @return float + * @return float Discount canceled. */ public function getDiscountCanceled(); /** - * Returns discount_description + * Gets the discount description for the order. * - * @return string + * @return string Discount description. */ public function getDiscountDescription(); /** - * Returns discount_invoiced + * Gets the discount invoiced amount for the order. * - * @return float + * @return float Discount invoiced. */ public function getDiscountInvoiced(); /** - * Returns discount_refunded + * Gets the discount refunded amount for the order. * - * @return float + * @return float Discount refunded amount. */ public function getDiscountRefunded(); /** - * Returns edit_increment + * Gets the edit increment value for the order. * - * @return int + * @return int Edit increment value. */ public function getEditIncrement(); /** - * Returns email_sent + * Gets the email-sent flag value for the order. * - * @return int + * @return int Email-sent flag value. */ public function getEmailSent(); /** - * Returns entity_id + * Gets the ID for the order. * - * @return int + * @return int Order ID. */ public function getEntityId(); /** - * Returns ext_customer_id + * Gets the external customer ID for the order. * - * @return string + * @return string External customer ID. */ public function getExtCustomerId(); /** - * Returns ext_order_id + * Gets the external order ID for the order. * - * @return string + * @return string External order ID. */ public function getExtOrderId(); /** - * Returns forced_shipment_with_invoice + * Gets the forced-shipment-with-invoice flag value for the order. * - * @return int + * @return int Forced-shipment-with-invoice flag value. */ public function getForcedShipmentWithInvoice(); /** - * Returns global_currency_code + * Gets the global currency code for the order. * - * @return string + * @return string Global currency code. */ public function getGlobalCurrencyCode(); /** - * Returns grand_total + * Gets the grand total for the order. * - * @return float + * @return float Grand total. */ public function getGrandTotal(); /** - * Returns hidden_tax_amount + * Gets the hidden tax amount for the order. * - * @return float + * @return float Hidden tax amount. */ public function getHiddenTaxAmount(); /** - * Returns hidden_tax_invoiced + * Gets the hidden tax invoiced amount for the order. * - * @return float + * @return float Hidden tax invoiced amount. */ public function getHiddenTaxInvoiced(); /** - * Returns hidden_tax_refunded + * Gets the hidden tax refunded amount for the order. * - * @return float + * @return float Hidden tax refunded amount. */ public function getHiddenTaxRefunded(); /** - * Returns hold_before_state + * Gets the hold before state for the order. * - * @return string + * @return string Hold before state. */ public function getHoldBeforeState(); /** - * Returns hold_before_status + * Gets the hold before status for the order. * - * @return string + * @return string Hold before status. */ public function getHoldBeforeStatus(); /** - * Returns increment_id + * Gets the increment ID for the order. * - * @return string + * @return string Increment ID. */ public function getIncrementId(); /** - * Returns is_virtual + * Gets the is-virtual flag value for the order. * - * @return int + * @return int Is-virtual flag value. */ public function getIsVirtual(); /** - * Returns order_currency_code + * Gets the order currency code for the order. * - * @return string + * @return string Order currency code. */ public function getOrderCurrencyCode(); /** - * Returns original_increment_id + * Gets the original increment ID for the order. * - * @return string + * @return string Original increment ID. */ public function getOriginalIncrementId(); /** - * Returns payment_authorization_amount + * Gets the payment authorization amount for the order. * - * @return float + * @return float Payment authorization amount. */ public function getPaymentAuthorizationAmount(); /** - * Returns payment_auth_expiration + * Gets the payment authorization expiration date for the order. * - * @return int + * @return int Payment authorization expiration date. */ public function getPaymentAuthExpiration(); /** - * Returns protect_code + * Gets the protect code for the order. * - * @return string + * @return string Protect code. */ public function getProtectCode(); /** - * Returns quote_address_id + * Gets the quote address ID for the order. * - * @return int + * @return int Quote address ID. */ public function getQuoteAddressId(); /** - * Returns quote_id + * Gets the quote ID for the order. * - * @return int + * @return int Quote ID. */ public function getQuoteId(); /** - * Returns relation_child_id + * Gets the relation child ID for the order. * - * @return string + * @return string Relation child ID. */ public function getRelationChildId(); /** - * Returns relation_child_real_id + * Gets the relation child real ID for the order. * - * @return string + * @return string Relation child real ID. */ public function getRelationChildRealId(); /** - * Returns relation_parent_id + * Gets the relation parent ID for the order. * - * @return string + * @return string Relation parent ID. */ public function getRelationParentId(); /** - * Returns relation_parent_real_id + * Gets the relation parent real ID for the order. * - * @return string + * @return string Relation parent real ID. */ public function getRelationParentRealId(); /** - * Returns remote_ip + * Gets the remote IP address for the order. * - * @return string + * @return string Remote IP address. */ public function getRemoteIp(); /** - * Returns shipping_address_id + * Gets the shipping address ID for the order. * - * @return int + * @return int Shipping address ID. */ public function getShippingAddressId(); /** - * Returns shipping_amount + * Gets the shipping amount for the order. * - * @return float + * @return float Shipping amount. */ public function getShippingAmount(); /** - * Returns shipping_canceled + * Gets the shipping canceled amount for the order. * - * @return float + * @return float Shipping canceled amount. */ public function getShippingCanceled(); /** - * Returns shipping_description + * Gets the shipping description for the order. * - * @return string + * @return string Shipping description. */ public function getShippingDescription(); /** - * Returns shipping_discount_amount + * Gets the shipping discount amount for the order. * - * @return float + * @return float Shipping discount amount. */ public function getShippingDiscountAmount(); /** - * Returns shipping_hidden_tax_amount + * Gets the shipping hidden tax amount for the order. * - * @return float + * @return float Shipping hidden tax amount. */ public function getShippingHiddenTaxAmount(); /** - * Returns shipping_incl_tax + * Gets the shipping including tax amount for the order. * - * @return float + * @return float Shipping including tax amount. */ public function getShippingInclTax(); /** - * Returns shipping_invoiced + * Gets the shipping invoiced amount for the order. * - * @return float + * @return float Shipping invoiced amount. */ public function getShippingInvoiced(); /** - * Returns shipping_method + * Gets the shipping method for the order. * - * @return string + * @return string Shipping method. */ public function getShippingMethod(); /** - * Returns shipping_refunded + * Gets the shipping refunded amount for the order. * - * @return float + * @return float Shipping refunded amount. */ public function getShippingRefunded(); /** - * Returns shipping_tax_amount + * Gets the shipping tax amount for the order. * - * @return float + * @return float Shipping tax amount. */ public function getShippingTaxAmount(); /** - * Returns shipping_tax_refunded + * Gets the shipping tax refunded amount for the order. * - * @return float + * @return float Shipping tax refunded amount. */ public function getShippingTaxRefunded(); /** - * Returns state + * Gets the state for the order. * - * @return string + * @return string State. */ public function getState(); /** - * Returns status + * Gets the status for the order. * - * @return string + * @return string Status. */ public function getStatus(); /** - * Returns store_currency_code + * Gets the store currency code for the order. * - * @return string + * @return string Store currency code. */ public function getStoreCurrencyCode(); /** - * Returns store_id + * Gets the store ID for the order. * - * @return int + * @return int Store ID. */ public function getStoreId(); /** - * Returns store_name + * Gets the store name for the order. * - * @return string + * @return string Store name. */ public function getStoreName(); /** - * Returns store_to_base_rate + * Gets the store-to-base rate for the order. * - * @return float + * @return float Store-to-base rate. */ public function getStoreToBaseRate(); /** - * Returns store_to_order_rate + * Gets the store-to-order rate for the order. * - * @return float + * @return float Store-to-order rate. */ public function getStoreToOrderRate(); /** - * Returns subtotal + * Gets the subtotal for the order. * - * @return float + * @return float Subtotal. */ public function getSubtotal(); /** - * Returns subtotal_canceled + * Gets the subtotal canceled amount for the order. * - * @return float + * @return float Subtotal canceled amount. */ public function getSubtotalCanceled(); /** - * Returns subtotal_incl_tax + * Gets the subtotal including tax amount for the order. * - * @return float + * @return float Subtotal including tax amount. */ public function getSubtotalInclTax(); /** - * Returns subtotal_invoiced + * Gets the subtotal invoiced amount for the order. * - * @return float + * @return float Subtotal invoiced amount. */ public function getSubtotalInvoiced(); /** - * Returns subtotal_refunded + * Gets the subtotal refunded amount for the order. * - * @return float + * @return float Subtotal refunded amount. */ public function getSubtotalRefunded(); /** - * Returns tax_amount + * Gets the tax amount for the order. * - * @return float + * @return float Tax amount. */ public function getTaxAmount(); /** - * Returns tax_canceled + * Gets the tax canceled amount for the order. * - * @return float + * @return float Tax canceled amount. */ public function getTaxCanceled(); /** - * Returns tax_invoiced + * Gets the tax invoiced amount for the order. * - * @return float + * @return float Tax invoiced amount. */ public function getTaxInvoiced(); /** - * Returns tax_refunded + * Gets the tax refunded amount for the order. * - * @return float + * @return float Tax refunded amount. */ public function getTaxRefunded(); /** - * Returns total_canceled + * Gets the total canceled for the order. * - * @return float + * @return float Total canceled. */ public function getTotalCanceled(); /** - * Returns total_due + * Gets the total due for the order. * - * @return float + * @return float Total due. */ public function getTotalDue(); /** - * Returns total_invoiced + * Gets the total invoiced amount for the order. * - * @return float + * @return float Total invoiced amount. */ public function getTotalInvoiced(); /** - * Returns total_item_count + * Gets the total item count for the order. * - * @return int + * @return int Total item count. */ public function getTotalItemCount(); /** - * Returns total_offline_refunded + * Gets the total offline refunded amount for the order. * - * @return float + * @return float Total offline refunded amount. */ public function getTotalOfflineRefunded(); /** - * Returns total_online_refunded + * Gets the total online refunded amount for the order. * - * @return float + * @return float Total online refunded amount. */ public function getTotalOnlineRefunded(); /** - * Returns total_paid + * Gets the total paid for the order. * - * @return float + * @return float Total paid. */ public function getTotalPaid(); /** - * Returns total_qty_ordered + * Gets the total quantity ordered for the order. * - * @return float + * @return float Total quantity ordered. */ public function getTotalQtyOrdered(); /** - * Returns total_refunded + * Gets the total amount refunded amount for the order. * - * @return float + * @return float Total amount refunded. */ public function getTotalRefunded(); /** - * Returns updated_at + * Gets the updated-at timestamp for the order. * - * @return string + * @return string Updated-at timestamp. */ public function getUpdatedAt(); /** - * Returns weight + * Gets the weight for the order. * - * @return float + * @return float Weight. */ public function getWeight(); /** - * Returns x_forwarded_for + * Gets the X-Forwarded-For HTTP header field for the order. + * + * This field identifies the originating IP address of a client + * connecting to a web server through an HTTP proxy or load balancer. * - * @return string + * @return string X-Forwarded-For field value. */ public function getXForwardedFor(); /** - * @return \Magento\Sales\Api\Data\OrderItemInterface[] + * Gets items for the order. + * + * @return \Magento\Sales\Api\Data\OrderItemInterface[] Array of items. */ public function getItems(); /** - * @return \Magento\Sales\Api\Data\OrderAddressInterface|null + * Gets the billing address, if any, for the order. + * + * @return \Magento\Sales\Api\Data\OrderAddressInterface|null Billing address. Otherwise, null. */ public function getBillingAddress(); /** - * @return \Magento\Sales\Api\Data\OrderAddressInterface|null + * Gets the shipping address, if any, for the order. + * + * @return \Magento\Sales\Api\Data\OrderAddressInterface|null Shipping address. Otherwise, null. */ public function getShippingAddress(); /** - * @return \Magento\Sales\Api\Data\OrderPaymentInterface[] + * Gets the payments for the order. + * + * @return \Magento\Sales\Api\Data\OrderPaymentInterface[] Array of payments. */ public function getPayments(); /** - * @return \Magento\Sales\Api\Data\OrderAddressInterface[] + * Gets addresses for the order. + * + * @return \Magento\Sales\Api\Data\OrderAddressInterface[] Array of addresses. */ public function getAddresses(); /** - * @return \Magento\Sales\Api\Data\OrderStatusHistoryInterface[] + * Gets status histories for the order. + * + * @return \Magento\Sales\Api\Data\OrderStatusHistoryInterface[] Array of status histories. */ public function getStatusHistories(); } diff --git a/app/code/Magento/Sales/Api/Data/OrderItemInterface.php b/app/code/Magento/Sales/Api/Data/OrderItemInterface.php index 30fa2b74033f8..b6885c416c5ee 100644 --- a/app/code/Magento/Sales/Api/Data/OrderItemInterface.php +++ b/app/code/Magento/Sales/Api/Data/OrderItemInterface.php @@ -5,763 +5,1049 @@ namespace Magento\Sales\Api\Data; /** - * Interface OrderItemInterface + * Order item interface. + * + * An order is a document that a web store issues to a customer. Magento generates a sales order that lists the product + * items, billing and shipping addresses, and shipping and payment methods. A corresponding external document, known as + * a purchase order, is emailed to the customer. */ interface OrderItemInterface extends \Magento\Framework\Api\ExtensibleDataInterface { /**#@+ * Constants for keys of data array. Identical to the name of the getter in snake case */ + /* + * Item ID. + */ const ITEM_ID = 'item_id'; + /* + * Order ID. + */ const ORDER_ID = 'order_id'; + /* + * Parent item ID. + */ const PARENT_ITEM_ID = 'parent_item_id'; + /* + * Quote item ID. + */ const QUOTE_ITEM_ID = 'quote_item_id'; + /* + * Store ID. + */ const STORE_ID = 'store_id'; + /* + * Created-at timestamp. + */ const CREATED_AT = 'created_at'; + /* + * Updated-at timestamp. + */ const UPDATED_AT = 'updated_at'; + /* + * Product ID. + */ const PRODUCT_ID = 'product_id'; + /* + * Product type. + */ const PRODUCT_TYPE = 'product_type'; + /* + * Product options. + */ const PRODUCT_OPTIONS = 'product_options'; + /* + * Weight. + */ const WEIGHT = 'weight'; + /* + * Is-virtual flag. + */ const IS_VIRTUAL = 'is_virtual'; + /* + * SKU. + */ const SKU = 'sku'; + /* + * Name. + */ const NAME = 'name'; + /* + * Description. + */ const DESCRIPTION = 'description'; + /* + * Applied rule IDs. + */ const APPLIED_RULE_IDS = 'applied_rule_ids'; + /* + * Additional data. + */ const ADDITIONAL_DATA = 'additional_data'; + /* + * Is-quantity-decimal flag. + */ const IS_QTY_DECIMAL = 'is_qty_decimal'; + /* + * No-discount flag. + */ const NO_DISCOUNT = 'no_discount'; + /* + * Quantity backordered. + */ const QTY_BACKORDERED = 'qty_backordered'; + /* + * Quantity canceled. + */ const QTY_CANCELED = 'qty_canceled'; + /* + * Quantity invoiced. + */ const QTY_INVOICED = 'qty_invoiced'; + /* + * Quantity ordered. + */ const QTY_ORDERED = 'qty_ordered'; + /* + * Quantity refunded. + */ const QTY_REFUNDED = 'qty_refunded'; + /* + * Quantity shipped. + */ const QTY_SHIPPED = 'qty_shipped'; + /* + * Base cost. + */ const BASE_COST = 'base_cost'; + /* + * Price. + */ const PRICE = 'price'; + /* + * Base price. + */ const BASE_PRICE = 'base_price'; + /* + * Original price. + */ const ORIGINAL_PRICE = 'original_price'; + /* + * Base original price. + */ const BASE_ORIGINAL_PRICE = 'base_original_price'; + /* + * Tax percent. + */ const TAX_PERCENT = 'tax_percent'; + /* + * Tax amount. + */ const TAX_AMOUNT = 'tax_amount'; + /* + * Base tax amount. + */ const BASE_TAX_AMOUNT = 'base_tax_amount'; + /* + * Tax invoiced. + */ const TAX_INVOICED = 'tax_invoiced'; + /* + * Base tax invoiced. + */ const BASE_TAX_INVOICED = 'base_tax_invoiced'; + /* + * Discount percent. + */ const DISCOUNT_PERCENT = 'discount_percent'; + /* + * Discount amount. + */ const DISCOUNT_AMOUNT = 'discount_amount'; + /* + * Base discount amount. + */ const BASE_DISCOUNT_AMOUNT = 'base_discount_amount'; + /* + * Discount invoiced. + */ const DISCOUNT_INVOICED = 'discount_invoiced'; + /* + * Base discount invoiced. + */ const BASE_DISCOUNT_INVOICED = 'base_discount_invoiced'; + /* + * Amount refunded. + */ const AMOUNT_REFUNDED = 'amount_refunded'; + /* + * Base amount refunded. + */ const BASE_AMOUNT_REFUNDED = 'base_amount_refunded'; + /* + * Row total. + */ const ROW_TOTAL = 'row_total'; + /* + * Base row total. + */ const BASE_ROW_TOTAL = 'base_row_total'; + /* + * Row invoiced. + */ const ROW_INVOICED = 'row_invoiced'; + /* + * Base row invoiced. + */ const BASE_ROW_INVOICED = 'base_row_invoiced'; + /* + * Row weight. + */ const ROW_WEIGHT = 'row_weight'; + /* + * Base tax before discount. + */ const BASE_TAX_BEFORE_DISCOUNT = 'base_tax_before_discount'; + /* + * Tax before discount. + */ const TAX_BEFORE_DISCOUNT = 'tax_before_discount'; + /* + * External order item ID. + */ const EXT_ORDER_ITEM_ID = 'ext_order_item_id'; + /* + * Locked DO invoice. + */ const LOCKED_DO_INVOICE = 'locked_do_invoice'; + /* + * Locked DO ship. + */ const LOCKED_DO_SHIP = 'locked_do_ship'; + /* + * Price including tax. + */ const PRICE_INCL_TAX = 'price_incl_tax'; + /* + * Base price including tax. + */ const BASE_PRICE_INCL_TAX = 'base_price_incl_tax'; + /* + * Row total including tax. + */ const ROW_TOTAL_INCL_TAX = 'row_total_incl_tax'; + /* + * Base row total including tax. + */ const BASE_ROW_TOTAL_INCL_TAX = 'base_row_total_incl_tax'; + /* + * Hidden tax amount. + */ const HIDDEN_TAX_AMOUNT = 'hidden_tax_amount'; + /* + * Base hidden tax amount. + */ const BASE_HIDDEN_TAX_AMOUNT = 'base_hidden_tax_amount'; + /* + * Hidden tax invoiced. + */ const HIDDEN_TAX_INVOICED = 'hidden_tax_invoiced'; + /* + * Base hidden tax invoiced. + */ const BASE_HIDDEN_TAX_INVOICED = 'base_hidden_tax_invoiced'; + /* + * Hidden tax refunded. + */ const HIDDEN_TAX_REFUNDED = 'hidden_tax_refunded'; + /* + * Base hidden tax refunded. + */ const BASE_HIDDEN_TAX_REFUNDED = 'base_hidden_tax_refunded'; + /* + * Is-nominal flag. + */ const IS_NOMINAL = 'is_nominal'; + /* + * Tax-canceled flag. + */ const TAX_CANCELED = 'tax_canceled'; + /* + * Hidden-tax-canceled flag. + */ const HIDDEN_TAX_CANCELED = 'hidden_tax_canceled'; + /* + * Tax refunded. + */ const TAX_REFUNDED = 'tax_refunded'; + /* + * Base tax refunded. + */ const BASE_TAX_REFUNDED = 'base_tax_refunded'; + /* + * Discount refunded. + */ const DISCOUNT_REFUNDED = 'discount_refunded'; + /* + * Base discount refunded. + */ const BASE_DISCOUNT_REFUNDED = 'base_discount_refunded'; + /* + * GW ID. + */ const GW_ID = 'gw_id'; + /* + * GW base price. + */ const GW_BASE_PRICE = 'gw_base_price'; + /* + * GW price. + */ const GW_PRICE = 'gw_price'; + /* + * GW base tax amount. + */ const GW_BASE_TAX_AMOUNT = 'gw_base_tax_amount'; + /* + * GW tax amount. + */ const GW_TAX_AMOUNT = 'gw_tax_amount'; + /* + * GW base price invoiced. + */ const GW_BASE_PRICE_INVOICED = 'gw_base_price_invoiced'; + /* + * GW price invoiced. + */ const GW_PRICE_INVOICED = 'gw_price_invoiced'; + /* + * GW base tax amount invoiced. + */ const GW_BASE_TAX_AMOUNT_INVOICED = 'gw_base_tax_amount_invoiced'; + /* + * GW tax amount invoiced. + */ const GW_TAX_AMOUNT_INVOICED = 'gw_tax_amount_invoiced'; + /* + * GW base price refunded. + */ const GW_BASE_PRICE_REFUNDED = 'gw_base_price_refunded'; + /* + * GW price refunded. + */ const GW_PRICE_REFUNDED = 'gw_price_refunded'; + /* + * GW base tax amount refunded. + */ const GW_BASE_TAX_AMOUNT_REFUNDED = 'gw_base_tax_amount_refunded'; + /* + * GW tax amount refunded. + */ const GW_TAX_AMOUNT_REFUNDED = 'gw_tax_amount_refunded'; + /* + * Free shipping. + */ const FREE_SHIPPING = 'free_shipping'; + /* + * Quantity returned. + */ const QTY_RETURNED = 'qty_returned'; + /* + * Event ID. + */ const EVENT_ID = 'event_id'; + /* + * Base WEEE tax applied amount. + */ const BASE_WEEE_TAX_APPLIED_AMOUNT = 'base_weee_tax_applied_amount'; + /* + * Base WEEE tax applied row amount. + */ const BASE_WEEE_TAX_APPLIED_ROW_AMNT = 'base_weee_tax_applied_row_amnt'; + /* + * WEEE tax applied amount. + */ const WEEE_TAX_APPLIED_AMOUNT = 'weee_tax_applied_amount'; + /* + * WEEE tax applied row amount. + */ const WEEE_TAX_APPLIED_ROW_AMOUNT = 'weee_tax_applied_row_amount'; + /* + * WEEE tax applied. + */ const WEEE_TAX_APPLIED = 'weee_tax_applied'; + /* + * WEEE tax disposition. + */ const WEEE_TAX_DISPOSITION = 'weee_tax_disposition'; + /* + * WEEE tax row disposition. + */ const WEEE_TAX_ROW_DISPOSITION = 'weee_tax_row_disposition'; + /* + * Base WEEE tax disposition. + */ const BASE_WEEE_TAX_DISPOSITION = 'base_weee_tax_disposition'; + /* + * Base WEEE tax row disposition. + */ const BASE_WEEE_TAX_ROW_DISPOSITION = 'base_weee_tax_row_disposition'; /** - * Returns additional_data + * Gets the additional data for the order item. * - * @return string + * @return string Additional data. */ public function getAdditionalData(); /** - * Returns amount_refunded + * Gets the amount refunded for the order item. * - * @return float + * @return float Amount refunded. */ public function getAmountRefunded(); /** - * Returns applied_rule_ids + * Gets the applied rule IDs for the order item. * - * @return string + * @return string Applied rule IDs. */ public function getAppliedRuleIds(); /** - * Returns base_amount_refunded + * Gets the base amount refunded for the order item. * - * @return float + * @return float Base amount refunded. */ public function getBaseAmountRefunded(); /** - * Returns base_cost + * Gets the base cost for the order item. * - * @return float + * @return float Base cost. */ public function getBaseCost(); /** - * Returns base_discount_amount + * Gets the base discount amount for the order item. * - * @return float + * @return float Base discount amount. */ public function getBaseDiscountAmount(); /** - * Returns base_discount_invoiced + * Gets the base discount invoiced for the order item. * - * @return float + * @return float Base discount invoiced. */ public function getBaseDiscountInvoiced(); /** - * Returns base_discount_refunded + * Gets the base discount refunded for the order item. * - * @return float + * @return float Base discount refunded. */ public function getBaseDiscountRefunded(); /** - * Returns base_hidden_tax_amount + * Gets the base hidden tax amount for the order item. * - * @return float + * @return float Base hidden tax amount. */ public function getBaseHiddenTaxAmount(); /** - * Returns base_hidden_tax_invoiced + * Gets the base hidden tax invoiced for the order item. * - * @return float + * @return float Base hidden tax invoiced. */ public function getBaseHiddenTaxInvoiced(); /** - * Returns base_hidden_tax_refunded + * Gets the base hidden tax refunded for the order item. * - * @return float + * @return float Base hidden tax refunded. */ public function getBaseHiddenTaxRefunded(); /** - * Returns base_original_price + * Gets the base original price for the order item. * - * @return float + * @return float Base original price. */ public function getBaseOriginalPrice(); /** - * Returns base_price + * Gets the base price for the order item. * - * @return float + * @return float Base price. */ public function getBasePrice(); /** - * Returns base_price_incl_tax + * Gets the base price including tax for the order item. * - * @return float + * @return float Base price including tax. */ public function getBasePriceInclTax(); /** - * Returns base_row_invoiced + * Gets the base row invoiced for the order item. * - * @return float + * @return float Base row invoiced. */ public function getBaseRowInvoiced(); /** - * Returns base_row_total + * Gets the base row total for the order item. * - * @return float + * @return float Base row total. */ public function getBaseRowTotal(); /** - * Returns base_row_total_incl_tax + * Gets the base row total including tax for the order item. * - * @return float + * @return float Base row total including tax. */ public function getBaseRowTotalInclTax(); /** - * Returns base_tax_amount + * Gets the base tax amount for the order item. * - * @return float + * @return float Base tax amount. */ public function getBaseTaxAmount(); /** - * Returns base_tax_before_discount + * Gets the base tax before discount for the order item. * - * @return float + * @return float Base tax before discount. */ public function getBaseTaxBeforeDiscount(); /** - * Returns base_tax_invoiced + * Gets the base tax invoiced for the order item. * - * @return float + * @return float Base tax invoiced. */ public function getBaseTaxInvoiced(); /** - * Returns base_tax_refunded + * Gets the base tax refunded for the order item. * - * @return float + * @return float Base tax refunded. */ public function getBaseTaxRefunded(); /** - * Returns base_weee_tax_applied_amount + * Gets the base WEEE tax applied amount for the order item. * - * @return float + * @return float Base WEEE tax applied amount. */ public function getBaseWeeeTaxAppliedAmount(); /** - * Returns base_weee_tax_applied_row_amnt + * Gets the base WEEE tax applied row amount for the order item. * - * @return float + * @return float Base WEEE tax applied row amount. */ public function getBaseWeeeTaxAppliedRowAmnt(); /** - * Returns base_weee_tax_disposition + * Gets the base WEEE tax disposition for the order item. * - * @return float + * @return float Base WEEE tax disposition. */ public function getBaseWeeeTaxDisposition(); /** - * Returns base_weee_tax_row_disposition + * Gets the base WEEE tax row disposition for the order item. * - * @return float + * @return float Base WEEE tax row disposition. */ public function getBaseWeeeTaxRowDisposition(); /** - * Returns created_at + * Gets the created-at timestamp for the order item. * - * @return string + * @return string Created-at timestamp. */ public function getCreatedAt(); /** - * Returns description + * Gets the description for the order item. * - * @return string + * @return string Description. */ public function getDescription(); /** - * Returns discount_amount + * Gets the discount amount for the order item. * - * @return float + * @return float Discount amount. */ public function getDiscountAmount(); /** - * Returns discount_invoiced + * Gets the discount invoiced for the order item. * - * @return float + * @return float Discount invoiced. */ public function getDiscountInvoiced(); /** - * Returns discount_percent + * Gets the discount percent for the order item. * - * @return float + * @return float Discount percent. */ public function getDiscountPercent(); /** - * Returns discount_refunded + * Gets the discount refunded for the order item. * - * @return float + * @return float Discount refunded. */ public function getDiscountRefunded(); /** - * Returns event_id + * Gets the event ID for the order item. * - * @return int + * @return int Event ID. */ public function getEventId(); /** - * Returns ext_order_item_id + * Gets the external order item ID for the order item. * - * @return string + * @return string External order item ID. */ public function getExtOrderItemId(); /** - * Returns free_shipping + * Gets the free-shipping flag value for the order item. * - * @return int + * @return int Free-shipping flag value. */ public function getFreeShipping(); /** - * Returns gw_base_price + * Gets the GW base price for the order item. * - * @return float + * @return float GW base price. */ public function getGwBasePrice(); /** - * Returns gw_base_price_invoiced + * Gets the GW base price invoiced for the order item. * - * @return float + * @return float GW base price invoiced. */ public function getGwBasePriceInvoiced(); /** - * Returns gw_base_price_refunded + * Gets the GW base price refunded for the order item. * - * @return float + * @return float GW base price refunded. */ public function getGwBasePriceRefunded(); /** - * Returns gw_base_tax_amount + * Gets the GW base tax amount for the order item. * - * @return float + * @return float GW base tax amount. */ public function getGwBaseTaxAmount(); /** - * Returns gw_base_tax_amount_invoiced + * Gets the GW base tax amount invoiced for the order item. * - * @return float + * @return float GW base tax amount invoiced. */ public function getGwBaseTaxAmountInvoiced(); /** - * Returns gw_base_tax_amount_refunded + * Gets the GW base tax amount refunded for the order item. * - * @return float + * @return float GW base tax amount refunded. */ public function getGwBaseTaxAmountRefunded(); /** - * Returns gw_id + * Gets the GW ID for the order item. * - * @return int + * @return int GW ID. */ public function getGwId(); /** - * Returns gw_price + * Gets the GW price for the order item. * - * @return float + * @return float GW price. */ public function getGwPrice(); /** - * Returns gw_price_invoiced + * Gets the GW price invoiced for the order item. * - * @return float + * @return float GW price invoiced. */ public function getGwPriceInvoiced(); /** - * Returns gw_price_refunded + * Gets the GW price refunded for the order item. * - * @return float + * @return float GW price refunded. */ public function getGwPriceRefunded(); /** - * Returns gw_tax_amount + * Gets the GW tax amount for the order item. * - * @return float + * @return float GW tax amount. */ public function getGwTaxAmount(); /** - * Returns gw_tax_amount_invoiced + * Gets the GW tax amount invoiced for the order item. * - * @return float + * @return float GW tax amount invoiced. */ public function getGwTaxAmountInvoiced(); /** - * Returns gw_tax_amount_refunded + * Gets the GW tax amount refunded for the order item. * - * @return float + * @return float GW tax amount refunded. */ public function getGwTaxAmountRefunded(); /** - * Returns hidden_tax_amount + * Gets the hidden tax amount for the order item. * - * @return float + * @return float Hidden tax amount. */ public function getHiddenTaxAmount(); /** - * Returns hidden_tax_canceled + * Gets the hidden tax canceled for the order item. * - * @return float + * @return float Hidden tax canceled. */ public function getHiddenTaxCanceled(); /** - * Returns hidden_tax_invoiced + * Gets the hidden tax invoiced for the order item. * - * @return float + * @return float Hidden tax invoiced. */ public function getHiddenTaxInvoiced(); /** - * Returns hidden_tax_refunded + * Gets the hidden tax refunded for the order item. * - * @return float + * @return float Hidden tax refunded. */ public function getHiddenTaxRefunded(); /** - * Returns is_nominal + * Gets the is-nominal flag value for the order item. * - * @return int + * @return int Is-nominal flag value. */ public function getIsNominal(); /** - * Returns is_qty_decimal + * Gets the is-quantity-decimal flag value for the order item. * - * @return int + * @return int Is-quantity-decimal flag value. */ public function getIsQtyDecimal(); /** - * Returns is_virtual + * Gets the is-virtual flag value for the order item. * - * @return int + * @return int Is-virtual flag value. */ public function getIsVirtual(); /** - * Returns item_id + * Gets the item ID for the order item. * - * @return int + * @return int Item ID. */ public function getItemId(); /** - * Returns locked_do_invoice + * Gets the locked DO invoice flag value for the order item. * - * @return int + * @return int Locked DO invoice flag value. */ public function getLockedDoInvoice(); /** - * Returns locked_do_ship + * Gets the locked DO ship flag value for the order item. * - * @return int + * @return int Locked DO ship flag value. */ public function getLockedDoShip(); /** - * Returns name + * Gets the name for the order item. * - * @return string + * @return string Name. */ public function getName(); /** - * Returns no_discount + * Gets the no discount flag value for the order item. * - * @return int + * @return int No-discount flag value. */ public function getNoDiscount(); /** - * Returns order_id + * Gets the order ID for the order item. * - * @return int + * @return int Order ID. */ public function getOrderId(); /** - * Returns original_price + * Gets the original price for the order item. * - * @return float + * @return float Original price. */ public function getOriginalPrice(); /** - * Returns parent_item_id + * Gets the parent item ID for the order item. * - * @return int + * @return int Parent item ID. */ public function getParentItemId(); /** - * Returns price + * Gets the price for the order item. * - * @return float + * @return float Price. */ public function getPrice(); /** - * Returns price_incl_tax + * Gets the price including tax for the order item. * - * @return float + * @return float Price including tax. */ public function getPriceInclTax(); /** - * Returns product_id + * Gets the product ID for the order item. * - * @return int + * @return int Product ID. */ public function getProductId(); /** - * Returns product_options + * Gets the product options for the order item. * - * @return string[] + * @return string[] Array of product options. */ public function getProductOptions(); /** - * Returns product_type + * Gets the product type for the order item. * - * @return string + * @return string Product type. */ public function getProductType(); /** - * Returns qty_backordered + * Gets the quantity backordered for the order item. * - * @return float + * @return float Quantity backordered. */ public function getQtyBackordered(); /** - * Returns qty_canceled + * Gets the quantity canceled for the order item. * - * @return float + * @return float Quantity canceled. */ public function getQtyCanceled(); /** - * Returns qty_invoiced + * Gets the quantity invoiced for the order item. * - * @return float + * @return float Quantity invoiced. */ public function getQtyInvoiced(); /** - * Returns qty_ordered + * Gets the quantity ordered for the order item. * - * @return float + * @return float Quantity ordered. */ public function getQtyOrdered(); /** - * Returns qty_refunded + * Gets the quantity refunded for the order item. * - * @return float + * @return float Quantity refunded. */ public function getQtyRefunded(); /** - * Returns qty_returned + * Gets the quantity returned for the order item. * - * @return float + * @return float Quantity returned. */ public function getQtyReturned(); /** - * Returns qty_shipped + * Gets the quantity shipped for the order item. * - * @return float + * @return float Quantity shipped. */ public function getQtyShipped(); /** - * Returns quote_item_id + * Gets the quote item ID for the order item. * - * @return int + * @return int Quote item ID. */ public function getQuoteItemId(); /** - * Returns row_invoiced + * Gets the row invoiced for the order item. * - * @return float + * @return float Row invoiced. */ public function getRowInvoiced(); /** - * Returns row_total + * Gets the row total for the order item. * - * @return float + * @return float Row total. */ public function getRowTotal(); /** - * Returns row_total_incl_tax + * Gets the row total including tax for the order item. * - * @return float + * @return float Row total including tax. */ public function getRowTotalInclTax(); /** - * Returns row_weight + * Gets the row weight for the order item. * - * @return float + * @return float Row weight. */ public function getRowWeight(); /** - * Returns sku + * Gets the SKU for the order item. * - * @return string + * @return string SKU. */ public function getSku(); /** - * Returns store_id + * Gets the store ID for the order item. * - * @return int + * @return int Store ID. */ public function getStoreId(); /** - * Returns tax_amount + * Gets the tax amount for the order item. * - * @return float + * @return float Tax amount. */ public function getTaxAmount(); /** - * Returns tax_before_discount + * Gets the tax before discount for the order item. * - * @return float + * @return float Tax before discount. */ public function getTaxBeforeDiscount(); /** - * Returns tax_canceled + * Gets the tax canceled for the order item. * - * @return float + * @return float Tax canceled. */ public function getTaxCanceled(); /** - * Returns tax_invoiced + * Gets the tax invoiced for the order item. * - * @return float + * @return float Tax invoiced. */ public function getTaxInvoiced(); /** - * Returns tax_percent + * Gets the tax percent for the order item. * - * @return float + * @return float Tax percent. */ public function getTaxPercent(); /** - * Returns tax_refunded + * Gets the tax refunded for the order item. * - * @return float + * @return float Tax refunded. */ public function getTaxRefunded(); /** - * Returns updated_at + * Gets the updated-at timestamp for the order item. * - * @return string + * @return string Updated-at timestamp. */ public function getUpdatedAt(); /** - * Returns weee_tax_applied + * Gets the WEEE tax applied for the order item. * - * @return string + * @return string WEEE tax applied. */ public function getWeeeTaxApplied(); /** - * Returns weee_tax_applied_amount + * Gets the WEEE tax applied amount for the order item. * - * @return float + * @return float WEEE tax applied amount. */ public function getWeeeTaxAppliedAmount(); /** - * Returns weee_tax_applied_row_amount + * Gets the WEEE tax applied row amount for the order item. * - * @return float + * @return float WEEE tax applied row amount. */ public function getWeeeTaxAppliedRowAmount(); /** - * Returns weee_tax_disposition + * Gets the WEEE tax disposition for the order item. * - * @return float + * @return float WEEE tax disposition. */ public function getWeeeTaxDisposition(); /** - * Returns weee_tax_row_disposition + * Gets the WEEE tax row disposition for the order item. * - * @return float + * @return float WEEE tax row disposition. */ public function getWeeeTaxRowDisposition(); /** - * Returns weight + * Gets the weight for the order item. * - * @return float + * @return float Weight. */ public function getWeight(); } diff --git a/app/code/Magento/Sales/Api/Data/OrderItemSearchResultInterface.php b/app/code/Magento/Sales/Api/Data/OrderItemSearchResultInterface.php index a99706259190b..68cbb41c407b0 100644 --- a/app/code/Magento/Sales/Api/Data/OrderItemSearchResultInterface.php +++ b/app/code/Magento/Sales/Api/Data/OrderItemSearchResultInterface.php @@ -2,18 +2,21 @@ /** * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) */ - namespace Magento\Sales\Api\Data; /** - * Interface OrderItemSearchResultInterface + * Order item search result interface. + * + * An order is a document that a web store issues to a customer. Magento generates a sales order that lists the product + * items, billing and shipping addresses, and shipping and payment methods. A corresponding external document, known as + * a purchase order, is emailed to the customer. */ interface OrderItemSearchResultInterface extends \Magento\Framework\Api\SearchResultsInterface { /** - * Get collection items + * Gets collection items. * - * @return \Magento\Sales\Api\Data\OrderItemInterface[] + * @return \Magento\Sales\Api\Data\OrderItemInterface[] Array of collection items. */ public function getItems(); } diff --git a/app/code/Magento/Sales/Api/Data/OrderPaymentInterface.php b/app/code/Magento/Sales/Api/Data/OrderPaymentInterface.php index a06e1c200f1e2..0accbd40ff397 100644 --- a/app/code/Magento/Sales/Api/Data/OrderPaymentInterface.php +++ b/app/code/Magento/Sales/Api/Data/OrderPaymentInterface.php @@ -5,443 +5,609 @@ namespace Magento\Sales\Api\Data; /** - * Interface OrderPaymentInterface + * Order payment interface. + * + * An order is a document that a web store issues to a customer. Magento generates a sales order that lists the product + * items, billing and shipping addresses, and shipping and payment methods. A corresponding external document, known as + * a purchase order, is emailed to the customer. */ interface OrderPaymentInterface extends \Magento\Framework\Api\ExtensibleDataInterface { /**#@+ - * Constants for keys of data array. Identical to the name of the getter in snake case + * Constants for keys of data array. Identical to the name of the getter in snake case. + */ + /* + * Entity ID. */ const ENTITY_ID = 'entity_id'; + /* + * Parent ID. + */ const PARENT_ID = 'parent_id'; + /* + * Base shipping captured. + */ const BASE_SHIPPING_CAPTURED = 'base_shipping_captured'; + /* + * Shipping captured. + */ const SHIPPING_CAPTURED = 'shipping_captured'; + /* + * Amount refunded. + */ const AMOUNT_REFUNDED = 'amount_refunded'; + /* + * Base amount paid. + */ const BASE_AMOUNT_PAID = 'base_amount_paid'; + /* + * Amount canceled. + */ const AMOUNT_CANCELED = 'amount_canceled'; + /* + * Base amount authorized. + */ const BASE_AMOUNT_AUTHORIZED = 'base_amount_authorized'; + /* + * Base amount paid online. + */ const BASE_AMOUNT_PAID_ONLINE = 'base_amount_paid_online'; + /* + * Base amount refunded online. + */ const BASE_AMOUNT_REFUNDED_ONLINE = 'base_amount_refunded_online'; + /* + * Base shipping amount. + */ const BASE_SHIPPING_AMOUNT = 'base_shipping_amount'; + /* + * Shipping amount. + */ const SHIPPING_AMOUNT = 'shipping_amount'; + /* + * Amount paid. + */ const AMOUNT_PAID = 'amount_paid'; + /* + * Amount authorized. + */ const AMOUNT_AUTHORIZED = 'amount_authorized'; + /* + * Base amount ordered. + */ const BASE_AMOUNT_ORDERED = 'base_amount_ordered'; + /* + * Base shipping refunded. + */ const BASE_SHIPPING_REFUNDED = 'base_shipping_refunded'; + /* + * Shipping refunded. + */ const SHIPPING_REFUNDED = 'shipping_refunded'; + /* + * Base amount refunded. + */ const BASE_AMOUNT_REFUNDED = 'base_amount_refunded'; + /* + * Amount ordered. + */ const AMOUNT_ORDERED = 'amount_ordered'; + /* + * Base amount canceled. + */ const BASE_AMOUNT_CANCELED = 'base_amount_canceled'; + /* + * Quote payment ID. + */ const QUOTE_PAYMENT_ID = 'quote_payment_id'; + /* + * Additional data. + */ const ADDITIONAL_DATA = 'additional_data'; + /* + * Credit card expiration month. + */ const CC_EXP_MONTH = 'cc_exp_month'; + /* + * Credit card SS start year. + */ const CC_SS_START_YEAR = 'cc_ss_start_year'; + /* + * eCheck bank name. + */ const ECHECK_BANK_NAME = 'echeck_bank_name'; + /* + * Payment method. + */ const METHOD = 'method'; + /* + * Credit card debug request body. + */ const CC_DEBUG_REQUEST_BODY = 'cc_debug_request_body'; + /* + * Credit card secure verify. + */ const CC_SECURE_VERIFY = 'cc_secure_verify'; + /* + * Protection eligibility. + */ const PROTECTION_ELIGIBILITY = 'protection_eligibility'; + /* + * Credit card approval. + */ const CC_APPROVAL = 'cc_approval'; + /* + * Last four digits of credit card number. + */ const CC_LAST_4 = 'cc_last_4'; + /* + * Credit card status description. + */ const CC_STATUS_DESCRIPTION = 'cc_status_description'; + /* + * eCheck type. + */ const ECHECK_TYPE = 'echeck_type'; + /* + * Credit card debug response serialized. + */ const CC_DEBUG_RESPONSE_SERIALIZED = 'cc_debug_response_serialized'; + /* + * Credit card SS start month. + */ const CC_SS_START_MONTH = 'cc_ss_start_month'; + /* + * eCheck account type. + */ const ECHECK_ACCOUNT_TYPE = 'echeck_account_type'; + /* + * Last transaction ID. + */ const LAST_TRANS_ID = 'last_trans_id'; + /* + * Credit card CID status. + */ const CC_CID_STATUS = 'cc_cid_status'; + /* + * Credit card owner. + */ const CC_OWNER = 'cc_owner'; + /* + * Credit card type. + */ const CC_TYPE = 'cc_type'; + /* + * PO number. + */ const PO_NUMBER = 'po_number'; + /* + * Credit card expiration year. + */ const CC_EXP_YEAR = 'cc_exp_year'; + /* + * Credit card status. + */ const CC_STATUS = 'cc_status'; + /* + * eCheck routing number. + */ const ECHECK_ROUTING_NUMBER = 'echeck_routing_number'; + /* + * Account status. + */ const ACCOUNT_STATUS = 'account_status'; + /* + * ANET transaction method. + */ const ANET_TRANS_METHOD = 'anet_trans_method'; + /* + * Credit card debug response body. + */ const CC_DEBUG_RESPONSE_BODY = 'cc_debug_response_body'; + /* + * Credit card SS issue. + */ const CC_SS_ISSUE = 'cc_ss_issue'; + /* + * eCheck account name. + */ const ECHECK_ACCOUNT_NAME = 'echeck_account_name'; + /* + * Credit card AVS status. + */ const CC_AVS_STATUS = 'cc_avs_status'; + /* + * Encrypted credit card number. + */ const CC_NUMBER_ENC = 'cc_number_enc'; + /* + * Credit card transaction ID. + */ const CC_TRANS_ID = 'cc_trans_id'; + /* + * Address status. + */ const ADDRESS_STATUS = 'address_status'; + /* + * Additional information. + */ const ADDITIONAL_INFORMATION = 'additional_information'; /** - * Returns account_status + * Gets the account status for the order payment. * - * @return string + * @return string Account status. */ public function getAccountStatus(); /** - * Returns additional_data + * Gets the additional data for the order payment. * - * @return string + * @return string Additional data. */ public function getAdditionalData(); /** - * Returns additional_information + * Gets the additional information for the order payment. * - * @return string[] + * @return string[] Array of additional information. */ public function getAdditionalInformation(); /** - * Returns address_status + * Gets the address status for the order payment. * - * @return string + * @return string Address status. */ public function getAddressStatus(); /** - * Returns amount_authorized + * Gets the amount authorized for the order payment. * - * @return float + * @return float Amount authorized. */ public function getAmountAuthorized(); /** - * Returns amount_canceled + * Gets the amount canceled for the order payment. * - * @return float + * @return float Amount canceled. */ public function getAmountCanceled(); /** - * Returns amount_ordered + * Gets the amount ordered for the order payment. * - * @return float + * @return float Amount ordered. */ public function getAmountOrdered(); /** - * Returns amount_paid + * Gets the amount paid for the order payment. * - * @return float + * @return float Amount paid. */ public function getAmountPaid(); /** - * Returns amount_refunded + * Gets the amount refunded for the order payment. * - * @return float + * @return float Amount refunded. */ public function getAmountRefunded(); /** - * Returns anet_trans_method + * Gets the anet transaction method for the order payment. * - * @return string + * @return string Anet transaction method. */ public function getAnetTransMethod(); /** - * Returns base_amount_authorized + * Gets the base amount authorized for the order payment. * - * @return float + * @return float Base amount authorized. */ public function getBaseAmountAuthorized(); /** - * Returns base_amount_canceled + * Gets the base amount canceled for the order payment. * - * @return float + * @return float Base amount canceled. */ public function getBaseAmountCanceled(); /** - * Returns base_amount_ordered + * Gets the base amount ordered for the order payment. * - * @return float + * @return float Base amount ordered. */ public function getBaseAmountOrdered(); /** - * Returns base_amount_paid + * Gets the base amount paid for the order payment. * - * @return float + * @return float Base amount paid. */ public function getBaseAmountPaid(); /** - * Returns base_amount_paid_online + * Gets the base amount paid online for the order payment. * - * @return float + * @return float Base amount paid online. */ public function getBaseAmountPaidOnline(); /** - * Returns base_amount_refunded + * Gets the base amount refunded for the order payment. * - * @return float + * @return float Base amount refunded. */ public function getBaseAmountRefunded(); /** - * Returns base_amount_refunded_online + * Gets the base amount refunded online for the order payment. * - * @return float + * @return float Base amount refunded online. */ public function getBaseAmountRefundedOnline(); /** - * Returns base_shipping_amount + * Gets the base shipping amount for the order payment. * - * @return float + * @return float Base shipping amount. */ public function getBaseShippingAmount(); /** - * Returns base_shipping_captured + * Gets the base shipping captured for the order payment. * - * @return float + * @return float Base shipping captured amount. */ public function getBaseShippingCaptured(); /** - * Returns base_shipping_refunded + * Gets the base shipping refunded amount for the order payment. * - * @return float + * @return float Base shipping refunded amount. */ public function getBaseShippingRefunded(); /** - * Returns cc_approval + * Gets the credit card approval for the order payment. * - * @return string + * @return string Credit card approval. */ public function getCcApproval(); /** - * Returns cc_avs_status + * Gets the credit card avs status for the order payment. * - * @return string + * @return string Credit card avs status. */ public function getCcAvsStatus(); /** - * Returns cc_cid_status + * Gets the credit card cid status for the order payment. * - * @return string + * @return string Credit card CID status. */ public function getCcCidStatus(); /** - * Returns cc_debug_request_body + * Gets the credit card debug request body for the order payment. * - * @return string + * @return string Credit card debug request body. */ public function getCcDebugRequestBody(); /** - * Returns cc_debug_response_body + * Gets the credit card debug response body for the order payment. * - * @return string + * @return string Credit card debug response body. */ public function getCcDebugResponseBody(); /** - * Returns cc_debug_response_serialized + * Gets the credit card debug response serialized for the order payment. * - * @return string + * @return string Credit card debug response serialized. */ public function getCcDebugResponseSerialized(); /** - * Returns cc_exp_month + * Gets the credit card expiration month for the order payment. * - * @return string + * @return string Credit card expiration month. */ public function getCcExpMonth(); /** - * Returns cc_exp_year + * Gets the credit card expiration year for the order payment. * - * @return string + * @return string Credit card expiration year. */ public function getCcExpYear(); /** - * Returns cc_last_4 + * Gets the last four digits of the credit card for the order payment. * - * @return string + * @return string Last four digits of the credit card. */ public function getCcLast4(); /** - * Returns cc_number_enc + * Gets the encrypted credit card number for the order payment. * - * @return string + * @return string Encrypted credit card number. */ public function getCcNumberEnc(); /** - * Returns cc_owner + * Gets the credit card owner for the order payment. * - * @return string + * @return string Credit card number. */ public function getCcOwner(); /** - * Returns cc_secure_verify + * Gets the credit card secure verify for the order payment. * - * @return string + * @return string Credit card secure verify. */ public function getCcSecureVerify(); /** - * Returns cc_ss_issue + * Gets the credit card SS issue for the order payment. * - * @return string + * @return string Credit card SS issue. */ public function getCcSsIssue(); /** - * Returns cc_ss_start_month + * Gets the credit card SS start month for the order payment. * - * @return string + * @return string Credit card SS start month. */ public function getCcSsStartMonth(); /** - * Returns cc_ss_start_year + * Gets the credit card SS start year for the order payment. * - * @return string + * @return string Credit card SS start year. */ public function getCcSsStartYear(); /** - * Returns cc_status + * Gets the credit card status for the order payment. * - * @return string + * @return string Credit card status. */ public function getCcStatus(); /** - * Returns cc_status_description + * Gets the credit card status description for the order payment. * - * @return string + * @return string Credit card status description. */ public function getCcStatusDescription(); /** - * Returns cc_trans_id + * Gets the credit card transaction id for the order payment. * - * @return string + * @return string Credit card transaction ID. */ public function getCcTransId(); /** - * Returns cc_type + * Gets the credit card type for the order payment. * - * @return string + * @return string Credit card type. */ public function getCcType(); /** - * Returns echeck_account_name + * Gets the eCheck account name for the order payment. * - * @return string + * @return string eCheck account name. */ public function getEcheckAccountName(); /** - * Returns echeck_account_type + * Gets the eCheck account type for the order payment. * - * @return string + * @return string eCheck account type. */ public function getEcheckAccountType(); /** - * Returns echeck_bank_name + * Gets the eCheck bank name for the order payment. * - * @return string + * @return string eCheck bank name. */ public function getEcheckBankName(); /** - * Returns echeck_routing_number + * Gets the eCheck routing number for the order payment. * - * @return string + * @return string eCheck routing number. */ public function getEcheckRoutingNumber(); /** - * Returns echeck_type + * Gets the eCheck type for the order payment. * - * @return string + * @return string eCheck type. */ public function getEcheckType(); /** - * Returns entity_id + * Gets the entity ID for the order payment. * - * @return int + * @return int Entity ID. */ public function getEntityId(); /** - * Returns last_trans_id + * Gets the last transaction ID for the order payment. * - * @return string + * @return string Last transaction ID. */ public function getLastTransId(); /** - * Returns method + * Gets the method for the order payment. * - * @return string + * @return string Method. */ public function getMethod(); /** - * Returns parent_id + * Gets the parent ID for the order payment. * - * @return int + * @return int Parent ID. */ public function getParentId(); /** - * Returns po_number + * Gets the PO number for the order payment. * - * @return string + * @return string PO number. */ public function getPoNumber(); /** - * Returns protection_eligibility + * Gets the protection eligibility for the order payment. * - * @return string + * @return string Protection eligibility. */ public function getProtectionEligibility(); /** - * Returns quote_payment_id + * Gets the quote payment ID for the order payment. * - * @return int + * @return int Quote payment ID. */ public function getQuotePaymentId(); /** - * Returns shipping_amount + * Gets the shipping amount for the order payment. * - * @return float + * @return float Shipping amount. */ public function getShippingAmount(); /** - * Returns shipping_captured + * Gets the shipping captured for the order payment. * - * @return float + * @return float Shipping captured. */ public function getShippingCaptured(); /** - * Returns shipping_refunded + * Gets the shipping refunded for the order payment. * - * @return float + * @return float Shipping refunded. */ public function getShippingRefunded(); } diff --git a/app/code/Magento/Sales/Api/Data/OrderPaymentSearchResultInterface.php b/app/code/Magento/Sales/Api/Data/OrderPaymentSearchResultInterface.php index b6a38cfb297be..1e0357cf2b52e 100644 --- a/app/code/Magento/Sales/Api/Data/OrderPaymentSearchResultInterface.php +++ b/app/code/Magento/Sales/Api/Data/OrderPaymentSearchResultInterface.php @@ -2,18 +2,21 @@ /** * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) */ - namespace Magento\Sales\Api\Data; /** - * Interface OrderPaymentSearchResultInterface + * Order payment search result interface. + * + * An order is a document that a web store issues to a customer. Magento generates a sales order that lists the product + * items, billing and shipping addresses, and shipping and payment methods. A corresponding external document, known as + * a purchase order, is emailed to the customer. */ interface OrderPaymentSearchResultInterface extends \Magento\Framework\Api\SearchResultsInterface { /** - * Get collection items + * Gets collection items. * - * @return \Magento\Sales\Api\Data\OrderPaymentInterface[] + * @return \Magento\Sales\Api\Data\OrderPaymentInterface[] Array of collection items. */ public function getItems(); } diff --git a/app/code/Magento/Sales/Api/Data/OrderSearchResultInterface.php b/app/code/Magento/Sales/Api/Data/OrderSearchResultInterface.php index 5391609cbeebb..defaf96e51dd2 100644 --- a/app/code/Magento/Sales/Api/Data/OrderSearchResultInterface.php +++ b/app/code/Magento/Sales/Api/Data/OrderSearchResultInterface.php @@ -2,18 +2,21 @@ /** * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) */ - namespace Magento\Sales\Api\Data; /** - * Interface OrderSearchResultInterface + * Order search result interface. + * + * An order is a document that a web store issues to a customer. Magento generates a sales order that lists the product + * items, billing and shipping addresses, and shipping and payment methods. A corresponding external document, known as + * a purchase order, is emailed to the customer. */ interface OrderSearchResultInterface { /** - * Get collection items + * Gets collection items. * - * @return \Magento\Sales\Api\Data\OrderSearchResultInterface[] + * @return \Magento\Sales\Api\Data\OrderSearchResultInterface[] Array of collection items. */ public function getItems(); } diff --git a/app/code/Magento/Sales/Api/Data/OrderStatusHistoryInterface.php b/app/code/Magento/Sales/Api/Data/OrderStatusHistoryInterface.php index 527be3bf03859..86e0ffc81535a 100644 --- a/app/code/Magento/Sales/Api/Data/OrderStatusHistoryInterface.php +++ b/app/code/Magento/Sales/Api/Data/OrderStatusHistoryInterface.php @@ -5,75 +5,103 @@ namespace Magento\Sales\Api\Data; /** - * Interface OrderStatusHistoryInterface + * Order status history interface. + * + * An order is a document that a web store issues to a customer. Magento generates a sales order that lists the product + * items, billing and shipping addresses, and shipping and payment methods. A corresponding external document, known as + * a purchase order, is emailed to the customer. */ interface OrderStatusHistoryInterface extends \Magento\Framework\Api\ExtensibleDataInterface { /**#@+ - * Constants for keys of data array. Identical to the name of the getter in snake case + * Constants for keys of data array. Identical to the name of the getter in snake case. + */ + /* + * Entity ID. */ const ENTITY_ID = 'entity_id'; + /* + * Parent ID. + */ const PARENT_ID = 'parent_id'; + /* + * Is-customer-notified flag. + */ const IS_CUSTOMER_NOTIFIED = 'is_customer_notified'; + /* + * Is-visible-on-storefront flag. + */ const IS_VISIBLE_ON_FRONT = 'is_visible_on_front'; + /* + * Comment. + */ const COMMENT = 'comment'; + /* + * Status. + */ const STATUS = 'status'; + /* + * Create-at timestamp. + */ const CREATED_AT = 'created_at'; + /* + * Entity name. + */ const ENTITY_NAME = 'entity_name'; /** - * Returns comment + * Gets the comment for the order status history. * - * @return string + * @return string Comment. */ public function getComment(); /** - * Returns created_at + * Gets the created-at timestamp for the order status history. * - * @return string + * @return string Created-at timestamp. */ public function getCreatedAt(); /** - * Returns entity_id + * Gets the ID for the order status history. * - * @return int + * @return int Order status history ID. */ public function getEntityId(); /** - * Returns entity_name + * Gets the entity name for the order status history. * - * @return string + * @return string Entity name. */ public function getEntityName(); /** - * Returns is_customer_notified + * Gets the is-customer-notified flag value for the order status history. * - * @return int + * @return int Is-customer-notified flag value. */ public function getIsCustomerNotified(); /** - * Returns is_visible_on_front + * Gets the is-visible-on-storefront flag value for the order status history. * - * @return int + * @return int Is-visible-on-storefront flag value. */ public function getIsVisibleOnFront(); /** - * Returns parent_id + * Gets the parent ID for the order status history. * - * @return int + * @return int Parent ID. */ public function getParentId(); /** - * Returns status + * Gets the status for the order status history. * - * @return string + * @return string Status. */ public function getStatus(); } diff --git a/app/code/Magento/Sales/Api/Data/OrderStatusHistorySearchResultInterface.php b/app/code/Magento/Sales/Api/Data/OrderStatusHistorySearchResultInterface.php index 2f65c5cf1f1dc..1a66bcced0c48 100644 --- a/app/code/Magento/Sales/Api/Data/OrderStatusHistorySearchResultInterface.php +++ b/app/code/Magento/Sales/Api/Data/OrderStatusHistorySearchResultInterface.php @@ -2,18 +2,21 @@ /** * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) */ - namespace Magento\Sales\Api\Data; /** - * Interface OrderStatusHistorySearchResultInterface + * Order status history search result interface. + * + * An order is a document that a web store issues to a customer. Magento generates a sales order that lists the product + * items, billing and shipping addresses, and shipping and payment methods. A corresponding external document, known as + * a purchase order, is emailed to the customer. */ interface OrderStatusHistorySearchResultInterface extends \Magento\Framework\Api\SearchResultsInterface { /** - * Get collection items + * Gets collection items. * - * @return \Magento\Sales\Api\Data\OrderStatusHistoryInterface[] + * @return \Magento\Sales\Api\Data\OrderStatusHistoryInterface[] Array of collection items. */ public function getItems(); } diff --git a/app/code/Magento/Sales/Api/Data/ShipmentCommentInterface.php b/app/code/Magento/Sales/Api/Data/ShipmentCommentInterface.php index 15abbd8409ff1..8de199df5e5e5 100644 --- a/app/code/Magento/Sales/Api/Data/ShipmentCommentInterface.php +++ b/app/code/Magento/Sales/Api/Data/ShipmentCommentInterface.php @@ -5,59 +5,80 @@ namespace Magento\Sales\Api\Data; /** - * Interface ShipmentCommentInterface + * Shipment comment interface. + * + * A shipment is a delivery package that contains products. A shipment document accompanies the shipment. This + * document lists the products and their quantities in the delivery package. A shipment document can contain comments. */ interface ShipmentCommentInterface extends \Magento\Framework\Api\ExtensibleDataInterface { /**#@+ - * Constants for keys of data array. Identical to the name of the getter in snake case + * Constants for keys of data array. Identical to the name of the getter in snake case. + */ + /* + * Entity ID. */ const ENTITY_ID = 'entity_id'; + /* + * Parent ID. + */ const PARENT_ID = 'parent_id'; + /* + * Is-customer-notified flag. + */ const IS_CUSTOMER_NOTIFIED = 'is_customer_notified'; + /* + * Is-visible-on-storefront flag. + */ const IS_VISIBLE_ON_FRONT = 'is_visible_on_front'; + /* + * Comment. + */ const COMMENT = 'comment'; + /* + * Created-at timestamp. + */ const CREATED_AT = 'created_at'; /** - * Returns comment + * Gets the comment for the shipment. * - * @return string + * @return string Comment. */ public function getComment(); /** - * Returns created_at + * Gets the created-at timestamp for the shipment comment. * - * @return string + * @return string Created-at timestamp. */ public function getCreatedAt(); /** - * Returns entity_id + * Gets the ID for the shipment comment. * - * @return int + * @return int Shipment comment ID. */ public function getEntityId(); /** - * Returns is_customer_notified + * Gets the is-customer-notified flag value for the shipment comment. * - * @return int + * @return int Is-customer-notified flag value. */ public function getIsCustomerNotified(); /** - * Returns is_visible_on_front + * Gets the is-visible-on-storefront flag value for the shipment comment. * - * @return int + * @return int Is-visible-on-storefront flag value. */ public function getIsVisibleOnFront(); /** - * Returns parent_id + * Gets the parent ID for the shipment comment. * - * @return int + * @return int Parent ID. */ public function getParentId(); } diff --git a/app/code/Magento/Sales/Api/Data/ShipmentCommentSearchResultInterface.php b/app/code/Magento/Sales/Api/Data/ShipmentCommentSearchResultInterface.php index 8ed69cd79bd37..c33dcd08535ce 100644 --- a/app/code/Magento/Sales/Api/Data/ShipmentCommentSearchResultInterface.php +++ b/app/code/Magento/Sales/Api/Data/ShipmentCommentSearchResultInterface.php @@ -5,14 +5,17 @@ namespace Magento\Sales\Api\Data; /** - * Interface ShipmentCommentSearchResultInterface + * Shipment comment search result interface. + * + * A shipment is a delivery package that contains products. A shipment document accompanies the shipment. This + * document lists the products and their quantities in the delivery package. A shipment document can contain comments. */ interface ShipmentCommentSearchResultInterface extends \Magento\Framework\Api\SearchResultsInterface { /** - * Get collection items + * Gets collection items. * - * @return \Magento\Sales\Api\Data\ShipmentCommentInterface[] + * @return \Magento\Sales\Api\Data\ShipmentCommentInterface[] Array of collection items. */ public function getItems(); } diff --git a/app/code/Magento/Sales/Api/Data/ShipmentInterface.php b/app/code/Magento/Sales/Api/Data/ShipmentInterface.php index a3faaa9dc120a..e8655ecde2ee3 100644 --- a/app/code/Magento/Sales/Api/Data/ShipmentInterface.php +++ b/app/code/Magento/Sales/Api/Data/ShipmentInterface.php @@ -5,155 +5,212 @@ namespace Magento\Sales\Api\Data; /** - * Interface ShipmentInterface + * Shipment interface. + * + * A shipment is a delivery package that contains products. A shipment document accompanies the shipment. This + * document lists the products and their quantities in the delivery package. */ interface ShipmentInterface extends \Magento\Framework\Api\ExtensibleDataInterface { /**#@+ * Constants for keys of data array. Identical to the name of the getter in snake case */ + /* + * Entity ID. + */ const ENTITY_ID = 'entity_id'; + /* + * Store ID. + */ const STORE_ID = 'store_id'; + /* + * Total weight. + */ const TOTAL_WEIGHT = 'total_weight'; + /* + * Total quantity. + */ const TOTAL_QTY = 'total_qty'; + /* + * Email sent flag. + */ const EMAIL_SENT = 'email_sent'; + /* + * Order ID. + */ const ORDER_ID = 'order_id'; + /* + * Customer ID. + */ const CUSTOMER_ID = 'customer_id'; + /* + * Shipping address ID. + */ const SHIPPING_ADDRESS_ID = 'shipping_address_id'; + /* + * Billing address ID. + */ const BILLING_ADDRESS_ID = 'billing_address_id'; + /* + * Shipment status. + */ const SHIPMENT_STATUS = 'shipment_status'; + /* + * Increment ID. + */ const INCREMENT_ID = 'increment_id'; + /* + * Created-at timestamp. + */ const CREATED_AT = 'created_at'; + /* + * Updated-at timestamp. + */ const UPDATED_AT = 'updated_at'; + /* + * Packages. + */ const PACKAGES = 'packages'; + /* + * Shipping label. + */ const SHIPPING_LABEL = 'shipping_label'; + /* + * Items. + */ const ITEMS = 'items'; + /* + * Tracks. + */ const TRACKS = 'tracks'; + /* + * Comments. + */ const COMMENTS = 'comments'; /** - * Returns billing_address_id + * Gets the billing address ID for the shipment. * - * @return int + * @return int Billing address ID. */ public function getBillingAddressId(); /** - * Returns created_at + * Gets the created-at timestamp for the shipment. * - * @return string + * @return string Created-at timestamp. */ public function getCreatedAt(); /** - * Returns customer_id + * Gets the customer ID for the shipment. * - * @return int + * @return int Customer ID. */ public function getCustomerId(); /** - * Returns email_sent + * Gets the email-sent flag value for the shipment. * - * @return int + * @return int Email-sent flag value. */ public function getEmailSent(); /** - * Returns entity_id + * Gets the ID for the shipment. * - * @return int + * @return int Shipment ID. */ public function getEntityId(); /** - * Returns increment_id + * Gets the increment ID for the shipment. * - * @return string + * @return string Increment ID. */ public function getIncrementId(); /** - * Returns order_id + * Gets the order ID for the shipment. * - * @return int + * @return int Order ID. */ public function getOrderId(); /** - * Returns packages + * Gets any packages for the shipment. * - * @return \Magento\Sales\Api\Data\ShipmentPackageInterface[]|null + * @return \Magento\Sales\Api\Data\ShipmentPackageInterface[]|null Array of packages, if any. Otherwise, null. */ public function getPackages(); /** - * Returns shipment_status + * Gets the shipment status. * - * @return int + * @return int Shipment status. */ public function getShipmentStatus(); /** - * Returns shipping_address_id + * Gets the shipping address ID for the shipment. * - * @return int + * @return int Shipping address ID. */ public function getShippingAddressId(); /** - * Returns shipping_label + * Gets the shipping label for the shipment. * - * @return string + * @return string Shipping label. */ public function getShippingLabel(); /** - * Returns store_id + * Gets the store ID for the shipment. * - * @return int + * @return int Store ID. */ public function getStoreId(); /** - * Returns total_qty + * Gets the total quantity for the shipment. * - * @return float + * @return float Total quantity. */ public function getTotalQty(); /** - * Returns total_weight + * Gets the total weight for the shipment. * - * @return float + * @return float Total weight. */ public function getTotalWeight(); /** - * Returns updated_at + * Gets the updated-at timestamp for the shipment. * - * @return string + * @return string Updated-at timestamp. */ public function getUpdatedAt(); /** - * Returns items + * Gets the items for the shipment. * - * @return \Magento\Sales\Api\Data\ShipmentItemInterface[] + * @return \Magento\Sales\Api\Data\ShipmentItemInterface[] Array of items. */ public function getItems(); /** - * Returns tracks + * Gets the tracks for the shipment. * - * @return \Magento\Sales\Api\Data\ShipmentTrackInterface[] + * @return \Magento\Sales\Api\Data\ShipmentTrackInterface[] Array of tracks. */ public function getTracks(); /** - * Returns comments + * Gets the comments for the shipment. * - * @return \Magento\Sales\Api\Data\ShipmentCommentInterface[] + * @return \Magento\Sales\Api\Data\ShipmentCommentInterface[] Array of comments. */ public function getComments(); } diff --git a/app/code/Magento/Sales/Api/Data/ShipmentItemInterface.php b/app/code/Magento/Sales/Api/Data/ShipmentItemInterface.php index 1702932e7b6fd..7e2f9d0ec0bab 100644 --- a/app/code/Magento/Sales/Api/Data/ShipmentItemInterface.php +++ b/app/code/Magento/Sales/Api/Data/ShipmentItemInterface.php @@ -5,107 +5,146 @@ namespace Magento\Sales\Api\Data; /** - * Interface ShipmentItemInterface + * Shipment item interface. + * + * A shipment is a delivery package that contains products. A shipment document accompanies the shipment. This + * document lists the products and their quantities in the delivery package. A product is an item in a shipment. */ interface ShipmentItemInterface extends \Magento\Framework\Api\ExtensibleDataInterface { /**#@+ * Constants for keys of data array. Identical to the name of the getter in snake case */ + /* + * Entity ID. + */ const ENTITY_ID = 'entity_id'; + /* + * Parent ID. + */ const PARENT_ID = 'parent_id'; + /* + * Row total. + */ const ROW_TOTAL = 'row_total'; + /* + * Price. + */ const PRICE = 'price'; + /* + * Weight. + */ const WEIGHT = 'weight'; + /* + * Quantity. + */ const QTY = 'qty'; + /* + * Product ID. + */ const PRODUCT_ID = 'product_id'; + /* + * Order item ID. + */ const ORDER_ITEM_ID = 'order_item_id'; + /* + * Additional data. + */ const ADDITIONAL_DATA = 'additional_data'; + /* + * Description. + */ const DESCRIPTION = 'description'; + /* + * Name. + */ const NAME = 'name'; + /* + * SKU. + */ const SKU = 'sku'; /** - * Returns additional_data + * Gets the additional data for the shipment item. * - * @return string + * @return string Additional data. */ public function getAdditionalData(); /** - * Returns description + * Gets the description for the shipment item. * - * @return string + * @return string Description. */ public function getDescription(); /** - * Returns entity_id + * Gets the ID for the shipment item. * - * @return int + * @return int Shipment item ID. */ public function getEntityId(); /** - * Returns name + * Gets the name for the shipment item. * - * @return string + * @return string Name. */ public function getName(); /** - * Returns order_item_id + * Gets the order item ID for the shipment item. * - * @return int + * @return int Order item ID. */ public function getOrderItemId(); /** - * Returns parent_id + * Gets the parent ID for the shipment item. * - * @return int + * @return int Parent ID. */ public function getParentId(); /** - * Returns price + * Gets the price for the shipment item. * - * @return float + * @return float Price. */ public function getPrice(); /** - * Returns product_id + * Gets the product ID for the shipment item. * - * @return int + * @return int Product ID. */ public function getProductId(); /** - * Returns qty + * Gets the quantity for the shipment item. * - * @return float + * @return float Quantity. */ public function getQty(); /** - * Returns row_total + * Gets the row total for the shipment item. * - * @return float + * @return float Row total. */ public function getRowTotal(); /** - * Returns sku + * Gets the SKU for the shipment item. * - * @return string + * @return string SKU. */ public function getSku(); /** - * Returns weight + * Gets the weight for the shipment item. * - * @return float + * @return float Weight. */ public function getWeight(); } diff --git a/app/code/Magento/Sales/Api/Data/ShipmentItemSearchResultInterface.php b/app/code/Magento/Sales/Api/Data/ShipmentItemSearchResultInterface.php index d9203697e6053..b090456edbdcc 100644 --- a/app/code/Magento/Sales/Api/Data/ShipmentItemSearchResultInterface.php +++ b/app/code/Magento/Sales/Api/Data/ShipmentItemSearchResultInterface.php @@ -2,18 +2,20 @@ /** * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) */ - namespace Magento\Sales\Api\Data; /** - * Interface ShipmentItemSearchResultInterface + * Shipment item search result interface. + * + * A shipment is a delivery package that contains products. A shipment document accompanies the shipment. This + * document lists the products and their quantities in the delivery package. A product is an item in a shipment. */ interface ShipmentItemSearchResultInterface extends \Magento\Framework\Api\SearchResultsInterface { /** - * Get collection items + * Gets collection items. * - * @return \Magento\Sales\Api\Data\ShipmentItemInterface[] + * @return \Magento\Sales\Api\Data\ShipmentItemInterface[] Array of collection items. */ public function getItems(); } diff --git a/app/code/Magento/Sales/Api/Data/ShipmentPackageInterface.php b/app/code/Magento/Sales/Api/Data/ShipmentPackageInterface.php index f617fe7d8be76..df714f9d36b06 100644 --- a/app/code/Magento/Sales/Api/Data/ShipmentPackageInterface.php +++ b/app/code/Magento/Sales/Api/Data/ShipmentPackageInterface.php @@ -5,7 +5,10 @@ namespace Magento\Sales\Api\Data; /** - * Interface ShipmentPackageInterface + * Shipment package interface. + * + * A shipment is a delivery package that contains products. A shipment document accompanies the shipment. This + * document lists the products and their quantities in the delivery package. */ interface ShipmentPackageInterface extends \Magento\Framework\Api\ExtensibleDataInterface { diff --git a/app/code/Magento/Sales/Api/Data/ShipmentSearchResultInterface.php b/app/code/Magento/Sales/Api/Data/ShipmentSearchResultInterface.php index c2b7e655e3cfe..da6892ba10777 100644 --- a/app/code/Magento/Sales/Api/Data/ShipmentSearchResultInterface.php +++ b/app/code/Magento/Sales/Api/Data/ShipmentSearchResultInterface.php @@ -2,20 +2,22 @@ /** * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) */ - namespace Magento\Sales\Api\Data; use Magento\Framework\Api\SearchResultsInterface; /** - * Interface ShipmentSearchResultInterface + * Shipment search result interface. + * + * A shipment is a delivery package that contains products. A shipment document accompanies the shipment. This + * document lists the products and their quantities in the delivery package. */ interface ShipmentSearchResultInterface extends SearchResultsInterface { /** - * Get collection items + * Gets collection items. * - * @return \Magento\Sales\Api\Data\ShipmentInterface[] + * @return \Magento\Sales\Api\Data\ShipmentInterface[] Array of collection items. */ public function getItems(); } diff --git a/app/code/Magento/Sales/Api/Data/ShipmentTrackInterface.php b/app/code/Magento/Sales/Api/Data/ShipmentTrackInterface.php index 2238ba4a2a021..e293d283b8195 100644 --- a/app/code/Magento/Sales/Api/Data/ShipmentTrackInterface.php +++ b/app/code/Magento/Sales/Api/Data/ShipmentTrackInterface.php @@ -5,99 +5,136 @@ namespace Magento\Sales\Api\Data; /** - * Interface ShipmentTrackInterface + * Shipment track interface. + * + * A shipment is a delivery package that contains products. A shipment document accompanies the shipment. This + * document lists the products and their quantities in the delivery package. Merchants and customers can track + * shipments. */ interface ShipmentTrackInterface extends \Magento\Framework\Api\ExtensibleDataInterface { /**#@+ - * Constants for keys of data array. Identical to the name of the getter in snake case + * Constants for keys of data array. Identical to the name of the getter in snake case. + */ + /* + * Entity ID. */ const ENTITY_ID = 'entity_id'; + /* + * Parent ID. + */ const PARENT_ID = 'parent_id'; + /* + * Weight. + */ const WEIGHT = 'weight'; + /* + * Quantity. + */ const QTY = 'qty'; + /* + * Order ID. + */ const ORDER_ID = 'order_id'; + /* + * Track number. + */ const TRACK_NUMBER = 'track_number'; + /* + * Description. + */ const DESCRIPTION = 'description'; + /* + * Title. + */ const TITLE = 'title'; + /* + * Carrier code. + */ const CARRIER_CODE = 'carrier_code'; + /* + * Created-at timestamp. + */ const CREATED_AT = 'created_at'; + /* + * Updated-at timestamp. + */ const UPDATED_AT = 'updated_at'; /** - * Returns carrier_code + * Gets the carrier code for the shipment package. * - * @return string + * @return string Carrier code. */ public function getCarrierCode(); /** - * Returns created_at + * Gets the created-at timestamp for the shipment package. * - * @return string + * @return string Created-at timestamp. */ public function getCreatedAt(); /** - * Returns description + * Gets the description for the shipment package. * - * @return string + * @return string Description. */ public function getDescription(); /** - * Returns entity_id + * Gets the ID for the shipment package. * - * @return int + * @return int Shipment package ID. */ public function getEntityId(); /** - * Returns order_id + * Gets the order_id for the shipment package. * * @return int */ public function getOrderId(); /** - * Returns parent_id + * Gets the parent ID for the shipment package. * - * @return int + * @return int Parent ID. */ public function getParentId(); /** - * Returns qty + * Gets the quantity for the shipment package. * - * @return float + * @return float Quantity. */ public function getQty(); /** - * Returns title + * Gets the title for the shipment package. * - * @return string + * @return string Title. */ public function getTitle(); /** - * Returns track_number + * Gets the track number for the shipment package. * - * @return string + * @return string Track number. */ public function getTrackNumber(); /** - * Returns updated_at + * Gets the updated-at timestamp for the shipment package. * - * @return string + * @return string Updated-at timestamp. */ public function getUpdatedAt(); /** - * Returns weight + * Gets the weight for the shipment package. * - * @return float + * @return float Weight. */ public function getWeight(); } diff --git a/app/code/Magento/Sales/Api/Data/ShipmentTrackSearchResultInterface.php b/app/code/Magento/Sales/Api/Data/ShipmentTrackSearchResultInterface.php index 6223962192bd7..4e48e7e0871ea 100644 --- a/app/code/Magento/Sales/Api/Data/ShipmentTrackSearchResultInterface.php +++ b/app/code/Magento/Sales/Api/Data/ShipmentTrackSearchResultInterface.php @@ -5,14 +5,18 @@ namespace Magento\Sales\Api\Data; /** - * Interface ShipmentTrackSearchResultInterface + * Shipment track search result interface. + * + * A shipment is a delivery package that contains products. A shipment document accompanies the shipment. This + * document lists the products and their quantities in the delivery package. Merchants and customers can track + * shipments. */ interface ShipmentTrackSearchResultInterface extends \Magento\Framework\Api\SearchResultsInterface { /** - * Get collection items + * Gets collection items. * - * @return \Magento\Sales\Api\Data\ShipmentTrackInterface[] + * @return \Magento\Sales\Api\Data\ShipmentTrackInterface[] Array of collection items. */ public function getItems(); } diff --git a/app/code/Magento/Sales/Api/Data/TransactionInterface.php b/app/code/Magento/Sales/Api/Data/TransactionInterface.php index b2a55fcd35ff6..0594cd280a344 100644 --- a/app/code/Magento/Sales/Api/Data/TransactionInterface.php +++ b/app/code/Magento/Sales/Api/Data/TransactionInterface.php @@ -5,101 +5,142 @@ namespace Magento\Sales\Api\Data; /** - * Interface TransactionInterface + * Transaction interface. + * + * A transaction is an interaction between a merchant and a customer such as a purchase, a credit, a refund, and so on. */ interface TransactionInterface extends \Magento\Framework\Api\ExtensibleDataInterface { /**#@+ - * Constants for keys of data array. Identical to the name of the getter in snake case + * Constants for keys of data array. Identical to the name of the getter in snake case. + */ + /* + * Transaction ID. */ const TRANSACTION_ID = 'transaction_id'; + /* + * Parent ID. + */ const PARENT_ID = 'parent_id'; + /* + * Order ID. + */ const ORDER_ID = 'order_id'; + /* + * Payment ID. + */ const PAYMENT_ID = 'payment_id'; + /* + * Transaction business ID. + */ const TXN_ID = 'txn_id'; + /* + * Parent transaction ID. + */ const PARENT_TXN_ID = 'parent_txn_id'; + /* + * Transaction type. + */ const TXN_TYPE = 'txn_type'; + /* + * Is closed flag. + */ const IS_CLOSED = 'is_closed'; + /* + * Additional information. + */ const ADDITIONAL_INFORMATION = 'additional_information'; + /* + * Created-at timestamp. + */ const CREATED_AT = 'created_at'; + /* + * Method. + */ const METHOD = 'method'; + /* + * Increment ID. + */ const INCREMENT_ID = 'increment_id'; + /* + * Child transactions. + */ const CHILD_TRANSACTIONS = 'child_transactions'; /** - * Returns transaction_id + * Gets the transaction ID for the transaction. * - * @return int + * @return int Transaction ID. */ public function getTransactionId(); /** - * Returns parent_id + * Gets the parent ID for the transaction. * - * @return int|null + * @return int|null The parent ID for the transaction. Otherwise, null. */ public function getParentId(); /** - * Returns order_id + * Gets the order ID for the transaction. * - * @return int + * @return int Order ID. */ public function getOrderId(); /** - * Returns payment_id + * Gets the payment ID for the transaction. * - * @return int + * @return int Payment ID. */ public function getPaymentId(); /** - * Returns txn_id + * Gets the transaction business ID for the transaction. * - * @return string + * @return string Transaction business ID. */ public function getTxnId(); /** - * Returns parent_txn_id + * Gets the parent transaction business ID for the transaction. * - * @return string + * @return string Parent transaction business ID. */ public function getParentTxnId(); /** - * Returns txn_type + * Gets the transaction type for the transaction. * - * @return string + * @return string Transaction type. */ public function getTxnType(); /** - * Returns is_closed + * Gets the value of the is-closed flag for the transaction. * - * @return int + * @return int Is-closed flag value. */ public function getIsClosed(); /** - * Returns additional_information + * Gets any additional information for the transaction. * - * @return string[]|null + * @return string[]|null Array of additional information. Otherwise, null. */ public function getAdditionalInformation(); /** - * Returns created_at + * Gets the created-at timestamp for the transaction. * - * @return string + * @return string Created-at timestamp. */ public function getCreatedAt(); /** - * Returns child_transactions + * Gets an array of child transactions for the transaction. * - * @return \Magento\Sales\Api\Data\TransactionInterface[] + * @return \Magento\Sales\Api\Data\TransactionInterface[] Array of child transactions. */ public function getChildTransactions(); } diff --git a/app/code/Magento/Sales/Api/Data/TransactionSearchResultInterface.php b/app/code/Magento/Sales/Api/Data/TransactionSearchResultInterface.php index 79293d4a0d147..5def2fe749240 100644 --- a/app/code/Magento/Sales/Api/Data/TransactionSearchResultInterface.php +++ b/app/code/Magento/Sales/Api/Data/TransactionSearchResultInterface.php @@ -2,18 +2,19 @@ /** * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) */ - namespace Magento\Sales\Api\Data; /** - * Interface TransactionSearchResultInterface + * Transaction search result interface. + * + * A transaction is an interaction between a merchant and a customer such as a purchase, a credit, a refund, and so on. */ interface TransactionSearchResultInterface extends \Magento\Framework\Api\SearchResultsInterface { /** - * Get collection items + * Gets collection items. * - * @return \Magento\Sales\Api\Data\TransactionInterface[] + * @return \Magento\Sales\Api\Data\TransactionInterface[] Array of collection items. */ public function getItems(); } diff --git a/app/code/Magento/Sales/Api/InvoiceCommentRepositoryInterface.php b/app/code/Magento/Sales/Api/InvoiceCommentRepositoryInterface.php index 8af4f6f90b5b9..e728221b98297 100644 --- a/app/code/Magento/Sales/Api/InvoiceCommentRepositoryInterface.php +++ b/app/code/Magento/Sales/Api/InvoiceCommentRepositoryInterface.php @@ -5,37 +5,42 @@ namespace Magento\Sales\Api; /** - * Interface RepositoryInterface + * Invoice comment repository interface. + * + * An invoice is a record of the receipt of payment for an order. An invoice can include comments that detail the + * invoice history. */ interface InvoiceCommentRepositoryInterface { /** - * @param \Magento\Framework\Api\SearchCriteria $criteria - * @return \Magento\Sales\Api\Data\InvoiceSearchResultInterface + * Lists invoice comments that match specified search criteria. + * + * @param \Magento\Framework\Api\SearchCriteria $criteria The search criteria. + * @return \Magento\Sales\Api\Data\InvoiceSearchResultInterface Invoice search result interface. */ public function getList(\Magento\Framework\Api\SearchCriteria $criteria); /** - * Load entity + * Loads a specified invoice comment. * - * @param int $id - * @return \Magento\Sales\Api\Data\InvoiceCommentInterface + * @param int $id The invoice comment ID. + * @return \Magento\Sales\Api\Data\InvoiceCommentInterface Invoice comment interface. */ public function get($id); /** - * Delete entity + * Deletes a specified invoice comment. * - * @param \Magento\Sales\Api\Data\InvoiceCommentInterface $entity + * @param \Magento\Sales\Api\Data\InvoiceCommentInterface $entity The invoice comment. * @return bool */ public function delete(\Magento\Sales\Api\Data\InvoiceCommentInterface $entity); /** - * Perform persist operations for one entity + * Performs persist operations for a specified invoice comment. * - * @param \Magento\Sales\Api\Data\InvoiceCommentInterface $entity - * @return \Magento\Sales\Api\Data\InvoiceCommentInterface + * @param \Magento\Sales\Api\Data\InvoiceCommentInterface $entity The invoice comment. + * @return \Magento\Sales\Api\Data\InvoiceCommentInterface Invoice comment interface. */ public function save(\Magento\Sales\Api\Data\InvoiceCommentInterface $entity); } diff --git a/app/code/Magento/Sales/Api/InvoiceItemRepositoryInterface.php b/app/code/Magento/Sales/Api/InvoiceItemRepositoryInterface.php index f835ec46b37fe..e3a6a61088484 100644 --- a/app/code/Magento/Sales/Api/InvoiceItemRepositoryInterface.php +++ b/app/code/Magento/Sales/Api/InvoiceItemRepositoryInterface.php @@ -5,37 +5,41 @@ namespace Magento\Sales\Api; /** - * Interface RepositoryInterface + * Invoice item repository interface. + * + * An invoice is a record of the receipt of payment for an order. An invoice item is a purchased item in an invoice. */ interface InvoiceItemRepositoryInterface { /** + * Lists the invoice items that match specified search criteria. + * * @param \Magento\Framework\Api\SearchCriteria $criteria * @return \Magento\Sales\Api\Data\InvoiceItemSearchResultInterface */ public function getList(\Magento\Framework\Api\SearchCriteria $criteria); /** - * Load entity + * Loads a specified invoice item. * - * @param int $id - * @return \Magento\Sales\Api\Data\InvoiceItemInterface + * @param int $id The invoice item ID. + * @return \Magento\Sales\Api\Data\InvoiceItemInterface Invoice item interface. */ public function get($id); /** - * Delete entity + * Deletes a specified invoice item. * - * @param \Magento\Sales\Api\Data\InvoiceItemInterface $entity + * @param \Magento\Sales\Api\Data\InvoiceItemInterface $entity The invoice item. * @return bool */ public function delete(\Magento\Sales\Api\Data\InvoiceItemInterface $entity); /** - * Perform persist operations for one entity + * Performs persist operations for a specified invoice item. * - * @param \Magento\Sales\Api\Data\InvoiceItemInterface $entity - * @return \Magento\Sales\Api\Data\InvoiceItemInterface + * @param \Magento\Sales\Api\Data\InvoiceItemInterface $entity The invoice item. + * @return \Magento\Sales\Api\Data\InvoiceItemInterface Invoice item interface. */ public function save(\Magento\Sales\Api\Data\InvoiceItemInterface $entity); } diff --git a/app/code/Magento/Sales/Api/InvoiceManagementInterface.php b/app/code/Magento/Sales/Api/InvoiceManagementInterface.php index d2a67c87aad34..456ce7ef40a9f 100644 --- a/app/code/Magento/Sales/Api/InvoiceManagementInterface.php +++ b/app/code/Magento/Sales/Api/InvoiceManagementInterface.php @@ -5,12 +5,14 @@ namespace Magento\Sales\Api; /** - * Interface InvoiceManagementInterface + * Invoice management interface. + * + * An invoice is a record of the receipt of payment for an order. */ interface InvoiceManagementInterface { /** - * Set invoice capture + * Sets invoice capture. * * @param int $id * @return string @@ -18,24 +20,25 @@ interface InvoiceManagementInterface public function setCapture($id); /** - * Returns list of comments attached to invoice - * @param int $id - * @return \Magento\Sales\Api\Data\InvoiceCommentSearchResultInterface + * Lists comments for a specified invoice. + * + * @param int $id The invoice ID. + * @return \Magento\Sales\Api\Data\InvoiceCommentSearchResultInterface Invoice comment search result interface. */ public function getCommentsList($id); /** - * Notify user + * Emails a user a specified invoice. * - * @param int $id + * @param int $id The invoice ID. * @return bool */ public function notify($id); /** - * Set invoice void + * Voids a specified invoice. * - * @param int $id + * @param int $id The invoice ID. * @return bool */ public function setVoid($id); diff --git a/app/code/Magento/Sales/Api/InvoiceRepositoryInterface.php b/app/code/Magento/Sales/Api/InvoiceRepositoryInterface.php index e26196118ecf7..eeb025d497ce6 100644 --- a/app/code/Magento/Sales/Api/InvoiceRepositoryInterface.php +++ b/app/code/Magento/Sales/Api/InvoiceRepositoryInterface.php @@ -5,37 +5,41 @@ namespace Magento\Sales\Api; /** - * Interface RepositoryInterface + * Invoice repository interface. + * + * An invoice is a record of the receipt of payment for an order. */ interface InvoiceRepositoryInterface { /** - * @param \Magento\Framework\Api\SearchCriteria $criteria - * @return \Magento\Sales\Api\Data\InvoiceSearchResultInterface + * Lists invoices that match specified search criteria. + * + * @param \Magento\Framework\Api\SearchCriteria $criteria The search criteria. + * @return \Magento\Sales\Api\Data\InvoiceSearchResultInterface Invoice search result interface. */ public function getList(\Magento\Framework\Api\SearchCriteria $criteria); /** - * Load entity + * Loads a specified invoice. * - * @param int $id - * @return \Magento\Sales\Api\Data\InvoiceInterface + * @param int $id The invoice ID. + * @return \Magento\Sales\Api\Data\InvoiceInterface Invoice interface. */ public function get($id); /** - * Delete entity + * Deletes a specified invoice. * - * @param \Magento\Sales\Api\Data\InvoiceInterface $entity + * @param \Magento\Sales\Api\Data\InvoiceInterface $entity The invoice. * @return bool */ public function delete(\Magento\Sales\Api\Data\InvoiceInterface $entity); /** - * Perform persist operations for one entity + * Performs persist operations for a specified invoice. * - * @param \Magento\Sales\Api\Data\InvoiceInterface $entity - * @return \Magento\Sales\Api\Data\InvoiceInterface + * @param \Magento\Sales\Api\Data\InvoiceInterface $entity The invoice. + * @return \Magento\Sales\Api\Data\InvoiceInterface Invoice interface. */ public function save(\Magento\Sales\Api\Data\InvoiceInterface $entity); } diff --git a/app/code/Magento/Sales/Api/OrderAddressRepositoryInterface.php b/app/code/Magento/Sales/Api/OrderAddressRepositoryInterface.php index 8577230b45ea3..2ce66c0592e63 100644 --- a/app/code/Magento/Sales/Api/OrderAddressRepositoryInterface.php +++ b/app/code/Magento/Sales/Api/OrderAddressRepositoryInterface.php @@ -5,37 +5,43 @@ namespace Magento\Sales\Api; /** - * Interface RepositoryInterface + * Order address repository interface. + * + * An order is a document that a web store issues to a customer. Magento generates a sales order that lists the product + * items, billing and shipping addresses, and shipping and payment methods. A corresponding external document, known as + * a purchase order, is emailed to the customer. */ interface OrderAddressRepositoryInterface { /** - * @param \Magento\Framework\Api\SearchCriteria $criteria - * @return \Magento\Sales\Api\Data\OrderAddressSearchResultInterface + * Lists order addresses that match specified search criteria. + * + * @param \Magento\Framework\Api\SearchCriteria $criteria The search criteria. + * @return \Magento\Sales\Api\Data\OrderAddressSearchResultInterface Order address search result interface. */ public function getList(\Magento\Framework\Api\SearchCriteria $criteria); /** - * Load entity + * Loads a specified order address. * - * @param int $id - * @return \Magento\Sales\Api\Data\OrderAddressInterface + * @param int $id The order address ID. + * @return \Magento\Sales\Api\Data\OrderAddressInterface Order address interface. */ public function get($id); /** - * Delete entity + * Deletes a specified order address. * - * @param \Magento\Sales\Api\Data\OrderAddressInterface $entity + * @param \Magento\Sales\Api\Data\OrderAddressInterface $entity The order address. * @return bool */ public function delete(\Magento\Sales\Api\Data\OrderAddressInterface $entity); /** - * Perform persist operations for one entity + * Performs persist operations for a specified order address. * - * @param \Magento\Sales\Api\Data\OrderAddressInterface $entity - * @return \Magento\Sales\Api\Data\OrderAddressInterface + * @param \Magento\Sales\Api\Data\OrderAddressInterface $entity The order address. + * @return \Magento\Sales\Api\Data\OrderAddressInterface Order address interface. */ public function save(\Magento\Sales\Api\Data\OrderAddressInterface $entity); } diff --git a/app/code/Magento/Sales/Api/OrderItemRepositoryInterface.php b/app/code/Magento/Sales/Api/OrderItemRepositoryInterface.php index c93214fdbbe4a..69fd7b5569428 100644 --- a/app/code/Magento/Sales/Api/OrderItemRepositoryInterface.php +++ b/app/code/Magento/Sales/Api/OrderItemRepositoryInterface.php @@ -5,37 +5,43 @@ namespace Magento\Sales\Api; /** - * Interface RepositoryInterface + * Order item repository interface. + * + * An order is a document that a web store issues to a customer. Magento generates a sales order that lists the product + * items, billing and shipping addresses, and shipping and payment methods. A corresponding external document, known as + * a purchase order, is emailed to the customer. */ interface OrderItemRepositoryInterface { /** - * @param \Magento\Framework\Api\SearchCriteria $criteria - * @return \Magento\Sales\Api\Data\OrderItemSearchResultInterface + * Lists order items that match specified search criteria. + * + * @param \Magento\Framework\Api\SearchCriteria $criteria The search criteria. + * @return \Magento\Sales\Api\Data\OrderItemSearchResultInterface Order item search result interface. */ public function getList(\Magento\Framework\Api\SearchCriteria $criteria); /** - * Load entity + * Loads a specified order item. * - * @param int $id - * @return \Magento\Sales\Api\Data\OrderItemInterface + * @param int $id The order item ID. + * @return \Magento\Sales\Api\Data\OrderItemInterface Order item interface. */ public function get($id); /** - * Delete entity + * Deletes a specified order item. * - * @param \Magento\Sales\Api\Data\OrderItemInterface $entity + * @param \Magento\Sales\Api\Data\OrderItemInterface $entity The order item. * @return bool */ public function delete(\Magento\Sales\Api\Data\OrderItemInterface $entity); /** - * Perform persist operations for one entity + * Performs persist operations for a specified order item. * - * @param \Magento\Sales\Api\Data\OrderItemInterface $entity - * @return \Magento\Sales\Api\Data\OrderItemInterface + * @param \Magento\Sales\Api\Data\OrderItemInterface $entity The order item. + * @return \Magento\Sales\Api\Data\OrderItemInterface Order item interface. */ public function save(\Magento\Sales\Api\Data\OrderItemInterface $entity); } diff --git a/app/code/Magento/Sales/Api/OrderManagementInterface.php b/app/code/Magento/Sales/Api/OrderManagementInterface.php index f65062b55f4f9..0d32179b90f8f 100644 --- a/app/code/Magento/Sales/Api/OrderManagementInterface.php +++ b/app/code/Magento/Sales/Api/OrderManagementInterface.php @@ -5,63 +5,67 @@ namespace Magento\Sales\Api; /** - * Interface OrderManagementInterface + * Order management interface. + * + * An order is a document that a web store issues to a customer. Magento generates a sales order that lists the product + * items, billing and shipping addresses, and shipping and payment methods. A corresponding external document, known as + * a purchase order, is emailed to the customer. */ interface OrderManagementInterface { /** - * Order cancel + * Cancels a specified order. * - * @param int $id + * @param int $id The order ID. * @return bool */ public function cancel($id); /** - * Returns list of comments attached to order + * Lists comments for a specified order. * - * @param int $id - * @return \Magento\Sales\Api\Data\OrderStatusHistorySearchResultInterface + * @param int $id The order ID. + * @return \Magento\Sales\Api\Data\OrderStatusHistorySearchResultInterface Order status history search results interface. */ public function getCommentsList($id); /** - * Add comment to order + * Adds a comment to a specified order. * - * @param int $id - * @param \Magento\Sales\Api\Data\OrderStatusHistoryInterface $statusHistory + * @param int $id The order ID. + * @param \Magento\Sales\Api\Data\OrderStatusHistoryInterface $statusHistory Status history comment. * @return bool */ public function addComment($id, \Magento\Sales\Api\Data\OrderStatusHistoryInterface $statusHistory); /** - * Notify user + * Emails a user a specified order. * - * @param int $id + * @param int $id The order ID. * @return bool */ public function notify($id); /** - * Returns order status + * Gets the status for a specified order. * - * @param int $id - * @return string + * @param int $id The order ID. + * @return string Order status. */ public function getStatus($id); /** - * Order hold + * Holds a specified order. * - * @param int $id + * @param int $id The order ID. * @return bool */ public function hold($id); /** - * Order un hold + * Releases a specified order from hold status. * - * @param int $id + * @param int $id The order ID. * @return bool */ public function unHold($id); diff --git a/app/code/Magento/Sales/Api/OrderPaymentRepositoryInterface.php b/app/code/Magento/Sales/Api/OrderPaymentRepositoryInterface.php index 131d53dff3b21..4f962f6ac2e96 100644 --- a/app/code/Magento/Sales/Api/OrderPaymentRepositoryInterface.php +++ b/app/code/Magento/Sales/Api/OrderPaymentRepositoryInterface.php @@ -5,37 +5,43 @@ namespace Magento\Sales\Api; /** - * Interface RepositoryInterface + * Order payment repository interface. + * + * An order is a document that a web store issues to a customer. Magento generates a sales order that lists the product + * items, billing and shipping addresses, and shipping and payment methods. A corresponding external document, known as + * a purchase order, is emailed to the customer. */ interface OrderPaymentRepositoryInterface { /** - * @param \Magento\Framework\Api\SearchCriteria $criteria - * @return \Magento\Sales\Api\Data\OrderPaymentSearchResultInterface + * Lists order payments that match specified search criteria. + * + * @param \Magento\Framework\Api\SearchCriteria $criteria The search criteria. + * @return \Magento\Sales\Api\Data\OrderPaymentSearchResultInterface Order payment search result interface. */ public function getList(\Magento\Framework\Api\SearchCriteria $criteria); /** - * Load entity + * Loads a specified order payment. * - * @param int $id - * @return \Magento\Sales\Api\Data\OrderPaymentInterface + * @param int $id The order payment ID. + * @return \Magento\Sales\Api\Data\OrderPaymentInterface Order payment interface. */ public function get($id); /** - * Delete entity + * Deletes a specified order payment. * - * @param \Magento\Sales\Api\Data\OrderPaymentInterface $entity + * @param \Magento\Sales\Api\Data\OrderPaymentInterface $entity The order payment ID. * @return bool */ public function delete(\Magento\Sales\Api\Data\OrderPaymentInterface $entity); /** - * Perform persist operations for one entity + * Performs persist operations for a specified order payment. * - * @param \Magento\Sales\Api\Data\OrderPaymentInterface $entity - * @return \Magento\Sales\Api\Data\OrderPaymentInterface + * @param \Magento\Sales\Api\Data\OrderPaymentInterface $entity The order payment ID. + * @return \Magento\Sales\Api\Data\OrderPaymentInterface Order payment interface. */ public function save(\Magento\Sales\Api\Data\OrderPaymentInterface $entity); } diff --git a/app/code/Magento/Sales/Api/OrderRepositoryInterface.php b/app/code/Magento/Sales/Api/OrderRepositoryInterface.php index 2f8c5e3bc7e0a..fd01cc163b587 100644 --- a/app/code/Magento/Sales/Api/OrderRepositoryInterface.php +++ b/app/code/Magento/Sales/Api/OrderRepositoryInterface.php @@ -5,37 +5,43 @@ namespace Magento\Sales\Api; /** - * Interface RepositoryInterface + * Order repository interface. + * + * An order is a document that a web store issues to a customer. Magento generates a sales order that lists the product + * items, billing and shipping addresses, and shipping and payment methods. A corresponding external document, known as + * a purchase order, is emailed to the customer. */ interface OrderRepositoryInterface { /** - * @param \Magento\Framework\Api\SearchCriteria $criteria - * @return \Magento\Sales\Api\Data\OrderSearchResultInterface + * Lists orders that match specified search criteria. + * + * @param \Magento\Framework\Api\SearchCriteria $criteria The search criteria. + * @return \Magento\Sales\Api\Data\OrderSearchResultInterface Order search result interface. */ public function getList(\Magento\Framework\Api\SearchCriteria $criteria); /** - * Load entity + * Loads a specified order. * - * @param int $id - * @return \Magento\Sales\Api\Data\OrderInterface + * @param int $id The order ID. + * @return \Magento\Sales\Api\Data\OrderInterface Order interface. */ public function get($id); /** - * Delete entity + * Deletes a specified order. * - * @param \Magento\Sales\Api\Data\OrderInterface $entity + * @param \Magento\Sales\Api\Data\OrderInterface $entity The order ID. * @return bool */ public function delete(\Magento\Sales\Api\Data\OrderInterface $entity); /** - * Perform persist operations for one entity + * Performs persist operations for a specified order. * - * @param \Magento\Sales\Api\Data\OrderInterface $entity - * @return \Magento\Sales\Api\Data\OrderInterface + * @param \Magento\Sales\Api\Data\OrderInterface $entity The order ID. + * @return \Magento\Sales\Api\Data\OrderInterface Order interface. */ public function save(\Magento\Sales\Api\Data\OrderInterface $entity); } diff --git a/app/code/Magento/Sales/Api/OrderStatusHistoryRepositoryInterface.php b/app/code/Magento/Sales/Api/OrderStatusHistoryRepositoryInterface.php index 38a4cc07abdfe..bb832f7f15bc2 100644 --- a/app/code/Magento/Sales/Api/OrderStatusHistoryRepositoryInterface.php +++ b/app/code/Magento/Sales/Api/OrderStatusHistoryRepositoryInterface.php @@ -5,37 +5,43 @@ namespace Magento\Sales\Api; /** - * Interface RepositoryInterface + * Order status history repository interface. + * + * An order is a document that a web store issues to a customer. Magento generates a sales order that lists the product + * items, billing and shipping addresses, and shipping and payment methods. A corresponding external document, known as + * a purchase order, is emailed to the customer. */ interface OrderStatusHistoryRepositoryInterface { /** - * @param \Magento\Framework\Api\SearchCriteria $criteria - * @return \Magento\Sales\Api\Data\OrderStatusHistorySearchResultInterface + * Lists order status history comments that match specified search criteria. + * + * @param \Magento\Framework\Api\SearchCriteria $criteria The search criteria. + * @return \Magento\Sales\Api\Data\OrderStatusHistorySearchResultInterface Order status history search result interface. */ public function getList(\Magento\Framework\Api\SearchCriteria $criteria); /** - * Load entity + * Loads a specified order status comment. * - * @param int $id - * @return \Magento\Sales\Api\Data\OrderStatusHistoryInterface + * @param int $id The order status comment ID. + * @return \Magento\Sales\Api\Data\OrderStatusHistoryInterface Order status history interface. */ public function get($id); /** - * Delete entity + * Deletes a specified order status comment. * - * @param \Magento\Sales\Api\Data\OrderStatusHistoryInterface $entity + * @param \Magento\Sales\Api\Data\OrderStatusHistoryInterface $entity The order status comment. * @return bool */ public function delete(\Magento\Sales\Api\Data\OrderStatusHistoryInterface $entity); /** - * Perform persist operations for one entity + * Performs persist operations for a specified order status comment. * - * @param \Magento\Sales\Api\Data\OrderStatusHistoryInterface $entity - * @return \Magento\Sales\Api\Data\OrderStatusHistoryInterface + * @param \Magento\Sales\Api\Data\OrderStatusHistoryInterface $entity The order status comment. + * @return \Magento\Sales\Api\Data\OrderStatusHistoryInterface Order status history interface. */ public function save(\Magento\Sales\Api\Data\OrderStatusHistoryInterface $entity); } diff --git a/app/code/Magento/Sales/Api/ShipmentCommentRepositoryInterface.php b/app/code/Magento/Sales/Api/ShipmentCommentRepositoryInterface.php index deca5a9776f6f..6fc03862ae6cf 100644 --- a/app/code/Magento/Sales/Api/ShipmentCommentRepositoryInterface.php +++ b/app/code/Magento/Sales/Api/ShipmentCommentRepositoryInterface.php @@ -5,37 +5,42 @@ namespace Magento\Sales\Api; /** - * Interface ShipmentCommentRepositoryInterface + * Shipment comment repository interface. + * + * A shipment is a delivery package that contains products. A shipment document accompanies the shipment. This + * document lists the products and their quantities in the delivery package. A shipment document can contain comments. */ interface ShipmentCommentRepositoryInterface { /** - * @param \Magento\Framework\Api\SearchCriteria $criteria - * @return \Magento\Sales\Api\Data\ShipmentCommentSearchResultInterface + * Lists shipment comments that match specific search criteria. + * + * @param \Magento\Framework\Api\SearchCriteria $criteria The search criteria. + * @return \Magento\Sales\Api\Data\ShipmentCommentSearchResultInterface Shipment comment search result interface. */ public function getList(\Magento\Framework\Api\SearchCriteria $criteria); /** - * Load entity + * Loads a specified shipment comment. * - * @param int $id - * @return \Magento\Sales\Api\Data\ShipmentCommentInterface + * @param int $id The shipment comment ID. + * @return \Magento\Sales\Api\Data\ShipmentCommentInterface Shipment comment interface. */ public function get($id); /** - * Delete entity + * Deletes a specified shipment comment. * - * @param \Magento\Sales\Api\Data\ShipmentCommentInterface $entity + * @param \Magento\Sales\Api\Data\ShipmentCommentInterface $entity The shipment comment. * @return bool */ public function delete(\Magento\Sales\Api\Data\ShipmentCommentInterface $entity); /** - * Perform persist operations for one entity + * Performs persist operations for a specified shipment comment. * - * @param \Magento\Sales\Api\Data\ShipmentCommentInterface $entity - * @return \Magento\Sales\Api\Data\ShipmentCommentInterface + * @param \Magento\Sales\Api\Data\ShipmentCommentInterface $entity The shipment comment. + * @return \Magento\Sales\Api\Data\ShipmentCommentInterface Shipment comment interface. */ public function save(\Magento\Sales\Api\Data\ShipmentCommentInterface $entity); } diff --git a/app/code/Magento/Sales/Api/ShipmentItemRepositoryInterface.php b/app/code/Magento/Sales/Api/ShipmentItemRepositoryInterface.php index 99b61f4ad5e8f..8793d121cdfc4 100644 --- a/app/code/Magento/Sales/Api/ShipmentItemRepositoryInterface.php +++ b/app/code/Magento/Sales/Api/ShipmentItemRepositoryInterface.php @@ -2,22 +2,26 @@ /** * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) */ - namespace Magento\Sales\Api; /** - * Interface ShipmentItemRepositoryInterface + * Shipment item repository interface. + * + * A shipment is a delivery package that contains products. A shipment document accompanies the shipment. This + * document lists the products and their quantities in the delivery package. A product is an item in a shipment. */ interface ShipmentItemRepositoryInterface { /** - * @param \Magento\Framework\Api\SearchCriteria $criteria - * @return \Magento\Sales\Api\Data\ShipmentItemSearchResultInterface + * Lists shipment items that match specified search criteria. + * + * @param \Magento\Framework\Api\SearchCriteria $criteria The search criteria. + * @return \Magento\Sales\Api\Data\ShipmentItemSearchResultInterface Shipment item search result interface. */ public function getList(\Magento\Framework\Api\SearchCriteria $criteria); /** - * Load entity + * Loads a specified shipment item. * * @param int $id * @return \Magento\Sales\Api\Data\ShipmentInterface @@ -25,18 +29,18 @@ public function getList(\Magento\Framework\Api\SearchCriteria $criteria); public function get($id); /** - * Delete entity + * Deletes a specified shipment item. * - * @param \Magento\Sales\Api\Data\ShipmentInterface $entity + * @param \Magento\Sales\Api\Data\ShipmentInterface $entity The shipment item. * @return bool */ public function delete(\Magento\Sales\Api\Data\ShipmentInterface $entity); /** - * Perform persist operations for one entity + * Performs persist operations for a specified shipment item. * - * @param \Magento\Sales\Api\Data\ShipmentInterface $entity - * @return \Magento\Sales\Api\Data\ShipmentInterface + * @param \Magento\Sales\Api\Data\ShipmentInterface $entity The shipment item. + * @return \Magento\Sales\Api\Data\ShipmentInterface Shipment interface. */ public function save(\Magento\Sales\Api\Data\ShipmentInterface $entity); } diff --git a/app/code/Magento/Sales/Api/ShipmentManagementInterface.php b/app/code/Magento/Sales/Api/ShipmentManagementInterface.php index 9b735e62da7e1..5dd8abf38dc12 100644 --- a/app/code/Magento/Sales/Api/ShipmentManagementInterface.php +++ b/app/code/Magento/Sales/Api/ShipmentManagementInterface.php @@ -5,29 +5,33 @@ namespace Magento\Sales\Api; /** - * Interface ShipmentManagementInterface + * Shipment management interface. + * + * A shipment is a delivery package that contains products. A shipment document accompanies the shipment. This + * document lists the products and their quantities in the delivery package. */ interface ShipmentManagementInterface { /** - * Returns shipment label + * Gets a specified shipment label. * - * @param int $id - * @return string + * @param int $id The shipment label ID. + * @return string Shipment label. */ public function getLabel($id); /** - * Returns list of comments attached to shipment - * @param int $id - * @return \Magento\Sales\Api\Data\ShipmentCommentSearchResultInterface + * Lists comments for a specified shipment. + * + * @param int $id The shipment ID. + * @return \Magento\Sales\Api\Data\ShipmentCommentSearchResultInterface Shipment comment search result interface. */ public function getCommentsList($id); /** - * Notify user + * Emails user a specified shipment. * - * @param int $id + * @param int $id The shipment ID. * @return bool */ public function notify($id); diff --git a/app/code/Magento/Sales/Api/ShipmentRepositoryInterface.php b/app/code/Magento/Sales/Api/ShipmentRepositoryInterface.php index ae850fd1c43a7..5ac5a6fef046f 100644 --- a/app/code/Magento/Sales/Api/ShipmentRepositoryInterface.php +++ b/app/code/Magento/Sales/Api/ShipmentRepositoryInterface.php @@ -2,41 +2,45 @@ /** * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) */ - namespace Magento\Sales\Api; /** - * Interface ShipmentRepositoryInterface + * Shipment repository interface. + * + * A shipment is a delivery package that contains products. A shipment document accompanies the shipment. This + * document lists the products and their quantities in the delivery package. */ interface ShipmentRepositoryInterface { /** - * @param \Magento\Framework\Api\SearchCriteria $criteria - * @return \Magento\Sales\Api\Data\ShipmentSearchResultInterface + * Lists shipments that match specified search criteria. + * + * @param \Magento\Framework\Api\SearchCriteria $criteria The search criteria. + * @return \Magento\Sales\Api\Data\ShipmentSearchResultInterface Shipment search results interface. */ public function getList(\Magento\Framework\Api\SearchCriteria $criteria); /** - * Load entity + * Loads a specified shipment. * - * @param int $id + * @param int $id The shipment ID. * @return \Magento\Sales\Api\Data\ShipmentInterface */ public function get($id); /** - * Delete entity + * Deletes a specified shipment. * - * @param \Magento\Sales\Api\Data\ShipmentInterface $entity + * @param \Magento\Sales\Api\Data\ShipmentInterface $entity The shipment. * @return bool */ public function delete(\Magento\Sales\Api\Data\ShipmentInterface $entity); /** - * Perform persist operations for one entity + * Performs persist operations for a specified shipment. * - * @param \Magento\Sales\Api\Data\ShipmentInterface $entity - * @return \Magento\Sales\Api\Data\ShipmentInterface + * @param \Magento\Sales\Api\Data\ShipmentInterface $entity The shipment. + * @return \Magento\Sales\Api\Data\ShipmentInterface Shipment interface. */ public function save(\Magento\Sales\Api\Data\ShipmentInterface $entity); } diff --git a/app/code/Magento/Sales/Api/ShipmentTrackRepositoryInterface.php b/app/code/Magento/Sales/Api/ShipmentTrackRepositoryInterface.php index e0e915f749e13..8910b5c142f3b 100644 --- a/app/code/Magento/Sales/Api/ShipmentTrackRepositoryInterface.php +++ b/app/code/Magento/Sales/Api/ShipmentTrackRepositoryInterface.php @@ -2,47 +2,52 @@ /** * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) */ - namespace Magento\Sales\Api; /** - * Interface ShipmentTrackRepositoryInterface + * Shipment track repository interface. + * + * A shipment is a delivery package that contains products. A shipment document accompanies the shipment. This + * document lists the products and their quantities in the delivery package. */ interface ShipmentTrackRepositoryInterface { /** - * @param \Magento\Framework\Api\SearchCriteria $criteria - * @return \Magento\Sales\Api\Data\ShipmentTrackSearchResultInterface + * Lists shipment tracks that match specified search criteria. + * + * @param \Magento\Framework\Api\SearchCriteria $criteria The search criteria. + * @return \Magento\Sales\Api\Data\ShipmentTrackSearchResultInterface Shipment track search result interface. */ public function getList(\Magento\Framework\Api\SearchCriteria $criteria); /** - * Load entity + * Loads a specified shipment track. * - * @param int $id - * @return \Magento\Sales\Api\Data\ShipmentTrackInterface + * @param int $id The shipment track ID. + * @return \Magento\Sales\Api\Data\ShipmentTrackInterface Shipment track interface. */ public function get($id); /** - * Delete entity + * Deletes a specified shipment track. * - * @param \Magento\Sales\Api\Data\ShipmentTrackInterface $entity + * @param \Magento\Sales\Api\Data\ShipmentTrackInterface $entity The shipment track. * @return bool */ public function delete(\Magento\Sales\Api\Data\ShipmentTrackInterface $entity); /** - * Perform persist operations for one entity + * Performs persist operations for a specified shipment track. * - * @param \Magento\Sales\Api\Data\ShipmentTrackInterface $entity - * @return \Magento\Sales\Api\Data\ShipmentTrackInterface + * @param \Magento\Sales\Api\Data\ShipmentTrackInterface $entity The shipment track. + * @return \Magento\Sales\Api\Data\ShipmentTrackInterface Shipment track interface. */ public function save(\Magento\Sales\Api\Data\ShipmentTrackInterface $entity); /** - * Delete entity by Id - * @param int $id + * Deletes a specified shipment track by ID. + * + * @param int $id The shipment track ID. * @return bool */ public function deleteById($id); diff --git a/app/code/Magento/Sales/Api/TransactionRepositoryInterface.php b/app/code/Magento/Sales/Api/TransactionRepositoryInterface.php index 4d5e755263619..67e6cfec367c5 100644 --- a/app/code/Magento/Sales/Api/TransactionRepositoryInterface.php +++ b/app/code/Magento/Sales/Api/TransactionRepositoryInterface.php @@ -5,37 +5,41 @@ namespace Magento\Sales\Api; /** - * Interface TransactionRepositoryInterface + * Transaction repository interface. + * + * A transaction is an interaction between a merchant and a customer such as a purchase, a credit, a refund, and so on. */ interface TransactionRepositoryInterface { /** - * @param \Magento\Framework\Api\SearchCriteria $criteria - * @return \Magento\Sales\Api\Data\TransactionSearchResultInterface + * Lists transactions that match specified search criteria. + * + * @param \Magento\Framework\Api\SearchCriteria $criteria The search criteria. + * @return \Magento\Sales\Api\Data\TransactionSearchResultInterface Transaction search result interface. */ public function getList(\Magento\Framework\Api\SearchCriteria $criteria); /** - * Load entity + * Loads a specified transaction. * - * @param int $id - * @return \Magento\Sales\Api\Data\TransactionInterface + * @param int $id The transaction ID. + * @return \Magento\Sales\Api\Data\TransactionInterface Transaction interface. */ public function get($id); /** - * Delete entity + * Deletes a specified transaction. * - * @param \Magento\Sales\Api\Data\TransactionInterface $entity + * @param \Magento\Sales\Api\Data\TransactionInterface $entity The transaction. * @return bool */ public function delete(\Magento\Sales\Api\Data\TransactionInterface $entity); /** - * Perform persist operations for one entity + * Performs persist operations for a specified transaction. * - * @param \Magento\Sales\Api\Data\TransactionInterface $entity - * @return \Magento\Sales\Api\Data\TransactionInterface + * @param \Magento\Sales\Api\Data\TransactionInterface $entity The transaction. + * @return \Magento\Sales\Api\Data\TransactionInterface Transaction interface. */ public function save(\Magento\Sales\Api\Data\TransactionInterface $entity); } diff --git a/app/code/Magento/Sales/Model/Config/Reader.php b/app/code/Magento/Sales/Model/Config/Reader.php index 8f1c904e125d0..7be5bc3c040ab 100644 --- a/app/code/Magento/Sales/Model/Config/Reader.php +++ b/app/code/Magento/Sales/Model/Config/Reader.php @@ -20,6 +20,7 @@ class Reader extends \Magento\Framework\Config\Reader\Filesystem '/config/section' => 'name', '/config/section/group' => 'name', '/config/section/group/item' => 'name', + '/config/section/group/item/renderer' => 'name', '/config/order/available_product_type' => 'name', ]; diff --git a/app/code/Magento/Sales/Model/Order/Creditmemo.php b/app/code/Magento/Sales/Model/Order/Creditmemo.php index 324f9af688ddb..b8ef9173022b8 100644 --- a/app/code/Magento/Sales/Model/Order/Creditmemo.php +++ b/app/code/Magento/Sales/Model/Order/Creditmemo.php @@ -297,6 +297,7 @@ public function getShippingAddress() public function getItemsCollection() { $collection = $this->_cmItemCollectionFactory->create()->setCreditmemoFilter($this->getId()); + if ($this->getId()) { foreach ($collection as $item) { $item->setCreditmemo($this); diff --git a/app/code/Magento/Sales/Model/Quote.php b/app/code/Magento/Sales/Model/Quote.php index 1f94e48474048..2a3013319bd2f 100644 --- a/app/code/Magento/Sales/Model/Quote.php +++ b/app/code/Magento/Sales/Model/Quote.php @@ -746,7 +746,6 @@ public function addCustomerAddress(\Magento\Customer\Api\Data\AddressInterface $ ->setAddresses($addresses) ->create(); $this->setCustomer($customer); - return $this; } diff --git a/app/code/Magento/Sales/Model/Resource/Entity.php b/app/code/Magento/Sales/Model/Resource/Entity.php index 94a94466b9b06..9331aff68ade4 100644 --- a/app/code/Magento/Sales/Model/Resource/Entity.php +++ b/app/code/Magento/Sales/Model/Resource/Entity.php @@ -126,6 +126,22 @@ protected function _afterSave(\Magento\Framework\Model\AbstractModel $object) if ($this->gridAggregator) { $this->gridAggregator->refresh($object->getId()); } + + $adapter = $this->_getReadAdapter(); + $columns = $adapter->describeTable($this->getMainTable()); + + if (isset($columns['created_at'], $columns['updated_at'])) { + $select = $adapter->select() + ->from($this->getMainTable(), ['created_at', 'updated_at']) + ->where($this->getIdFieldName() . ' = :entity_id'); + $row = $adapter->fetchRow($select, [':entity_id' => $object->getId()]); + + if (is_array($row) && isset($row['created_at'], $row['updated_at'])) { + $object->setCreatedAt($row['created_at']); + $object->setUpdatedAt($row['updated_at']); + } + } + parent::_afterSave($object); return $this; } diff --git a/app/code/Magento/Sales/Model/Resource/Order.php b/app/code/Magento/Sales/Model/Resource/Order.php index 12e3071d9e784..08f92e636d516 100644 --- a/app/code/Magento/Sales/Model/Resource/Order.php +++ b/app/code/Magento/Sales/Model/Resource/Order.php @@ -146,8 +146,8 @@ protected function _beforeSave(\Magento\Framework\Model\AbstractModel $object) $store->getName(), ]; $object->setStoreName(implode("\n", $name)); + $object->setTotalItemCount($this->calculateItems($object)); } - $object->setTotalItemCount($this->calculateItems($object)); $object->setData( 'protect_code', substr(md5(uniqid(Random::getRandomNumber(), true) . ':' . microtime(true)), 5, 6) diff --git a/app/code/Magento/Sales/composer.json b/app/code/Magento/Sales/composer.json index 6d804ffd3b84c..a1b36f44f8929 100644 --- a/app/code/Magento/Sales/composer.json +++ b/app/code/Magento/Sales/composer.json @@ -3,32 +3,32 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha108", - "magento/module-catalog": "0.1.0-alpha108", - "magento/module-customer": "0.1.0-alpha108", - "magento/module-authorization": "0.1.0-alpha108", - "magento/module-payment": "0.1.0-alpha108", - "magento/module-core": "0.1.0-alpha108", - "magento/module-checkout": "0.1.0-alpha108", - "magento/module-theme": "0.1.0-alpha108", - "magento/module-sales-rule": "0.1.0-alpha108", - "magento/module-backend": "0.1.0-alpha108", - "magento/module-widget": "0.1.0-alpha108", - "magento/module-directory": "0.1.0-alpha108", - "magento/module-eav": "0.1.0-alpha108", - "magento/module-tax": "0.1.0-alpha108", - "magento/module-gift-message": "0.1.0-alpha108", - "magento/module-reports": "0.1.0-alpha108", - "magento/module-catalog-inventory": "0.1.0-alpha108", - "magento/module-wishlist": "0.1.0-alpha108", - "magento/module-email": "0.1.0-alpha108", - "magento/module-shipping": "0.1.0-alpha108", - "magento/framework": "0.1.0-alpha108", - "magento/module-ui": "0.1.0-alpha108", + "magento/module-store": "0.42.0-beta1", + "magento/module-catalog": "0.42.0-beta1", + "magento/module-customer": "0.42.0-beta1", + "magento/module-authorization": "0.42.0-beta1", + "magento/module-payment": "0.42.0-beta1", + "magento/module-core": "0.42.0-beta1", + "magento/module-checkout": "0.42.0-beta1", + "magento/module-theme": "0.42.0-beta1", + "magento/module-sales-rule": "0.42.0-beta1", + "magento/module-backend": "0.42.0-beta1", + "magento/module-widget": "0.42.0-beta1", + "magento/module-directory": "0.42.0-beta1", + "magento/module-eav": "0.42.0-beta1", + "magento/module-tax": "0.42.0-beta1", + "magento/module-gift-message": "0.42.0-beta1", + "magento/module-reports": "0.42.0-beta1", + "magento/module-catalog-inventory": "0.42.0-beta1", + "magento/module-wishlist": "0.42.0-beta1", + "magento/module-email": "0.42.0-beta1", + "magento/module-shipping": "0.42.0-beta1", + "magento/framework": "0.42.0-beta1", + "magento/module-ui": "0.42.0-beta1", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha108", + "version": "0.42.0-beta1", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Sales/sql/sales_setup/install-2.0.0.php b/app/code/Magento/Sales/sql/sales_setup/install-2.0.0.php index 6c0e7fb3e6c0e..5b60d80169151 100644 --- a/app/code/Magento/Sales/sql/sales_setup/install-2.0.0.php +++ b/app/code/Magento/Sales/sql/sales_setup/install-2.0.0.php @@ -3147,6 +3147,12 @@ '12,4', [], 'Base Hidden Tax Amount' +)->addColumn( + 'tax_ratio', + \Magento\Framework\DB\Ddl\Table::TYPE_TEXT, + 512, + [], + 'Ratio of tax invoiced over tax of the order item' )->addIndex( $this->getIdxName('sales_invoice_item', ['parent_id']), ['parent_id'] @@ -3893,6 +3899,12 @@ '12,4', [], 'Base Hidden Tax Amount' +)->addColumn( + 'tax_ratio', + \Magento\Framework\DB\Ddl\Table::TYPE_TEXT, + 512, + [], + 'Ratio of tax in the creditmemo item over tax of the order item' )->addIndex( $this->getIdxName('sales_creditmemo_item', ['parent_id']), ['parent_id'] diff --git a/app/code/Magento/SalesRule/composer.json b/app/code/Magento/SalesRule/composer.json index f81f1bde2345c..b6346dfd07ba6 100644 --- a/app/code/Magento/SalesRule/composer.json +++ b/app/code/Magento/SalesRule/composer.json @@ -3,25 +3,25 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha108", - "magento/module-rule": "0.1.0-alpha108", - "magento/module-catalog": "0.1.0-alpha108", - "magento/module-sales": "0.1.0-alpha108", - "magento/module-eav": "0.1.0-alpha108", - "magento/module-core": "0.1.0-alpha108", - "magento/module-backend": "0.1.0-alpha108", - "magento/module-customer": "0.1.0-alpha108", - "magento/module-directory": "0.1.0-alpha108", - "magento/module-shipping": "0.1.0-alpha108", - "magento/module-payment": "0.1.0-alpha108", - "magento/module-reports": "0.1.0-alpha108", - "magento/module-catalog-rule": "0.1.0-alpha108", - "magento/module-widget": "0.1.0-alpha108", - "magento/framework": "0.1.0-alpha108", + "magento/module-store": "0.42.0-beta1", + "magento/module-rule": "0.42.0-beta1", + "magento/module-catalog": "0.42.0-beta1", + "magento/module-sales": "0.42.0-beta1", + "magento/module-eav": "0.42.0-beta1", + "magento/module-core": "0.42.0-beta1", + "magento/module-backend": "0.42.0-beta1", + "magento/module-customer": "0.42.0-beta1", + "magento/module-directory": "0.42.0-beta1", + "magento/module-shipping": "0.42.0-beta1", + "magento/module-payment": "0.42.0-beta1", + "magento/module-reports": "0.42.0-beta1", + "magento/module-catalog-rule": "0.42.0-beta1", + "magento/module-widget": "0.42.0-beta1", + "magento/framework": "0.42.0-beta1", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha108", + "version": "0.42.0-beta1", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Search/Controller/Adminhtml/Term/Index.php b/app/code/Magento/Search/Controller/Adminhtml/Term/Index.php index 291c813879bec..80150d7248ef2 100644 --- a/app/code/Magento/Search/Controller/Adminhtml/Term/Index.php +++ b/app/code/Magento/Search/Controller/Adminhtml/Term/Index.php @@ -13,7 +13,7 @@ class Index extends \Magento\Search\Controller\Adminhtml\Term public function execute() { $resultPage = $this->createPage(); - $resultPage->getPage()->getConfig()->getTitle()->prepend(__('Search Terms')); + $resultPage->getConfig()->getTitle()->prepend(__('Search Terms')); $resultPage->addBreadcrumb(__('Search'), __('Search')); return $resultPage; } diff --git a/app/code/Magento/Search/composer.json b/app/code/Magento/Search/composer.json index eba2fa71e5b23..b629eee559fbc 100644 --- a/app/code/Magento/Search/composer.json +++ b/app/code/Magento/Search/composer.json @@ -3,14 +3,14 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/framework": "0.1.0-alpha108", - "magento/module-backend": "0.1.0-alpha108", - "magento/module-store": "0.1.0-alpha108", - "magento/module-reports": "0.1.0-alpha108", + "magento/framework": "0.42.0-beta1", + "magento/module-backend": "0.42.0-beta1", + "magento/module-store": "0.42.0-beta1", + "magento/module-reports": "0.42.0-beta1", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha108", + "version": "0.42.0-beta1", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Sendfriend/composer.json b/app/code/Magento/Sendfriend/composer.json index 4de648ebc2aa2..1024ff1f3318d 100644 --- a/app/code/Magento/Sendfriend/composer.json +++ b/app/code/Magento/Sendfriend/composer.json @@ -3,16 +3,16 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha108", - "magento/module-catalog": "0.1.0-alpha108", - "magento/module-core": "0.1.0-alpha108", - "magento/module-customer": "0.1.0-alpha108", - "magento/module-theme": "0.1.0-alpha108", - "magento/framework": "0.1.0-alpha108", + "magento/module-store": "0.42.0-beta1", + "magento/module-catalog": "0.42.0-beta1", + "magento/module-core": "0.42.0-beta1", + "magento/module-customer": "0.42.0-beta1", + "magento/module-theme": "0.42.0-beta1", + "magento/framework": "0.42.0-beta1", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha108", + "version": "0.42.0-beta1", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Shipping/composer.json b/app/code/Magento/Shipping/composer.json index fd8deb4b4397b..7eaa767a4deec 100644 --- a/app/code/Magento/Shipping/composer.json +++ b/app/code/Magento/Shipping/composer.json @@ -3,27 +3,27 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha108", - "magento/module-core": "0.1.0-alpha108", - "magento/module-catalog": "0.1.0-alpha108", - "magento/module-sales": "0.1.0-alpha108", - "magento/module-backend": "0.1.0-alpha108", - "magento/module-directory": "0.1.0-alpha108", - "magento/module-contact": "0.1.0-alpha108", - "magento/module-customer": "0.1.0-alpha108", - "magento/module-payment": "0.1.0-alpha108", - "magento/module-tax": "0.1.0-alpha108", - "magento/module-catalog-inventory": "0.1.0-alpha108", - "magento/framework": "0.1.0-alpha108", + "magento/module-store": "0.42.0-beta1", + "magento/module-core": "0.42.0-beta1", + "magento/module-catalog": "0.42.0-beta1", + "magento/module-sales": "0.42.0-beta1", + "magento/module-backend": "0.42.0-beta1", + "magento/module-directory": "0.42.0-beta1", + "magento/module-contact": "0.42.0-beta1", + "magento/module-customer": "0.42.0-beta1", + "magento/module-payment": "0.42.0-beta1", + "magento/module-tax": "0.42.0-beta1", + "magento/module-catalog-inventory": "0.42.0-beta1", + "magento/framework": "0.42.0-beta1", "ext-gd": "*", "magento/magento-composer-installer": "*" }, "suggest": { - "magento/module-fedex": "0.1.0-alpha108", - "magento/module-ups": "0.1.0-alpha108" + "magento/module-fedex": "0.42.0-beta1", + "magento/module-ups": "0.42.0-beta1" }, "type": "magento2-module", - "version": "0.1.0-alpha108", + "version": "0.42.0-beta1", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Shipping/view/adminhtml/templates/order/packaging/popup.phtml b/app/code/Magento/Shipping/view/adminhtml/templates/order/packaging/popup.phtml index 039a0c66df8d5..270a0dacd178e 100644 --- a/app/code/Magento/Shipping/view/adminhtml/templates/order/packaging/popup.phtml +++ b/app/code/Magento/Shipping/view/adminhtml/templates/order/packaging/popup.phtml @@ -105,7 +105,7 @@ require([ $customsValueValidation = ''; } ?> - > + > [getCustomValueCurrencyCode(); ?>] diff --git a/app/code/Magento/Sitemap/composer.json b/app/code/Magento/Sitemap/composer.json index 0434892300242..e8b37f4c468cb 100644 --- a/app/code/Magento/Sitemap/composer.json +++ b/app/code/Magento/Sitemap/composer.json @@ -3,18 +3,18 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha108", - "magento/module-catalog": "0.1.0-alpha108", - "magento/module-core": "0.1.0-alpha108", - "magento/module-eav": "0.1.0-alpha108", - "magento/module-cms": "0.1.0-alpha108", - "magento/module-backend": "0.1.0-alpha108", - "magento/module-catalog-url-rewrite": "0.1.0-alpha108", - "magento/framework": "0.1.0-alpha108", + "magento/module-store": "0.42.0-beta1", + "magento/module-catalog": "0.42.0-beta1", + "magento/module-core": "0.42.0-beta1", + "magento/module-eav": "0.42.0-beta1", + "magento/module-cms": "0.42.0-beta1", + "magento/module-backend": "0.42.0-beta1", + "magento/module-catalog-url-rewrite": "0.42.0-beta1", + "magento/framework": "0.42.0-beta1", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha108", + "version": "0.42.0-beta1", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Store/Model/Store.php b/app/code/Magento/Store/Model/Store.php index becd8fa2819b2..2d51a5f161858 100644 --- a/app/code/Magento/Store/Model/Store.php +++ b/app/code/Magento/Store/Model/Store.php @@ -1177,7 +1177,8 @@ public function setCookie() { $cookieMetadata = $this->_cookieMetadataFactory->createPublicCookieMetadata() ->setHttpOnly(true) - ->setDurationOneYear(); + ->setDurationOneYear() + ->setPath($this->getStorePath()); $this->_cookieManager->setPublicCookie( self::COOKIE_NAME, $this->getCode(), @@ -1203,7 +1204,18 @@ public function getStoreCodeFromCookie() */ public function deleteCookie() { - $this->_cookieManager->deleteCookie(self::COOKIE_NAME); + $cookieMetadata = $this->_cookieMetadataFactory->createPublicCookieMetadata() + ->setPath($this->getStorePath()); + $this->_cookieManager->deleteCookie(self::COOKIE_NAME, $cookieMetadata); return $this; } + + /** + * @return string + */ + public function getStorePath() + { + $parsedUrl = parse_url($this->getBaseUrl()); + return isset($parsedUrl['path']) ? $parsedUrl['path'] : '/'; + } } diff --git a/app/code/Magento/Store/composer.json b/app/code/Magento/Store/composer.json index 0aac9d8f09e72..80bd98f67ee49 100644 --- a/app/code/Magento/Store/composer.json +++ b/app/code/Magento/Store/composer.json @@ -3,14 +3,14 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-core": "0.1.0-alpha108", - "magento/module-directory": "0.1.0-alpha108", - "magento/module-ui": "0.1.0-alpha108", - "magento/framework": "0.1.0-alpha108", + "magento/module-core": "0.42.0-beta1", + "magento/module-directory": "0.42.0-beta1", + "magento/module-ui": "0.42.0-beta1", + "magento/framework": "0.42.0-beta1", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha108", + "version": "0.42.0-beta1", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Tax/Helper/Data.php b/app/code/Magento/Tax/Helper/Data.php index e0ce1a0427a9e..26e3386435f47 100644 --- a/app/code/Magento/Tax/Helper/Data.php +++ b/app/code/Magento/Tax/Helper/Data.php @@ -150,25 +150,25 @@ class Data extends \Magento\Framework\App\Helper\AbstractHelper protected $priceCurrency; /** - * @param \Magento\Framework\App\Helper\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Framework\Registry $coreRegistry - * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig - * @param Config $taxConfig - * @param \Magento\Store\Model\StoreManagerInterface $storeManager - * @param \Magento\Framework\Locale\FormatInterface $localeFormat - * @param \Magento\Eav\Model\Entity\AttributeFactory $attributeFactory - * @param \Magento\Tax\Model\Resource\Sales\Order\Tax\ItemFactory $taxItemFactory + * @param \Magento\Framework\App\Helper\Context $context + * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\Framework\Registry $coreRegistry + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig + * @param Config $taxConfig + * @param \Magento\Store\Model\StoreManagerInterface $storeManager + * @param \Magento\Framework\Locale\FormatInterface $localeFormat + * @param \Magento\Eav\Model\Entity\AttributeFactory $attributeFactory + * @param \Magento\Tax\Model\Resource\Sales\Order\Tax\ItemFactory $taxItemFactory * @param \Magento\Tax\Model\Resource\Sales\Order\Tax\CollectionFactory $orderTaxCollectionFactory - * @param \Magento\Framework\Locale\ResolverInterface $localeResolver - * @param QuoteDetailsDataBuilder $quoteDetailsBuilder - * @param QuoteDetailsItemDataBuilder $quoteDetailsItemBuilder - * @param TaxClassKeyDataBuilder $taxClassKeyBuilder - * @param TaxCalculationInterface $taxCalculation - * @param CustomerSession $customerSession - * @param \Magento\Catalog\Helper\Data $catalogHelper - * @param OrderTaxManagementInterface $orderTaxManagement - * @param PriceCurrencyInterface $priceCurrency + * @param \Magento\Framework\Locale\ResolverInterface $localeResolver + * @param QuoteDetailsDataBuilder $quoteDetailsBuilder + * @param QuoteDetailsItemDataBuilder $quoteDetailsItemBuilder + * @param TaxClassKeyDataBuilder $taxClassKeyBuilder + * @param TaxCalculationInterface $taxCalculation + * @param CustomerSession $customerSession + * @param \Magento\Catalog\Helper\Data $catalogHelper + * @param OrderTaxManagementInterface $orderTaxManagement + * @param PriceCurrencyInterface $priceCurrency */ public function __construct( \Magento\Framework\App\Helper\Context $context, @@ -223,6 +223,7 @@ public function getPostCodeSubStringLength() if ($len <= 0) { $len = 10; } + return $len; } @@ -239,8 +240,8 @@ public function getConfig() /** * Check if product prices inputed include tax * - * @param null|int|string|Store $store - * @return bool + * @param null|int|string|Store $store + * @return bool */ public function priceIncludesTax($store = null) { @@ -250,8 +251,8 @@ public function priceIncludesTax($store = null) /** * Check what taxes should be applied after discount * - * @param null|int|string|Store $store - * @return bool + * @param null|int|string|Store $store + * @return bool */ public function applyTaxAfterDiscount($store = null) { @@ -264,7 +265,7 @@ public function applyTaxAfterDiscount($store = null) * 2 - Including tax * 3 - Both * - * @param null|int|string|Store $store + * @param null|int|string|Store $store * @return int */ public function getPriceDisplayType($store = null) @@ -276,7 +277,7 @@ public function getPriceDisplayType($store = null) * Check if necessary do product price conversion * If it necessary will be returned conversion type (minus or plus) * - * @param null|int|string|Store $store + * @param null|int|string|Store $store * @return bool */ public function needPriceConversion($store = null) @@ -287,7 +288,7 @@ public function needPriceConversion($store = null) /** * Check if need display full tax summary information in totals block * - * @param null|int|string|Store $store + * @param null|int|string|Store $store * @return bool */ public function displayFullSummary($store = null) @@ -298,7 +299,7 @@ public function displayFullSummary($store = null) /** * Check if need display zero tax in subtotal * - * @param null|int|string|Store $store + * @param null|int|string|Store $store * @return bool */ public function displayZeroTax($store = null) @@ -309,7 +310,7 @@ public function displayZeroTax($store = null) /** * Check if need display cart prices included tax * - * @param null|int|string|Store $store + * @param null|int|string|Store $store * @return bool */ public function displayCartPriceInclTax($store = null) @@ -320,7 +321,7 @@ public function displayCartPriceInclTax($store = null) /** * Check if need display cart prices excluding price * - * @param null|int|string|Store $store + * @param null|int|string|Store $store * @return bool */ public function displayCartPriceExclTax($store = null) @@ -331,7 +332,7 @@ public function displayCartPriceExclTax($store = null) /** * Check if need display cart prices excluding and including tax * - * @param null|int|string|Store $store + * @param null|int|string|Store $store * @return bool */ public function displayCartBothPrices($store = null) @@ -342,7 +343,7 @@ public function displayCartBothPrices($store = null) /** * Check if need display order prices included tax * - * @param null|int|string|Store $store + * @param null|int|string|Store $store * @return bool */ public function displaySalesPriceInclTax($store = null) @@ -353,7 +354,7 @@ public function displaySalesPriceInclTax($store = null) /** * Check if need display order prices excluding price * - * @param null|int|string|Store $store + * @param null|int|string|Store $store * @return bool */ public function displaySalesPriceExclTax($store = null) @@ -364,7 +365,7 @@ public function displaySalesPriceExclTax($store = null) /** * Check if need display order prices excluding and including tax * - * @param null|int|string|Store $store + * @param null|int|string|Store $store * @return bool */ public function displaySalesBothPrices($store = null) @@ -375,7 +376,7 @@ public function displaySalesBothPrices($store = null) /** * Check if we need display price include and exclude tax for order/invoice subtotal * - * @param null|int|string|Store $store + * @param null|int|string|Store $store * @return bool */ public function displaySalesSubtotalBoth($store = null) @@ -386,7 +387,7 @@ public function displaySalesSubtotalBoth($store = null) /** * Check if we need display price include tax for order/invoice subtotal * - * @param null|int|string|Store $store + * @param null|int|string|Store $store * @return bool */ public function displaySalesSubtotalInclTax($store = null) @@ -397,7 +398,7 @@ public function displaySalesSubtotalInclTax($store = null) /** * Check if we need display price exclude tax for order/invoice subtotal * - * @param null|int|string|Store $store + * @param null|int|string|Store $store * @return bool */ public function displaySalesSubtotalExclTax($store = null) @@ -408,7 +409,7 @@ public function displaySalesSubtotalExclTax($store = null) /** * Get prices javascript format json * - * @param null|int|string|Store $store + * @param null|int|string|Store $store * @return string */ public function getPriceFormat($store = null) @@ -419,6 +420,7 @@ public function getPriceFormat($store = null) if ($store) { $priceFormat['pattern'] = $this->_storeManager->getStore($store)->getCurrentCurrency()->getOutputFormat(); } + return $this->_coreData->jsonEncode($priceFormat); } @@ -456,7 +458,7 @@ public function displayBothPrices($store = null) /** * Check if shipping prices include tax * - * @param null|string|bool|int|Store $store + * @param null|string|bool|int|Store $store * @return bool */ public function shippingPriceIncludesTax($store = null) @@ -467,7 +469,7 @@ public function shippingPriceIncludesTax($store = null) /** * Get shipping price display type * - * @param null|string|bool|int|Store $store + * @param null|string|bool|int|Store $store * @return int */ public function getShippingPriceDisplayType($store = null) @@ -508,7 +510,7 @@ public function displayShippingBothPrices() /** * Get tax class id specified for shipping tax estimation * - * @param null|string|bool|int|Store $store + * @param null|string|bool|int|Store $store * @return int */ public function getShippingTaxClass($store) @@ -519,11 +521,11 @@ public function getShippingTaxClass($store) /** * Get shipping price * - * @param float $price - * @param bool|null $includingTax - * @param Address|null $shippingAddress - * @param int|null $ctc - * @param null|string|bool|int|Store $store + * @param float $price + * @param bool|null $includingTax + * @param Address|null $shippingAddress + * @param int|null $ctc + * @param null|string|bool|int|Store $store * @return float */ public function getShippingPrice($price, $includingTax = null, $shippingAddress = null, $ctc = null, $store = null) @@ -546,13 +548,14 @@ public function getShippingPrice($price, $includingTax = null, $shippingAddress $store, $this->shippingPriceIncludesTax($store) ); + return $price; } /** * Get configuration setting "Apply Discount On Prices Including Tax" value * - * @param null|string|bool|int|Store $store + * @param null|string|bool|int|Store $store * @return bool */ public function discountTax($store = null) @@ -563,7 +566,7 @@ public function discountTax($store = null) /** * Get value of "Apply Tax On" custom/original price configuration settings * - * @param null|string|bool|int|Store $store + * @param null|string|bool|int|Store $store * @return string|null */ public function getTaxBasedOn($store = null) @@ -578,12 +581,12 @@ public function getTaxBasedOn($store = null) /** * Check if tax can be applied to custom price * - * @param null|string|bool|int|Store $store + * @param null|string|bool|int|Store $store * @return bool */ public function applyTaxOnCustomPrice($store = null) { - return (int)$this->_scopeConfig->getValue( + return (int) $this->_scopeConfig->getValue( Config::CONFIG_XML_PATH_APPLY_ON, \Magento\Store\Model\ScopeInterface::SCOPE_STORE, $store @@ -593,12 +596,12 @@ public function applyTaxOnCustomPrice($store = null) /** * Check if tax should be applied just to original price * - * @param null|string|bool|int|Store $store + * @param null|string|bool|int|Store $store * @return bool */ public function applyTaxOnOriginalPrice($store = null) { - return (int)$this->_scopeConfig->getValue( + return (int) $this->_scopeConfig->getValue( Config::CONFIG_XML_PATH_APPLY_ON, \Magento\Store\Model\ScopeInterface::SCOPE_STORE, $store @@ -611,7 +614,7 @@ public function applyTaxOnOriginalPrice($store = null) * This sequence depends on "Catalog price include tax", "Apply Tax After Discount" * and "Apply Discount On Prices Including Tax" configuration options. * - * @param null|int|string|Store $store + * @param null|int|string|Store $store * @return string */ public function getCalculationSequence($store = null) @@ -622,7 +625,7 @@ public function getCalculationSequence($store = null) /** * Get tax calculation algorithm code * - * @param null|string|bool|int|Store $store + * @param null|string|bool|int|Store $store * @return string */ public function getCalculationAgorithm($store = null) @@ -643,7 +646,7 @@ public function getCalculationAgorithm($store = null) * ) * ) * - * @param \Magento\Sales\Model\Order|\Magento\Sales\Model\Order\Invoice|\Magento\Sales\Model\Order\Creditmemo $source + * @param \Magento\Sales\Model\Order|\Magento\Sales\Model\Order\Invoice|\Magento\Sales\Model\Order\Creditmemo $source * @return array */ public function getCalculatedTaxes($source) @@ -683,9 +686,9 @@ public function getCalculatedTaxes($source) * ) * ) * - * @param array $taxClassAmount - * @param OrderTaxDetailsItemInterface $itemTaxDetail - * @param float $ratio + * @param array $taxClassAmount + * @param OrderTaxDetailsItemInterface $itemTaxDetail + * @param float $ratio * @return array */ private function _aggregateTaxes($taxClassAmount, OrderTaxDetailsItemInterface $itemTaxDetail, $ratio) @@ -709,13 +712,14 @@ private function _aggregateTaxes($taxClassAmount, OrderTaxDetailsItemInterface $ $taxClassAmount[$taxCode]['base_tax_amount'] += $baseTaxAmount; } } + return $taxClassAmount; } /** * Returns the array of tax rates for the order * - * @param \Magento\Sales\Model\Order $order + * @param \Magento\Sales\Model\Order $order * @return array */ protected function _getTaxRateSubtotals($order) @@ -752,16 +756,16 @@ public function getDefaultProductTaxClass() /** * Return whether cross border trade is enabled or not * - * @param null|int|string|Store $store - * @return bool + * @param null|int|string|Store $store + * @return bool */ public function isCrossBorderTradeEnabled($store = null) { - return (bool)$this->_config->crossBorderTradeEnabled($store); + return (bool) $this->_config->crossBorderTradeEnabled($store); } /** - * @param EntityInterface $current + * @param EntityInterface $current * @return array */ protected function calculateTaxForOrder(EntityInterface $current) @@ -777,12 +781,13 @@ protected function calculateTaxForOrder(EntityInterface $current) $taxClassAmount[$taxCode]['title'] = $appliedTax->getTitle(); $taxClassAmount[$taxCode]['percent'] = $appliedTax->getPercent(); } + return $taxClassAmount; } /** - * @param EntityInterface $order - * @param EntityInterface $salesItem + * @param EntityInterface $order + * @param EntityInterface $salesItem * @return array */ protected function calculateTaxForItems(EntityInterface $order, EntityInterface $salesItem) @@ -810,7 +815,7 @@ protected function calculateTaxForItems(EntityInterface $order, EntityInterface // Apply any taxes for the items /** @var $item \Magento\Sales\Model\Order\Invoice\Item|\Magento\Sales\Model\Order\Creditmemo\Item */ - foreach ($salesItem->getItemsCollection() as $item) { + foreach ($salesItem->getItems() as $item) { $orderItem = $item->getOrderItem(); $orderItemId = $orderItem->getId(); $orderItemTax = $orderItem->getTaxAmount(); @@ -828,13 +833,17 @@ protected function calculateTaxForItems(EntityInterface $order, EntityInterface } elseif ($itemTaxDetail->getAssociatedItemId() == $orderItemId) { $taxableItemType = $itemTaxDetail->getType(); $ratio = $itemRatio; - if ($item->getTaxRatio() && isset($item->getTaxRatio()[$taxableItemType])) { - $ratio = $item->getTaxRatio()[$taxableItemType]; + if ($item->getTaxRatio()) { + $taxRatio = unserialize($item->getTaxRatio()); + if (isset($taxRatio[$taxableItemType])) { + $ratio = $taxRatio[$taxableItemType]; + } } $taxClassAmount = $this->_aggregateTaxes($taxClassAmount, $itemTaxDetail, $ratio); } } } + return $taxClassAmount; } } diff --git a/app/code/Magento/Tax/Model/Calculation/AbstractCalculator.php b/app/code/Magento/Tax/Model/Calculation/AbstractCalculator.php index 944244b0ab4c0..d871fde75bad8 100644 --- a/app/code/Magento/Tax/Model/Calculation/AbstractCalculator.php +++ b/app/code/Magento/Tax/Model/Calculation/AbstractCalculator.php @@ -160,6 +160,7 @@ public function __construct( /** * Set billing address * + * @codeCoverageIgnoreStart * @param CustomerAddress $billingAddress * @return void */ @@ -200,6 +201,7 @@ public function setCustomerId($customerId) { $this->customerId = $customerId; } + // @codeCoverageIgnoreEnd /** * Calculate tax details for quote item with given quantity diff --git a/app/code/Magento/Tax/Model/TaxRateCollection.php b/app/code/Magento/Tax/Model/TaxRateCollection.php index c33bb2f0c1412..ddb152ef3210d 100644 --- a/app/code/Magento/Tax/Model/TaxRateCollection.php +++ b/app/code/Magento/Tax/Model/TaxRateCollection.php @@ -35,9 +35,9 @@ class TaxRateCollection extends AbstractServiceCollection * @param EntityFactory $entityFactory * @param FilterBuilder $filterBuilder * @param SearchCriteriaBuilder $searchCriteriaBuilder + * @param SortOrderBuilder $sortOrderBuilder * @param TaxRateRepositoryInterface $rateService * @param \Magento\Tax\Model\Calculation\Rate\Converter $rateConverter - * @param SortOrderBuilder $sortOrderBuilder */ public function __construct( EntityFactory $entityFactory, diff --git a/app/code/Magento/Tax/Model/TaxRuleCollection.php b/app/code/Magento/Tax/Model/TaxRuleCollection.php index b47797af4d86e..0e95e9f78d811 100644 --- a/app/code/Magento/Tax/Model/TaxRuleCollection.php +++ b/app/code/Magento/Tax/Model/TaxRuleCollection.php @@ -29,8 +29,8 @@ class TaxRuleCollection extends AbstractServiceCollection * @param EntityFactory $entityFactory * @param FilterBuilder $filterBuilder * @param SearchCriteriaBuilder $searchCriteriaBuilder - * @param TaxRuleRepositoryInterface $ruleService * @param SortOrderBuilder $sortOrderBuilder + * @param TaxRuleRepositoryInterface $ruleService */ public function __construct( EntityFactory $entityFactory, diff --git a/app/code/Magento/Tax/composer.json b/app/code/Magento/Tax/composer.json index 1cc1ae2c1c93e..f064cd1b5adcb 100644 --- a/app/code/Magento/Tax/composer.json +++ b/app/code/Magento/Tax/composer.json @@ -3,22 +3,22 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha108", - "magento/module-catalog": "0.1.0-alpha108", - "magento/module-customer": "0.1.0-alpha108", - "magento/module-core": "0.1.0-alpha108", - "magento/module-backend": "0.1.0-alpha108", - "magento/module-directory": "0.1.0-alpha108", - "magento/module-checkout": "0.1.0-alpha108", - "magento/module-shipping": "0.1.0-alpha108", - "magento/module-eav": "0.1.0-alpha108", - "magento/module-sales": "0.1.0-alpha108", - "magento/module-reports": "0.1.0-alpha108", - "magento/framework": "0.1.0-alpha108", + "magento/module-store": "0.42.0-beta1", + "magento/module-catalog": "0.42.0-beta1", + "magento/module-customer": "0.42.0-beta1", + "magento/module-core": "0.42.0-beta1", + "magento/module-backend": "0.42.0-beta1", + "magento/module-directory": "0.42.0-beta1", + "magento/module-checkout": "0.42.0-beta1", + "magento/module-shipping": "0.42.0-beta1", + "magento/module-eav": "0.42.0-beta1", + "magento/module-sales": "0.42.0-beta1", + "magento/module-reports": "0.42.0-beta1", + "magento/framework": "0.42.0-beta1", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha108", + "version": "0.42.0-beta1", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Tax/view/adminhtml/templates/rate/js.phtml b/app/code/Magento/Tax/view/adminhtml/templates/rate/js.phtml index b632c2e33c4c4..d0237f147110d 100644 --- a/app/code/Magento/Tax/view/adminhtml/templates/rate/js.phtml +++ b/app/code/Magento/Tax/view/adminhtml/templates/rate/js.phtml @@ -10,6 +10,8 @@ require([ ], function(jQuery){ var updater = new RegionUpdater('tax_country_id', 'tax_region', 'tax_region_id', helper('Magento\Directory\Helper\Data')->getRegionJson() ?>, 'disable'); + updater.disableRegionValidation(); + (function ($) { $(document).ready(function () { 'use strict'; diff --git a/app/code/Magento/TaxImportExport/composer.json b/app/code/Magento/TaxImportExport/composer.json index fcc2dc7de627d..6e3cb2bb7fb97 100644 --- a/app/code/Magento/TaxImportExport/composer.json +++ b/app/code/Magento/TaxImportExport/composer.json @@ -3,15 +3,15 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-tax": "0.1.0-alpha108", - "magento/module-backend": "0.1.0-alpha108", - "magento/module-directory": "0.1.0-alpha108", - "magento/module-store": "0.1.0-alpha108", - "magento/framework": "0.1.0-alpha108", + "magento/module-tax": "0.42.0-beta1", + "magento/module-backend": "0.42.0-beta1", + "magento/module-directory": "0.42.0-beta1", + "magento/module-store": "0.42.0-beta1", + "magento/framework": "0.42.0-beta1", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha108", + "version": "0.42.0-beta1", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Theme/Block/Adminhtml/System/Design/Theme.php b/app/code/Magento/Theme/Block/Adminhtml/System/Design/Theme.php index 239dbf69718f7..469630e6a7b61 100644 --- a/app/code/Magento/Theme/Block/Adminhtml/System/Design/Theme.php +++ b/app/code/Magento/Theme/Block/Adminhtml/System/Design/Theme.php @@ -23,7 +23,7 @@ public function _construct() $this->getLayout()->getBlock('page-title')->setPageTitle('Themes'); } - $this->buttonList->update('add', 'label', __('Add New Theme')); + $this->buttonList->remove('add'); } /** diff --git a/app/code/Magento/Theme/composer.json b/app/code/Magento/Theme/composer.json index 2aec9c687ed28..7037f3dd26c4f 100644 --- a/app/code/Magento/Theme/composer.json +++ b/app/code/Magento/Theme/composer.json @@ -3,20 +3,20 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha108", - "magento/module-core": "0.1.0-alpha108", - "magento/module-customer": "0.1.0-alpha108", - "magento/module-backend": "0.1.0-alpha108", - "magento/module-cms": "0.1.0-alpha108", - "magento/framework": "0.1.0-alpha108", - "magento/module-require-js": "0.1.0-alpha108", + "magento/module-store": "0.42.0-beta1", + "magento/module-core": "0.42.0-beta1", + "magento/module-customer": "0.42.0-beta1", + "magento/module-backend": "0.42.0-beta1", + "magento/module-cms": "0.42.0-beta1", + "magento/framework": "0.42.0-beta1", + "magento/module-require-js": "0.42.0-beta1", "magento/magento-composer-installer": "*" }, "suggest": { - "magento/module-translation": "0.1.0-alpha108" + "magento/module-translation": "0.42.0-beta1" }, "type": "magento2-module", - "version": "0.1.0-alpha108", + "version": "0.42.0-beta1", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Theme/view/adminhtml/layouts.xml b/app/code/Magento/Theme/view/adminhtml/layouts.xml index 9892d406f163e..7dd3b63c83542 100644 --- a/app/code/Magento/Theme/view/adminhtml/layouts.xml +++ b/app/code/Magento/Theme/view/adminhtml/layouts.xml @@ -5,6 +5,9 @@ */ --> + + + diff --git a/app/code/Magento/Theme/view/adminhtml/page_layout/admin-empty.xml b/app/code/Magento/Theme/view/adminhtml/page_layout/admin-empty.xml new file mode 100644 index 0000000000000..18678c1e15bd0 --- /dev/null +++ b/app/code/Magento/Theme/view/adminhtml/page_layout/admin-empty.xml @@ -0,0 +1,14 @@ + + + + + + + + + + diff --git a/app/code/Magento/Theme/view/frontend/templates/html/topmenu.phtml b/app/code/Magento/Theme/view/frontend/templates/html/topmenu.phtml index 13298d49f39d8..10a6fd1622d98 100644 --- a/app/code/Magento/Theme/view/frontend/templates/html/topmenu.phtml +++ b/app/code/Magento/Theme/view/frontend/templates/html/topmenu.phtml @@ -12,10 +12,9 @@ ?> getColumnsLimit() ?: 0; ?> getHtml('level-top', 'submenu', $columnsLimit) ?> - + - diff --git a/app/code/Magento/Translation/composer.json b/app/code/Magento/Translation/composer.json index a9d1c7cad17c2..f2615a6f2fbbf 100644 --- a/app/code/Magento/Translation/composer.json +++ b/app/code/Magento/Translation/composer.json @@ -3,14 +3,14 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-core": "0.1.0-alpha108", - "magento/module-store": "0.1.0-alpha108", - "magento/module-backend": "0.1.0-alpha108", - "magento/framework": "0.1.0-alpha108", + "magento/module-core": "0.42.0-beta1", + "magento/module-store": "0.42.0-beta1", + "magento/module-backend": "0.42.0-beta1", + "magento/framework": "0.42.0-beta1", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha108", + "version": "0.42.0-beta1", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Ui/DataProvider/Config/Converter.php b/app/code/Magento/Ui/DataProvider/Config/Converter.php index 08d8b167b096b..f9de00aa191be 100644 --- a/app/code/Magento/Ui/DataProvider/Config/Converter.php +++ b/app/code/Magento/Ui/DataProvider/Config/Converter.php @@ -26,7 +26,7 @@ class Converter implements ConverterInterface 'text' => 'input', 'textarea' => 'textarea', 'multiline' => 'input', - 'date' => 'input', + 'date' => 'date', 'select' => 'select', 'multiselect' => 'multiselect', 'boolean' => 'select', diff --git a/app/code/Magento/Ui/composer.json b/app/code/Magento/Ui/composer.json index e89e925a69078..f6334f24f4e25 100644 --- a/app/code/Magento/Ui/composer.json +++ b/app/code/Magento/Ui/composer.json @@ -3,14 +3,14 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-backend": "0.1.0-alpha108", - "magento/module-store": "0.1.0-alpha108", - "magento/framework": "0.1.0-alpha108", - "magento/module-eav": "0.1.0-alpha108", + "magento/module-backend": "0.42.0-beta1", + "magento/module-store": "0.42.0-beta1", + "magento/framework": "0.42.0-beta1", + "magento/module-eav": "0.42.0-beta1", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha108", + "version": "0.42.0-beta1", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Ui/view/base/layout/ui_components.xml b/app/code/Magento/Ui/view/base/layout/ui_components.xml index befa97ceabc7e..4259756180edd 100644 --- a/app/code/Magento/Ui/view/base/layout/ui_components.xml +++ b/app/code/Magento/Ui/view/base/layout/ui_components.xml @@ -92,6 +92,17 @@ + + + + Magento_Ui/js/form/element/multiselect + + multiselect + ui/form/element/multiselect + + + + diff --git a/app/code/Magento/Ui/view/base/web/js/core/renderer/components/types.js b/app/code/Magento/Ui/view/base/web/js/core/renderer/components/types.js index 4c259b1938443..02630769a7d82 100644 --- a/app/code/Magento/Ui/view/base/web/js/core/renderer/components/types.js +++ b/app/code/Magento/Ui/view/base/web/js/core/renderer/components/types.js @@ -15,6 +15,8 @@ define([ this.types = {}; this.set(types); + + return this; }, set: function(types){ diff --git a/app/code/Magento/Ui/view/base/web/js/core/renderer/renderer.js b/app/code/Magento/Ui/view/base/web/js/core/renderer/renderer.js index cb5a231e8563d..023fcf3bda0b5 100644 --- a/app/code/Magento/Ui/view/base/web/js/core/renderer/renderer.js +++ b/app/code/Magento/Ui/view/base/web/js/core/renderer/renderer.js @@ -12,6 +12,8 @@ define([ initialize: function(data){ this.types = new Types(data.types); this.layout = new Layout(data.layout, this.types); + + return this; }, render: function(data){ diff --git a/app/code/Magento/Ui/view/base/web/js/form.js b/app/code/Magento/Ui/view/base/web/js/form.js index 4fabc0e7999d8..2f4c262c956e8 100644 --- a/app/code/Magento/Ui/view/base/web/js/form.js +++ b/app/code/Magento/Ui/view/base/web/js/form.js @@ -2,14 +2,13 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) */ define([ + 'underscore', 'Magento_Ui/js/form/component', 'Magento_Ui/js/lib/spinner', './form/adapter' -], function (Component, loader, adapter) { +], function (_, Component, loader, adapter) { 'use strict'; - var __super__ = Component.prototype; - function collectData(selector){ var items = document.querySelectorAll(selector), result = {}; @@ -26,11 +25,12 @@ define([ return Component.extend({ initialize: function(){ - __super__.initialize.apply(this, arguments); - - this.initAdapter() + this._super() + .initAdapter() .initSelector() .hideLoader(); + + return this; }, initAdapter: function(){ diff --git a/app/code/Magento/Ui/view/base/web/js/form/client.js b/app/code/Magento/Ui/view/base/web/js/form/client.js index ef2917fdea29c..0f14d56053bf7 100644 --- a/app/code/Magento/Ui/view/base/web/js/form/client.js +++ b/app/code/Magento/Ui/view/base/web/js/form/client.js @@ -47,6 +47,8 @@ define([ */ initialize: function(config) { _.extend(this, defaults, config); + + return this; }, /** diff --git a/app/code/Magento/Ui/view/base/web/js/form/component.js b/app/code/Magento/Ui/view/base/web/js/form/component.js index 4ff4518146b83..1387ff258148b 100644 --- a/app/code/Magento/Ui/view/base/web/js/form/component.js +++ b/app/code/Magento/Ui/view/base/web/js/form/component.js @@ -74,7 +74,9 @@ define([ this.initProperties() .initObservable() .initListeners() - .initUnique() + .initUnique(); + + return this; }, /** diff --git a/app/code/Magento/Ui/view/base/web/js/form/components/area.js b/app/code/Magento/Ui/view/base/web/js/form/components/area.js index cc5416c74285f..cd8e9f9391461 100644 --- a/app/code/Magento/Ui/view/base/web/js/form/components/area.js +++ b/app/code/Magento/Ui/view/base/web/js/form/components/area.js @@ -7,27 +7,22 @@ define([ ], function(_, Tab) { 'use strict'; - var defaults = { - uniqueNs: 'activeArea', - template: 'ui/area', - changed: false, - loading: false - }; - - var __super__ = Tab.prototype; - return Tab.extend({ + defaults: { + uniqueNs: 'activeArea', + template: 'ui/area', + changed: false, + loading: false + }, /** * Extends instance with defaults. Invokes parent initialize method. * Calls initListeners and pushParams methods. */ initialize: function() { - _.extend(this, defaults); - _.bindAll(this, 'onChildrenUpdate', 'onContentLoading', 'onContentLoaded'); - __super__.initialize.apply(this, arguments); + return this._super(); }, /** @@ -36,9 +31,8 @@ define([ * @return {Object} - reference to instance */ initObservable: function() { - __super__.initObservable.apply(this, arguments); - - this.observe('changed loading'); + this._super() + .observe('changed loading'); return this; }, @@ -50,7 +44,7 @@ define([ * @return {Object} - reference to instance */ initElement: function(elem){ - __super__.initElement.apply(this, arguments); + this._super(); elem.on({ 'update': this.onChildrenUpdate, diff --git a/app/code/Magento/Ui/view/base/web/js/form/components/collapsible.js b/app/code/Magento/Ui/view/base/web/js/form/components/collapsible.js index 13ac50f8aa4a3..642a7d2bc5915 100644 --- a/app/code/Magento/Ui/view/base/web/js/form/components/collapsible.js +++ b/app/code/Magento/Ui/view/base/web/js/form/components/collapsible.js @@ -2,27 +2,14 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) */ define([ - 'underscore', 'Magento_Ui/js/form/component' -], function(_, Component) { +], function(Component) { 'use strict'; - var defaults = { - collapsible: false, - opened: true - }; - - var __super__ = Component.prototype; - return Component.extend({ - - /** - * Merges 'defaults' to instance, calls 'initialize' of parent - */ - initialize: function() { - _.extend(this, defaults); - - __super__.initialize.apply(this, arguments); + defaults: { + collapsible: false, + opened: true }, /** @@ -31,9 +18,8 @@ define([ * @return {Object} - reference to instance */ initObservable: function(){ - __super__.initObservable.apply(this, arguments); - - this.observe('opened'); + this._super() + .observe('opened'); return this; }, diff --git a/app/code/Magento/Ui/view/base/web/js/form/components/collection.js b/app/code/Magento/Ui/view/base/web/js/form/components/collection.js index d99f30520030f..54c3f017480a8 100644 --- a/app/code/Magento/Ui/view/base/web/js/form/components/collection.js +++ b/app/code/Magento/Ui/view/base/web/js/form/components/collection.js @@ -2,20 +2,13 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) */ define([ + 'underscore', 'mage/utils', + 'Magento_Ui/js/lib/registry/registry', 'Magento_Ui/js/form/component', - 'underscore', - 'Magento_Ui/js/lib/registry/registry' -], function (utils, Component, _, registry) { +], function (_, utils, registry, Component) { 'use strict'; - var __super__ = Component.prototype; - - var defaults = { - lastIndex: 0, - template: 'ui/form/components/collection' - }; - var childTemplate = { template: "{name}.{itemTemplate}", parent: "{name}", @@ -24,17 +17,20 @@ define([ }; return Component.extend({ + defaults: { + lastIndex: 0, + template: 'ui/form/components/collection' + }, /** * Extends instance with default config, calls initialize of parent * class, calls initChildren method. */ initialize: function () { - _.extend(this, defaults); + this._super() + .initChildren(); - __super__.initialize.apply(this, arguments); - - this.initChildren(); + return this; }, /** @@ -42,12 +38,14 @@ define([ * * @param {Object} elem - Incoming child. */ - initElement: function (elem) { - __super__.initElement.apply(this, arguments); + initElement: function(elem) { + this._super(); elem.activate(); this.trigger('update'); + + return this; }, /** @@ -56,19 +54,18 @@ define([ * * @returns {Collection} Chainable. */ - initChildren: function () { + initChildren: function() { var data = this.provider.data, children = data.get(this.dataScope), initial = this.initialItems = []; - - _.each(children, function(item, index){ + + _.each(children, function(item, index) { initial.push(index); this.addChild(index); }, this); return this; }, - /** * Creates new item of collection, based on incoming 'index'. * If not passed creates one with 'new_' prefix. diff --git a/app/code/Magento/Ui/view/base/web/js/form/components/collection/item.js b/app/code/Magento/Ui/view/base/web/js/form/components/collection/item.js index 8178efb00563a..84874211d8ea0 100644 --- a/app/code/Magento/Ui/view/base/web/js/form/components/collection/item.js +++ b/app/code/Magento/Ui/view/base/web/js/form/components/collection/item.js @@ -2,27 +2,17 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) */ define([ - '../tab', 'underscore', - 'mage/utils' -], function (Tab, _, utils) { + 'mage/utils', + '../tab' +], function (_, utils, Tab) { 'use strict'; - var defaults = { - template: 'ui/form/components/collection/item', - displayArea: 'body', - label: '', - uniqueNs: 'activeCollectionItem', - previewTpl: 'ui/form/components/collection/preview' - }; - var previewConfig = { separator: ' ', prefix: '' }; - var __super__ = Tab.prototype; - /** * Parses incoming data and returnes result merged with default preview config * @@ -42,16 +32,20 @@ define([ } return Tab.extend({ + defaults: { + template: 'ui/form/components/collection/item', + label: '', + uniqueNs: 'activeCollectionItem', + previewTpl: 'ui/form/components/collection/preview' + }, /** * Extends instance with default config, calls initializes of parent class */ initialize: function () { - _.extend(this, defaults); - _.bindAll(this, 'buildPreview', 'hasPreview'); - __super__.initialize.apply(this, arguments); + return this._super(); }, /** @@ -61,7 +55,7 @@ define([ * @return {Object} - reference to instance */ initProperties: function () { - __super__.initProperties.apply(this, arguments); + this._super(); this.displayed = []; @@ -77,7 +71,7 @@ define([ * @return {Object} - reference to instance */ initObservable: function () { - __super__.initObservable.apply(this, arguments); + this._super(); this.observe({ 'noPreview': true, @@ -95,9 +89,10 @@ define([ * @param {Object} elem */ initElement: function (elem) { - __super__.initElement.apply(this, arguments); + this._super() + .insertToIndexed(elem); - this.insertToIndexed(elem); + return this; }, /** diff --git a/app/code/Magento/Ui/view/base/web/js/form/components/fieldset.js b/app/code/Magento/Ui/view/base/web/js/form/components/fieldset.js index 4eb1fb139142f..7414584470629 100644 --- a/app/code/Magento/Ui/view/base/web/js/form/components/fieldset.js +++ b/app/code/Magento/Ui/view/base/web/js/form/components/fieldset.js @@ -2,27 +2,13 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) */ define([ - 'underscore', './collapsible' -], function(_, Collapsible) { +], function(Collapsible) { 'use strict'; - var defaults = { - template: 'ui/fieldset/fieldset' - }; - - var __super__ = Collapsible.prototype; - return Collapsible.extend({ - - /** - * Extends instance with default config, binds required methods - * to instance, calls initialize method of parent class. - */ - initialize: function() { - _.extend(this, defaults); - - __super__.initialize.apply(this, arguments); + defaults: { + template: 'ui/fieldset/fieldset' } }); }); \ No newline at end of file diff --git a/app/code/Magento/Ui/view/base/web/js/form/components/group.js b/app/code/Magento/Ui/view/base/web/js/form/components/group.js index 61300a431a61c..650dfc3321056 100644 --- a/app/code/Magento/Ui/view/base/web/js/form/components/group.js +++ b/app/code/Magento/Ui/view/base/web/js/form/components/group.js @@ -7,18 +7,7 @@ define([ 'mage/utils' ], function(_, Component, utils) { 'use strict'; - - var defaults = { - hidden: false, - label: '', - required: false, - template: 'ui/group/group', - fieldTemplate: 'ui/group/field', - breakLine: true - }; - - var __super__ = Component.prototype; - + function extractData(container, field){ var data, value; @@ -37,6 +26,14 @@ define([ } return Component.extend({ + defaults: { + hidden: false, + label: '', + required: false, + template: 'ui/group/group', + fieldTemplate: 'ui/group/field', + breakLine: true + }, /** * Extends this with defaults and config. @@ -44,12 +41,10 @@ define([ * * @param {Object} config */ - initialize: function() { - _.extend(this, defaults); - + initialize: function() { _.bindAll(this, 'toggle'); - __super__.initialize.apply(this, arguments); + return this._super(); }, /** @@ -59,9 +54,10 @@ define([ * @return {Object} - reference to instance */ initObservable: function(){ - __super__.initObservable.apply(this, arguments); + this._super() + .observe('hidden label required'); - return this.observe('hidden label required'); + return this; }, /** @@ -71,7 +67,7 @@ define([ * @return {Object} - reference to instance */ initElement: function(elem){ - __super__.initElement.apply(this, arguments); + this._super(); elem.on({ 'toggle': this.toggle diff --git a/app/code/Magento/Ui/view/base/web/js/form/components/html.js b/app/code/Magento/Ui/view/base/web/js/form/components/html.js index a1c45636cf5d2..7700d79cab5e8 100644 --- a/app/code/Magento/Ui/view/base/web/js/form/components/html.js +++ b/app/code/Magento/Ui/view/base/web/js/form/components/html.js @@ -8,29 +8,25 @@ define([ ], function($, _, Component) { 'use strict'; - var defaults = { - content: '', - showSpinner: false, - loading: false, - template: 'ui/content/content' - }; - - var __super__ = Component.prototype; - return Component.extend({ + defaults: { + content: '', + showSpinner: false, + loading: false, + template: 'ui/content/content' + }, /** * Extends instance with default config, calls 'initialize' method of * parent, calls 'initAjaxConfig' */ initialize: function() { - _.extend(this, defaults); - - __super__.initialize.apply(this, arguments); - _.bindAll(this, 'onContainerToggle', 'onDataLoaded'); - this.initAjaxConfig(); + this._super() + .initAjaxConfig(); + + return this; }, /** @@ -39,10 +35,9 @@ define([ * * @return {Object} - reference to instance */ - initObservable: function(){ - __super__.initObservable.apply(this, arguments); - - this.observe('content loading'); + initObservable: function() { + this._super() + .observe('content loading'); return this; }, @@ -52,18 +47,18 @@ define([ * * @return {Object} - reference to instance */ - initListeners: function () { - __super__.initListeners.apply(this, arguments); + initListeners: function() { + this._super(); - this.loading.subscribe(function(value){ + this.loading.subscribe(function(value) { this.trigger(value ? 'loading' : 'loaded'); }, this); return this; }, - initContainer: function(parent){ - __super__.initContainer.apply(this, arguments); + initContainer: function(parent) { + this._super(); parent.on('active', this.onContainerToggle); @@ -91,8 +86,8 @@ define([ * * @param {Boolean} active */ - onContainerToggle: function(active){ - if(active && this.shouldLoad()){ + onContainerToggle: function(active) { + if (active && this.shouldLoad()) { this.loadData(); } }, @@ -102,7 +97,7 @@ define([ * * @return {Boolean} [description] */ - hasData: function(){ + hasData: function() { return !!this.content(); }, @@ -111,7 +106,7 @@ define([ * * @return {Boolean} */ - shouldLoad: function(){ + shouldLoad: function() { return this.source && !this.hasData() && !this.loading(); }, @@ -120,7 +115,7 @@ define([ * * @return {Object} - reference to instance */ - loadData: function(){ + loadData: function() { this.loading(true); $.ajax(this.ajaxConfig); @@ -134,9 +129,9 @@ define([ * * @param {String} data */ - onDataLoaded: function(data){ + onDataLoaded: function(data) { this.updateContent(data) - .loading(false); + .loading(false); }, /** @@ -145,7 +140,7 @@ define([ * @param {String} content * @return {Object} - reference to instance */ - updateContent: function(content){ + updateContent: function(content) { this.content(content); return this; diff --git a/app/code/Magento/Ui/view/base/web/js/form/components/tab.js b/app/code/Magento/Ui/view/base/web/js/form/components/tab.js index cccf9bc1f8cc2..cfe3ddc938905 100644 --- a/app/code/Magento/Ui/view/base/web/js/form/components/tab.js +++ b/app/code/Magento/Ui/view/base/web/js/form/components/tab.js @@ -2,31 +2,24 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) */ define([ - 'underscore', '../component' -], function(_, Component) { +], function(Component) { 'use strict'; - var defaults = { - uniqueProp: 'active', - active: false, - wasActivated: false - }; - - var __super__ = Component.prototype; - return Component.extend({ + defaults: { + uniqueProp: 'active', + active: false, + wasActivated: false + }, /** * Extends instance with defaults. Invokes parent initialize method. * Calls initListeners and pushParams methods. */ initialize: function() { - _.extend(this, defaults); - - __super__.initialize.apply(this, arguments); - - this.setUnique(); + this._super() + .setUnique(); }, /** @@ -35,9 +28,8 @@ define([ * @return {Object} - reference to instance */ initObservable: function() { - __super__.initObservable.apply(this, arguments); - - this.observe('active wasActivated'); + this._super() + .observe('active wasActivated'); return this; }, @@ -45,7 +37,7 @@ define([ onUniqueUpdate: function(name){ var active = name === this.name; - __super__.onUniqueUpdate.apply(this, arguments); + this._super(); this.trigger('active', active); }, diff --git a/app/code/Magento/Ui/view/base/web/js/form/components/tab_group.js b/app/code/Magento/Ui/view/base/web/js/form/components/tab_group.js index 86582276b46a5..831d0e84982be 100644 --- a/app/code/Magento/Ui/view/base/web/js/form/components/tab_group.js +++ b/app/code/Magento/Ui/view/base/web/js/form/components/tab_group.js @@ -2,13 +2,12 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) */ define([ + 'underscore', './collapsible', 'Magento_Ui/js/lib/spinner' -], function(Collapsible, loader) { +], function(_, Collapsible, loader) { 'use strict'; - var __super__ = Collapsible.prototype; - return Collapsible.extend({ /** @@ -18,9 +17,8 @@ define([ * @returns {Object} - reference to instance */ initElement: function(elem){ - __super__.initElement.apply(this, arguments); - - this.initActivation(elem) + this._super() + .initActivation(elem) .hideLoader(); return this; @@ -35,7 +33,7 @@ define([ var data = this.provider.data, handler = this.onValidate.bind(this); - __super__.initListeners.apply(this, arguments); + this._super(); data.on('validate', handler, this.name); @@ -45,8 +43,9 @@ define([ /** * Activates element if one is first or if one has 'active' propert * set to true. + * * @param {Object} elem - * @return {Object} - reference to instance + * @returns {Object} - reference to instance */ initActivation: function(elem){ var elems = this.elems(), @@ -68,6 +67,7 @@ define([ * of params storage, and if defined, activates element, sets * 'allValid' property of instance to false and sets invalid's * 'focused' property to true. + * * @param {Object} elem */ validate: function(elem){ diff --git a/app/code/Magento/Ui/view/base/web/js/form/element/abstract.js b/app/code/Magento/Ui/view/base/web/js/form/element/abstract.js index a09d7fe8ed96c..553df7c5a7f38 100644 --- a/app/code/Magento/Ui/view/base/web/js/form/element/abstract.js +++ b/app/code/Magento/Ui/view/base/web/js/form/element/abstract.js @@ -8,28 +8,34 @@ define([ 'Magento_Ui/js/lib/validation/validator' ], function (_, utils, Component, validator) { 'use strict'; - - var defaults = { - hidden: false, - preview: '', - focused: false, - tooltip: null, - required: false, - disabled: false, - tmpPath: 'ui/form/element/', - tooltipTpl: 'ui/form/element/helper/tooltip', - input_type: 'input', - placeholder: null, - noticeid: null, - description: '', - label: '', - error: '', - notice: null - }; - - var __super__ = Component.prototype; + + /** + * Checks wether the incoming value is not empty, + * e.g. not 'null' or 'undefined' + * + * @param {*} value - Value to check. + * @returns {Boolean} + */ + function isEmpty(value){ + return _.isUndefined(value) || _.isNull(value); + } return Component.extend({ + defaults: { + hidden: false, + preview: '', + focused: false, + required: false, + disabled: false, + tmpPath: 'ui/form/element/', + tooltipTpl: 'ui/form/element/helper/tooltip', + input_type: 'input', + placeholder: '', + description: '', + label: '', + error: '', + notice: '' + }, /** * Invokes initialize method of parent class, contains initialization @@ -38,14 +44,13 @@ define([ * @param {Object} config - form element configuration */ initialize: function () { - _.extend(this, defaults); - _.bindAll(this, 'onUpdate', 'reset'); - __super__.initialize.apply(this, arguments); - - this.setHidden(this.hidden()) + this._super() + .setHidden(this.hidden()) .store(this.value()); + + return this; }, /** @@ -54,18 +59,15 @@ define([ * @returns {Abstract} Chainable. */ initObservable: function () { - var value = this.getInititalValue(), - rules; - - __super__.initObservable.apply(this, arguments); + var rules = this.validation = this.validation || {}; - rules = this.validation = this.validation || {}; + this._super(); - this.initialValue = value; + this.initialValue = this.getInititalValue(); this.observe('error disabled focused preview hidden') .observe({ - 'value': value, + 'value': this.initialValue, 'required': !!rules['required-entry'] }); @@ -78,11 +80,14 @@ define([ * @returns {Abstract} Chainable. */ initProperties: function () { - __super__.initProperties.apply(this, arguments); + var uid = utils.uniqueid(); + + this._super(); _.extend(this, { - 'uid': utils.uniqueid(), - 'inputName': utils.serializeName(this.dataScope) + 'uid': uid, + 'noticeId': 'notice-' + this.uid, + 'inputName': utils.serializeName(this.dataScope) }); _.defaults(this, { @@ -101,7 +106,7 @@ define([ var provider = this.provider, data = provider.data; - __super__.initListeners.apply(this, arguments); + this._super(); data.on('reset', this.reset, this.name); @@ -117,22 +122,14 @@ define([ */ getInititalValue: function(){ var data = this.provider.data, - value = data.get(this.dataScope); - - if(_.isUndefined(value) || _.isNull(value)){ - value = ''; - } + values = [data.get(this.dataScope), this.default], + value; - return value; - }, + values.some(function(v){ + return !isEmpty(value = v); + }); - /** - * Defines notice id for the element. - * - * @returns {String} Notice id. - */ - getNoticeId: function () { - return 'notice-' + this.uid; + return isEmpty(value) ? '': value; }, /** @@ -262,6 +259,6 @@ define([ .trigger('update', this.hasChanged()); this.validate(); - }, + } }); }); \ No newline at end of file diff --git a/app/code/Magento/Ui/view/base/web/js/form/element/boolean.js b/app/code/Magento/Ui/view/base/web/js/form/element/boolean.js index 43b6f531b89f7..895d0b95f522a 100644 --- a/app/code/Magento/Ui/view/base/web/js/form/element/boolean.js +++ b/app/code/Magento/Ui/view/base/web/js/form/element/boolean.js @@ -6,8 +6,6 @@ define([ ], function (Abstract) { 'use strict'; - var __super__ = Abstract.prototype; - return Abstract.extend({ /** * Converts the result of parent 'getInitialValue' call to boolean @@ -15,9 +13,7 @@ define([ * @return {Boolean} */ getInititalValue: function(){ - var value = __super__.getInititalValue.apply(this, arguments); - - return !!+value; + return !!+this._super(); }, /** @@ -28,7 +24,7 @@ define([ * @return {Object} - reference to instance */ store: function() { - __super__.store.apply(this, arguments); + this._super(); if (this.hasUnique) { this.setUnique(); diff --git a/app/code/Magento/Ui/view/base/web/js/form/element/multiselect.js b/app/code/Magento/Ui/view/base/web/js/form/element/multiselect.js index 24299eb448b4a..d4adcccd5ac05 100644 --- a/app/code/Magento/Ui/view/base/web/js/form/element/multiselect.js +++ b/app/code/Magento/Ui/view/base/web/js/form/element/multiselect.js @@ -8,28 +8,26 @@ define([ ], function (_, utils, Select) { 'use strict'; - var defaults = { - size: 5, - template: 'ui/form/element/multiselect' - }; - - var __super__ = Select.prototype; - return Select.extend({ + defaults: { + size: 5 + }, /** - * Extends instance with defaults, extends config with formatted values - * and options, and invokes initialize method of AbstractElement class. + * Calls 'getInitialValue' of parent and if the result of it is not empty + * string, returs it, else returnes caption or first found option's value + * + * @returns {Number|String} */ - initialize: function () { - _.extend(this, defaults); - - __super__.initialize.apply(this, arguments); + getInititalValue: function(){ + var value = this._super(); + + return _.isString(value) ? value.split(',') : value; }, /** * Defines if value has changed - * @return {Boolean} + * @returns {Boolean} */ hasChanged: function () { var value = this.value(), @@ -38,4 +36,4 @@ define([ return !utils.identical(value, initial); } }); -}); \ No newline at end of file +}); diff --git a/app/code/Magento/Ui/view/base/web/js/form/element/select.js b/app/code/Magento/Ui/view/base/web/js/form/element/select.js index 0dc58cf2fc48e..9622115017dfd 100644 --- a/app/code/Magento/Ui/view/base/web/js/form/element/select.js +++ b/app/code/Magento/Ui/view/base/web/js/form/element/select.js @@ -8,12 +8,6 @@ define([ ], function (_, utils, Abstract) { 'use strict'; - var defaults = { - template: 'ui/form/element/select' - }; - - var __super__ = Abstract.prototype; - var inputNode = { name: '{index}_input', type: 'input', @@ -87,6 +81,9 @@ define([ } return Abstract.extend({ + defaults: { + template: 'ui/form/element/select' + }, /** * Extends instance with defaults, extends config with formatted values @@ -94,15 +91,14 @@ define([ * If instance's 'customEntry' property is set to true, calls 'initInput' */ initialize: function (config) { - _.extend(this, defaults); - - this.initOptions(config); - - __super__.initialize.apply(this, arguments); + this.initOptions(config) + ._super(); if(this.customEntry){ this.initInput(); } + + return this; }, /** @@ -112,7 +108,7 @@ define([ * @returns {Select} Chainable. */ initObservable: function(){ - __super__.initObservable.apply(this, arguments); + this._super(); this.initialOptions = this.options; @@ -158,7 +154,7 @@ define([ * @returns {Number|String} */ getInititalValue: function(){ - var value = __super__.getInititalValue.apply(this, arguments); + var value = this._super(); if(value !== ''){ return value; diff --git a/app/code/Magento/Ui/view/base/web/js/form/element/textarea.js b/app/code/Magento/Ui/view/base/web/js/form/element/textarea.js index d446d7270550b..3c85f544b1421 100644 --- a/app/code/Magento/Ui/view/base/web/js/form/element/textarea.js +++ b/app/code/Magento/Ui/view/base/web/js/form/element/textarea.js @@ -6,21 +6,11 @@ define([ ], function (Abstract) { 'use strict'; - var defaults = { - cols: 15, - rows: 2, - template: 'ui/form/element/textarea' - }; - return Abstract.extend({ - - /** - * Invokes initialize method of parent class. - */ - initialize: function (config) { - _.extend(this, defaults); - - Abstract.prototype.initialize.apply(this, arguments); + defaults: { + cols: 15, + rows: 2, + template: 'ui/form/element/textarea' } }); }); \ No newline at end of file diff --git a/app/code/Magento/Ui/view/base/web/js/lib/class.js b/app/code/Magento/Ui/view/base/web/js/lib/class.js index a5d741608e854..5d43b55d5bde9 100644 --- a/app/code/Magento/Ui/view/base/web/js/lib/class.js +++ b/app/code/Magento/Ui/view/base/web/js/lib/class.js @@ -6,38 +6,89 @@ define([ ], function(_) { 'use strict'; + var superReg = /\b_super\b/; + + /** + * Checks wether the incoming method contains calls of the '_super' property. + * + * @param {Function} method - Method to be checked. + * @returns {Boolean} + */ + function hasSuper(method){ + return _.isFunction(method) && superReg.test(method); + } + + /** + * Wraps the incoming method to implement support of the '_super' method. + * + * @param {Object} parent - Reference to parents' prototype. + * @param {String} name - Name of the method. + * @param {Function} method - Method to be wrapped. + * @returns {Function} Wrapped method. + */ + function superWrapper(parent, name, method){ + return function(){ + var superTmp = this._super, + args = arguments, + result; + + this._super = function(){ + var superArgs = arguments.length ? arguments : args; + + return parent[name].apply(this, superArgs); + }; + + result = method.apply(this, args); + + this._super = superTmp; + + return result; + } + } + /** * Analogue of Backbone.extend function. - * @param {Object} protoProps - object, that describes the prototype of - * created constructor. - * @return {Function} - new constructor + * + * @param {Object} extender - + * Object, that describes the prototype of + * created constructor. + * @param {...Object} Multiple amount of mixins. + * @returns {Function} New constructor. */ - function extend( protoProps ){ - var parent = this, + function extend(extender){ + var parent = this, + parentProto = parent.prototype, + defaults = extender.defaults || {}, child, - args, - hasConstructor; + childProto, + mixins; - protoProps = protoProps || {}; - hasConstructor = protoProps.hasOwnProperty('constructor'); + child = function(){ + _.defaults(this, defaults); - child = hasConstructor ? - protoProps.constructor : - function() { - return parent.apply(this, arguments); - }; + parent.apply(this, arguments); + }; + + delete extender.defaults; + + childProto = child.prototype = Object.create(parentProto); - child.prototype = Object.create( parent.prototype ); - child.prototype.constructor = child; + childProto.constructor = child; - args = [child.prototype]; + _.each(extender, function(method, name){ + childProto[name] = hasSuper(method) ? + superWrapper(parentProto, name, method) : + method; + }); - args.push.apply(args, arguments); + mixins = _.toArray(arguments).slice(1); - _.extend.apply(_, args); + mixins.forEach(function(mixin){ + _.extend(childProto, mixin); + }); - child.extend = extend; - child.__super__ = parent.prototype; + child.__super__ = parentProto; + child.extend = extend; return child; } diff --git a/app/code/Magento/Ui/view/base/web/js/lib/ko/scope.js b/app/code/Magento/Ui/view/base/web/js/lib/ko/scope.js index 81138a56f2fbf..17903b02635b7 100644 --- a/app/code/Magento/Ui/view/base/web/js/lib/ko/scope.js +++ b/app/code/Magento/Ui/view/base/web/js/lib/ko/scope.js @@ -57,12 +57,6 @@ define([ return this; }, - compute: function (path, defs) { - this[path] = ko.computed(defs); - - return this; - }, - /** * Reads it's params from provider and stores it into its params object * @return {Object} reference to instance @@ -104,18 +98,6 @@ define([ reload: function() { this.pushParams() .provider.refresh(); - }, - - updateObservable: function (defs) { - var field; - - _.each(defs, function (value, key) { - field = this[key]; - - if (ko.isObservable(field)) { - field(value); - } - }, this); } }); }); \ No newline at end of file diff --git a/app/code/Magento/Ui/view/base/web/templates/form/element/checkbox.html b/app/code/Magento/Ui/view/base/web/templates/form/element/checkbox.html index 2e9e1150f5ced..e12267216a5ad 100644 --- a/app/code/Magento/Ui/view/base/web/templates/form/element/checkbox.html +++ b/app/code/Magento/Ui/view/base/web/templates/form/element/checkbox.html @@ -16,6 +16,6 @@ -
+
\ No newline at end of file diff --git a/app/code/Magento/Ui/view/base/web/templates/form/element/date.html b/app/code/Magento/Ui/view/base/web/templates/form/element/date.html index 12c98400d84b8..2f15cb8f30941 100644 --- a/app/code/Magento/Ui/view/base/web/templates/form/element/date.html +++ b/app/code/Magento/Ui/view/base/web/templates/form/element/date.html @@ -10,6 +10,6 @@ value: value, name: inputName, placeholder: placeholder, - 'aria-describedby': noticeid, + 'aria-describedby': noticeId, disabled: disabled }" /> \ No newline at end of file diff --git a/app/code/Magento/Ui/view/base/web/templates/form/element/email.html b/app/code/Magento/Ui/view/base/web/templates/form/element/email.html index 714bddc3fe94e..6bd0a7e98c600 100644 --- a/app/code/Magento/Ui/view/base/web/templates/form/element/email.html +++ b/app/code/Magento/Ui/view/base/web/templates/form/element/email.html @@ -9,7 +9,7 @@ attr: { name: inputName, placeholder: placeholder, - 'aria-describedby': noticeid, + 'aria-describedby': noticeId, id: uid, disabled: disabled }"/> \ No newline at end of file diff --git a/app/code/Magento/Ui/view/base/web/templates/form/element/input.html b/app/code/Magento/Ui/view/base/web/templates/form/element/input.html index aca1ef2e9362d..9b9589278ce94 100644 --- a/app/code/Magento/Ui/view/base/web/templates/form/element/input.html +++ b/app/code/Magento/Ui/view/base/web/templates/form/element/input.html @@ -9,7 +9,7 @@ attr: { name: inputName, placeholder: placeholder, - 'aria-describedby': noticeid, + 'aria-describedby': noticeId, id: uid, disabled: disabled }" /> \ No newline at end of file diff --git a/app/code/Magento/Ui/view/base/web/templates/form/element/media.html b/app/code/Magento/Ui/view/base/web/templates/form/element/media.html index dd98e90468139..87b5bfe9d4b1c 100644 --- a/app/code/Magento/Ui/view/base/web/templates/form/element/media.html +++ b/app/code/Magento/Ui/view/base/web/templates/form/element/media.html @@ -8,7 +8,7 @@ attr: { name: inputName, id: uid, - 'aria-describedby': noticeid, + 'aria-describedby': noticeId, disabled: disabled }, hasFocus: focused" diff --git a/app/code/Magento/Ui/view/base/web/templates/form/element/multiselect.html b/app/code/Magento/Ui/view/base/web/templates/form/element/multiselect.html index dc9c313aa86a2..12bd338a57b59 100644 --- a/app/code/Magento/Ui/view/base/web/templates/form/element/multiselect.html +++ b/app/code/Magento/Ui/view/base/web/templates/form/element/multiselect.html @@ -9,7 +9,7 @@ id: uid, size: size, disabled: disabled, - 'aria-describedby': noticeid, + 'aria-describedby': noticeId, placeholder: placeholder }, hasFocus: focused, diff --git a/app/code/Magento/Ui/view/base/web/templates/form/element/select.html b/app/code/Magento/Ui/view/base/web/templates/form/element/select.html index e3aa654a1df95..d8502f82ff290 100644 --- a/app/code/Magento/Ui/view/base/web/templates/form/element/select.html +++ b/app/code/Magento/Ui/view/base/web/templates/form/element/select.html @@ -8,7 +8,7 @@ name: inputName, id: uid, disabled: disabled, - 'aria-describedby': noticeid, + 'aria-describedby': noticeId, placeholder: placeholder }, hasFocus: focused, diff --git a/app/code/Magento/Ui/view/base/web/templates/form/element/textarea.html b/app/code/Magento/Ui/view/base/web/templates/form/element/textarea.html index 31347b346a230..d10a8703ac74a 100644 --- a/app/code/Magento/Ui/view/base/web/templates/form/element/textarea.html +++ b/app/code/Magento/Ui/view/base/web/templates/form/element/textarea.html @@ -10,7 +10,7 @@ name: inputName, cols: cols, rows: rows, - 'aria-describedby': noticeid, + 'aria-describedby': noticeId, placeholder: placeholder, id: uid }" diff --git a/app/code/Magento/Ui/view/base/web/templates/group/field.html b/app/code/Magento/Ui/view/base/web/templates/group/field.html index ae890464e9607..a43266bb8031d 100644 --- a/app/code/Magento/Ui/view/base/web/templates/group/field.html +++ b/app/code/Magento/Ui/view/base/web/templates/group/field.html @@ -35,7 +35,7 @@ -
+
diff --git a/app/code/Magento/Ups/Model/Carrier.php b/app/code/Magento/Ups/Model/Carrier.php index 6b72c10d40d7f..86a2f8b5bb2f7 100644 --- a/app/code/Magento/Ups/Model/Carrier.php +++ b/app/code/Magento/Ups/Model/Carrier.php @@ -249,7 +249,7 @@ public function setRequest(RateRequest $request) ); } - $rowRequest->setOrigCountry($this->_countryFactory->create()->load($origCountry)->getIso2Code()); + $rowRequest->setOrigCountry($this->_countryFactory->create()->load($origCountry)->getData('iso2_code')); if ($request->getOrigRegionCode()) { $origRegionCode = $request->getOrigRegionCode(); @@ -307,7 +307,7 @@ public function setRequest(RateRequest $request) $destCountry = self::GUAM_COUNTRY_ID; } - $rowRequest->setDestCountry($this->_countryFactory->create()->load($destCountry)->getIso2Code()); + $rowRequest->setDestCountry($this->_countryFactory->create()->load($destCountry)->getData('iso2_code')); $rowRequest->setDestRegionCode($request->getDestRegionCode()); diff --git a/app/code/Magento/Ups/composer.json b/app/code/Magento/Ups/composer.json index c1370e7426f6f..1a71901138236 100644 --- a/app/code/Magento/Ups/composer.json +++ b/app/code/Magento/Ups/composer.json @@ -3,18 +3,18 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha108", - "magento/module-core": "0.1.0-alpha108", - "magento/module-backend": "0.1.0-alpha108", - "magento/module-sales": "0.1.0-alpha108", - "magento/module-shipping": "0.1.0-alpha108", - "magento/module-directory": "0.1.0-alpha108", - "magento/module-catalog-inventory": "0.1.0-alpha108", - "magento/framework": "0.1.0-alpha108", + "magento/module-store": "0.42.0-beta1", + "magento/module-core": "0.42.0-beta1", + "magento/module-backend": "0.42.0-beta1", + "magento/module-sales": "0.42.0-beta1", + "magento/module-shipping": "0.42.0-beta1", + "magento/module-directory": "0.42.0-beta1", + "magento/module-catalog-inventory": "0.42.0-beta1", + "magento/framework": "0.42.0-beta1", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha108", + "version": "0.42.0-beta1", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/UrlRewrite/composer.json b/app/code/Magento/UrlRewrite/composer.json index 9674b31b22ecb..308cde149bc01 100644 --- a/app/code/Magento/UrlRewrite/composer.json +++ b/app/code/Magento/UrlRewrite/composer.json @@ -3,18 +3,18 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-catalog": "0.1.0-alpha108", - "magento/module-core": "0.1.0-alpha108", - "magento/module-store": "0.1.0-alpha108", - "magento/framework": "0.1.0-alpha108", - "magento/module-backend": "0.1.0-alpha108", - "magento/module-catalog-url-rewrite": "0.1.0-alpha108", - "magento/module-cms": "0.1.0-alpha108", - "magento/module-cms-url-rewrite": "0.1.0-alpha108", + "magento/module-catalog": "0.42.0-beta1", + "magento/module-core": "0.42.0-beta1", + "magento/module-store": "0.42.0-beta1", + "magento/framework": "0.42.0-beta1", + "magento/module-backend": "0.42.0-beta1", + "magento/module-catalog-url-rewrite": "0.42.0-beta1", + "magento/module-cms": "0.42.0-beta1", + "magento/module-cms-url-rewrite": "0.42.0-beta1", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha108", + "version": "0.42.0-beta1", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/User/Controller/Adminhtml/User/Save.php b/app/code/Magento/User/Controller/Adminhtml/User/Save.php index df41a697c17e3..048bf50ddba33 100644 --- a/app/code/Magento/User/Controller/Adminhtml/User/Save.php +++ b/app/code/Magento/User/Controller/Adminhtml/User/Save.php @@ -62,8 +62,11 @@ public function execute() $this->_redirect('adminhtml/*/'); } catch (\Magento\Framework\Model\Exception $e) { $this->messageManager->addMessages($e->getMessages()); - if ($e->getMessage()) { - $this->messageManager->addError($e->getMessage()); + $messages = $e->getMessages(); + if (empty($messages)) { + if ($e->getMessage()) { + $this->messageManager->addError($e->getMessage()); + } } $this->_getSession()->setUserData($data); $arguments = $model->getId() ? ['user_id' => $model->getId()] : []; diff --git a/app/code/Magento/User/composer.json b/app/code/Magento/User/composer.json index d0ee6d7f45794..551e1a3c969f0 100644 --- a/app/code/Magento/User/composer.json +++ b/app/code/Magento/User/composer.json @@ -3,18 +3,18 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-authorization": "0.1.0-alpha108", - "magento/module-backend": "0.1.0-alpha108", - "magento/module-core": "0.1.0-alpha108", - "magento/module-integration": "0.1.0-alpha108", - "magento/module-store": "0.1.0-alpha108", - "magento/module-theme": "0.1.0-alpha108", - "magento/framework": "0.1.0-alpha108", - "magento/module-require-js": "0.1.0-alpha108", + "magento/module-authorization": "0.42.0-beta1", + "magento/module-backend": "0.42.0-beta1", + "magento/module-core": "0.42.0-beta1", + "magento/module-integration": "0.42.0-beta1", + "magento/module-store": "0.42.0-beta1", + "magento/module-theme": "0.42.0-beta1", + "magento/framework": "0.42.0-beta1", + "magento/module-require-js": "0.42.0-beta1", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha108", + "version": "0.42.0-beta1", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Usps/Model/Carrier.php b/app/code/Magento/Usps/Model/Carrier.php index 14b501c6e3180..d6aebb495fcf7 100644 --- a/app/code/Magento/Usps/Model/Carrier.php +++ b/app/code/Magento/Usps/Model/Carrier.php @@ -59,14 +59,6 @@ class Carrier extends AbstractCarrierOnline implements \Magento\Shipping\Model\C */ protected $_code = self::CODE; - /** - * Destination Zip Code required flag - * - * @var boolean - * @deprecated since 1.7.0 functionality implemented in \Magento\Shipping\Model\Carrier\AbstractCarrierOnline - */ - protected $_isZipCodeRequired; - /** * Rate request data * diff --git a/app/code/Magento/Usps/composer.json b/app/code/Magento/Usps/composer.json index 8424859cebbe6..ced6462e5f077 100644 --- a/app/code/Magento/Usps/composer.json +++ b/app/code/Magento/Usps/composer.json @@ -3,19 +3,19 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha108", - "magento/module-shipping": "0.1.0-alpha108", - "magento/module-directory": "0.1.0-alpha108", - "magento/module-core": "0.1.0-alpha108", - "magento/module-catalog": "0.1.0-alpha108", - "magento/module-sales": "0.1.0-alpha108", - "magento/module-catalog-inventory": "0.1.0-alpha108", - "magento/framework": "0.1.0-alpha108", + "magento/module-store": "0.42.0-beta1", + "magento/module-shipping": "0.42.0-beta1", + "magento/module-directory": "0.42.0-beta1", + "magento/module-core": "0.42.0-beta1", + "magento/module-catalog": "0.42.0-beta1", + "magento/module-sales": "0.42.0-beta1", + "magento/module-catalog-inventory": "0.42.0-beta1", + "magento/framework": "0.42.0-beta1", "lib-libxml": "*", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha108", + "version": "0.42.0-beta1", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Webapi/Controller/Request.php b/app/code/Magento/Webapi/Controller/Request.php index ac433b51fc23b..ca37b0b20007d 100644 --- a/app/code/Magento/Webapi/Controller/Request.php +++ b/app/code/Magento/Webapi/Controller/Request.php @@ -51,4 +51,22 @@ public function getCookie($name = null, $default = null) { return $this->_cookieReader->getCookie($name, $default); } + + /** + * {@inheritdoc} + * + * Added CGI environment support. + */ + public function getHeader($header) + { + $headerValue = parent::getHeader($header); + if ($headerValue == false) { + /** Workaround for php-fpm environment */ + $header = strtoupper(str_replace('-', '_', $header)); + if (isset($_SERVER[$header]) && in_array($header, ['CONTENT_TYPE', 'CONTENT_LENGTH'])) { + $headerValue = $_SERVER[$header]; + } + } + return $headerValue; + } } diff --git a/app/code/Magento/Webapi/Controller/Rest/Request/Deserializer/Json.php b/app/code/Magento/Webapi/Controller/Rest/Request/Deserializer/Json.php index 4843abc0c19a7..32eeaf050dbc8 100644 --- a/app/code/Magento/Webapi/Controller/Rest/Request/Deserializer/Json.php +++ b/app/code/Magento/Webapi/Controller/Rest/Request/Deserializer/Json.php @@ -36,7 +36,7 @@ public function __construct(\Magento\Core\Helper\Data $helper, State $appState) * @param string $encodedBody Posted content from request. * @return array|null Return NULL if content is invalid. * @throws \InvalidArgumentException - * @throws \Magento\Webapi\Exception If decoding error occurs or in case of empty argument type + * @throws \Magento\Webapi\Exception If decoding error was encountered. */ public function deserialize($encodedBody) { @@ -45,9 +45,6 @@ public function deserialize($encodedBody) sprintf('"%s" data type is invalid. String is expected.', gettype($encodedBody)) ); } - if (empty($encodedBody)) { - throw new \Magento\Webapi\Exception(__('Request body should not be empty.')); - } try { $decodedBody = $this->_helper->jsonDecode($encodedBody); } catch (\Zend_Json_Exception $e) { diff --git a/app/code/Magento/Webapi/Controller/Rest/Request/Deserializer/Xml.php b/app/code/Magento/Webapi/Controller/Rest/Request/Deserializer/Xml.php index 4b1a912f0ac44..d8abb30075f23 100644 --- a/app/code/Magento/Webapi/Controller/Rest/Request/Deserializer/Xml.php +++ b/app/code/Magento/Webapi/Controller/Rest/Request/Deserializer/Xml.php @@ -41,7 +41,7 @@ public function __construct(\Magento\Framework\Xml\Parser $xmlParser, State $app * @param string $xmlRequestBody XML document * @return array Data converted from XML document to array. Root node is excluded from response. * @throws \InvalidArgumentException In case of invalid argument type. - * @throws \Magento\Webapi\Exception If decoding error occurs or in case of empty argument type + * @throws \Magento\Webapi\Exception If decoding error occurs. */ public function deserialize($xmlRequestBody) { @@ -50,9 +50,6 @@ public function deserialize($xmlRequestBody) sprintf('"%s" data type is invalid. String is expected.', gettype($xmlRequestBody)) ); } - if (empty($xmlRequestBody)) { - throw new \Magento\Webapi\Exception(__('Request body is expected.')); - } /** Disable external entity loading to prevent possible vulnerability */ $previousLoaderState = libxml_disable_entity_loader(true); set_error_handler([$this, 'handleErrors']); diff --git a/app/code/Magento/Webapi/Controller/ServiceArgsSerializer.php b/app/code/Magento/Webapi/Controller/ServiceArgsSerializer.php index 5400f5ca7c401..e980f5a5c589d 100644 --- a/app/code/Magento/Webapi/Controller/ServiceArgsSerializer.php +++ b/app/code/Magento/Webapi/Controller/ServiceArgsSerializer.php @@ -10,6 +10,7 @@ use Magento\Framework\Api\AttributeValue; use Magento\Framework\Api\Config\Reader as ServiceConfigReader; use Magento\Framework\Api\SimpleDataObjectConverter; +use Magento\Framework\Exception\InputException; use Magento\Framework\Exception\SerializationException; use Magento\Framework\Reflection\TypeProcessor; use Magento\Framework\Serialization\DataBuilderFactory; @@ -71,6 +72,7 @@ public function __construct( * @param string $serviceMethodName name of the method that we are trying to call * @param array $inputArray data to send to method in key-value format * @return array list of parameters that can be used to call the service method + * @throws InputException if no value is provided for required parameters */ public function getInputData($serviceClassName, $serviceMethodName, array $inputArray) { @@ -82,6 +84,7 @@ public function getInputData($serviceClassName, $serviceMethodName, array $input $params = $serviceMethod->getParameters(); $inputData = []; + $inputError = []; foreach ($params as $param) { $paramName = $param->getName(); $snakeCaseParamName = strtolower(preg_replace("/(?<=\\w)(?=[A-Z])/", "_$1", $paramName)); @@ -93,7 +96,21 @@ public function getInputData($serviceClassName, $serviceMethodName, array $input $paramType = $this->getParamType($param); $inputData[] = $this->_convertValue($paramValue, $paramType); } else { - $inputData[] = $param->isDefaultValueAvailable() ? $param->getDefaultValue() : null; + if ($param->isDefaultValueAvailable()) { + $inputData[] = $param->getDefaultValue(); + } else { + $inputError[] = $paramName; + } + } + } + + if (!empty($inputError)) { + $exception = new InputException(); + foreach ($inputError as $errorParamField) { + $exception->addError(InputException::REQUIRED_FIELD, ['fieldName' => $errorParamField]); + } + if ($exception->wasErrorAdded()) { + throw $exception; } } diff --git a/app/code/Magento/Webapi/composer.json b/app/code/Magento/Webapi/composer.json index ddd77845a7a70..78b24f45b4b00 100644 --- a/app/code/Magento/Webapi/composer.json +++ b/app/code/Magento/Webapi/composer.json @@ -3,19 +3,19 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha108", - "magento/module-authorization": "0.1.0-alpha108", - "magento/module-core": "0.1.0-alpha108", - "magento/module-integration": "0.1.0-alpha108", - "magento/module-backend": "0.1.0-alpha108", - "magento/framework": "0.1.0-alpha108", + "magento/module-store": "0.42.0-beta1", + "magento/module-authorization": "0.42.0-beta1", + "magento/module-core": "0.42.0-beta1", + "magento/module-integration": "0.42.0-beta1", + "magento/module-backend": "0.42.0-beta1", + "magento/framework": "0.42.0-beta1", "magento/magento-composer-installer": "*" }, "suggest": { - "magento/module-user": "0.1.0-alpha108" + "magento/module-user": "0.42.0-beta1" }, "type": "magento2-module", - "version": "0.1.0-alpha108", + "version": "0.42.0-beta1", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Weee/Model/Attribute/Backend/Weee/Tax.php b/app/code/Magento/Weee/Model/Attribute/Backend/Weee/Tax.php index 456dc199b29e2..d9d09e6511f66 100644 --- a/app/code/Magento/Weee/Model/Attribute/Backend/Weee/Tax.php +++ b/app/code/Magento/Weee/Model/Attribute/Backend/Weee/Tax.php @@ -140,7 +140,7 @@ public function afterSave($object) if (isset($tax['state']) && $tax['state']) { $state = $tax['state']; } else { - $state = '*'; + $state = '0'; } $data = []; diff --git a/app/code/Magento/Weee/Model/Total/Creditmemo/Weee.php b/app/code/Magento/Weee/Model/Total/Creditmemo/Weee.php index 655bc0a6c6146..0dfc5cebce1c6 100644 --- a/app/code/Magento/Weee/Model/Total/Creditmemo/Weee.php +++ b/app/code/Magento/Weee/Model/Total/Creditmemo/Weee.php @@ -24,7 +24,7 @@ class Weee extends \Magento\Sales\Model\Order\Creditmemo\Total\AbstractTotal * attributes This behavior may change in child classes * * @param \Magento\Weee\Helper\Data $weeeData - * @param array $data + * @param array $data */ public function __construct(\Magento\Weee\Helper\Data $weeeData, array $data = []) { @@ -35,7 +35,7 @@ public function __construct(\Magento\Weee\Helper\Data $weeeData, array $data = [ /** * Collect Weee amounts for the credit memo * - * @param Creditmemo $creditmemo + * @param Creditmemo $creditmemo * @return $this */ public function collect(Creditmemo $creditmemo) @@ -113,12 +113,12 @@ public function collect(Creditmemo $creditmemo) //Set the ratio of the tax amount in invoice item compared to tax amount in order item //This information is needed to calculate tax per tax rate later if ($orderItemTaxAmount != 0) { - if (!$item->getTaxRatio()) { - $item->setTaxRatio([]); + $taxRatio = []; + if ($item->getTaxRatio()) { + $taxRatio = unserialize($item->getTaxRatio()); } - $taxRatio = $item->getTaxRatio(); $taxRatio[\Magento\Weee\Model\Total\Quote\Weee::ITEM_TYPE] = $itemTaxAmount / $orderItemTaxAmount; - $item->setTaxRatio($taxRatio); + $item->setTaxRatio(serialize($taxRatio)); } $totalWeeeAmountInclTax += $weeeAmountInclTax; @@ -128,11 +128,11 @@ public function collect(Creditmemo $creditmemo) $applied = $this->_weeeData->getApplied($orderItem); foreach ($applied as $one) { $title = $one['title']; - $one['base_row_amount'] = $creditmemo->roundPrice($one['base_row_amount'] * $ratio, $title . '_base'); + $one['base_row_amount'] = $creditmemo->roundPrice($one['base_row_amount'] * $ratio, $title.'_base'); $one['row_amount'] = $creditmemo->roundPrice($one['row_amount'] * $ratio, $title); $one['base_row_amount_incl_tax'] = $creditmemo->roundPrice( $one['base_row_amount_incl_tax'] * $ratio, - $title . '_base' + $title.'_base' ); $one['row_amount_incl_tax'] = $creditmemo->roundPrice($one['row_amount_incl_tax'] * $ratio, $title); diff --git a/app/code/Magento/Weee/Model/Total/Invoice/Weee.php b/app/code/Magento/Weee/Model/Total/Invoice/Weee.php index 14aa8c37feddb..d0539a81325c0 100644 --- a/app/code/Magento/Weee/Model/Total/Invoice/Weee.php +++ b/app/code/Magento/Weee/Model/Total/Invoice/Weee.php @@ -22,7 +22,7 @@ class Weee extends \Magento\Sales\Model\Order\Invoice\Total\AbstractTotal * attributes This behavior may change in child classes * * @param \Magento\Weee\Helper\Data $weeeData - * @param array $data + * @param array $data */ public function __construct(\Magento\Weee\Helper\Data $weeeData, array $data = []) { @@ -33,7 +33,7 @@ public function __construct(\Magento\Weee\Helper\Data $weeeData, array $data = [ /** * Collect Weee amounts for the invoice * - * @param \Magento\Sales\Model\Order\Invoice $invoice + * @param \Magento\Sales\Model\Order\Invoice $invoice * @return $this */ public function collect(\Magento\Sales\Model\Order\Invoice $invoice) @@ -87,12 +87,12 @@ public function collect(\Magento\Sales\Model\Order\Invoice $invoice) //Set the ratio of the tax amount in invoice item compared to tax amount in order item //This information is needed to calculate tax per tax rate later if ($orderItemWeeeTax != 0) { - if (!$item->getTaxRatio()) { - $item->setTaxRatio([]); + $taxRatio = []; + if ($item->getTaxRatio()) { + $taxRatio = unserialize($item->getTaxRatio()); } - $taxRatio = $item->getTaxRatio(); $taxRatio[\Magento\Weee\Model\Total\Quote\Weee::ITEM_TYPE] = $itemWeeeTax / $orderItemWeeeTax; - $item->setTaxRatio($taxRatio); + $item->setTaxRatio(serialize($taxRatio)); } $item->setWeeeTaxAppliedRowAmount($weeeAmount); @@ -101,11 +101,11 @@ public function collect(\Magento\Sales\Model\Order\Invoice $invoice) $applied = $this->_weeeData->getApplied($orderItem); foreach ($applied as $one) { $title = $one['title']; - $one['base_row_amount'] = $invoice->roundPrice($one['base_row_amount'] * $ratio, $title . '_base'); + $one['base_row_amount'] = $invoice->roundPrice($one['base_row_amount'] * $ratio, $title.'_base'); $one['row_amount'] = $invoice->roundPrice($one['row_amount'] * $ratio, $title); $one['base_row_amount_incl_tax'] = $invoice->roundPrice( $one['base_row_amount_incl_tax'] * $ratio, - $title . '_base' + $title.'_base' ); $one['row_amount_incl_tax'] = $invoice->roundPrice($one['row_amount_incl_tax'] * $ratio, $title); diff --git a/app/code/Magento/Weee/composer.json b/app/code/Magento/Weee/composer.json index dc740b5e71034..adf13a5fe3f93 100644 --- a/app/code/Magento/Weee/composer.json +++ b/app/code/Magento/Weee/composer.json @@ -3,20 +3,20 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha108", - "magento/module-catalog": "0.1.0-alpha108", - "magento/module-tax": "0.1.0-alpha108", - "magento/module-sales": "0.1.0-alpha108", - "magento/module-backend": "0.1.0-alpha108", - "magento/module-directory": "0.1.0-alpha108", - "magento/module-core": "0.1.0-alpha108", - "magento/module-eav": "0.1.0-alpha108", - "magento/module-customer": "0.1.0-alpha108", - "magento/framework": "0.1.0-alpha108", + "magento/module-store": "0.42.0-beta1", + "magento/module-catalog": "0.42.0-beta1", + "magento/module-tax": "0.42.0-beta1", + "magento/module-sales": "0.42.0-beta1", + "magento/module-backend": "0.42.0-beta1", + "magento/module-directory": "0.42.0-beta1", + "magento/module-core": "0.42.0-beta1", + "magento/module-eav": "0.42.0-beta1", + "magento/module-customer": "0.42.0-beta1", + "magento/framework": "0.42.0-beta1", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha108", + "version": "0.42.0-beta1", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Widget/composer.json b/app/code/Magento/Widget/composer.json index 7f36bf1a53a6b..6edce51d361e0 100644 --- a/app/code/Magento/Widget/composer.json +++ b/app/code/Magento/Widget/composer.json @@ -3,16 +3,16 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha108", - "magento/module-cms": "0.1.0-alpha108", - "magento/module-core": "0.1.0-alpha108", - "magento/module-backend": "0.1.0-alpha108", - "magento/module-catalog": "0.1.0-alpha108", - "magento/framework": "0.1.0-alpha108", + "magento/module-store": "0.42.0-beta1", + "magento/module-cms": "0.42.0-beta1", + "magento/module-core": "0.42.0-beta1", + "magento/module-backend": "0.42.0-beta1", + "magento/module-catalog": "0.42.0-beta1", + "magento/framework": "0.42.0-beta1", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha108", + "version": "0.42.0-beta1", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Widget/view/adminhtml/templates/instance/edit/layout.phtml b/app/code/Magento/Widget/view/adminhtml/templates/instance/edit/layout.phtml index 0607e7ea74776..7d616b11baa7c 100644 --- a/app/code/Magento/Widget/view/adminhtml/templates/instance/edit/layout.phtml +++ b/app/code/Magento/Widget/view/adminhtml/templates/instance/edit/layout.phtml @@ -27,9 +27,9 @@ var pageGroupTemplate = '
'+ getDisplayOnContainers() as $container): ?> '
'+ - ''+ - ''+ - ''+ + ''+ + ''+ + ''+ ''+ ''+ ''+ @@ -42,9 +42,9 @@ var pageGroupTemplate = '
 '+ + ' '+ '
'+ - ' '+ + ' '+ ''+ ''+ '
'+ @@ -61,10 +61,10 @@ var pageGroupTemplate = '
'+ - ''+ - ''+ + ''+ + ''+ '

' + - ' ' + + ' ' + '' + '<?php echo $this->escapeJsQuote(__('Open Chooser')); ?>' + ' ' + @@ -77,10 +77,10 @@ var pageGroupTemplate = '

'+ - ''+ - ''+ - ''+ - ''+ + ''+ + ''+ + ''+ + ''+ ''+ ''+ ''+ @@ -108,9 +108,9 @@ var pageGroupTemplate = '
'+ - ''+ - ''+ - ''+ + ''+ + ''+ + ''+ '
'+ ''+ ''+ @@ -139,9 +139,9 @@ var pageGroupTemplate = '
'+ - ''+ - ''+ - ''+ + ''+ + ''+ + ''+ '
'+ ''+ ''+ @@ -269,6 +269,9 @@ var WidgetInstance = { container.removeClassName('no-display'); container.removeClassName('ignore-validate'); container.up('.fieldset-wrapper').addClassName('opened'); + container.select('input', 'select').each(function(element) { + $(element).removeAttribute('disabled'); + }); container.show(); } }, @@ -277,6 +280,9 @@ var WidgetInstance = { if (container) { container.addClassName('no-display'); container.addClassName('ignore-validate'); + container.select('input', 'select').each(function(element) { + $(element).writeAttribute('disabled', 'disabled'); + }); container.hide(); } }, diff --git a/app/code/Magento/Wishlist/Block/Adminhtml/Widget/Grid/Column/Filter/Text.php b/app/code/Magento/Wishlist/Block/Adminhtml/Widget/Grid/Column/Filter/Text.php new file mode 100644 index 0000000000000..402e32b634c8e --- /dev/null +++ b/app/code/Magento/Wishlist/Block/Adminhtml/Widget/Grid/Column/Filter/Text.php @@ -0,0 +1,18 @@ + $this->getValue()]; + } +} diff --git a/app/code/Magento/Wishlist/composer.json b/app/code/Magento/Wishlist/composer.json index 68decafc77964..263a9b27f3f39 100644 --- a/app/code/Magento/Wishlist/composer.json +++ b/app/code/Magento/Wishlist/composer.json @@ -3,28 +3,28 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha108", - "magento/module-customer": "0.1.0-alpha108", - "magento/module-catalog": "0.1.0-alpha108", - "magento/module-core": "0.1.0-alpha108", - "magento/module-checkout": "0.1.0-alpha108", - "magento/module-theme": "0.1.0-alpha108", - "magento/module-catalog-inventory": "0.1.0-alpha108", - "magento/module-rss": "0.1.0-alpha108", - "magento/module-backend": "0.1.0-alpha108", - "magento/module-sales": "0.1.0-alpha108", - "magento/module-grouped-product": "0.1.0-alpha108", - "magento/framework": "0.1.0-alpha108", - "magento/module-ui": "0.1.0-alpha108", + "magento/module-store": "0.42.0-beta1", + "magento/module-customer": "0.42.0-beta1", + "magento/module-catalog": "0.42.0-beta1", + "magento/module-core": "0.42.0-beta1", + "magento/module-checkout": "0.42.0-beta1", + "magento/module-theme": "0.42.0-beta1", + "magento/module-catalog-inventory": "0.42.0-beta1", + "magento/module-rss": "0.42.0-beta1", + "magento/module-backend": "0.42.0-beta1", + "magento/module-sales": "0.42.0-beta1", + "magento/module-grouped-product": "0.42.0-beta1", + "magento/framework": "0.42.0-beta1", + "magento/module-ui": "0.42.0-beta1", "magento/magento-composer-installer": "*" }, "suggest": { - "magento/module-configurable-product": "0.1.0-alpha108", - "magento/module-downloadable": "0.1.0-alpha108", - "magento/module-bundle": "0.1.0-alpha108" + "magento/module-configurable-product": "0.42.0-beta1", + "magento/module-downloadable": "0.42.0-beta1", + "magento/module-bundle": "0.42.0-beta1" }, "type": "magento2-module", - "version": "0.1.0-alpha108", + "version": "0.42.0-beta1", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Wishlist/view/adminhtml/layout/customer_index_wishlist.xml b/app/code/Magento/Wishlist/view/adminhtml/layout/customer_index_wishlist.xml index 6662a31b1eea8..621cc2d9cee6c 100644 --- a/app/code/Magento/Wishlist/view/adminhtml/layout/customer_index_wishlist.xml +++ b/app/code/Magento/Wishlist/view/adminhtml/layout/customer_index_wishlist.xml @@ -34,6 +34,7 @@ Productproduct_nameproduct_name + Magento\Wishlist\Block\Adminhtml\Widget\Grid\Column\Filter\TextMagento\Customer\Block\Adminhtml\Edit\Tab\View\Grid\Renderer\Itemcol-namecol-name @@ -109,5 +110,6 @@ + diff --git a/app/design/adminhtml/Magento/backend/Magento_Theme/web/css/source/module.less b/app/design/adminhtml/Magento/backend/Magento_Theme/web/css/source/module.less index d4f4b9564eac9..fc05de4c15513 100644 --- a/app/design/adminhtml/Magento/backend/Magento_Theme/web/css/source/module.less +++ b/app/design/adminhtml/Magento/backend/Magento_Theme/web/css/source/module.less @@ -27,6 +27,13 @@ body { font-weight: @baseFontWeight; .font-size(@baseFontSize); background: @primary7; + .vendor-prefix-display(flex); + .vendor-prefix-flex-direction(column); + & > * { + .vendor-prefix-flex-grow(0); + .vendor-prefix-flex-shrink(0); + .vendor-prefix-flex-basis(auto); + } } .page-wrapper { @@ -36,18 +43,20 @@ body { width: 100%; max-width: 100%; min-width: @layout-min-width + 2 * @layout-indent; - .ie10 &, - .ie11 & { - height: 100%; + & > * { + .vendor-prefix-flex-grow(0); + .vendor-prefix-flex-shrink(0); + .vendor-prefix-flex-basis(auto); } } + .page-header { &-wrapper { background-color: @color-dark; } &:extend(._layout-width all); text-align: right; - .clearer(); + .clearer(); .logo { margin-top: 5px; float: left; @@ -229,6 +238,9 @@ body { } .dropdown-menu { text-align: left; + .item { + display: block; + } } } // Fixed page actions @@ -237,7 +249,7 @@ body { top: 0; left: 0; right: 0; - z-index: 998; + z-index: 10; padding: 0; background: -webkit-linear-gradient(top, rgba(245, 242, 237, 1) 0%, rgba(245, 242, 237, 1) 56%, rgba(245, 242, 237, 0) 100%); // Use in 4.3 Android background: -ms-linear-gradient(top, rgba(245, 242, 237, 1) 0%, rgba(245, 242, 237, 1) 56%, rgba(245, 242, 237, 0) 100%); // Use in 10 IE @@ -299,6 +311,7 @@ body { .button-reset(); color: @color-link; line-height: normal; + margin-top: 2px; vertical-align: middle; } ul.dropdown-menu { @@ -481,25 +494,25 @@ button { } .footer-legal { - float:right; + float: right; width: 550px; .link-report, .magento-version, .copyright { - font-size:13px; + font-size: 13px; } &:before { content:""; display: inline-block; vertical-align: middle; - position:absolute; + position: absolute; z-index: 1; margin-top: 2px; margin-left: -35px; width: 30px; height: 35px; background-size: 109px 70px; - background: url("@{baseDir}images/logo.svg") no-repeat 0 -35px; + background: url("@{baseDir}images/logo.svg") no-repeat 0 -21px; } } diff --git a/app/design/adminhtml/Magento/backend/Magento_Ui/web/css/source/formelements.less b/app/design/adminhtml/Magento/backend/Magento_Ui/web/css/source/formelements.less index 97ef170ba320c..09c353c16f52e 100644 --- a/app/design/adminhtml/Magento/backend/Magento_Ui/web/css/source/formelements.less +++ b/app/design/adminhtml/Magento/backend/Magento_Ui/web/css/source/formelements.less @@ -133,6 +133,14 @@ box-sizing: border-box; max-width: 380px; } + .control-addon { + + .mage-error { + .no-flexbox.no-flexboxlegacy & { + display: inline-block; + width: 100%; + } + } + } } .form__field { diff --git a/app/design/adminhtml/Magento/backend/composer.json b/app/design/adminhtml/Magento/backend/composer.json index 801a7e061ea94..c1176fc6fb42f 100644 --- a/app/design/adminhtml/Magento/backend/composer.json +++ b/app/design/adminhtml/Magento/backend/composer.json @@ -3,11 +3,11 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/framework": "0.1.0-alpha108", + "magento/framework": "0.42.0-beta1", "magento/magento-composer-installer": "*" }, "type": "magento2-theme", - "version": "0.1.0-alpha108", + "version": "0.42.0-beta1", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/design/adminhtml/Magento/backend/web/css/admin.less b/app/design/adminhtml/Magento/backend/web/css/admin.less index a77d45ae5c9e8..ebd3fc8361b2b 100644 --- a/app/design/adminhtml/Magento/backend/web/css/admin.less +++ b/app/design/adminhtml/Magento/backend/web/css/admin.less @@ -7,6 +7,7 @@ @import "../less/styles/vars.less"; @import "../less/styles/base.less"; @import "../less/lib/buttons.less"; +@import 'source/lib/utilities.less'; .dont-use-this-class-big-size { font-size: 18px; @@ -636,9 +637,9 @@ textarea[readonly] { color: #999; } -select[disabled].multiselect > option[selected] { +select[disabled] option[selected] { color: #fff; - background: #6d6d6d; + background: #aaa; } textarea:-moz-placeholder, @@ -710,6 +711,11 @@ fieldset.field [class^='fields-group-'] .field .control { vertical-align: middle; } +.form-inline > form > div > .message { + margin-left: 18px; + margin-right: 18px; +} + .control > input { width: 100%; } @@ -1399,8 +1405,8 @@ address { background-image: url(../images/fam_application_form_delete.png); } -.x-tree-node-ct { - overflow: hidden; +.x-tree-node { + overflow: auto; } /* @@ -1426,7 +1432,7 @@ address { color: #be0a0a; font-size: 16px; font-weight: 500; - margin: 0 0 6px 0; + margin: 0 0 6px; } .tipsy-inner .error p { @@ -1787,7 +1793,8 @@ address { width: 262px; height: 64px; text-indent: -999em; - background: url(Magento_Backend::images/logo-magento.png) no-repeat; + .url('images/logo-magento.png', 'Magento_Backend'); + background: url("@{url}") no-repeat; } .page-login { @@ -3643,3 +3650,5 @@ tr.dynamic-grid input.input-text { .fieldset-wrapper-title:after { clear: both; } +@baseDir: "../"; //default + diff --git a/app/design/adminhtml/Magento/backend/web/css/pages.less b/app/design/adminhtml/Magento/backend/web/css/pages.less index 7525066fe2691..dd54a0cfc2577 100644 --- a/app/design/adminhtml/Magento/backend/web/css/pages.less +++ b/app/design/adminhtml/Magento/backend/web/css/pages.less @@ -728,6 +728,13 @@ padding: 18px; } +.customer-current-activity .action-refresh { + float: right; + &:hover { + text-decoration: none; + } +} + .order-currency { padding: 18px; } @@ -1738,7 +1745,8 @@ table.items-to-invoice tbody tr:hover td { .packaging-window .col-width, .packaging-window .col-height, .packaging-window .col-length, -.packaging-window .data-table .col-total-weight input[type="text"] { +.packaging-window .data-table .col-total-weight input[type="text"], +.packaging-window .data-table .col-custom input[type="text"] { width: 60px; } @@ -1752,7 +1760,8 @@ table.items-to-invoice tbody tr:hover td { } .packaging-window .data-table .col-actions, -.packaging-window .col-total-weight { +.packaging-window .col-total-weight, +.packaging-window .data-table .col-custom { white-space: nowrap; } diff --git a/app/design/adminhtml/Magento/backend/web/js/theme.js b/app/design/adminhtml/Magento/backend/web/js/theme.js index 979f70d810e7a..91d83cb6b2c2a 100644 --- a/app/design/adminhtml/Magento/backend/web/js/theme.js +++ b/app/design/adminhtml/Magento/backend/web/js/theme.js @@ -364,7 +364,9 @@ define([ /* @TODO refactor collapsable as widget and avoid logic binding with such a general selectors */ $('.collapse').collapsable(); $.each($('.entry-edit'), function(i, entry) { - $('.collapse:first', entry).collapse('show'); + $('.collapse:first', entry).filter(function(){ + return $(this).data('collapsed') !== true; + }).collapse('show'); }); // TODO: Move to VDE js widjets diff --git a/app/design/adminhtml/Magento/backend/web/less/styles/debug.less b/app/design/adminhtml/Magento/backend/web/less/styles/debug.less index 373955cceed6d..df8fc09eb2aab 100644 --- a/app/design/adminhtml/Magento/backend/web/less/styles/debug.less +++ b/app/design/adminhtml/Magento/backend/web/less/styles/debug.less @@ -301,8 +301,11 @@ border: 0; } -.accordion .config .comment a { - .style3(); +.accordion .config { + .comment a, + .link-more { + .style3(); + } } .accordion .config legend { @@ -367,7 +370,25 @@ .accordion .config .value { width: 50%; - padding-right:40px; + padding-right: 40px; + .checkboxes { + list-style: none; + padding: 0; + margin: -3px 0 0; + + li { + margin: 7px 0; + } + + input, + label { + vertical-align: middle; + } + + label { + margin-left: 5px; + } + } } .accordion .config .value.with-tooltip { diff --git a/app/design/adminhtml/Magento/backend/web/less/styles/pages.less b/app/design/adminhtml/Magento/backend/web/less/styles/pages.less index f71c3e670c030..20f7f4caab162 100644 --- a/app/design/adminhtml/Magento/backend/web/less/styles/pages.less +++ b/app/design/adminhtml/Magento/backend/web/less/styles/pages.less @@ -1114,9 +1114,6 @@ tr.row-totals:nth-child(odd) + tr.summary-details ~ tr.summary-total:not(.show-d } } } -.customer-current-activity .action-refresh { - float: right; -} .customer-current-activity .action-refresh, .customer-current-activity .data-table .icon { diff --git a/app/design/frontend/Magento/blank/Magento_Bundle/web/css/source/module.less b/app/design/frontend/Magento/blank/Magento_Bundle/web/css/source/module.less index 7b31d2f686814..f5188ca211300 100644 --- a/app/design/frontend/Magento/blank/Magento_Bundle/web/css/source/module.less +++ b/app/design/frontend/Magento/blank/Magento_Bundle/web/css/source/module.less @@ -80,6 +80,7 @@ .box-tocart { .actions { margin-bottom: @indent-s-base; + display: inline-block; } .action.primary { &:extend(.abs-button-l all); diff --git a/app/design/frontend/Magento/blank/Magento_Catalog/web/css/source/module.less b/app/design/frontend/Magento/blank/Magento_Catalog/web/css/source/module.less index ca11877ac9366..d265e43b02fbe 100644 --- a/app/design/frontend/Magento/blank/Magento_Catalog/web/css/source/module.less +++ b/app/design/frontend/Magento/blank/Magento_Catalog/web/css/source/module.less @@ -468,9 +468,6 @@ &:extend(.abs-revert-field-type-desktop all); } - .table-wrapper.comparison { - .table-overflow(); - } } // diff --git a/app/design/frontend/Magento/blank/Magento_Catalog/web/css/source/widgets.less b/app/design/frontend/Magento/blank/Magento_Catalog/web/css/source/widgets.less index b6c2421aa28cf..282c3d0cc6f58 100644 --- a/app/design/frontend/Magento/blank/Magento_Catalog/web/css/source/widgets.less +++ b/app/design/frontend/Magento/blank/Magento_Catalog/web/css/source/widgets.less @@ -68,12 +68,21 @@ .responsive-min-l(@break) when (@break = @screen-l) { .block.widget .products-grid .product-item { width: 100%/5 } - .page-layout-1column .block.widget .products-grid .product-item { width: 100%/6 } + .page-layout-1column .block.widget .products-grid .product-item { + width: 100%/6; + margin-left: calc(~"(100% - 5 * (100%/6)) / 4"); + &:nth-child(4n+1) { + margin-left: calc(~"(100% - 5 * (100%/6)) / 4"); + } + &:nth-child(5n+1) { + margin-left: 0; + } + } .page-layout-3columns .block.widget .products-grid .product-item { width: 100%/4 } .block.widget .products-grid .product-items { margin: 0; } .block.widget .products-grid .product-item { - width: 22%; - margin-left: calc(~"(100% - 4 * 22%) / 3"); + width: 24%; + margin-left: calc(~"(100% - 4 * 24%) / 3"); padding: 0; &:nth-child(4n+1) { margin-left: 0; diff --git a/app/design/frontend/Magento/blank/Magento_Paypal/web/css/source/module.less b/app/design/frontend/Magento/blank/Magento_Paypal/web/css/source/module.less index 9c7a72ea9f1f0..24229d8a6b207 100644 --- a/app/design/frontend/Magento/blank/Magento_Paypal/web/css/source/module.less +++ b/app/design/frontend/Magento/blank/Magento_Paypal/web/css/source/module.less @@ -34,12 +34,12 @@ } } -.product-info-main, +.box-tocart, .block-minicart { - .paypal img { + .paypal img { display: block; margin: 0 auto; - } + } } .form-new-agreement { diff --git a/app/design/frontend/Magento/blank/composer.json b/app/design/frontend/Magento/blank/composer.json index 30452ec592d84..313d99a4265cf 100644 --- a/app/design/frontend/Magento/blank/composer.json +++ b/app/design/frontend/Magento/blank/composer.json @@ -3,11 +3,11 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/framework": "0.1.0-alpha108", + "magento/framework": "0.42.0-beta1", "magento/magento-composer-installer": "*" }, "type": "magento2-theme", - "version": "0.1.0-alpha108", + "version": "0.42.0-beta1", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/design/frontend/Magento/blank/web/css/source/layout.less b/app/design/frontend/Magento/blank/web/css/source/layout.less index 99763e87ef675..cc63bc589340a 100644 --- a/app/design/frontend/Magento/blank/web/css/source/layout.less +++ b/app/design/frontend/Magento/blank/web/css/source/layout.less @@ -81,7 +81,7 @@ margin-left: auto; margin-right: auto; width: auto; - max-width: @layout-max-width + @layout-indent * 2; + max-width: @layout-max-width; box-sizing: border-box; } .page-main { diff --git a/app/design/frontend/Magento/blank/web/css/source/tables.less b/app/design/frontend/Magento/blank/web/css/source/tables.less index 2f7993414733e..bded4ea48e3a8 100644 --- a/app/design/frontend/Magento/blank/web/css/source/tables.less +++ b/app/design/frontend/Magento/blank/web/css/source/tables.less @@ -45,7 +45,7 @@ table { .table-wrapper { .table-overflow(); position: relative; // to hide unnecessary horizontal scrollbar in Safari - .table:not(.cart):not(.totals) { + .table:not(.cart):not(.totals):not(.table-comparison) { .table-responsive(); tbody > tr { > td:first-child { diff --git a/app/design/frontend/Magento/luma/Magento_Catalog/web/css/source/module.less b/app/design/frontend/Magento/luma/Magento_Catalog/web/css/source/module.less index a962298d28b60..6c26974875092 100644 --- a/app/design/frontend/Magento/luma/Magento_Catalog/web/css/source/module.less +++ b/app/design/frontend/Magento/luma/Magento_Catalog/web/css/source/module.less @@ -849,10 +849,6 @@ body.catalog-product-compare-index { } } -.compare.wrapper { - display: none; -} - } // @@ -869,13 +865,18 @@ body.catalog-product-compare-index { } } } +.responsive-max-m(@break) when (@break = @screen-m) { + .compare.wrapper, + [class*="block-compare"] { + display: none; + } +} // // Desktop //-------------------------------------- .responsive-min-l(@break) when (@break = @screen-m) { .compare.wrapper { - display: block; float: right; .list-reset-styles(); .action.compare { @@ -901,9 +902,6 @@ body.catalog-product-compare-index { } } } - .table-wrapper.comparison { - .table-overflow(); - } } // diff --git a/app/design/frontend/Magento/luma/Magento_Paypal/web/css/source/module.less b/app/design/frontend/Magento/luma/Magento_Paypal/web/css/source/module.less deleted file mode 100644 index 782f2b0743243..0000000000000 --- a/app/design/frontend/Magento/luma/Magento_Paypal/web/css/source/module.less +++ /dev/null @@ -1,182 +0,0 @@ -// /** -// * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) -// */ - -// -// Common -//-------------------------------------- - -.responsive-common() { - -// -// PayPal checkout button -//-------------------------------------- - -.paypal { - display: inline-block; - vertical-align: top; - .block-minicart &, - .cart-summary & { - display: block; - } - img { - display: block; - margin: @indent-xs-base auto 0; - } - .opc & { - vertical-align: middle; - } - &.acceptance { - display: block; - margin: 0 0 @indent-base; - img { - max-width: 100%; - } - } -} - -// -// Account -//-------------------------------------- -.table-wrapper.billing-agreements { - margin-bottom: @indent-xl-base; -} - -// -// PayPal Review Order page -//-------------------------------------- -.paypal-review { - .block { - &:extend(.abs-account-blocks all); - .actions-toolbar { - .action.primary { - &:extend(.abs-revert-secondary-color all); - } - } - } - - .actions-toolbar { - margin-top: @indent-s-base; - } - - .paypal-review-title { - padding: 0 0 @indent-s-base; - > strong { - .font-size(24); - font-weight: @font-weight-light; - } - .action { - display: inline-block; - margin: 12px 0 0 @indent-l-base; - } - } - - .table-paypal-review-items { - .col { - &.price, - &.subtotal { - &:extend(.abs-incl-excl-tax all); - } - &.name { - padding-top: 16px; - } - &.qty { - text-align: center; - } - } - - .cart-tax-total { - &:extend(.abs-tax-total all); - &-expanded { - &:extend(.abs-tax-total-expanded all); - } - } - } - - .item-options { - dt { - display: inline-block; - &:after { - content: ": "; - } - } - dd { - margin: 0; - } - } -} - -} - -// -// Mobile -//-------------------------------------- -.responsive-max-m(@break) when (@break = @screen-s) { - .account { - .table-billing-agreements, - .table-billing-agreements-related { - .col.actions { - &:extend(.abs-col-no-prefix all); - } - } - } - .form-new-agreement { - select { - width: auto; - } - } - .table-paypal-review-items { - .col.subtotal { - text-align: left; - } - .product-item-name { - display: inline-block; - } - } -} - -// -// Desktop -//-------------------------------------- -.responsive-min-l(@break) when (@break = @screen-m) { - .paypal-review { - .paypal-review-title { - border-bottom: @border-width-base solid @border-color-base; - } - .block-content { - &:extend(.abs-add-clearfix-desktop all); - .box-order-shipping-address, - .box-order-shipping-method, - .box-order-shipping-method + .box-order-billing-address { - box-sizing: border-box; - float: left; - width: 33%; - } - .box-order-shipping-address { - padding: 0 5%; - width: 34%; - } - } - .column.main & { - .actions-toolbar { - &:extend(.abs-reset-left-margin-desktop all); - } - } - .table-paypal-review-items { - .col { - &.price, - &.qty { - text-align: center; - } - &.item { - width: 60%; - } - } - } - .col.subtotal, - .mark, - .amount { - text-align: right; - } - } -} diff --git a/app/design/frontend/Magento/luma/Magento_Theme/web/css/source/module.less b/app/design/frontend/Magento/luma/Magento_Theme/web/css/source/module.less index e5acdf98c9abd..469dadae1a7d5 100644 --- a/app/design/frontend/Magento/luma/Magento_Theme/web/css/source/module.less +++ b/app/design/frontend/Magento/luma/Magento_Theme/web/css/source/module.less @@ -436,15 +436,19 @@ body { @_dropdown-toggle-active-icon-content: @icon-up, @_icon-font-text-hide: true, @_icon-font-size: 10px, - @_icon-font-line-height: 22px + @_icon-font-line-height: 22px, + @_dropdown-list-pointer-position: right, + @_dropdown-list-position-right: 0 ); .action.switch { .button-reset(); - color: @color-white; + .css(color, @color-white); + } + .header.links { + min-width: 175px; } li { &:extend(.switcher li all); - min-width: 120px; a { .link( @_link-color: @color-gray20, diff --git a/app/design/frontend/Magento/luma/Magento_Wishlist/web/css/source/module.less b/app/design/frontend/Magento/luma/Magento_Wishlist/web/css/source/module.less index 8086bfc3f0633..bac1fcf66843a 100644 --- a/app/design/frontend/Magento/luma/Magento_Wishlist/web/css/source/module.less +++ b/app/design/frontend/Magento/luma/Magento_Wishlist/web/css/source/module.less @@ -76,6 +76,7 @@ .link.wishlist { .counter { color: @text-color-muted; + white-space: nowrap; &:before { content: "("; } diff --git a/app/design/frontend/Magento/luma/composer.json b/app/design/frontend/Magento/luma/composer.json index 32ffb035bfdc4..706b303934511 100644 --- a/app/design/frontend/Magento/luma/composer.json +++ b/app/design/frontend/Magento/luma/composer.json @@ -3,12 +3,12 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/theme-frontend-blank": "0.1.0-alpha108", - "magento/framework": "0.1.0-alpha108", + "magento/theme-frontend-blank": "0.42.0-beta1", + "magento/framework": "0.42.0-beta1", "magento/magento-composer-installer": "*" }, "type": "magento2-theme", - "version": "0.1.0-alpha108", + "version": "0.42.0-beta1", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/design/frontend/Magento/luma/web/css/source/tables.less b/app/design/frontend/Magento/luma/web/css/source/tables.less index 4ee6c68778c82..45c887c3ccc12 100644 --- a/app/design/frontend/Magento/luma/web/css/source/tables.less +++ b/app/design/frontend/Magento/luma/web/css/source/tables.less @@ -47,7 +47,7 @@ table { border-top: @table-border-width @table-border-style @table-border-color; .table-overflow(); position: relative; // to hide unnecessary horizontal scrollbar in Safari - .table:not(.totals):not(.cart) { + .table:not(.totals):not(.cart):not(.table-comparison) { .table-responsive(); tbody { > tr { diff --git a/app/etc/di.xml b/app/etc/di.xml index 048eea823d789..11bb9ee59bbfd 100644 --- a/app/etc/di.xml +++ b/app/etc/di.xml @@ -8,6 +8,7 @@ + diff --git a/app/i18n/magento/de_de/composer.json b/app/i18n/magento/de_de/composer.json index 45c4e058908a9..6c7118d89984e 100644 --- a/app/i18n/magento/de_de/composer.json +++ b/app/i18n/magento/de_de/composer.json @@ -1,13 +1,13 @@ { "name": "magento/language-de_de", "description": "German (Germany) language", - "version": "0.1.0-alpha108", + "version": "0.42.0-beta1", "license": [ "OSL-3.0", "AFL-3.0" ], "require": { - "magento/framework": "0.1.0-alpha108", + "magento/framework": "0.42.0-beta1", "magento/magento-composer-installer": "*" }, "type": "magento2-language", diff --git a/app/i18n/magento/en_us/composer.json b/app/i18n/magento/en_us/composer.json index 78f32008c4c82..7ffb52d829f96 100644 --- a/app/i18n/magento/en_us/composer.json +++ b/app/i18n/magento/en_us/composer.json @@ -1,13 +1,13 @@ { "name": "magento/language-en_us", "description": "English (United States) language", - "version": "0.1.0-alpha108", + "version": "0.42.0-beta1", "license": [ "OSL-3.0", "AFL-3.0" ], "require": { - "magento/framework": "0.1.0-alpha108", + "magento/framework": "0.42.0-beta1", "magento/magento-composer-installer": "*" }, "type": "magento2-language", diff --git a/app/i18n/magento/es_es/composer.json b/app/i18n/magento/es_es/composer.json index 0a74fdc4543ab..f99489d51672b 100644 --- a/app/i18n/magento/es_es/composer.json +++ b/app/i18n/magento/es_es/composer.json @@ -1,13 +1,13 @@ { "name": "magento/language-es_es", "description": "Spanish (Spain) language", - "version": "0.1.0-alpha108", + "version": "0.42.0-beta1", "license": [ "OSL-3.0", "AFL-3.0" ], "require": { - "magento/framework": "0.1.0-alpha108", + "magento/framework": "0.42.0-beta1", "magento/magento-composer-installer": "*" }, "type": "magento2-language", diff --git a/app/i18n/magento/fr_fr/composer.json b/app/i18n/magento/fr_fr/composer.json index d915ee76f3399..bda3533f63981 100644 --- a/app/i18n/magento/fr_fr/composer.json +++ b/app/i18n/magento/fr_fr/composer.json @@ -1,13 +1,13 @@ { "name": "magento/language-fr_fr", "description": "French (France) language", - "version": "0.1.0-alpha108", + "version": "0.42.0-beta1", "license": [ "OSL-3.0", "AFL-3.0" ], "require": { - "magento/framework": "0.1.0-alpha108", + "magento/framework": "0.42.0-beta1", "magento/magento-composer-installer": "*" }, "type": "magento2-language", diff --git a/app/i18n/magento/nl_nl/composer.json b/app/i18n/magento/nl_nl/composer.json index 65bba789606d5..357991fb1e47d 100644 --- a/app/i18n/magento/nl_nl/composer.json +++ b/app/i18n/magento/nl_nl/composer.json @@ -1,13 +1,13 @@ { "name": "magento/language-nl_nl", "description": "Dutch (Netherlands) language", - "version": "0.1.0-alpha108", + "version": "0.42.0-beta1", "license": [ "OSL-3.0", "AFL-3.0" ], "require": { - "magento/framework": "0.1.0-alpha108", + "magento/framework": "0.42.0-beta1", "magento/magento-composer-installer": "*" }, "type": "magento2-language", diff --git a/app/i18n/magento/pt_br/composer.json b/app/i18n/magento/pt_br/composer.json index 1990858131225..1ce0e7526d9da 100644 --- a/app/i18n/magento/pt_br/composer.json +++ b/app/i18n/magento/pt_br/composer.json @@ -1,13 +1,13 @@ { "name": "magento/language-pt_br", "description": "Portuguese (Brazil) language", - "version": "0.1.0-alpha108", + "version": "0.42.0-beta1", "license": [ "OSL-3.0", "AFL-3.0" ], "require": { - "magento/framework": "0.1.0-alpha108", + "magento/framework": "0.42.0-beta1", "magento/magento-composer-installer": "*" }, "type": "magento2-language", diff --git a/app/i18n/magento/zh_cn/composer.json b/app/i18n/magento/zh_cn/composer.json index 5b4acb09b6a31..06cb1f677bdac 100644 --- a/app/i18n/magento/zh_cn/composer.json +++ b/app/i18n/magento/zh_cn/composer.json @@ -1,13 +1,13 @@ { "name": "magento/language-zh_cn", "description": "Chinese (China) language", - "version": "0.1.0-alpha108", + "version": "0.42.0-beta1", "license": [ "OSL-3.0", "AFL-3.0" ], "require": { - "magento/framework": "0.1.0-alpha108", + "magento/framework": "0.42.0-beta1", "magento/magento-composer-installer": "*" }, "type": "magento2-language", diff --git a/composer.json b/composer.json index 7d2f652018410..ae473710a82d7 100644 --- a/composer.json +++ b/composer.json @@ -2,7 +2,7 @@ "name": "magento/project-community-edition", "description": "Magento project (Community Edition)", "type": "project", - "version": "0.1.0-alpha108", + "version": "0.42.0-beta1", "license": [ "OSL-3.0", "AFL-3.0" @@ -29,7 +29,7 @@ "zendframework/zend-serializer": "2.3.1", "zendframework/zend-log": "2.3.1", "zendframework/zend-http": "2.3.1", - "magento/zendframework1": "1.12.9", + "magento/zendframework1": "1.12.9-patch1", "composer/composer": "1.0.0-alpha8" }, "require-dev": { @@ -52,7 +52,6 @@ "replace": { "magento/module-admin-notification": "self.version", "magento/module-authorization": "self.version", - "magento/module-authorizenet": "self.version", "magento/module-backend": "self.version", "magento/module-backup": "self.version", "magento/module-bundle": "self.version", @@ -101,10 +100,8 @@ "magento/module-newsletter": "self.version", "magento/module-offline-payments": "self.version", "magento/module-offline-shipping": "self.version", - "magento/module-ogone": "self.version", "magento/module-page-cache": "self.version", "magento/module-payment": "self.version", - "magento/module-paypal": "self.version", "magento/module-persistent": "self.version", "magento/module-product-alert": "self.version", "magento/module-reports": "self.version", @@ -197,7 +194,6 @@ "psr-4": { "Magento\\Sniffs\\": "dev/tests/static/framework/Magento/Sniffs/", "Magento\\Tools\\": "dev/tools/Magento/Tools/", - "Magento\\Tools\\License\\": "dev/build/publication/license/", "Magento\\Tools\\Sanity\\": "dev/build/publication/sanity/Magento/Tools/Sanity/", "Magento\\TestFramework\\Inspection\\": "dev/tests/static/framework/Magento/TestFramework/Inspection/", "Magento\\TestFramework\\Utility\\": "dev/tests/static/framework/Magento/TestFramework/Utility/", diff --git a/dev/tests/functional/composer.json b/dev/tests/functional/composer.json new file mode 100644 index 0000000000000..ab4bd87728a67 --- /dev/null +++ b/dev/tests/functional/composer.json @@ -0,0 +1,16 @@ +{ + "require": { + "magento/mtf": "1.0.0-rc10", + "php": ">=5.4.0", + "phpunit/phpunit": "4.1.0", + "phpunit/phpunit-selenium": ">=1.2", + "netwing/selenium-server-standalone": ">=2.35" + }, + "autoload": { + "psr-4": { + "Mtf\\": ["lib/Mtf/", "generated/Mtf/", "testsuites/Mtf/"], + "Magento\\": ["generated/Magento/", "tests/app/Magento/"], + "Test\\": "generated/Test/" + } + } +} diff --git a/dev/tests/functional/composer.json.dist b/dev/tests/functional/composer.json.dist index 00488d8d09689..2ea37c5b4a7aa 100644 --- a/dev/tests/functional/composer.json.dist +++ b/dev/tests/functional/composer.json.dist @@ -1,16 +1,16 @@ { "require": { - "magento/mtf": "dev-master", + "magento/mtf": "dev-develop", "php": ">=5.4.0", "phpunit/phpunit": "4.1.0", "phpunit/phpunit-selenium": ">=1.2", "netwing/selenium-server-standalone": ">=2.35" }, "autoload": { - "psr-0": { - "Mtf\\": "lib", - "Magento\\": "", - "": ["testsuites", "generated", "lib", "tests/app"] + "psr-4": { + "Mtf\\": ["lib/Mtf/", "generated/Mtf/", "testsuites/Mtf/"], + "Magento\\": ["generated/Magento/", "tests/app/Magento/"], + "Test\\": "generated/Test/" } } } diff --git a/dev/tests/functional/config/install_data.yml.dist b/dev/tests/functional/config/install_data.yml.dist new file mode 100644 index 0000000000000..4bffc0a19622d --- /dev/null +++ b/dev/tests/functional/config/install_data.yml.dist @@ -0,0 +1,9 @@ +# @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) +db_credentials: + dbHost: '127.0.0.1' + dbUser: 'root' + dbPassword: '123123q' + dbName: 'default' +url: + base_url: 'http://127.0.0.1/magento2/' + backend_frontname: 'backend' diff --git a/dev/tests/functional/lib/Mtf/App/State/State1.php b/dev/tests/functional/lib/Mtf/App/State/State1.php index 4efebde76be77..c1b094e88cf50 100644 --- a/dev/tests/functional/lib/Mtf/App/State/State1.php +++ b/dev/tests/functional/lib/Mtf/App/State/State1.php @@ -5,7 +5,9 @@ namespace Mtf\App\State; -use Magento\Core\Test\Fixture\Config; +use Mtf\ObjectManager; +use Mtf\Fixture\FixtureFactory; +use Magento\Core\Test\Fixture\ConfigData; /** * Class State1 @@ -13,20 +15,37 @@ */ class State1 extends AbstractState { + // TODO: Move data set to ConfigData fixture after implement merging fixture xml + /** + * Data set for configuration state + * + * @var array + */ + protected $configDataSet = [ + 'section' => [ + [ + 'path' => 'cms/wysiwyg/enabled', + 'scope' => 'default', + 'scope_id' => 1, + 'value' => 'disabled', + ], + ] + ]; + /** * Configuration fixture * - * @var Config + * @var ConfigData */ protected $config; /** * @construct - * @param Config $config + * @param FixtureFactory $fixtureFactory */ - public function __construct(Config $config) + public function __construct(FixtureFactory $fixtureFactory) { - $this->config = $config; + $this->config = $fixtureFactory->createByCode('configData', ['data' => $this->configDataSet]); } /** @@ -35,8 +54,9 @@ public function __construct(Config $config) public function apply() { parent::apply(); - $this->config->switchData('app_state1_configuration'); - $this->config->persist(); + if (file_exists(dirname(dirname(dirname(MTF_BP))) . '/app/etc/config.php')) { + $this->config->persist(); + } } /** diff --git a/dev/tests/functional/lib/Mtf/Client/Driver/Selenium/Element/ConditionsElement.php b/dev/tests/functional/lib/Mtf/Client/Driver/Selenium/Element/ConditionsElement.php index e5a53c67fbaaf..358a5df3f25a7 100644 --- a/dev/tests/functional/lib/Mtf/Client/Driver/Selenium/Element/ConditionsElement.php +++ b/dev/tests/functional/lib/Mtf/Client/Driver/Selenium/Element/ConditionsElement.php @@ -166,7 +166,7 @@ class ConditionsElement extends AbstractElement * * @var string */ - protected $ruleParamInput = '.element [name^="rule[conditions]"]'; + protected $ruleParamInput = '.element [name^="rule"]'; /** * Set value to conditions diff --git a/dev/tests/functional/lib/Mtf/Client/Driver/Selenium/Element/GlobalsearchElement.php b/dev/tests/functional/lib/Mtf/Client/Driver/Selenium/Element/GlobalsearchElement.php new file mode 100644 index 0000000000000..6d59992fcdfa3 --- /dev/null +++ b/dev/tests/functional/lib/Mtf/Client/Driver/Selenium/Element/GlobalsearchElement.php @@ -0,0 +1,192 @@ +_eventManager->dispatchEvent(['set_value'], [__METHOD__, $this->getAbsoluteSelector()]); + + $this->waitInitElement(); + + if (!$this->find($this->searchInput)->isVisible()) { + $this->find($this->searchIcon)->click(); + } + $this->selectWindow(); + $this->clear(); + $this->find($this->searchInput)->_getWrappedElement()->value($value); + $this->selectWindow(); + + $this->waitResult(); + } + + /** + * Clear value of element. + * + * @return void + */ + protected function clear() + { + $element = $this->find($this->searchInput); + while ('' != $element->getValue()) { + $element->keys([self::BACKSPACE]); + } + } + + /** + * Select to last window. + * + * @return void + */ + protected function selectWindow() + { + $windowHandles = $this->_driver->windowHandles(); + $this->_driver->window(end($windowHandles)); + } + + /** + * Wait init search suggest container. + * + * @return void + * @throws \Exception + */ + protected function waitInitElement() + { + $browser = clone $this; + $selector = $this->initializedSuggest; + + $browser->waitUntil( + function () use ($browser, $selector) { + return $browser->find($selector, Locator::SELECTOR_XPATH)->isVisible() ? true : null; + } + ); + } + + /** + * Wait for search result is visible. + * + * @return void + */ + public function waitResult() + { + $browser = clone $this; + $selector = $this->searchResult; + + $browser->waitUntil( + function () use ($browser, $selector) { + if ($browser->find($selector)->isVisible()) { + return true; + } else { + $browser->selectWindow(); + return null; + } + } + ); + } + + /** + * Get value. + * + * @throws \BadMethodCallException + */ + public function getValue() + { + throw new \BadMethodCallException('Not applicable for this class of elements (GlobalSearch)'); + } + + /** + * Checking exist value in search result. + * + * @param string $value + * @return bool + */ + public function isExistValueInSearchResult($value) + { + $searchResult = $this->find($this->searchResult); + if (!$searchResult->isVisible()) { + return false; + } + $searchResults = $this->getSearchResults(); + return in_array($value, $searchResults); + } + + /** + * Get search results. + * + * @return array + */ + protected function getSearchResults() + { + /** @var Element $searchResult */ + $searchResult = $this->find($this->searchResult); + $resultItems = $searchResult->find($this->resultItem)->getElements(); + $resultArray = []; + + /** @var Element $resultItem */ + foreach ($resultItems as $resultItem) { + $resultItemLink = $resultItem->find('a'); + $resultText = $resultItemLink->isVisible() + ? trim($resultItemLink->getText()) + : trim($resultItem->getText()); + $resultArray[] = $resultText; + } + + return $resultArray; + } +} diff --git a/dev/tests/functional/lib/Mtf/Client/Driver/Selenium/Element/MultisuggestElement.php b/dev/tests/functional/lib/Mtf/Client/Driver/Selenium/Element/MultisuggestElement.php index 96ef33dad0a17..3457b67854d88 100644 --- a/dev/tests/functional/lib/Mtf/Client/Driver/Selenium/Element/MultisuggestElement.php +++ b/dev/tests/functional/lib/Mtf/Client/Driver/Selenium/Element/MultisuggestElement.php @@ -9,41 +9,40 @@ use Mtf\Client\Element\Locator; /** - * Class MultisuggestElement - * Typified element class for multi suggest element + * Typified element class for multi suggest element. */ class MultisuggestElement extends SuggestElement { /** - * Selector list choice + * Selector list choice. * * @var string */ protected $listChoice = './/ul[contains(@class,"mage-suggest-choices")]'; /** - * Selector choice item + * Selector choice item. * * @var string */ protected $choice = './/li/div[text()="%s"]/..'; /** - * Selector choice value + * Selector choice value. * * @var string */ protected $choiceValue = './/li[contains(@class,"mage-suggest-choice")]/div'; /** - * Selector remove choice item + * Selector remove choice item. * * @var string */ protected $choiceClose = '.mage-suggest-choice-close'; /** - * Set value + * Set value. * * @param array|string $values * @return void @@ -55,13 +54,14 @@ public function setValue($values) $this->clear(); foreach ((array)$values as $value) { if (!$this->isChoice($value)) { + $this->selectWindow(); parent::setValue($value); } } } /** - * Get value + * Get value. * * @return array */ @@ -81,7 +81,7 @@ public function getValue() } /** - * Check exist selected item + * Check exist selected item. * * @param string $value * @return bool @@ -92,7 +92,7 @@ protected function isChoice($value) } /** - * Clear element + * Clear element. * * @return void */ @@ -104,4 +104,15 @@ protected function clear() $choiceClose = $this->find($this->choiceClose); } } + + /** + * Select to last window. + * + * @return void + */ + protected function selectWindow() + { + $windowHandles = $this->_driver->windowHandles(); + $this->_driver->window(end($windowHandles)); + } } diff --git a/dev/tests/functional/lib/Mtf/Client/Driver/Selenium/Element/SuggestElement.php b/dev/tests/functional/lib/Mtf/Client/Driver/Selenium/Element/SuggestElement.php index 1a4429d10c2b7..225f4634db5b0 100755 --- a/dev/tests/functional/lib/Mtf/Client/Driver/Selenium/Element/SuggestElement.php +++ b/dev/tests/functional/lib/Mtf/Client/Driver/Selenium/Element/SuggestElement.php @@ -14,6 +14,11 @@ */ class SuggestElement extends Element { + /** + * "Backspace" key code. + */ + const BACKSPACE = "\xEE\x80\x83"; + /** * Selector suggest input * @@ -45,11 +50,25 @@ public function setValue($value) { $this->_eventManager->dispatchEvent(['set_value'], [__METHOD__, $this->getAbsoluteSelector()]); - $this->find($this->suggest)->setValue($value); + $this->clear(); + $this->find($this->suggest)->_getWrappedElement()->value($value); $this->waitResult(); $this->find(sprintf($this->resultItem, $value), Locator::SELECTOR_XPATH)->click(); } + /** + * Clear value of element. + * + * @return void + */ + protected function clear() + { + $element = $this->find($this->suggest); + while ($element->getValue() != '') { + $element->keys([self::BACKSPACE]); + } + } + /** * Wait for search result is visible * diff --git a/dev/tests/functional/phpunit.xml.dist b/dev/tests/functional/phpunit.xml.dist index 3a26aa0bac228..3cfdfc5ccbdfe 100755 --- a/dev/tests/functional/phpunit.xml.dist +++ b/dev/tests/functional/phpunit.xml.dist @@ -21,22 +21,23 @@ - + - + - - - - - - - - - + + + + + + + + + + diff --git a/dev/tests/functional/tests/app/Magento/Backend/Test/Block/Page/Main.php b/dev/tests/functional/tests/app/Magento/Backend/Test/Block/Page/Main.php new file mode 100644 index 0000000000000..69fbab87303b4 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Backend/Test/Block/Page/Main.php @@ -0,0 +1,31 @@ +_rootElement->find($this->revenuePriceBlock)->getText(); + } +} diff --git a/dev/tests/functional/tests/app/Magento/Backend/Test/Block/System/Store/FormPageFooterActions.php b/dev/tests/functional/tests/app/Magento/Backend/Test/Block/System/Store/FormPageFooterActions.php deleted file mode 100644 index 7bebdcc662e96..0000000000000 --- a/dev/tests/functional/tests/app/Magento/Backend/Test/Block/System/Store/FormPageFooterActions.php +++ /dev/null @@ -1,32 +0,0 @@ -_rootElement->find($this->deleteButton)->click(); - } -} diff --git a/dev/tests/functional/tests/app/Magento/Backend/Test/Constraint/AssertGlobalSearchCustomerName.php b/dev/tests/functional/tests/app/Magento/Backend/Test/Constraint/AssertGlobalSearchCustomerName.php index 22d567e9e2829..4a0daeb8c3a2a 100644 --- a/dev/tests/functional/tests/app/Magento/Backend/Test/Constraint/AssertGlobalSearchCustomerName.php +++ b/dev/tests/functional/tests/app/Magento/Backend/Test/Constraint/AssertGlobalSearchCustomerName.php @@ -15,12 +15,9 @@ */ class AssertGlobalSearchCustomerName extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that customer name is present in search results diff --git a/dev/tests/functional/tests/app/Magento/Backend/Test/Constraint/AssertGlobalSearchNoRecordsFound.php b/dev/tests/functional/tests/app/Magento/Backend/Test/Constraint/AssertGlobalSearchNoRecordsFound.php index fd87317999993..412c3e680e70f 100644 --- a/dev/tests/functional/tests/app/Magento/Backend/Test/Constraint/AssertGlobalSearchNoRecordsFound.php +++ b/dev/tests/functional/tests/app/Magento/Backend/Test/Constraint/AssertGlobalSearchNoRecordsFound.php @@ -14,18 +14,15 @@ */ class AssertGlobalSearchNoRecordsFound extends AbstractConstraint { + /* tags */ + const SEVERITY = 'low'; + /* end tags */ + /** * Expected search result text */ const EXPECTED_RESULT = 'No records found.'; - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; - /** * Assert that search result contains expected text * diff --git a/dev/tests/functional/tests/app/Magento/Backend/Test/Constraint/AssertGlobalSearchOrderId.php b/dev/tests/functional/tests/app/Magento/Backend/Test/Constraint/AssertGlobalSearchOrderId.php index 9b5c2f328cb0a..e0d317250dc74 100644 --- a/dev/tests/functional/tests/app/Magento/Backend/Test/Constraint/AssertGlobalSearchOrderId.php +++ b/dev/tests/functional/tests/app/Magento/Backend/Test/Constraint/AssertGlobalSearchOrderId.php @@ -15,12 +15,9 @@ */ class AssertGlobalSearchOrderId extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that order Id is present in search results diff --git a/dev/tests/functional/tests/app/Magento/Backend/Test/Constraint/AssertGlobalSearchProductName.php b/dev/tests/functional/tests/app/Magento/Backend/Test/Constraint/AssertGlobalSearchProductName.php index b74d89ab739cf..f5cb9cd0e5730 100644 --- a/dev/tests/functional/tests/app/Magento/Backend/Test/Constraint/AssertGlobalSearchProductName.php +++ b/dev/tests/functional/tests/app/Magento/Backend/Test/Constraint/AssertGlobalSearchProductName.php @@ -16,12 +16,9 @@ */ class AssertGlobalSearchProductName extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that product name is present in search results diff --git a/dev/tests/functional/tests/app/Magento/Backend/Test/Page/Adminhtml/Dashboard.xml b/dev/tests/functional/tests/app/Magento/Backend/Test/Page/Adminhtml/Dashboard.xml index b4ad0db67abb8..ac4a3670f2f0f 100644 --- a/dev/tests/functional/tests/app/Magento/Backend/Test/Page/Adminhtml/Dashboard.xml +++ b/dev/tests/functional/tests/app/Magento/Backend/Test/Page/Adminhtml/Dashboard.xml @@ -16,6 +16,11 @@ .page-title css selector + + Magento\Backend\Test\Block\Page\Main + .dashboard-main + css selector + Magento\Backend\Test\Block\Menu .navigation diff --git a/dev/tests/functional/tests/app/Magento/Backend/Test/Page/Adminhtml/DeleteGroup.xml b/dev/tests/functional/tests/app/Magento/Backend/Test/Page/Adminhtml/DeleteGroup.xml index dd627c66fea4f..e4523af95b95a 100644 --- a/dev/tests/functional/tests/app/Magento/Backend/Test/Page/Adminhtml/DeleteGroup.xml +++ b/dev/tests/functional/tests/app/Magento/Backend/Test/Page/Adminhtml/DeleteGroup.xml @@ -11,10 +11,10 @@ #edit_form css selector - - Magento\Backend\Test\Block\System\Store\FormPageFooterActions - .content-footer + + Magento\Backend\Test\Block\System\Store\FormPageActions + .page-main-actions css selector - + diff --git a/dev/tests/functional/tests/app/Magento/Backend/Test/Page/Adminhtml/DeleteWebsite.xml b/dev/tests/functional/tests/app/Magento/Backend/Test/Page/Adminhtml/DeleteWebsite.xml index 574c0c90d4927..a8d71273b067d 100644 --- a/dev/tests/functional/tests/app/Magento/Backend/Test/Page/Adminhtml/DeleteWebsite.xml +++ b/dev/tests/functional/tests/app/Magento/Backend/Test/Page/Adminhtml/DeleteWebsite.xml @@ -11,10 +11,10 @@ #edit_form css selector - - Magento\Backend\Test\Block\System\Store\FormPageFooterActions - .content-footer + + Magento\Backend\Test\Block\System\Store\FormPageActions + .page-main-actions css selector - + diff --git a/dev/tests/functional/tests/app/Magento/Backend/Test/Page/Adminhtml/StoreDelete.xml b/dev/tests/functional/tests/app/Magento/Backend/Test/Page/Adminhtml/StoreDelete.xml index 2cc738d80ea35..a1662ce9a9446 100644 --- a/dev/tests/functional/tests/app/Magento/Backend/Test/Page/Adminhtml/StoreDelete.xml +++ b/dev/tests/functional/tests/app/Magento/Backend/Test/Page/Adminhtml/StoreDelete.xml @@ -16,10 +16,10 @@ #edit_form css selector - - Magento\Backend\Test\Block\System\Store\FormPageFooterActions - .content-footer + + Magento\Backend\Test\Block\System\Store\FormPageActions + .page-main-actions css selector - + diff --git a/dev/tests/functional/tests/app/Magento/Backend/Test/TestCase/GlobalSearchEntityTest.php b/dev/tests/functional/tests/app/Magento/Backend/Test/TestCase/GlobalSearchEntityTest.php deleted file mode 100644 index cb04180eae5d7..0000000000000 --- a/dev/tests/functional/tests/app/Magento/Backend/Test/TestCase/GlobalSearchEntityTest.php +++ /dev/null @@ -1,63 +0,0 @@ -dashboard = $dashboard; - } - - /** - * Run Global Search Entity Test - * - * @param GlobalSearch $search - * @return void - */ - public function test(GlobalSearch $search) - { - //Steps: - $this->dashboard->open(); - $this->dashboard->getAdminPanelHeader()->search($search->getQuery()); - } -} diff --git a/dev/tests/functional/tests/app/Magento/Backend/Test/TestCase/GlobalSearchEntityTest/test.csv b/dev/tests/functional/tests/app/Magento/Backend/Test/TestCase/GlobalSearchEntityTest/test.csv deleted file mode 100644 index d72d76a461c6e..0000000000000 --- a/dev/tests/functional/tests/app/Magento/Backend/Test/TestCase/GlobalSearchEntityTest/test.csv +++ /dev/null @@ -1,6 +0,0 @@ -"description";"search/data/query";"constraint";"issue" -"search existed product and order created with this product";"orderInjectable::default::product::name";"assertGlobalSearchProductName, assertGlobalSearchOrderId";"Bug: MAGETWO-28448" -"search with 2 sign return no results";":)";"assertGlobalSearchNoRecordsFound";"" -"search product by sku";"orderInjectable::default::product::sku";"assertGlobalSearchProductName";"" -"search existed customer";"customerInjectable::johndoe_unique::lastname";"assertGlobalSearchCustomerName";"" -"search order (by order id)";"orderInjectable::default::id";"assertGlobalSearchOrderId";"" \ No newline at end of file diff --git a/dev/tests/functional/tests/app/Magento/Backend/Test/etc/constraint.xml b/dev/tests/functional/tests/app/Magento/Backend/Test/etc/constraint.xml index 792c6787056ef..e6f96b2219e9c 100644 --- a/dev/tests/functional/tests/app/Magento/Backend/Test/etc/constraint.xml +++ b/dev/tests/functional/tests/app/Magento/Backend/Test/etc/constraint.xml @@ -6,15 +6,15 @@ --> - low + low - low + low - low + low - low + low diff --git a/dev/tests/functional/tests/app/Magento/Backup/Test/Constraint/AssertBackupInGrid.php b/dev/tests/functional/tests/app/Magento/Backup/Test/Constraint/AssertBackupInGrid.php index 208e59d130eec..33e12ff62d1f5 100644 --- a/dev/tests/functional/tests/app/Magento/Backup/Test/Constraint/AssertBackupInGrid.php +++ b/dev/tests/functional/tests/app/Magento/Backup/Test/Constraint/AssertBackupInGrid.php @@ -14,12 +14,9 @@ */ class AssertBackupInGrid extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that one backup row is present in Backups grid diff --git a/dev/tests/functional/tests/app/Magento/Backup/Test/etc/constraint.xml b/dev/tests/functional/tests/app/Magento/Backup/Test/etc/constraint.xml index b912c9f142017..19c580a66f7a4 100644 --- a/dev/tests/functional/tests/app/Magento/Backup/Test/etc/constraint.xml +++ b/dev/tests/functional/tests/app/Magento/Backup/Test/etc/constraint.xml @@ -6,6 +6,6 @@ --> - low + low diff --git a/dev/tests/functional/tests/app/Magento/Bundle/Test/Constraint/AssertBundleInCategory.php b/dev/tests/functional/tests/app/Magento/Bundle/Test/Constraint/AssertBundleInCategory.php index 87f12ff64b2a1..2b39584bd185f 100644 --- a/dev/tests/functional/tests/app/Magento/Bundle/Test/Constraint/AssertBundleInCategory.php +++ b/dev/tests/functional/tests/app/Magento/Bundle/Test/Constraint/AssertBundleInCategory.php @@ -16,12 +16,9 @@ */ class AssertBundleInCategory extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Check bundle product on the category page diff --git a/dev/tests/functional/tests/app/Magento/Bundle/Test/Constraint/AssertBundleItemsOnProductPage.php b/dev/tests/functional/tests/app/Magento/Bundle/Test/Constraint/AssertBundleItemsOnProductPage.php index deb9c41f46142..2fd74a3e6e37e 100755 --- a/dev/tests/functional/tests/app/Magento/Bundle/Test/Constraint/AssertBundleItemsOnProductPage.php +++ b/dev/tests/functional/tests/app/Magento/Bundle/Test/Constraint/AssertBundleItemsOnProductPage.php @@ -16,12 +16,9 @@ */ class AssertBundleItemsOnProductPage extends AbstractAssertForm { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that displayed product bundle items data on product page equals passed from fixture preset diff --git a/dev/tests/functional/tests/app/Magento/Bundle/Test/Constraint/AssertBundlePriceType.php b/dev/tests/functional/tests/app/Magento/Bundle/Test/Constraint/AssertBundlePriceType.php index ba01e34ddcf23..a0452c4bcf51e 100755 --- a/dev/tests/functional/tests/app/Magento/Bundle/Test/Constraint/AssertBundlePriceType.php +++ b/dev/tests/functional/tests/app/Magento/Bundle/Test/Constraint/AssertBundlePriceType.php @@ -16,12 +16,9 @@ */ class AssertBundlePriceType extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Product price type diff --git a/dev/tests/functional/tests/app/Magento/Bundle/Test/Constraint/AssertBundlePriceView.php b/dev/tests/functional/tests/app/Magento/Bundle/Test/Constraint/AssertBundlePriceView.php index 3128633d464b5..5dc36a9727af2 100644 --- a/dev/tests/functional/tests/app/Magento/Bundle/Test/Constraint/AssertBundlePriceView.php +++ b/dev/tests/functional/tests/app/Magento/Bundle/Test/Constraint/AssertBundlePriceView.php @@ -15,12 +15,9 @@ */ class AssertBundlePriceView extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that displayed price view for bundle product on product page equals passed from fixture. diff --git a/dev/tests/functional/tests/app/Magento/Bundle/Test/Constraint/AssertBundleProductForm.php b/dev/tests/functional/tests/app/Magento/Bundle/Test/Constraint/AssertBundleProductForm.php index 7c9e55c95eb78..ac8080f613c13 100755 --- a/dev/tests/functional/tests/app/Magento/Bundle/Test/Constraint/AssertBundleProductForm.php +++ b/dev/tests/functional/tests/app/Magento/Bundle/Test/Constraint/AssertBundleProductForm.php @@ -12,12 +12,9 @@ */ class AssertBundleProductForm extends AssertProductForm { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Formatting options for array values diff --git a/dev/tests/functional/tests/app/Magento/Bundle/Test/Constraint/AssertTierPriceOnBundleProductPage.php b/dev/tests/functional/tests/app/Magento/Bundle/Test/Constraint/AssertTierPriceOnBundleProductPage.php index 2e29a70eccf80..459247667b2c8 100644 --- a/dev/tests/functional/tests/app/Magento/Bundle/Test/Constraint/AssertTierPriceOnBundleProductPage.php +++ b/dev/tests/functional/tests/app/Magento/Bundle/Test/Constraint/AssertTierPriceOnBundleProductPage.php @@ -15,12 +15,9 @@ */ class AssertTierPriceOnBundleProductPage extends AssertProductTierPriceOnProductPage { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Tier price block diff --git a/dev/tests/functional/tests/app/Magento/Bundle/Test/TestCase/CreateBundleProductEntityTest/test.csv b/dev/tests/functional/tests/app/Magento/Bundle/Test/TestCase/CreateBundleProductEntityTest/test.csv index a5cb3ad71d77d..53d0c45423592 100644 --- a/dev/tests/functional/tests/app/Magento/Bundle/Test/TestCase/CreateBundleProductEntityTest/test.csv +++ b/dev/tests/functional/tests/app/Magento/Bundle/Test/TestCase/CreateBundleProductEntityTest/test.csv @@ -1,15 +1,15 @@ -"product/data/name";"product/data/sku_type";"product/data/sku";"product/data/status";"product/data/price_type";"product/data/price/value";"product/data/price/preset";"product/data/tax_class_id/dataSet";"product/data/quantity_and_stock_status/is_in_stock";"product/data/weight_type";"product/data/weight";"product/data/category";"product/data/description";"product/data/group_price/preset";"product/data/special_price";"product/data/special_from_date/pattern";"product/data/special_to_date/pattern";"product/data/tier_price/preset";"product/data/price_view";"product/data/stock_data/use_config_manage_stock";"product/data/stock_data/manage_stock";"product/data/shipment_type";"product/data/bundle_selections/preset";"product/data/bundle_selections/products";"product/data/checkout_data/preset";"product/data/custom_options/preset";"product/data/custom_options/import_products";"product/data/visibility";"product/data/use_config_gift_message_available";"product/data/gift_message_available";"constraint";"issue" -"BundleProduct %isolation%";"-";"bundle_sku_%isolation%";"-";"-";"-";"-";"-";"-";"-";"-";"-";"Bundle Product Dynamic Required";"-";"-";"-";"-";"-";"-";"No";"No";"-";"default_dynamic";"catalogProductSimple::100_dollar_product,catalogProductVirtual::50_dollar_product";"default";"-";"-";"-";"-";"-";"assertProductSaveMessage, assertProductInGrid, assertBundleItemsOnProductPage";"" -"BundleProduct %isolation%";"Fixed";"bundle_sku_%isolation%";"Product offline";"Dynamic";"-";"-";"-";"Out of Stock";"Dynamic";"-";"category_%isolation%";"-";"-";"-";"-";"-";"-";"-";"-";"-";"Separately";"default_dynamic";"catalogProductSimple::100_dollar_product,catalogProductVirtual::50_dollar_product";"default";"-";"-";"Catalog, Search";"No";"Yes";"assertProductSaveMessage, assertProductNotSearchableBySku";"" -"BundleProduct %isolation%";"Dynamic";"bundle_sku_%isolation%";"Product online";"Dynamic";"-";"dynamic-200";"-";"In Stock";"Dynamic";"-";"category_%isolation%";"Bundle Product Dynamic";"-";"-";"-";"-";"-";"Price Range";"-";"-";"Together";"all_types_dynamic";"catalogProductSimple::100_dollar_product,catalogProductVirtual::50_dollar_product|catalogProductSimple::100_dollar_product,catalogProductVirtual::50_dollar_product|catalogProductSimple::100_dollar_product,catalogProductVirtual::50_dollar_product|catalogProductSimple::100_dollar_product,catalogProductVirtual::50_dollar_product";"all_types_bundle_options";"-";"-";"Catalog, Search";"No";"Yes";"assertProductSaveMessage, assertProductInGrid, assertBundleProductForm, assertProductSearchableBySku, assertBundleProductPage, assertProductInStock, assertBundleItemsOnProductPage, assertProductVisibleInCategory, assertBundlePriceView, assertBundlePriceType";"" -"BundleProduct %isolation%";"Fixed";"bundle_sku_%isolation%";"-";"Fixed";"10";"fixed-15";"None";"-";"Fixed";"10";"-";"Bundle Product Fixed Required";"-";"-";"-";"-";"-";"-";"-";"-";"-";"default_fixed";"catalogProductSimple::100_dollar_product,catalogProductVirtual::50_dollar_product";"default";"-";"-";"-";"-";"-";"assertProductSaveMessage, assertProductInGrid, assertBundleProductForm, assertProductSearchableBySku, assertBundleProductPage, assertBundleItemsOnProductPage";"" -"BundleProduct %isolation%";"Fixed";"bundle_sku_%isolation%";"Product online";"Fixed";"100";"fixed-24";"Taxable Goods";"In Stock";"Fixed";"10";"category_%isolation%";"Bundle Product Fixed";"default";"-";"-";"-";"-";"As Low as";"-";"-";"Separately";"all_types_fixed";"catalogProductSimple::100_dollar_product,catalogProductVirtual::50_dollar_product|catalogProductSimple::100_dollar_product,catalogProductVirtual::50_dollar_product|catalogProductSimple::100_dollar_product,catalogProductVirtual::50_dollar_product|catalogProductSimple::100_dollar_product,catalogProductVirtual::50_dollar_product";"all_types_bundle_fixed_and_custom_options";"all_types";"-";"Catalog, Search";"No";"No";"assertProductSaveMessage, assertProductInGrid, assertBundleProductForm, assertProductVisibleInCategory, assertBundleProductPage, assertProductInStock, assertGroupedPriceOnBundleProductPage, assertBundleItemsOnProductPage, assertBundlePriceView, assertBundlePriceType";"" -"BundleProduct %isolation%";"Fixed";"bundle_sku_%isolation%";"Product online";"Fixed";"10";"fixed-1";"Taxable Goods";"Out of Stock";"Fixed";"10";"category_%isolation%";"-";"-";"10";"m/d/Y";"m/d/Y +3 days";"-";"Price Range";"No";"Yes";"Together";"with_not_required_options";"catalogProductSimple::100_dollar_product,catalogProductVirtual::50_dollar_product|catalogProductSimple::100_dollar_product,catalogProductVirtual::50_dollar_product";"with_not_required_options";"-";"-";"Catalog";"No";"No";"assertProductSaveMessage, assertProductInGrid, assertBundleProductForm, assertBundleProductPage, assertProductOutOfStock, assertBundlePriceView";"Bug: MAGETWO-26980" -"BundleProduct %isolation%";"Dynamic";"bundle_sku_%isolation%";"-";"Dynamic";"-";"dynamic-50";"-";"-";"Fixed";"10";"-";"-";"-";"-";"-";"-";"default";"As Low as";"No";"No";"Together";"default_dynamic";"catalogProductSimple::100_dollar_product,catalogProductVirtual::50_dollar_product";"default";"-";"-";"Search";"-";"-";"assertProductSaveMessage, assertProductInGrid, assertBundleProductForm, assertProductSearchableBySku, assertBundleProductPage, assertBundleItemsOnProductPage, assertTierPriceOnBundleProductPage";"" -"Bundle Dynamic %isolation%";"Dynamic";"sku_bundle_dynamic_%isolation%";"-";"Dynamic";"-";"dynamic-8";"-";"-";"-";"-";"-";"-";"-";"20";"-";"-";"-";"-";"-";"-";"-";"default_dynamic";"catalogProductSimple::100_dollar_product,catalogProductSimple::40_dollar_product";"default";"-";"-";"-";"-";"-";"assertProductSaveMessage, assertBundleInCategory";"" -"Bundle Dynamic %isolation%";"Dynamic";"sku_bundle_dynamic_%isolation%";"-";"Dynamic";"-";"dynamic-32";"-";"-";"-";"-";"-";"-";"MAGETWO-23061";"-";"-";"-";"-";"-";"-";"-";"-";"default_dynamic";"catalogProductSimple::100_dollar_product,catalogProductSimple::40_dollar_product";"default";"-";"-";"-";"-";"-";"assertProductSaveMessage, assertBundleInCategory, assertBundlePriceView, assertBundlePriceType";"" -"Bundle Dynamic %isolation%";"Dynamic";"sku_bundle_dynamic_%isolation%";"-";"Dynamic";"-";"dynamic-40";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"default_dynamic";"catalogProductSimple::100_dollar_product,catalogProductSimple::40_dollar_product";"default";"-";"-";"-";"-";"-";"assertProductSaveMessage, assertBundleInCategory, assertBundlePriceView, assertBundlePriceType";"" -"Bundle Fixed %isolation%";"Fixed";"sku_bundle_fixed_%isolation%";"-";"Fixed";"110";"fixed-115";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"second";"catalogProductSimple::100_dollar_product,catalogProductSimple::40_dollar_product";"with_custom_options_1";"drop_down_with_one_option_fixed_price";"catalogProductSimple::with_two_custom_option,catalogProductSimple::with_all_custom_option";"-";"-";"-";"assertProductSaveMessage, assertBundleInCategory, assertBundlePriceView, assertBundlePriceType, assertProductCustomOptionsOnBundleProductPage";"" -"Bundle Fixed %isolation%";"Fixed";"sku_bundle_fixed_%isolation%";"-";"Fixed";"110";"fixed-159";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"second";"catalogProductSimple::100_dollar_product,catalogProductSimple::40_dollar_product";"with_custom_options_2";"drop_down_with_one_option_percent_price";"-";"-";"-";"-";"assertProductSaveMessage, assertBundleInCategory, assertBundlePriceView, assertBundlePriceType";"" -"Bundle Dynamic %isolation%";"Dynamic";"sku_bundle_dynamic_%isolation%";"-";"Dynamic";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"default_dynamic";"catalogProductSimple::100_dollar_product,catalogProductSimple::40_dollar_product";"default";"-";"-";"-";"-";"-";"assertProductSaveMessage";"" -"Bundle Fixed %isolation%";"Fixed";"sku_bundle_fixed_%isolation%";"-";"Fixed";"10";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"second";"catalogProductSimple::100_dollar_product,catalogProductSimple::40_dollar_product";"default";"-";"-";"-";"-";"-";"assertProductSaveMessage";"" +"product/data/name";"product/data/sku_type";"product/data/sku";"product/data/status";"product/data/price_type";"product/data/price/value";"product/data/price/preset";"product/data/tax_class_id/dataSet";"product/data/quantity_and_stock_status/is_in_stock";"product/data/weight_type";"product/data/weight";"product/data/category";"product/data/description";"product/data/group_price/preset";"product/data/special_price";"product/data/special_from_date/pattern";"product/data/special_to_date/pattern";"product/data/tier_price/preset";"product/data/price_view";"product/data/stock_data/use_config_manage_stock";"product/data/stock_data/manage_stock";"product/data/shipment_type";"product/data/bundle_selections/preset";"product/data/bundle_selections/products";"product/data/checkout_data/preset";"product/data/custom_options/preset";"product/data/custom_options/import_products";"product/data/visibility";"product/data/use_config_gift_message_available";"product/data/gift_message_available";"constraint" +"BundleProduct %isolation%";"-";"bundle_sku_%isolation%";"-";"-";"-";"-";"-";"-";"-";"-";"-";"Bundle Product Dynamic Required";"-";"-";"-";"-";"-";"-";"No";"No";"-";"default_dynamic";"catalogProductSimple::100_dollar_product,catalogProductVirtual::50_dollar_product";"default";"-";"-";"-";"-";"-";"assertProductSaveMessage, assertProductInGrid, assertBundleItemsOnProductPage" +"BundleProduct %isolation%";"Fixed";"bundle_sku_%isolation%";"Product offline";"Dynamic";"-";"-";"-";"Out of Stock";"Dynamic";"-";"category_%isolation%";"-";"-";"-";"-";"-";"-";"-";"-";"-";"Separately";"default_dynamic";"catalogProductSimple::100_dollar_product,catalogProductVirtual::50_dollar_product";"default";"-";"-";"Catalog, Search";"No";"Yes";"assertProductSaveMessage, assertProductNotSearchableBySku" +"BundleProduct %isolation%";"Dynamic";"bundle_sku_%isolation%";"Product online";"Dynamic";"-";"dynamic-200";"-";"In Stock";"Dynamic";"-";"category_%isolation%";"Bundle Product Dynamic";"-";"-";"-";"-";"-";"Price Range";"-";"-";"Together";"all_types_dynamic";"catalogProductSimple::100_dollar_product,catalogProductVirtual::50_dollar_product|catalogProductSimple::100_dollar_product,catalogProductVirtual::50_dollar_product|catalogProductSimple::100_dollar_product,catalogProductVirtual::50_dollar_product|catalogProductSimple::100_dollar_product,catalogProductVirtual::50_dollar_product";"all_types_bundle_options";"-";"-";"Catalog, Search";"No";"Yes";"assertProductSaveMessage, assertProductInGrid, assertBundleProductForm, assertProductSearchableBySku, assertBundleProductPage, assertProductInStock, assertBundleItemsOnProductPage, assertProductVisibleInCategory, assertBundlePriceView, assertBundlePriceType" +"BundleProduct %isolation%";"Fixed";"bundle_sku_%isolation%";"-";"Fixed";"10";"fixed-15";"None";"-";"Fixed";"10";"-";"Bundle Product Fixed Required";"-";"-";"-";"-";"-";"-";"-";"-";"-";"default_fixed";"catalogProductSimple::100_dollar_product,catalogProductVirtual::50_dollar_product";"default";"-";"-";"-";"-";"-";"assertProductSaveMessage, assertProductInGrid, assertBundleProductForm, assertProductSearchableBySku, assertBundleProductPage, assertBundleItemsOnProductPage" +"BundleProduct %isolation%";"Fixed";"bundle_sku_%isolation%";"Product online";"Fixed";"100";"fixed-24";"Taxable Goods";"In Stock";"Fixed";"10";"category_%isolation%";"Bundle Product Fixed";"default";"-";"-";"-";"-";"As Low as";"-";"-";"Separately";"all_types_fixed";"catalogProductSimple::100_dollar_product,catalogProductVirtual::50_dollar_product|catalogProductSimple::100_dollar_product,catalogProductVirtual::50_dollar_product|catalogProductSimple::100_dollar_product,catalogProductVirtual::50_dollar_product|catalogProductSimple::100_dollar_product,catalogProductVirtual::50_dollar_product";"all_types_bundle_fixed_and_custom_options";"all_types";"-";"Catalog, Search";"No";"No";"assertProductSaveMessage, assertProductInGrid, assertBundleProductForm, assertProductVisibleInCategory, assertBundleProductPage, assertProductInStock, assertGroupedPriceOnBundleProductPage, assertBundleItemsOnProductPage, assertBundlePriceView, assertBundlePriceType" +"BundleProduct %isolation%";"Fixed";"bundle_sku_%isolation%";"Product online";"Fixed";"10";"fixed-1";"Taxable Goods";"Out of Stock";"Fixed";"10";"category_%isolation%";"-";"-";"10";"m/d/Y";"m/d/Y +3 days";"-";"Price Range";"No";"Yes";"Together";"with_not_required_options";"catalogProductSimple::100_dollar_product,catalogProductVirtual::50_dollar_product|catalogProductSimple::100_dollar_product,catalogProductVirtual::50_dollar_product";"with_not_required_options";"-";"-";"Catalog";"No";"No";"assertProductSaveMessage, assertProductInGrid, assertBundleProductForm, assertBundleProductPage, assertProductOutOfStock, assertBundlePriceView" +"BundleProduct %isolation%";"Dynamic";"bundle_sku_%isolation%";"-";"Dynamic";"-";"dynamic-50";"-";"-";"Fixed";"10";"-";"-";"-";"-";"-";"-";"default";"As Low as";"No";"No";"Together";"default_dynamic";"catalogProductSimple::100_dollar_product,catalogProductVirtual::50_dollar_product";"default";"-";"-";"Search";"-";"-";"assertProductSaveMessage, assertProductInGrid, assertBundleProductForm, assertProductSearchableBySku, assertBundleProductPage, assertBundleItemsOnProductPage, assertTierPriceOnBundleProductPage" +"Bundle Dynamic %isolation%";"Dynamic";"sku_bundle_dynamic_%isolation%";"-";"Dynamic";"-";"dynamic-8";"-";"-";"-";"-";"-";"-";"-";"20";"-";"-";"-";"-";"-";"-";"-";"default_dynamic";"catalogProductSimple::100_dollar_product,catalogProductSimple::40_dollar_product";"default";"-";"-";"-";"-";"-";"assertProductSaveMessage, assertBundleInCategory" +"Bundle Dynamic %isolation%";"Dynamic";"sku_bundle_dynamic_%isolation%";"-";"Dynamic";"-";"dynamic-32";"-";"-";"-";"-";"-";"-";"MAGETWO-23061";"-";"-";"-";"-";"-";"-";"-";"-";"default_dynamic";"catalogProductSimple::100_dollar_product,catalogProductSimple::40_dollar_product";"default";"-";"-";"-";"-";"-";"assertProductSaveMessage, assertBundleInCategory, assertBundlePriceView, assertBundlePriceType" +"Bundle Dynamic %isolation%";"Dynamic";"sku_bundle_dynamic_%isolation%";"-";"Dynamic";"-";"dynamic-40";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"default_dynamic";"catalogProductSimple::100_dollar_product,catalogProductSimple::40_dollar_product";"default";"-";"-";"-";"-";"-";"assertProductSaveMessage, assertBundleInCategory, assertBundlePriceView, assertBundlePriceType" +"Bundle Fixed %isolation%";"Fixed";"sku_bundle_fixed_%isolation%";"-";"Fixed";"110";"fixed-115";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"second";"catalogProductSimple::100_dollar_product,catalogProductSimple::40_dollar_product";"with_custom_options_1";"drop_down_with_one_option_fixed_price";"catalogProductSimple::with_two_custom_option,catalogProductSimple::with_all_custom_option";"-";"-";"-";"assertProductSaveMessage, assertBundleInCategory, assertBundlePriceView, assertBundlePriceType, assertProductCustomOptionsOnBundleProductPage" +"Bundle Fixed %isolation%";"Fixed";"sku_bundle_fixed_%isolation%";"-";"Fixed";"110";"fixed-159";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"second";"catalogProductSimple::100_dollar_product,catalogProductSimple::40_dollar_product";"with_custom_options_2";"drop_down_with_one_option_percent_price";"-";"-";"-";"-";"assertProductSaveMessage, assertBundleInCategory, assertBundlePriceView, assertBundlePriceType" +"Bundle Dynamic %isolation%";"Dynamic";"sku_bundle_dynamic_%isolation%";"-";"Dynamic";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"default_dynamic";"catalogProductSimple::100_dollar_product,catalogProductSimple::40_dollar_product";"default";"-";"-";"-";"-";"-";"assertProductSaveMessage" +"Bundle Fixed %isolation%";"Fixed";"sku_bundle_fixed_%isolation%";"-";"Fixed";"10";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"second";"catalogProductSimple::100_dollar_product,catalogProductSimple::40_dollar_product";"default";"-";"-";"-";"-";"-";"assertProductSaveMessage" diff --git a/dev/tests/functional/tests/app/Magento/Bundle/Test/etc/constraint.xml b/dev/tests/functional/tests/app/Magento/Bundle/Test/etc/constraint.xml index 60e36e2e0c762..7cc2fb2b69650 100644 --- a/dev/tests/functional/tests/app/Magento/Bundle/Test/etc/constraint.xml +++ b/dev/tests/functional/tests/app/Magento/Bundle/Test/etc/constraint.xml @@ -6,7 +6,7 @@ --> - low + low @@ -15,30 +15,30 @@ - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Attribute/Edit/AttributeForm.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Attribute/Edit/AttributeForm.php index 2a7baf8562675..1d70bd71d2f03 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Attribute/Edit/AttributeForm.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Attribute/Edit/AttributeForm.php @@ -24,6 +24,13 @@ class AttributeForm extends FormTabs */ protected $closedToggle = '//*[contains(@class,"collapsable-wrapper") and not(contains(@class,"opened"))]//strong'; + /** + * Properties tab selector. + * + * @var string + */ + protected $propertiesTab = '#product_attribute_tabs_main'; + /** * Get data of the tabs. * @@ -37,22 +44,27 @@ class AttributeForm extends FormTabs */ public function getData(FixtureInterface $fixture = null, Element $element = null) { + $this->waitForElementVisible($this->propertiesTab); $data = []; if (null === $fixture) { foreach ($this->tabs as $tabName => $tab) { - $this->openTab($tabName); - $this->expandAllToggles(); - $tabData = $this->getTabElement($tabName)->getDataFormTab(); - $data = array_merge($data, $tabData); + if ($this->isTabVisible($tabName)) { + $this->openTab($tabName); + $this->expandAllToggles(); + $tabData = $this->getTabElement($tabName)->getDataFormTab(); + $data = array_merge($data, $tabData); + } } } else { $isHasData = ($fixture instanceof InjectableFixture) ? $fixture->hasData() : true; $tabsFields = $isHasData ? $this->getFieldsByTabs($fixture) : []; foreach ($tabsFields as $tabName => $fields) { - $this->openTab($tabName); - $this->expandAllToggles(); - $tabData = $this->getTabElement($tabName)->getDataFormTab($fields, $this->_rootElement); - $data = array_merge($data, $tabData); + if ($this->isTabVisible($tabName)) { + $this->openTab($tabName); + $this->expandAllToggles(); + $tabData = $this->getTabElement($tabName)->getDataFormTab($fields, $this->_rootElement); + $data = array_merge($data, $tabData); + } } } @@ -85,10 +97,24 @@ public function openTab($tabName) ? $this->tabs[$tabName]['strategy'] : Locator::SELECTOR_CSS; $tab = $this->_rootElement->find($selector, $strategy); - $target = $this->browser->find('.logo');// Handle menu overlap problem + $target = $this->browser->find('.page-title .title');// Handle menu overlap problem $this->_rootElement->dragAndDrop($target); $tab->click(); - return $this; } + + /** + * Check if tab is visible. + * + * @param string $tabName + * @return bool + */ + protected function isTabVisible($tabName) + { + $selector = $this->tabs[$tabName]['selector']; + $strategy = isset($this->tabs[$tabName]['strategy']) + ? $this->tabs[$tabName]['strategy'] + : Locator::SELECTOR_CSS; + return $this->_rootElement->find($selector, $strategy)->isVisible(); + } } diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Attribute/Set/Main.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Attribute/Set/Main.php index 5161864e1fab8..8d54abfe9a08a 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Attribute/Set/Main.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Attribute/Set/Main.php @@ -42,6 +42,13 @@ class Main extends Block */ protected $addGroupButton = '[data-ui-id="adminhtml-catalog-product-set-edit-add-group-button"]'; + /** + * Selector for note block element. + * + * @var string + */ + protected $noteBlock = '.attribute-set .title'; + /** * Move Attribute to Attribute Group * @@ -60,6 +67,9 @@ public function moveAttribute(array $attributeData, $attributeGroup = 'Product D $attributeGroupLocator = sprintf($this->groups, $attributeGroup); $target = $this->_rootElement->find($attributeGroupLocator, Locator::SELECTOR_XPATH); + $target->click(); // Handle small resolution screen issue + $this->browser->find($this->noteBlock)->click(); + $attributeLabelLocator = sprintf($this->attribute, $attribute); $this->_rootElement->find($attributeLabelLocator, Locator::SELECTOR_XPATH)->dragAndDrop($target); } diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Action/Attribute.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Action/Attribute.php index bc458acaea1b6..4abeb778750b4 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Action/Attribute.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Action/Attribute.php @@ -9,27 +9,26 @@ use Mtf\Client\Element; /** - * Class Attribute - * Product attribute massaction edit page + * Product attribute massaction edit page. */ class Attribute extends Form { /** - * CSS selector for 'save' button + * CSS selector for 'save' button. * * @var string */ - protected $saveButton = '[data-ui-id="attribute-save-button"]'; + protected $saveButton = '[data-ui-id="page-actions-toolbar-save-button"]'; /** - * XPath selector for checkbox that enables price editing + * XPath selector for checkbox that enables price editing. * * @var string */ protected $priceFieldEnablerSelector = '//*[@id="attribute-price-container"]/div[1]/div/label//*[@type="checkbox"]'; /** - * Enable price field editing + * Enable price field editing. * * @return void */ diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/ProductTab.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/ProductTab.php index 98e6ef2e7c458..ef5d3093b922c 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/ProductTab.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/ProductTab.php @@ -5,8 +5,10 @@ namespace Magento\Catalog\Test\Block\Adminhtml\Product\Edit; -use Magento\Backend\Test\Block\Widget\Tab; use Mtf\Client\Element\Locator; +use Magento\Backend\Test\Block\Widget\Tab; +use Magento\Catalog\Test\Block\Adminhtml\Product\Attribute\Edit; +use Magento\Catalog\Test\Fixture\CatalogProductAttribute; /** * General class for tabs on product FormTabs with "Add attribute" button. @@ -18,7 +20,7 @@ class ProductTab extends Tab * * @var string */ - protected $attributeSearch = "//div[contains(@data-role, '%s')]//*[@id='product-attribute-search-container']"; + protected $attributeSearch = "//div[contains(@data-role, 'product-details')]//*[@data-toggle='dropdown']/span"; /** * Selector for 'New Attribute' button. @@ -27,6 +29,13 @@ class ProductTab extends Tab */ protected $newAttributeButton = '[id^="create_attribute"]'; + /** + * Selector for search input field. + * + * @var string + */ + protected $searchAttribute = "//input[@data-role='product-attribute-search']"; + /** * Fixture mapping. * @@ -51,7 +60,18 @@ protected function dataMapping(array $fields = null, $parent = null) */ public function addNewAttribute($tabName) { - $this->_rootElement->find(sprintf($this->attributeSearch, $tabName), Locator::SELECTOR_XPATH)->click(); - $this->_rootElement->find($this->newAttributeButton)->click(); + $element = $this->_rootElement; + $selector = sprintf($this->attributeSearch, $tabName); + $element->waitUntil( + function () use ($element, $selector) { + return $element->find($selector, Locator::SELECTOR_XPATH)->isVisible() ? true : null; + } + ); + $addAttributeToggle = $element->find($selector, Locator::SELECTOR_XPATH); + $addAttributeToggle->click(); + if (!$addAttributeToggle->find($this->newAttributeButton)->isVisible()) { + $element->find($this->searchAttribute, Locator::SELECTOR_XPATH)->click(); + } + $element->find($this->newAttributeButton)->click(); } } diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Tab/Options/Type/DropDown.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Tab/Options/Type/DropDown.php index f6cb41f435de8..c7cb8cbc125aa 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Tab/Options/Type/DropDown.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Tab/Options/Type/DropDown.php @@ -9,20 +9,26 @@ use Mtf\Client\Element; /** - * Class DropDown - * Form "Option dropdown" on tab product "Custom options" + * Form "Option dropdown" on tab product "Custom options". */ class DropDown extends AbstractOptions { /** - * Add button css selector + * Add button css selector. * * @var string */ protected $buttonAddLocator = '[id$="_add_select_row"]'; /** - * Fill the form + * Name for title column. + * + * @var string + */ + protected $optionTitle = '.data-table th.col-name'; + + /** + * Fill the form. * * @param array $fields * @param Element $element @@ -30,6 +36,7 @@ class DropDown extends AbstractOptions */ public function fillOptions(array $fields, Element $element = null) { + $this->_rootElement->find($this->optionTitle)->click(); $this->_rootElement->find($this->buttonAddLocator)->click(); return parent::fillOptions($fields, $element); } diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Tab/ProductDetails/CategoryIds.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Tab/ProductDetails/CategoryIds.php index 14ad4c5d53e6c..50939e39db4e5 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Tab/ProductDetails/CategoryIds.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Tab/ProductDetails/CategoryIds.php @@ -9,20 +9,26 @@ use Mtf\Client\Element\Locator; /** - * Class CategoryIds - * Typified element class for category element + * Typified element class for category element. */ class CategoryIds extends MultisuggestElement { /** - * Selector suggest input + * Selector suggest input. * * @var string */ protected $suggest = '#category_ids-suggest'; /** - * Selector item of search result + * Selector for suggest element. + * + * @var string + */ + protected $suggestElement = '.mage-suggest.category-select'; + + /** + * Selector item of search result. * * @var string */ @@ -36,7 +42,7 @@ class CategoryIds extends MultisuggestElement protected $top = './ancestor::body//*[@class="page-main-actions"]'; /** - * Set value + * Set value. * * @param array|string $values * @return void @@ -44,6 +50,25 @@ class CategoryIds extends MultisuggestElement public function setValue($values) { $this->find($this->top, Locator::SELECTOR_XPATH)->click(); + $this->waitInitElement(); parent::setValue($values); } + + /** + * Wait init search suggest container. + * + * @return void + * @throws \Exception + */ + protected function waitInitElement() + { + $browser = clone $this; + $selector = $this->suggestElement; + + $browser->waitUntil( + function () use ($browser, $selector) { + return $browser->find($selector)->isVisible() ? true : null; + } + ); + } } diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/ProductForm.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/ProductForm.php index 87076775194da..40e6a4d5d17b8 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/ProductForm.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/ProductForm.php @@ -181,7 +181,7 @@ protected function createCustomAttribute(InjectableFixture $product, $tabName = if (!$this->checkAttributeLabel($attribute)) { /** @var \Magento\Catalog\Test\Block\Adminhtml\Product\Edit\ProductTab $tab */ $tab = $this->openTab($tabName); - $tab->addNewAttribute(); + $tab->addNewAttribute($tabName); $this->fillAttributeForm($attribute); $this->reinitRootElement(); } @@ -223,7 +223,6 @@ protected function showAdvancedSettings() public function openTab($tabName) { $this->showAdvancedSettings(); - return parent::openTab($tabName); } diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Product/Compare/ListCompare.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Product/Compare/ListCompare.php index b4e9e628edb3a..8383790a3b026 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Product/Compare/ListCompare.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Product/Compare/ListCompare.php @@ -75,7 +75,7 @@ class ListCompare extends Block * * @var string */ - protected $isEmpty = 'p.empty'; + protected $isEmpty = 'div.empty:last-child'; /** * Selector for message block. @@ -145,6 +145,39 @@ function () use ($rootElement, $element) { return $data; } + /** + * Get item compare product attribute. + * + * @param string $key + * @return Element + */ + public function getCompareProductAttribute($key) + { + $rootElement = $this->_rootElement; + $element = $this->nameSelector; + $this->_rootElement->waitUntil( + function () use ($rootElement, $element) { + return $rootElement->find($element, Locator::SELECTOR_XPATH)->isVisible() ? true : null; + } + ); + return $this->_rootElement->find(sprintf($this->productAttribute, $key), Locator::SELECTOR_XPATH); + } + + /** + * Get item attribute. + * + * @param int $indexProduct + * @param string $attributeKey + * @return string + */ + public function getProductAttribute($indexProduct, $attributeKey) + { + return trim( + $this->getCompareProductAttribute($attributeKey) + ->find(sprintf($this->attributeSelector, $indexProduct), Locator::SELECTOR_XPATH)->getText() + ); + } + /** * Remove product from compare product list. * @@ -208,6 +241,7 @@ public function isProductVisibleInCompareBlock($productName = '') */ public function getEmptyMessage() { + $this->waitForElementVisible($this->isEmpty); $isEmpty = $this->_rootElement->find($this->isEmpty); if ($isEmpty->isVisible()) { return $isEmpty->getText(); diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Product/Compare/Sidebar.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Product/Compare/Sidebar.php index 161d8c30319fc..597ab1fa29613 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Product/Compare/Sidebar.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Product/Compare/Sidebar.php @@ -8,53 +8,65 @@ use Mtf\Client\Element; /** - * Class Sidebar - * Compare product block on cms page + * Compare product block on cms page. */ class Sidebar extends ListCompare { /** - * Selector for empty message + * Selector for empty message. * * @var string */ - protected $isEmpty = 'p.empty'; + protected $isEmpty = 'div.empty'; /** - * Product name selector + * Product name selector. * * @var string */ - protected $productName = 'li.item.odd.last strong.name a'; + protected $productName = 'li.product-item.odd.last strong.product-item-name a'; /** - * Selector for "Clear All" button + * Selector for "Clear All" button. * * @var string */ protected $clearAll = '#compare-clear-all'; /** - * Get compare products block content + * Get compare products block content. * + * @throws \Exception * @return array|string */ public function getProducts() { - $result = []; - $isEmpty = $this->_rootElement->find($this->isEmpty); - if ($isEmpty->isVisible()) { - return $isEmpty->getText(); + try { + $result = []; + $rootElement = $this->_rootElement; + $selector = $this->productName; + $this->_rootElement->waitUntil( + function () use ($rootElement, $selector) { + return $rootElement->find($selector)->isVisible() ? true : null; + } + ); + $elements = $this->_rootElement->find($this->productName)->getElements(); + foreach ($elements as $element) { + $result[] = $element->getText(); + } + return $result; + } catch (\Exception $e) { + $isEmpty = $this->_rootElement->find($this->isEmpty); + if ($isEmpty->isVisible()) { + return $isEmpty->getText(); + } else { + throw $e; + } } - $elements = $this->_rootElement->find($this->productName)->getElements(); - foreach ($elements as $element) { - $result[] = $element->getText(); - } - return $result; } /** - * Click "Clear All" on "My Account" page + * Click "Clear All" on "My Account" page. * * @return void */ diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertAbsenceDeleteAttributeButton.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertAbsenceDeleteAttributeButton.php index 2aff555e77e8b..c9401602d952a 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertAbsenceDeleteAttributeButton.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertAbsenceDeleteAttributeButton.php @@ -14,12 +14,9 @@ */ class AssertAbsenceDeleteAttributeButton extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'high'; + /* tags */ + const SEVERITY = 'high'; + /* end tags */ /** * Assert that Delete Attribute button is absent for system attribute on attribute edit page. diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertAddToCartButtonAbsent.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertAddToCartButtonAbsent.php index fe2b8fd83a61e..ed76a2c27cb5e 100755 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertAddToCartButtonAbsent.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertAddToCartButtonAbsent.php @@ -17,12 +17,9 @@ */ class AssertAddToCartButtonAbsent extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Category Page diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertAddToCartButtonPresent.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertAddToCartButtonPresent.php index 31e5cc832ce49..2869909c7b5a0 100755 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertAddToCartButtonPresent.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertAddToCartButtonPresent.php @@ -17,12 +17,9 @@ */ class AssertAddToCartButtonPresent extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Category Page on Frontend diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertAddedProductAttributeOnProductForm.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertAddedProductAttributeOnProductForm.php index 466997959fb2f..5b3438cec8d2e 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertAddedProductAttributeOnProductForm.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertAddedProductAttributeOnProductForm.php @@ -5,23 +5,23 @@ namespace Magento\Catalog\Test\Constraint; +use Magento\Catalog\Test\Fixture\CatalogAttributeSet; +use Magento\Catalog\Test\Fixture\CatalogProductSimple; +use Mtf\Fixture\InjectableFixture; +use Mtf\Constraint\AbstractConstraint; use Magento\Catalog\Test\Fixture\CatalogProductAttribute; use Magento\Catalog\Test\Page\Adminhtml\CatalogProductEdit; use Magento\Catalog\Test\Page\Adminhtml\CatalogProductIndex; -use Mtf\Constraint\AbstractConstraint; -use Mtf\Fixture\InjectableFixture; +use Mtf\ObjectManager; /** * Check attribute on product form. */ class AssertAddedProductAttributeOnProductForm extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'high'; + /* tags */ + const SEVERITY = 'high'; + /* end tags */ /** * Add this attribute to Default attribute Template. Create product and Assert that created attribute @@ -31,6 +31,7 @@ class AssertAddedProductAttributeOnProductForm extends AbstractConstraint * @param CatalogProductIndex $productGrid * @param CatalogProductEdit $productEdit * @param CatalogProductAttribute $attribute + * @param CatalogAttributeSet $productTemplate * @param CatalogProductAttribute $productAttributeOriginal * @throws \Exception * @return void @@ -40,11 +41,13 @@ public function processAssert( CatalogProductIndex $productGrid, CatalogProductEdit $productEdit, CatalogProductAttribute $attribute, + CatalogAttributeSet $productTemplate, CatalogProductAttribute $productAttributeOriginal = null ) { - $filterProduct = [ - 'sku' => $product->getSku(), - ]; + if (!$product->hasData('sku')) { + $product = $this->createProductWithAttributeSet($productAttributeOriginal, $productTemplate); + } + $filterProduct = ['sku' => $product->getSku()]; $productGrid->open(); $productGrid->getProductGrid()->searchAndOpen($filterProduct); @@ -67,4 +70,23 @@ public function toString() { return 'Product Attribute is present on Product form.'; } + + /** + * Create Product With AttributeSet. + * + * @param CatalogProductAttribute $attribute + * @param CatalogAttributeSet $productTemplate + * @return CatalogProductSimple + */ + protected function createProductWithAttributeSet( + CatalogProductAttribute $attribute, + CatalogAttributeSet $productTemplate + ) { + $product = ObjectManager::getInstance()->create( + 'Magento\Catalog\Test\TestStep\AddAttributeToProductTemplateStep', + ['attribute' => $attribute, 'productTemplate' => $productTemplate] + )->run(); + ObjectManager::getInstance()->create('Magento\Catalog\Test\TestStep\SaveProductTemplateStep')->run(); + return $product['product']; + } } diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertAttributeForm.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertAttributeForm.php index 6e99ad81cf7c9..1883451ea5d73 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertAttributeForm.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertAttributeForm.php @@ -15,12 +15,9 @@ */ class AssertAttributeForm extends AbstractAssertForm { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that displayed attribute data on edit page equals passed from fixture. diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertAttributeOptionsOnProductForm.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertAttributeOptionsOnProductForm.php index 31274227acee0..ca705c2170a1a 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertAttributeOptionsOnProductForm.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertAttributeOptionsOnProductForm.php @@ -12,12 +12,9 @@ */ class AssertAttributeOptionsOnProductForm extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * @return void diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertAttributeSearchableByLabel.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertAttributeSearchableByLabel.php index f2f021612864a..16e6f2cffc31e 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertAttributeSearchableByLabel.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertAttributeSearchableByLabel.php @@ -12,12 +12,9 @@ */ class AssertAttributeSearchableByLabel extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * @return void diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertCategoryAbsenceOnBackend.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertCategoryAbsenceOnBackend.php index 80757b310f580..e04f76f19626d 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertCategoryAbsenceOnBackend.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertCategoryAbsenceOnBackend.php @@ -15,12 +15,9 @@ */ class AssertCategoryAbsenceOnBackend extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that not displayed category in backend catalog category tree diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertCategoryAbsenceOnFrontend.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertCategoryAbsenceOnFrontend.php index 645b5b39ca641..46326d1ee30d2 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertCategoryAbsenceOnFrontend.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertCategoryAbsenceOnFrontend.php @@ -16,18 +16,15 @@ */ class AssertCategoryAbsenceOnFrontend extends AbstractConstraint { + /* tags */ + const SEVERITY = 'low'; + /* end tags */ + /** * Message on the product page 404 */ const NOT_FOUND_MESSAGE = 'Whoops, our bad...'; - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; - /** * Assert that not displayed category in frontend main menu * diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertCategoryForAssignedProducts.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertCategoryForAssignedProducts.php index 2250cb7b7789b..166faa8e7213d 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertCategoryForAssignedProducts.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertCategoryForAssignedProducts.php @@ -16,12 +16,9 @@ */ class AssertCategoryForAssignedProducts extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that displayed assigned products on category page equals passed from fixture diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertCategoryForm.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertCategoryForm.php index d5901b78b4738..5465492dac08b 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertCategoryForm.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertCategoryForm.php @@ -12,12 +12,9 @@ */ class AssertCategoryForm extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * @return void diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertCategoryIsNotActive.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertCategoryIsNotActive.php index c955feda2aa3b..ea0f357e3c878 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertCategoryIsNotActive.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertCategoryIsNotActive.php @@ -16,14 +16,11 @@ */ class AssertCategoryIsNotActive extends AbstractConstraint { - const NOT_FOUND_MESSAGE = 'Whoops, our bad...'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + const NOT_FOUND_MESSAGE = 'Whoops, our bad...'; /** * Assert that the category cannot be accessed from the navigation bar in the frontend diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertCategoryIsNotIncludeInMenu.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertCategoryIsNotIncludeInMenu.php index 65c0a77294927..1afb66d142fa7 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertCategoryIsNotIncludeInMenu.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertCategoryIsNotIncludeInMenu.php @@ -17,12 +17,9 @@ */ class AssertCategoryIsNotIncludeInMenu extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that the category is no longer available on the top menu bar diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertCategoryPage.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertCategoryPage.php index e6215db21a9f1..92b3304b91c53 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertCategoryPage.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertCategoryPage.php @@ -17,12 +17,9 @@ */ class AssertCategoryPage extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that displayed category data on category page equals to passed from fixture diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertCategoryRedirect.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertCategoryRedirect.php index ce8fc92a4867e..9d8f3987389ec 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertCategoryRedirect.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertCategoryRedirect.php @@ -15,12 +15,9 @@ */ class AssertCategoryRedirect extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that old Category URL lead to appropriate Category in frontend diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertCategorySaveMessage.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertCategorySaveMessage.php index 39104943fabfe..c704b36101be5 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertCategorySaveMessage.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertCategorySaveMessage.php @@ -14,18 +14,15 @@ */ class AssertCategorySaveMessage extends AbstractConstraint { + /* tags */ + const SEVERITY = 'low'; + /* end tags */ + /** * Success category save message */ const SUCCESS_MESSAGE = 'You saved the category.'; - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; - /** * Assert that success message is displayed after category save * diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertCategorySuccessDeleteMessage.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertCategorySuccessDeleteMessage.php index 9f7b262b02ac9..beb3994bd58f4 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertCategorySuccessDeleteMessage.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertCategorySuccessDeleteMessage.php @@ -14,18 +14,15 @@ */ class AssertCategorySuccessDeleteMessage extends AbstractConstraint { + /* tags */ + const SEVERITY = 'low'; + /* end tags */ + /** * Message that displayed after delete url rewrite */ const SUCCESS_DELETE_MESSAGE = 'You deleted the category.'; - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; - /** * Assert that after delete a category "You deleted the category." successful message appears * diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertCrossSellsProductsSection.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertCrossSellsProductsSection.php index 67f2329e1aa6c..2ca88767f484e 100755 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertCrossSellsProductsSection.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertCrossSellsProductsSection.php @@ -18,12 +18,9 @@ */ class AssertCrossSellsProductsSection extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'middle'; + /* tags */ + const SEVERITY = 'middle'; + /* end tags */ /** * Assert that product is displayed in cross-sell section diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertNoCrossSellsProductsSection.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertNoCrossSellsProductsSection.php index dcdde5bdb3082..765669ef91f72 100755 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertNoCrossSellsProductsSection.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertNoCrossSellsProductsSection.php @@ -18,12 +18,9 @@ */ class AssertNoCrossSellsProductsSection extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'middle'; + /* tags */ + const SEVERITY = 'middle'; + /* end tags */ /** * Assert that product is not displayed in cross-sell section diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertNoRelatedProductsSection.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertNoRelatedProductsSection.php index 4c06db094cfc6..76defe97417d8 100755 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertNoRelatedProductsSection.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertNoRelatedProductsSection.php @@ -17,12 +17,9 @@ */ class AssertNoRelatedProductsSection extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'middle'; + /* tags */ + const SEVERITY = 'middle'; + /* end tags */ /** * Assert that product is not displayed in related products section diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertNoUpSellsProductsSection.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertNoUpSellsProductsSection.php index ccfc9ff9ef510..e787890abee49 100755 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertNoUpSellsProductsSection.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertNoUpSellsProductsSection.php @@ -17,12 +17,9 @@ */ class AssertNoUpSellsProductsSection extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'middle'; + /* tags */ + const SEVERITY = 'middle'; + /* end tags */ /** * Assert that product is not displayed in up-sell section diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductAttributeAbsenceInGrid.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductAttributeAbsenceInGrid.php index 4dec45b012b86..aa4b2dc670435 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductAttributeAbsenceInGrid.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductAttributeAbsenceInGrid.php @@ -15,12 +15,9 @@ */ class AssertProductAttributeAbsenceInGrid extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'high'; + /* tags */ + const SEVERITY = 'high'; + /* end tags */ /** * Assert that after deleted product attribute cannot be found by attribute code. diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductAttributeAbsenceInSearchOnProductForm.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductAttributeAbsenceInSearchOnProductForm.php index 6f1d7991b81bf..fc43dd93cf8dd 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductAttributeAbsenceInSearchOnProductForm.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductAttributeAbsenceInSearchOnProductForm.php @@ -16,12 +16,9 @@ */ class AssertProductAttributeAbsenceInSearchOnProductForm extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'high'; + /* tags */ + const SEVERITY = 'high'; + /* end tags */ /** * Assert that deleted attribute can't be added to product template on Product Page via Add Attribute control diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductAttributeAbsenceInTemplateGroups.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductAttributeAbsenceInTemplateGroups.php index a5b5935a9bc42..82f536496c12a 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductAttributeAbsenceInTemplateGroups.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductAttributeAbsenceInTemplateGroups.php @@ -16,12 +16,9 @@ */ class AssertProductAttributeAbsenceInTemplateGroups extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that deleted attribute isn't displayed in Product template's Groups section diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductAttributeAbsenceInUnassignedAttributes.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductAttributeAbsenceInUnassignedAttributes.php index 7c37c98529922..d70f3a761e09c 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductAttributeAbsenceInUnassignedAttributes.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductAttributeAbsenceInUnassignedAttributes.php @@ -16,12 +16,9 @@ */ class AssertProductAttributeAbsenceInUnassignedAttributes extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that deleted attribute isn't displayed in Product template's Unassigned Attributes section diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductAttributeDisplayingOnFrontend.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductAttributeDisplayingOnFrontend.php index cffe6fe28dc65..8213f53c9c161 100755 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductAttributeDisplayingOnFrontend.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductAttributeDisplayingOnFrontend.php @@ -16,12 +16,9 @@ */ class AssertProductAttributeDisplayingOnFrontend extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Check whether the attribute is visible on the frontend. diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductAttributeDisplayingOnSearchForm.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductAttributeDisplayingOnSearchForm.php index 41467cfdc7cac..5cfe643e0b2ef 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductAttributeDisplayingOnSearchForm.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductAttributeDisplayingOnSearchForm.php @@ -14,12 +14,9 @@ */ class AssertProductAttributeDisplayingOnSearchForm extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Check whether attribute is displayed in the advanced search form on the frontend. diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductAttributeInGrid.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductAttributeInGrid.php index 1ff1558055243..0ea5de0229235 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductAttributeInGrid.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductAttributeInGrid.php @@ -15,12 +15,9 @@ */ class AssertProductAttributeInGrid extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that created product attribute is found in grid diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductAttributeIsComparable.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductAttributeIsComparable.php index 6ffd0a154dba4..5cdbac2478c26 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductAttributeIsComparable.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductAttributeIsComparable.php @@ -17,12 +17,9 @@ */ class AssertProductAttributeIsComparable extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Check whether there is an opportunity to compare products using given attribute. diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductAttributeIsFilterable.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductAttributeIsFilterable.php index b3d9296c3cabf..88c15e1a7ea3b 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductAttributeIsFilterable.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductAttributeIsFilterable.php @@ -5,23 +5,24 @@ namespace Magento\Catalog\Test\Constraint; -use Magento\Catalog\Test\Fixture\CatalogProductAttribute; -use Magento\Catalog\Test\Page\Category\CatalogCategoryView; +use Mtf\Fixture\FixtureFactory; +use Mtf\Fixture\InjectableFixture; use Magento\Cms\Test\Page\CmsIndex; use Mtf\Constraint\AbstractConstraint; -use Mtf\Fixture\InjectableFixture; +use Magento\Catalog\Test\Fixture\CatalogProductAttribute; +use Magento\Catalog\Test\Page\Adminhtml\CatalogProductEdit; +use Magento\Catalog\Test\Page\Adminhtml\CatalogProductIndex; +use Magento\Catalog\Test\Page\Category\CatalogCategoryView; +use Magento\Catalog\Test\Block\Adminhtml\Product\ProductForm; /** * Check whether the attribute filter is displayed on the frontend in Layered navigation. */ class AssertProductAttributeIsFilterable extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Check whether the attribute filter is displayed on the frontend in Layered navigation. @@ -30,14 +31,37 @@ class AssertProductAttributeIsFilterable extends AbstractConstraint * @param InjectableFixture $product * @param CatalogProductAttribute $attribute * @param CmsIndex $cmsIndex + * @param CatalogProductIndex $catalogProductIndex + * @param CatalogProductEdit $catalogProductEdit + * @param FixtureFactory $fixtureFactory * @return void */ public function processAssert( CatalogCategoryView $catalogCategoryView, InjectableFixture $product, CatalogProductAttribute $attribute, - CmsIndex $cmsIndex + CmsIndex $cmsIndex, + CatalogProductIndex $catalogProductIndex, + CatalogProductEdit $catalogProductEdit, + FixtureFactory $fixtureFactory ) { + $fixtureFactory->createByCode( + 'catalogProductSimple', + [ + 'dataSet' => 'product_with_category_with_anchor', + 'data' => [ + 'category_ids' => [ + 'presets' => null, + 'category' => $product->getDataFieldConfig('category_ids')['source']->getCategories()[0] + ] + ], + ] + )->persist(); + + $catalogProductIndex->open()->getProductGrid()->searchAndOpen(['sku' => $product->getSku()]); + $productForm = $catalogProductEdit->getProductForm(); + $this->setDefaultAttributeValue($productForm, $attribute); + $catalogProductEdit->getFormPageActions()->save(); $cmsIndex->open()->getTopmenu()->selectCategoryByName($product->getCategoryIds()[0]); $label = $attribute->hasData('manage_frontend_label') ? $attribute->getManageFrontendLabel() @@ -57,4 +81,27 @@ public function toString() { return 'Attribute is present in layered navigation on category page.'; } + + /** + * Set default attribute value. + * + * @param ProductForm $productForm + * @param CatalogProductAttribute $attribute + * @return void + */ + protected function setDefaultAttributeValue(ProductForm $productForm, CatalogProductAttribute $attribute) + { + $attributeData = $attribute->getData(); + if (isset($attributeData['options'])) { + foreach ($attributeData['options'] as $option) { + if ($option['is_default'] == 'Yes') { + $defaultValue = $option['admin']; + } + } + } else { + $field = preg_grep('@^default_value@', array_keys($attributeData)); + $defaultValue = $attributeData[array_shift($field)]; + } + $productForm->getAttributeElement($attribute)->setValue($defaultValue); + } } diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductAttributeIsFilterableInSearch.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductAttributeIsFilterableInSearch.php index 47c98a3b3a5f3..519235ceaeb99 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductAttributeIsFilterableInSearch.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductAttributeIsFilterableInSearch.php @@ -16,12 +16,9 @@ */ class AssertProductAttributeIsFilterableInSearch extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Check out if the attribute in the navigation bar on the search results page in Layered navigation. diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductAttributeIsGlobal.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductAttributeIsGlobal.php index 802ea88feac8e..804a7be2ff59e 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductAttributeIsGlobal.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductAttributeIsGlobal.php @@ -14,12 +14,9 @@ */ class AssertProductAttributeIsGlobal extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Look on the scope of product attribute in the grid. diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductAttributeIsHtmlAllowed.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductAttributeIsHtmlAllowed.php index 8af708ec9e836..b88bea3779a27 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductAttributeIsHtmlAllowed.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductAttributeIsHtmlAllowed.php @@ -16,12 +16,9 @@ */ class AssertProductAttributeIsHtmlAllowed extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Check whether html tags are using in attribute value. diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductAttributeIsRequired.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductAttributeIsRequired.php index 6a7c58b1f0312..39ce6823aaf58 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductAttributeIsRequired.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductAttributeIsRequired.php @@ -16,18 +16,15 @@ */ class AssertProductAttributeIsRequired extends AbstractConstraint { + /* tags */ + const SEVERITY = 'low'; + /* end tags */ + /** * Expected message. */ const REQUIRE_MESSAGE = 'This is a required field.'; - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; - /** * Check whether the attribute is mandatory. * diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductAttributeIsUnique.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductAttributeIsUnique.php index 186ecc4249f0b..0eb936e80df26 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductAttributeIsUnique.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductAttributeIsUnique.php @@ -10,53 +10,64 @@ use Magento\Catalog\Test\Page\Adminhtml\CatalogProductEdit; use Magento\Catalog\Test\Page\Adminhtml\CatalogProductIndex; use Mtf\Constraint\AbstractConstraint; +use Mtf\Fixture\FixtureFactory; /** * Check whether the attribute is unique. */ class AssertProductAttributeIsUnique extends AbstractConstraint { + /* tags */ + const SEVERITY = 'low'; + /* end tags */ + /** * Expected message. */ const UNIQUE_MESSAGE = 'The value of attribute "%s" must be unique'; - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; - /** * Check whether the attribute is unique. * * @param CatalogProductIndex $catalogProductIndex * @param CatalogProductEdit $catalogProductEdit - * @param CatalogProductSimple $product * @param CatalogProductAttribute $attribute + * @param CatalogProductSimple $product, + * @param FixtureFactory $fixtureFactory * @throws \Exception * @return void */ public function processAssert( CatalogProductIndex $catalogProductIndex, CatalogProductEdit $catalogProductEdit, + CatalogProductAttribute $attribute, CatalogProductSimple $product, - CatalogProductAttribute $attribute + FixtureFactory $fixtureFactory ) { + $simpleProduct = $fixtureFactory->createByCode( + 'catalogProductSimple', + [ + 'dataSet' => 'product_with_category_with_anchor', + 'data' => [ + 'attribute_set_id' => [ + 'attribute_set' => $product->getDataFieldConfig('attribute_set_id')['source']->getAttributeSet() + ], + 'custom_attribute' => $attribute, + ], + ] + ); $catalogProductIndex->open()->getGridPageActionBlock()->addProduct('simple'); $productForm = $catalogProductEdit->getProductForm(); - $productForm->fill($product); + $productForm->fill($simpleProduct); $catalogProductEdit->getFormPageActions()->save(); - $failedAttributes = $productForm->getRequireNoticeAttributes($product); - $actualMessage = $failedAttributes['product-details'][$attribute->getFrontendLabel()]; - - $fixtureData = $attribute->getData(); - $defaultValue = preg_grep('/^default_value/', array_keys($fixtureData)); + $failedAttributes = $productForm->getRequireNoticeAttributes($simpleProduct); + $actualMessage = isset($failedAttributes['product-details'][$attribute->getFrontendLabel()]) + ? $failedAttributes['product-details'][$attribute->getFrontendLabel()] + : null; \PHPUnit_Framework_Assert::assertEquals( - self::UNIQUE_MESSAGE, - sprintf($actualMessage, $fixtureData[array_shift($defaultValue)]), + sprintf(self::UNIQUE_MESSAGE, $attribute->getFrontendLabel()), + $actualMessage, 'JS error notice on product edit page is not equal to expected.' ); } diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductAttributeIsUsedInSortOnFrontend.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductAttributeIsUsedInSortOnFrontend.php index 5c8f7b73d31a6..3862ee8da32e4 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductAttributeIsUsedInSortOnFrontend.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductAttributeIsUsedInSortOnFrontend.php @@ -16,12 +16,9 @@ */ class AssertProductAttributeIsUsedInSortOnFrontend extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that attribute present in sort dropdown on search results page on frontend. diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductAttributeIsUsedPromoRules.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductAttributeIsUsedPromoRules.php index a7c4dc2a3dc8f..3ff15f9eec04c 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductAttributeIsUsedPromoRules.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductAttributeIsUsedPromoRules.php @@ -12,12 +12,9 @@ */ class AssertProductAttributeIsUsedPromoRules extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * @return void diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductAttributeSaveMessage.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductAttributeSaveMessage.php index 921910d6d8737..5298a607d8837 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductAttributeSaveMessage.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductAttributeSaveMessage.php @@ -13,14 +13,11 @@ */ class AssertProductAttributeSaveMessage extends AbstractConstraint { - const SUCCESS_MESSAGE = 'You saved the product attribute.'; + /* tags */ + const SEVERITY = 'high'; + /* end tags */ - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'high'; + const SUCCESS_MESSAGE = 'You saved the product attribute.'; /** * Assert that message "You saved the product attribute." is present on Attribute page diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductAttributeSuccessDeleteMessage.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductAttributeSuccessDeleteMessage.php index 339b3ea9944f2..4d1a956f733be 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductAttributeSuccessDeleteMessage.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductAttributeSuccessDeleteMessage.php @@ -14,14 +14,11 @@ */ class AssertProductAttributeSuccessDeleteMessage extends AbstractConstraint { - const SUCCESS_MESSAGE = 'The product attribute has been deleted.'; + /* tags */ + const SEVERITY = 'high'; + /* end tags */ - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'high'; + const SUCCESS_MESSAGE = 'The product attribute has been deleted.'; /** * Assert that message "The product attribute has been deleted." is present on Attribute page diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductCompareBlockOnCmsPage.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductCompareBlockOnCmsPage.php index 1ac0dd859e687..0e05a29df614a 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductCompareBlockOnCmsPage.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductCompareBlockOnCmsPage.php @@ -15,12 +15,9 @@ */ class AssertProductCompareBlockOnCmsPage extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that Compare Products block is presented on CMS pages. diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductCompareItemsLink.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductCompareItemsLink.php index 6c449ec83efd3..f276e22d6aaf7 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductCompareItemsLink.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductCompareItemsLink.php @@ -13,12 +13,9 @@ */ class AssertProductCompareItemsLink extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that link "Compare Products..." on top menu of page diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductCompareItemsLinkIsAbsent.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductCompareItemsLinkIsAbsent.php index 2975e07257efa..89e969297ec11 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductCompareItemsLinkIsAbsent.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductCompareItemsLinkIsAbsent.php @@ -13,12 +13,9 @@ */ class AssertProductCompareItemsLinkIsAbsent extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert compare products link is NOT visible at the top of page. diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductComparePage.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductComparePage.php index 3448b15939ff2..0fec1e7d33cca 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductComparePage.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductComparePage.php @@ -15,12 +15,9 @@ */ class AssertProductComparePage extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Product attribute on compare product page diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductCompareRemoveLastProductMessage.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductCompareRemoveLastProductMessage.php index 3d0b22887093e..2cfb20b85f2ba 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductCompareRemoveLastProductMessage.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductCompareRemoveLastProductMessage.php @@ -14,14 +14,11 @@ */ class AssertProductCompareRemoveLastProductMessage extends AbstractConstraint { - const SUCCESS_MESSAGE = 'You have no items to compare.'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + const SUCCESS_MESSAGE = 'You have no items to compare.'; /** * After removing last product message is appeared on "Compare Products" page diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductCompareSuccessAddMessage.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductCompareSuccessAddMessage.php index a87663f7b09a8..17915bc28a3bc 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductCompareSuccessAddMessage.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductCompareSuccessAddMessage.php @@ -14,14 +14,11 @@ */ class AssertProductCompareSuccessAddMessage extends AbstractConstraint { - const SUCCESS_MESSAGE = 'You added product %s to the comparison list.'; + /* tags */ + const SEVERITY = 'high'; + /* end tags */ - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'high'; + const SUCCESS_MESSAGE = 'You added product %s to the comparison list.'; /** * Assert success message is presented on page diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductCompareSuccessRemoveAllProductsMessage.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductCompareSuccessRemoveAllProductsMessage.php index 9510c30840757..2ffa8de9f8a53 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductCompareSuccessRemoveAllProductsMessage.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductCompareSuccessRemoveAllProductsMessage.php @@ -13,14 +13,11 @@ */ class AssertProductCompareSuccessRemoveAllProductsMessage extends AbstractConstraint { - const SUCCESS_MESSAGE = 'You cleared the comparison list.'; + /* tags */ + const SEVERITY = 'high'; + /* end tags */ - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'high'; + const SUCCESS_MESSAGE = 'You cleared the comparison list.'; /** * Assert message is appeared on "Compare Products" page. diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductCompareSuccessRemoveMessage.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductCompareSuccessRemoveMessage.php index cd9b0426ea817..a69502f3ac415 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductCompareSuccessRemoveMessage.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductCompareSuccessRemoveMessage.php @@ -15,14 +15,11 @@ */ class AssertProductCompareSuccessRemoveMessage extends AbstractConstraint { - const SUCCESS_MESSAGE = 'You removed product %s from the comparison list.'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + const SUCCESS_MESSAGE = 'You removed product %s from the comparison list.'; /** * Assert message is appeared on "Compare Products" block on myAccount page diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductCustomOptionsOnProductPage.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductCustomOptionsOnProductPage.php index cba8f3087a17a..c619e0f81e969 100755 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductCustomOptionsOnProductPage.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductCustomOptionsOnProductPage.php @@ -15,12 +15,9 @@ */ class AssertProductCustomOptionsOnProductPage extends AbstractAssertForm { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Skipped field for custom options diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductDuplicateForm.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductDuplicateForm.php index 4888cf2551631..24117c0290173 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductDuplicateForm.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductDuplicateForm.php @@ -10,12 +10,16 @@ use Mtf\Fixture\FixtureInterface; /** - * Class AssertProductDuplicateForm + * Assert form data equals fixture data. */ class AssertProductDuplicateForm extends AssertProductForm { + /* tags */ + const SEVERITY = 'low'; + /* end tags */ + /** - * Formatting options for numeric values + * Formatting options for numeric values. * * @var array */ @@ -38,14 +42,7 @@ class AssertProductDuplicateForm extends AssertProductForm ]; /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; - - /** - * Assert form data equals fixture data + * Assert form data equals fixture data. * * @param FixtureInterface $product * @param CatalogProductIndex $productGrid @@ -68,7 +65,7 @@ public function processAssert( } /** - * Prepares fixture data for comparison + * Prepares fixture data for comparison. * * @param array $data * @param array $sortFields [optional] @@ -97,18 +94,33 @@ function (&$item, $key, $formattingOptions) { $compareData['status'] = 'Product offline'; } if (isset($compareData['quantity_and_stock_status']['qty'])) { - $compareData['quantity_and_stock_status']['qty'] = 0; + $compareData['quantity_and_stock_status']['qty'] = ''; + $compareData['quantity_and_stock_status']['is_in_stock'] = 'Out of Stock'; } if (isset($compareData['special_price'])) { $compareData['special_price'] = ['special_price' => $compareData['special_price']]; } $compareData['sku'] .= '-1'; + $compareData['url_key'] = $this->prepareUrlKey($compareData['url_key']); return parent::prepareFixtureData($compareData, $sortFields); } /** - * Returns a string representation of the object + * Prepare url key. + * + * @param string $urlKey + * @return string + */ + protected function prepareUrlKey($urlKey) + { + preg_match("~\d+$~", $urlKey, $matches); + $key = intval($matches[0]) + 1; + return str_replace($matches[0], $key, $urlKey); + } + + /** + * Returns a string representation of the object. * * @return string */ diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductDuplicateIsNotDisplayingOnFrontend.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductDuplicateIsNotDisplayingOnFrontend.php index 86a2abaaf6e42..d04c3b310107e 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductDuplicateIsNotDisplayingOnFrontend.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductDuplicateIsNotDisplayingOnFrontend.php @@ -12,12 +12,9 @@ */ class AssertProductDuplicateIsNotDisplayingOnFrontend extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'high'; + /* tags */ + const SEVERITY = 'high'; + /* end tags */ /** * Assert that product duplicate is not displayed on front-end diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductDuplicateMessage.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductDuplicateMessage.php index 732a11a8f1406..6657740a35247 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductDuplicateMessage.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductDuplicateMessage.php @@ -13,18 +13,15 @@ */ class AssertProductDuplicateMessage extends AbstractConstraint { + /* tags */ + const SEVERITY = 'high'; + /* end tags */ + /** * Text value to be checked */ const DUPLICATE_MESSAGE = 'You duplicated the product.'; - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'high'; - /** * Checking the output message successful product duplication * diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductDuplicatedInGrid.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductDuplicatedInGrid.php index a9b80267f4bfe..d9db6bcf1e131 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductDuplicatedInGrid.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductDuplicatedInGrid.php @@ -14,12 +14,9 @@ */ class AssertProductDuplicatedInGrid extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that duplicated product is found by sku and has correct product type, product template, diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductForm.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductForm.php index 75c3a34e9ebef..9cf3ff6546f4d 100755 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductForm.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductForm.php @@ -15,6 +15,10 @@ */ class AssertProductForm extends AbstractAssertForm { + /* tags */ + const SEVERITY = 'low'; + /* end tags */ + /** * List skipped fixture fields in verify * @@ -44,13 +48,6 @@ class AssertProductForm extends AbstractAssertForm */ protected $specialArray = []; - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; - /** * Assert form data equals fixture data * diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductGroupedPriceOnProductPage.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductGroupedPriceOnProductPage.php index cfd87eea3fb2f..6733686de31a6 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductGroupedPriceOnProductPage.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductGroupedPriceOnProductPage.php @@ -16,12 +16,9 @@ */ class AssertProductGroupedPriceOnProductPage extends AbstractConstraint implements AssertPriceOnProductPageInterface { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Error message diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductInCart.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductInCart.php index 54e27e633ad4a..b51e91662ee94 100755 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductInCart.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductInCart.php @@ -18,12 +18,9 @@ */ class AssertProductInCart extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assertion that the product is correctly displayed in cart diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductInCategory.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductInCategory.php index c0e98f182574f..44a62cce8d398 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductInCategory.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductInCategory.php @@ -16,12 +16,9 @@ */ class AssertProductInCategory extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Checking the product in the page of its price diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductInGrid.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductInGrid.php index c2b709593012d..f0ce173a43893 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductInGrid.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductInGrid.php @@ -15,12 +15,9 @@ */ class AssertProductInGrid extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'high'; + /* tags */ + const SEVERITY = 'high'; + /* end tags */ /** * Product fixture diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductInStock.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductInStock.php index a23b98cff1d24..cf56a59038104 100755 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductInStock.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductInStock.php @@ -15,12 +15,9 @@ */ class AssertProductInStock extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Text value for checking Stock Availability diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductIsNotDisplayingOnFrontend.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductIsNotDisplayingOnFrontend.php index 07b8d331ea215..459715d46f984 100755 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductIsNotDisplayingOnFrontend.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductIsNotDisplayingOnFrontend.php @@ -19,18 +19,15 @@ */ class AssertProductIsNotDisplayingOnFrontend extends AbstractConstraint { + /* tags */ + const SEVERITY = 'high'; + /* end tags */ + /** * Message on the product page 404 */ const NOT_FOUND_MESSAGE = 'Whoops, our bad...'; - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'high'; - /** * Product view page * diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductIsNotVisibleInCompareBlock.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductIsNotVisibleInCompareBlock.php index 72375b0ba7620..4d26b3c82837d 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductIsNotVisibleInCompareBlock.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductIsNotVisibleInCompareBlock.php @@ -16,14 +16,11 @@ */ class AssertProductIsNotVisibleInCompareBlock extends AbstractConstraint { - const SUCCESS_MESSAGE = 'You have no items to compare.'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + const SUCCESS_MESSAGE = 'You have no items to compare.'; /** * Assert the product is not displayed on Compare Products block on my account page diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductIsNotVisibleInComparePage.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductIsNotVisibleInComparePage.php index a576c9576da69..d9d07941436d5 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductIsNotVisibleInComparePage.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductIsNotVisibleInComparePage.php @@ -15,14 +15,11 @@ */ class AssertProductIsNotVisibleInComparePage extends AbstractConstraint { - const SUCCESS_MESSAGE = 'You have no items to compare.'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + const SUCCESS_MESSAGE = 'You have no items to compare.'; /** * Assert the product is not displayed on Compare Products page diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductNotInGrid.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductNotInGrid.php index accb97b15c456..0256378ca4ba0 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductNotInGrid.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductNotInGrid.php @@ -15,12 +15,9 @@ */ class AssertProductNotInGrid extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that product cannot be found by name and sku diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductNotSearchableBySku.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductNotSearchableBySku.php index 9d709832dc3fb..84f3841829713 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductNotSearchableBySku.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductNotSearchableBySku.php @@ -16,12 +16,9 @@ */ class AssertProductNotSearchableBySku extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that product cannot be found via Quick Search using searchable product attributes. diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductNotVisibleInCategory.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductNotVisibleInCategory.php index 7dd7f2d131b1c..d5034b364c0e4 100755 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductNotVisibleInCategory.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductNotVisibleInCategory.php @@ -16,12 +16,9 @@ */ class AssertProductNotVisibleInCategory extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that product is not visible in the assigned category diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductOutOfStock.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductOutOfStock.php index 8c80a1affb0bc..aa4b008f2eeb0 100755 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductOutOfStock.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductOutOfStock.php @@ -15,12 +15,9 @@ */ class AssertProductOutOfStock extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Text value for checking Stock Availability diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductPage.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductPage.php index df10b9edceedf..e46c706950f9d 100755 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductPage.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductPage.php @@ -17,6 +17,10 @@ */ class AssertProductPage extends AbstractAssertForm { + /* tags */ + const SEVERITY = 'middle'; + /* end tags */ + /** * Product view block on frontend page * @@ -31,13 +35,6 @@ class AssertProductPage extends AbstractAssertForm */ protected $product; - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'middle'; - /** * Assert that displayed product data on product page(front-end) equals passed from fixture: * 1. Product Name diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductSaveMessage.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductSaveMessage.php index f65de789d0054..b6da8b6533765 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductSaveMessage.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductSaveMessage.php @@ -13,18 +13,15 @@ */ class AssertProductSaveMessage extends AbstractConstraint { + /* tags */ + const SEVERITY = 'low'; + /* end tags */ + /** * Text value to be checked */ const SUCCESS_MESSAGE = 'You saved the product.'; - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; - /** * Assert that success message is displayed after product save * diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductSearchableBySku.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductSearchableBySku.php index 03e4a73005a4a..59b7c9a76ee8d 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductSearchableBySku.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductSearchableBySku.php @@ -15,12 +15,9 @@ */ class AssertProductSearchableBySku extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Displays an error message diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductSimpleDuplicateForm.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductSimpleDuplicateForm.php index 77c8624335a95..c1a2bdac797fd 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductSimpleDuplicateForm.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductSimpleDuplicateForm.php @@ -11,10 +11,7 @@ */ class AssertProductSimpleDuplicateForm extends AssertProductDuplicateForm { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ } diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductSkuAutoGenerated.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductSkuAutoGenerated.php index 0e43942ca300c..fed31f8a0068f 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductSkuAutoGenerated.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductSkuAutoGenerated.php @@ -14,12 +14,9 @@ */ class AssertProductSkuAutoGenerated extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Asserts that SKU successfully generated diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductSpecialPriceOnProductPage.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductSpecialPriceOnProductPage.php index 7de7dbdf053f9..35e6507222dff 100755 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductSpecialPriceOnProductPage.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductSpecialPriceOnProductPage.php @@ -16,12 +16,9 @@ */ class AssertProductSpecialPriceOnProductPage extends AbstractConstraint implements AssertPriceOnProductPageInterface { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Error message diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductSuccessDeleteMessage.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductSuccessDeleteMessage.php index 4ad8c8c85248f..f0925517bb7ca 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductSuccessDeleteMessage.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductSuccessDeleteMessage.php @@ -14,18 +14,15 @@ */ class AssertProductSuccessDeleteMessage extends AbstractConstraint { + /* tags */ + const SEVERITY = 'low'; + /* end tags */ + /** * Text value to be checked */ const SUCCESS_DELETE_MESSAGE = 'A total of %d record(s) have been deleted.'; - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; - /** * Assert that after deleting product success message. * diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductTemplateForm.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductTemplateForm.php index bbd8ceff87f6f..9411b80d97d4a 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductTemplateForm.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductTemplateForm.php @@ -17,12 +17,9 @@ */ class AssertProductTemplateForm extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'high'; + /* tags */ + const SEVERITY = 'high'; + /* end tags */ /** * Assert that after save a product template on edit product set page displays: diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductTemplateGroupOnProductForm.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductTemplateGroupOnProductForm.php index 3777c07060762..1d798a8be839d 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductTemplateGroupOnProductForm.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductTemplateGroupOnProductForm.php @@ -5,14 +5,15 @@ namespace Magento\Catalog\Test\Constraint; +use Mtf\ObjectManager; +use Mtf\Fixture\FixtureFactory; +use Mtf\Constraint\AbstractConstraint; use Magento\Catalog\Test\Fixture\CatalogAttributeSet; -use Magento\Catalog\Test\Fixture\CatalogProductAttribute; use Magento\Catalog\Test\Fixture\CatalogProductSimple; -use Magento\Catalog\Test\Page\Adminhtml\CatalogProductEdit; -use Magento\Catalog\Test\Page\Adminhtml\CatalogProductIndex; +use Magento\Catalog\Test\Fixture\CatalogProductAttribute; use Magento\Catalog\Test\Page\Adminhtml\CatalogProductNew; -use Mtf\Constraint\AbstractConstraint; -use Mtf\Fixture\FixtureFactory; +use Magento\Catalog\Test\Page\Adminhtml\CatalogProductIndex; +use Magento\Catalog\Test\Page\Adminhtml\CatalogProductEdit; /** * Class AssertProductTemplateGroupOnProductForm @@ -21,12 +22,9 @@ */ class AssertProductTemplateGroupOnProductForm extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'high'; + /* tags */ + const SEVERITY = 'high'; + /* end tags */ /** * Assert that created product template: diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductTemplateInGrid.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductTemplateInGrid.php index bb12891c2ffc9..5116d9a9ff11c 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductTemplateInGrid.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductTemplateInGrid.php @@ -15,12 +15,9 @@ */ class AssertProductTemplateInGrid extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'high'; + /* tags */ + const SEVERITY = 'high'; + /* end tags */ /** * Assert that new product template displays in Product Templates grid diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductTemplateNotInGrid.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductTemplateNotInGrid.php index a96082c06e304..7a6be9184a3a1 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductTemplateNotInGrid.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductTemplateNotInGrid.php @@ -15,12 +15,9 @@ */ class AssertProductTemplateNotInGrid extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that product template is not displayed in Product Templates grid diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductTemplateOnProductForm.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductTemplateOnProductForm.php index 821d50f24a4ec..4731c5dd97f73 100755 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductTemplateOnProductForm.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductTemplateOnProductForm.php @@ -20,12 +20,9 @@ */ class AssertProductTemplateOnProductForm extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'high'; + /* tags */ + const SEVERITY = 'high'; + /* end tags */ /** * Assert that created product template: diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductTemplateSuccessDeleteMessage.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductTemplateSuccessDeleteMessage.php index 3aa72d40432dc..1b7a0e19d2c01 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductTemplateSuccessDeleteMessage.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductTemplateSuccessDeleteMessage.php @@ -14,18 +14,15 @@ */ class AssertProductTemplateSuccessDeleteMessage extends AbstractConstraint { + /* tags */ + const SEVERITY = 'high'; + /* end tags */ + /** * Text value to be checked */ const SUCCESS_DELETE_MESSAGE = 'The attribute set has been removed.'; - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'high'; - /** * Assert that after deleting product template success delete message appears * diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductTemplateSuccessSaveMessage.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductTemplateSuccessSaveMessage.php index 6011b388422a6..e40c4e377f52f 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductTemplateSuccessSaveMessage.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductTemplateSuccessSaveMessage.php @@ -14,18 +14,15 @@ */ class AssertProductTemplateSuccessSaveMessage extends AbstractConstraint { + /* tags */ + const SEVERITY = 'high'; + /* end tags */ + /** * Text value to be checked */ const SUCCESS_MESSAGE = 'You saved the attribute set.'; - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'high'; - /** * Assert that after save a product template "You saved the attribute set." successful message appears * diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductTierPriceOnProductPage.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductTierPriceOnProductPage.php index 3213b146c037f..252b0a6454cf8 100755 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductTierPriceOnProductPage.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductTierPriceOnProductPage.php @@ -16,12 +16,9 @@ */ class AssertProductTierPriceOnProductPage extends AbstractConstraint implements AssertPriceOnProductPageInterface { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Error message diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductView.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductView.php index 5d880ff5b31e6..806c7be578f8b 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductView.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductView.php @@ -17,12 +17,9 @@ */ class AssertProductView extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * @param CatalogProductView $catalogProductView diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductVisibleInCategory.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductVisibleInCategory.php index 4c209e067cdee..6468e0b47f829 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductVisibleInCategory.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductVisibleInCategory.php @@ -16,12 +16,9 @@ */ class AssertProductVisibleInCategory extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Displays an error message diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertRelatedProductsSection.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertRelatedProductsSection.php index 516100eb59b82..91f38bcd8c3e4 100755 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertRelatedProductsSection.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertRelatedProductsSection.php @@ -17,12 +17,9 @@ */ class AssertRelatedProductsSection extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'middle'; + /* tags */ + const SEVERITY = 'middle'; + /* end tags */ /** * Assert that product is displayed in related products section diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertUpSellsProductsSection.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertUpSellsProductsSection.php index 4a6bac3aaeaf5..a9bc575d105c2 100755 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertUpSellsProductsSection.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertUpSellsProductsSection.php @@ -17,12 +17,9 @@ */ class AssertUpSellsProductsSection extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'middle'; + /* tags */ + const SEVERITY = 'middle'; + /* end tags */ /** * Assert that product is displayed in up-sell section diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertUsedSuperAttributeImpossibleDeleteMessages.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertUsedSuperAttributeImpossibleDeleteMessages.php index 3637c11d1e884..ac7bbc7a407b6 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertUsedSuperAttributeImpossibleDeleteMessages.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertUsedSuperAttributeImpossibleDeleteMessages.php @@ -14,18 +14,15 @@ */ class AssertUsedSuperAttributeImpossibleDeleteMessages extends AbstractConstraint { + /* tags */ + const SEVERITY = 'high'; + /* end tags */ + /** * Impossible to delete message */ const ERROR_DELETE_MESSAGE = 'This attribute is used in configurable products.'; - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'high'; - /** * Assert that it's impossible to delete configurable attribute that is used in created configurable product * diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductSimple.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductSimple.php index 0539908aa7ce5..51e5b73d7c450 100755 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductSimple.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductSimple.php @@ -493,6 +493,7 @@ public function __construct( protected $id = [ 'attribute_code' => 'id', 'backend_type' => 'virtual', + 'group' => null, ]; protected $type_id = [ @@ -593,6 +594,7 @@ public function __construct( protected $is_virtual = [ 'attribute_code' => 'is_virtual', 'backend_type' => 'virtual', + 'group' => 'product-details', ]; protected $attributes = [ diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductSimple.xml b/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductSimple.xml index b19b3a3dcb062..85a48583b0da8 100755 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductSimple.xml +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductSimple.xml @@ -385,6 +385,7 @@ type_id virtual + attribute_set_id @@ -451,6 +452,7 @@ is_virtual virtual + product-details attributes diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductSimple/CustomOptions.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductSimple/CustomOptions.php index 1e6ed9bfacbad..7736b6917964c 100755 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductSimple/CustomOptions.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductSimple/CustomOptions.php @@ -208,13 +208,13 @@ protected function getPreset($name) 'type' => 'Drop-down', 'options' => [ [ - 'title' => 'Test1 %isolation%', + 'title' => 'Test3-1 %isolation%', 'price' => 110.01, 'price_type' => 'Percent', 'sku' => 'sku2_%isolation%', ], [ - 'title' => 'Test2 %isolation%', + 'title' => 'Test3-2 %isolation%', 'price' => 210.02, 'price_type' => 'Fixed', 'sku' => 'sku3_%isolation%' diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Handler/CatalogProductSimple/Curl.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Handler/CatalogProductSimple/Curl.php index 5cda35666abff..e2f2dae1e8917 100755 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Handler/CatalogProductSimple/Curl.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Handler/CatalogProductSimple/Curl.php @@ -231,6 +231,9 @@ protected function prepareData(FixtureInterface $fixture, $prefix = null) $fields += $fields['attributes']; unset($fields['attributes']); } + if (isset($fields['custom_attribute'])) { + $fields[$fields['custom_attribute']['code']] = $fields['custom_attribute']['value']; + } $fields = $this->prepareStockData($fields); $fields = $prefix ? [$prefix => $fields] : $fields; diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Category/DeleteCategoryEntityTest.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Category/DeleteCategoryEntityTest.php index eccfa2397e59c..e337834ed3c59 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Category/DeleteCategoryEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Category/DeleteCategoryEntityTest.php @@ -64,6 +64,7 @@ public function __inject(CatalogCategoryIndex $catalogCategoryIndex, CatalogCate */ public function test(CatalogCategory $category) { + $this->markTestIncomplete('MAGETWO-31723'); $category->persist(); $this->catalogCategoryIndex->open(); $this->catalogCategoryIndex->getTreeCategories()->selectCategory($category); diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/AbstractCompareProductsTest.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/AbstractCompareProductsTest.php index 38a1d175b922d..96916f5d25fa4 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/AbstractCompareProductsTest.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/AbstractCompareProductsTest.php @@ -17,69 +17,70 @@ use Mtf\TestCase\Injectable; /** - * Class AbstractCompareProductsTest - * Abstract class for compare products class + * Abstract class for compare products class. + * + * @SuppressWarnings(PHPMD.CouplingBetweenObjects) */ abstract class AbstractCompareProductsTest extends Injectable { /** - * Array products + * Array products. * * @var array */ protected $products; /** - * Cms index page + * Cms index page. * * @var CmsIndex */ protected $cmsIndex; /** - * Browser + * Browser. * * @var Browser */ protected $browser; /** - * Catalog product compare page + * Catalog product compare page. * * @var CatalogProductCompare */ protected $catalogProductCompare; /** - * Catalog product page + * Catalog product page. * * @var CatalogProductView */ protected $catalogProductView; /** - * Customer login page + * Customer login page. * * @var CustomerAccountLogin */ protected $customerAccountLogin; /** - * Fixture factory + * Fixture factory. * * @var FixtureFactory */ protected $fixtureFactory; /** - * Fixture customer + * Fixture customer. * * @var CustomerInjectable */ protected $customer; /** - * Prepare data + * Prepare data. * * @param FixtureFactory $fixtureFactory * @param CustomerInjectable $customer @@ -93,7 +94,7 @@ public function __prepare(FixtureFactory $fixtureFactory, CustomerInjectable $cu } /** - * Injection data + * Injection data. * * @param CmsIndex $cmsIndex * @param CatalogProductView $catalogProductView @@ -114,7 +115,7 @@ public function __inject( } /** - * Login customer + * Login customer. * * @return void */ @@ -127,7 +128,7 @@ protected function loginCustomer() } /** - * Create products + * Create products. * * @param string $products * @return array @@ -145,7 +146,7 @@ protected function createProducts($products) } /** - * Add products to compare list + * Add products to compare list. * * @param array $products * @param AbstractConstraint $assert @@ -163,7 +164,7 @@ protected function addProducts(array $products, AbstractConstraint $assert = nul } /** - * Perform assert + * Perform assert. * * @param AbstractConstraint $assert * @param InjectableFixture $product @@ -171,10 +172,7 @@ protected function addProducts(array $products, AbstractConstraint $assert = nul */ protected function productCompareAssert(AbstractConstraint $assert, InjectableFixture $product) { - $assert->configure( - $this, - ['catalogProductView' => $this->catalogProductView, 'product' => $product] - ); + $assert->configure(['catalogProductView' => $this->catalogProductView, 'product' => $product]); \PHPUnit_Framework_Assert::assertThat($this->getName(), $assert); } } diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/CrosssellTest.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/CrosssellTest.php new file mode 100644 index 0000000000000..e1b12fc8a235f --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/CrosssellTest.php @@ -0,0 +1,130 @@ +magentoBackendLoginUser(); + } + + /** + * Product Cross-selling. Assign cross-selling to products and see them related on the front-end. + * + * @ZephyrId MAGETWO-12390 + * @return void + */ + public function testCreateCrosssell() + { + $simple1 = Factory::getFixtureFactory()->getMagentoCatalogSimpleProduct(); + $simple1->switchData('simple'); + $simple1->persist(); + + $simple2 = Factory::getFixtureFactory()->getMagentoCatalogSimpleProduct(); + $simple2->switchData('simple'); + $simple2->persist(); + + $configurable = Factory::getFixtureFactory()->getMagentoConfigurableProductConfigurableProduct(); + $configurable->switchData('configurable'); + $configurable->persist(); + + $this->addCrosssellProducts($simple1, [$simple2, $configurable]); + $this->addCrosssellProducts($configurable, [$simple1, $simple2]); + + //Ensure shopping cart is empty + $checkoutCartPage = Factory::getPageFactory()->getCheckoutCartIndex(); + $checkoutCartPage->open(); + $checkoutCartPage->getCartBlock()->clearShoppingCart(); + + $productPage = Factory::getPageFactory()->getCatalogProductView(); + Factory::getClientBrowser()->open($_ENV['app_frontend_url'] . $simple1->getUrlKey() . '.html'); + $productPage->getViewBlock()->addToCart($simple1); + + $checkoutCartPage = Factory::getPageFactory()->getCheckoutCartIndex(); + $checkoutCartPage->getMessagesBlock()->waitSuccessMessage(); + + $cartBlock = $checkoutCartPage->getCartBlock(); + $this->assertTrue($cartBlock->isProductInShoppingCart($simple1)); + + $crosssellBlock = $checkoutCartPage->getCrosssellBlock(); + + $this->assertTrue($crosssellBlock->isVisible(), "cross-sell view not found"); + + $this->assertTrue( + $crosssellBlock->verifyProductcrosssell($configurable), + 'Cross-sell product ' . $configurable->getName() . ' was not found in the first product page.' + ); + + $this->assertTrue( + $crosssellBlock->verifyProductcrosssell($simple2), + 'Upsell product ' . $simple2->getName() . ' was not found in the first product page.' + ); + + $crosssellBlock = $checkoutCartPage->getCrosssellBlock(); + $crosssellBlock->clickLink($configurable); + + $productPage = Factory::getPageFactory()->getCatalogProductView(); + Factory::getClientBrowser()->open($_ENV['app_frontend_url'] . $configurable->getUrlKey() . '.html'); + $productPage->getViewBlock()->addToCart($configurable); + + $checkoutCartPage = Factory::getPageFactory()->getCheckoutCartIndex(); + $cartBlock = $checkoutCartPage->getCartBlock(); + $this->assertTrue($cartBlock->isProductInShoppingCart($configurable)); + $this->assertTrue($cartBlock->isProductInShoppingCart($simple1)); + + $crosssellBlock = $checkoutCartPage->getCrosssellBlock(); + $crosssellBlock->clickLink($simple2); + + $productPage = Factory::getPageFactory()->getCatalogProductView(); + Factory::getClientBrowser()->open($_ENV['app_frontend_url'] . $simple2->getUrlKey() . '.html'); + $productPage->getViewBlock()->addToCart($simple2); + + $checkoutCartPage = Factory::getPageFactory()->getCheckoutCartIndex(); + $cartBlock = $checkoutCartPage->getCartBlock(); + $this->assertTrue($cartBlock->isProductInShoppingCart($configurable)); + $this->assertTrue($cartBlock->isProductInShoppingCart($simple1)); + $this->assertTrue($cartBlock->isProductInShoppingCart($simple2)); + + $this->assertFalse($checkoutCartPage->getCrosssellBlock()->isVisible()); + } + + /** + * Assign an array of products as cross-sells to the passed in $product + * + * @param Product $product + * @param array $crosssellProducts + * @return void + */ + private function addCrosssellProducts(Product $product, array $crosssellProducts) + { + $crosssellFixture = Factory::getFixtureFactory()->getMagentoCatalogCrosssellProducts(); + $crosssellFixture->setProducts($crosssellProducts); + $crosssellFixture->switchData('add_crosssell_products'); + //Data + $productGridPage = Factory::getPageFactory()->getCatalogProductIndex(); + $editProductPage = Factory::getPageFactory()->getCatalogProductEdit(); + //Steps + $productGridPage->open(); + $productGridPage->getProductGrid()->searchAndOpen(['sku' => $product->getSku()]); + $editProductPage->getProductForm()->fill($crosssellFixture); + $editProductPage->getFormPageActions()->save(); + $editProductPage->getMessagesBlock()->waitSuccessMessage(); + } +} diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/ManageProductsStockTest.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/ManageProductsStockTest.php deleted file mode 100644 index 7dffa4058254f..0000000000000 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/ManageProductsStockTest.php +++ /dev/null @@ -1,101 +0,0 @@ -objectManager = $objectManager; - $this->fixtureFactory = $fixtureFactory; - $setupConfigurationStep = $objectManager->create( - 'Magento\Core\Test\TestStep\SetupConfigurationStep', - ['configData' => "display_out_of_stock,backorders_allow_qty_below"] - ); - $setupConfigurationStep->run(); - } - - /** - * Manage products stock - * - * @param CatalogProductSimple $product - * @return array - */ - public function test(CatalogProductSimple $product) - { - // Preconditions - $product->persist(); - - // Steps - $addProductsToTheCartStep = $this->objectManager->create( - 'Magento\Checkout\Test\TestStep\AddProductsToTheCartStep', - ['products' => [$product]] - ); - $addProductsToTheCartStep->run(); - - $cart['data']['items'] = ['products' => [$product]]; - return ['cart' => $this->fixtureFactory->createByCode('cart', $cart)]; - } - - /** - * Set default configuration - * - * @return void - */ - public static function tearDownAfterClass() - { - $setupConfigurationStep = ObjectManager::getInstance()->create( - 'Magento\Core\Test\TestStep\SetupConfigurationStep', - ['configData' => "display_out_of_stock,backorders_allow_qty_below", 'rollback' => true] - ); - $setupConfigurationStep->run(); - } -} diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/ManageProductsStockTest/test.csv b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/ManageProductsStockTest/test.csv deleted file mode 100644 index 550c34dec21c4..0000000000000 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/ManageProductsStockTest/test.csv +++ /dev/null @@ -1,2 +0,0 @@ -"description";"product/dataSet";"product/data/qty_and_stock_status/is_in_stock";"constraint" -"add out of stock product to cart";"default";"Out of Stock";"assertAddedProductToCartSuccessMessage, assertProductQtyInShoppingCart" diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/ProductTypeSwitchingOnUpdateTest/test.csv b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/ProductTypeSwitchingOnUpdateTest/test.csv index 3ec77ae260b27..afbcec37babe9 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/ProductTypeSwitchingOnUpdateTest/test.csv +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/ProductTypeSwitchingOnUpdateTest/test.csv @@ -1,12 +1,12 @@ -"productOrigin";"product";"actionName";"constraint";"issue" -"catalogProductSimple::default";"configurableProductInjectable::default";"-";"assertProductSaveMessage, assertProductInGrid, assertChildProductsInGrid, assertConfigurableProductForm, assertConfigurableProductPage, assertProductInStock, assertChildProductIsNotDisplayedSeparately";"" -"catalogProductSimple::default";"catalogProductVirtual::default";"-";"assertProductSaveMessage, assertProductInGrid";"" -"configurableProductInjectable::default";"catalogProductSimple::default";"deleteAttributes";"assertProductSaveMessage, assertProductInGrid";"" -"configurableProductInjectable::default";"catalogProductVirtual::default";"deleteAttributes";"assertProductSaveMessage, assertProductInGrid";"" -"catalogProductVirtual::default";"catalogProductSimple::default";"-";"assertProductSaveMessage, assertProductInGrid";"" -"catalogProductVirtual::default";"configurableProductInjectable::not_virtual_for_type_switching";"-";"assertProductSaveMessage, assertProductInGrid, assertChildProductsInGrid, assertConfigurableProductForm, assertConfigurableProductPage, assertProductInStock, assertChildProductIsNotDisplayedSeparately";"" -"catalogProductVirtual::default";"downloadableProductInjectable::default";"-";"assertProductSaveMessage, assertProductInGrid, assertDownloadableProductForm, assertProductPage, assertProductInStock, assertDownloadableLinksData";"" -"downloadableProductInjectable::default";"catalogProductSimple::default";"-";"assertProductSaveMessage, assertProductInGrid";"" -"downloadableProductInjectable::default";"configurableProductInjectable::not_virtual_for_type_switching";"-";"assertProductSaveMessage, assertProductInGrid, assertChildProductsInGrid, assertConfigurableProductForm, assertConfigurableProductPage, assertProductInStock, assertChildProductIsNotDisplayedSeparately";"" -"downloadableProductInjectable::default";"catalogProductVirtual::default";"clearDownloadableData";"assertProductSaveMessage, assertProductInGrid";"Bug: MAGETWO-29903" -"catalogProductSimple::default";"downloadableProductInjectable::default";"-";"assertProductSaveMessage, assertProductInGrid, assertDownloadableProductForm, assertProductPage, assertProductInStock, assertDownloadableLinksData";"" +"productOrigin";"product";"actionName";"constraint" +"catalogProductSimple::default";"configurableProductInjectable::default";"-";"assertProductSaveMessage, assertProductInGrid, assertChildProductsInGrid, assertConfigurableProductForm, assertConfigurableProductPage, assertProductInStock, assertChildProductIsNotDisplayedSeparately" +"catalogProductSimple::default";"catalogProductVirtual::default";"-";"assertProductSaveMessage, assertProductInGrid" +"configurableProductInjectable::default";"catalogProductSimple::default";"deleteAttributes";"assertProductSaveMessage, assertProductInGrid" +"configurableProductInjectable::default";"catalogProductVirtual::default";"deleteAttributes";"assertProductSaveMessage, assertProductInGrid" +"catalogProductVirtual::default";"catalogProductSimple::default";"-";"assertProductSaveMessage, assertProductInGrid" +"catalogProductVirtual::default";"configurableProductInjectable::not_virtual_for_type_switching";"-";"assertProductSaveMessage, assertProductInGrid, assertChildProductsInGrid, assertConfigurableProductForm, assertConfigurableProductPage, assertProductInStock, assertChildProductIsNotDisplayedSeparately" +"catalogProductVirtual::default";"downloadableProductInjectable::default";"-";"assertProductSaveMessage, assertProductInGrid, assertDownloadableProductForm, assertProductPage, assertProductInStock, assertDownloadableLinksData" +"downloadableProductInjectable::default";"catalogProductSimple::default";"-";"assertProductSaveMessage, assertProductInGrid" +"downloadableProductInjectable::default";"configurableProductInjectable::not_virtual_for_type_switching";"-";"assertProductSaveMessage, assertProductInGrid, assertChildProductsInGrid, assertConfigurableProductForm, assertConfigurableProductPage, assertProductInStock, assertChildProductIsNotDisplayedSeparately" +"downloadableProductInjectable::default";"catalogProductVirtual::default";"clearDownloadableData";"assertProductSaveMessage, assertProductInGrid" +"catalogProductSimple::default";"downloadableProductInjectable::default";"-";"assertProductSaveMessage, assertProductInGrid, assertDownloadableProductForm, assertProductPage, assertProductInStock, assertDownloadableLinksData" diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/RelatedProductTest.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/RelatedProductTest.php new file mode 100644 index 0000000000000..e07672d923e58 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/RelatedProductTest.php @@ -0,0 +1,115 @@ +magentoBackendLoginUser(); + } + + /** + * Promoting products as related + * + * @ZephyrId MAGETWO-12392 + * @return void + */ + public function testRelatedProduct() + { + // Precondition: create simple product 1 + $simple1 = Factory::getFixtureFactory()->getMagentoCatalogSimpleProduct(); + $simple1->switchData('simple'); + $simple1->persist(); + $assignToSimple1 = Factory::getFixtureFactory()->getMagentoCatalogRelatedProducts(); + $assignToSimple1->switchData('add_related_products'); + $verify = [$assignToSimple1->getProduct('simple'), $assignToSimple1->getProduct('configurable')]; + //Data + $productGridPage = Factory::getPageFactory()->getCatalogProductIndex(); + $editProductPage = Factory::getPageFactory()->getCatalogProductEdit(); + //Steps + $productGridPage->open(); + $productGridPage->getProductGrid()->searchAndOpen(['sku' => $simple1->getSku()]); + $productForm = $editProductPage->getProductForm(); + $productForm->fill($assignToSimple1); + $editProductPage->getFormPageActions()->save(); + $editProductPage->getMessagesBlock()->waitSuccessMessage(); + + $productGridPage->open(); + $productGridPage->getProductGrid()->searchAndOpen( + ['sku' => $assignToSimple1->getProduct('configurable')->getSku()] + ); + $assignToSimple1->switchData('add_related_product'); + $productForm = $editProductPage->getProductForm(); + $productForm->fill($assignToSimple1); + $editProductPage->getFormPageActions()->save(); + $editProductPage->getMessagesBlock()->waitSuccessMessage(); + + $this->assertOnTheFrontend($simple1, $verify); + } + + /** + * Assert configurable product is added to cart together with the proper related product + * + * @param Product $product + * @param Product[] $assigned + * @return void + */ + protected function assertOnTheFrontEnd(Product $product, array $assigned) + { + /** @var Product $simple2 */ + /** @var Product $configurable */ + list($simple2, $configurable) = $assigned; + //Open up simple1 product page + $productPage = Factory::getPageFactory()->getCatalogProductView(); + Factory::getClientBrowser()->open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html'); + $this->assertEquals($product->getName(), $productPage->getViewBlock()->getProductName()); + + /** @var \Magento\Catalog\Test\Block\Product\ProductList\Related $relatedBlock */ + $relatedBlock = $productPage->getRelatedProductBlock(); + //Verify related simple2 and configurable on Simple1 product page + $this->assertTrue($relatedBlock->isRelatedProductVisible($simple2->getName())); + $this->assertTrue($relatedBlock->isRelatedProductSelectable($simple2->getName())); + $this->assertTrue($relatedBlock->isRelatedProductVisible($configurable->getName())); + $this->assertFalse($relatedBlock->isRelatedProductSelectable($configurable->getName())); + //Open and verify configurable page + $relatedBlock->openRelatedProduct($configurable->getName()); + $this->assertEquals($configurable->getName(), $productPage->getViewBlock()->getProductName()); + //Verify related simple2 on Configurable product page and add to cart it + $relatedBlock = $productPage->getRelatedProductBlock(); + $this->assertTrue($relatedBlock->isRelatedProductVisible($simple2->getName())); + $this->assertTrue($relatedBlock->isRelatedProductSelectable($simple2->getName())); + $relatedBlock->selectProductForAddToCart($simple2->getName()); + $productPage->getViewBlock()->addToCart($configurable); + + //Verify that both configurable product and simple product 2 are added to shopping cart + $checkoutCartPage = Factory::getPageFactory()->getCheckoutCartIndex(); + $checkoutCartBlock = $checkoutCartPage->getCartBlock(); + $checkoutCartPage->getMessagesBlock()->waitSuccessMessage(); + $this->assertTrue( + $checkoutCartBlock->isProductInShoppingCart($configurable), + 'Configurable product was not found in the shopping cart.' + ); + $this->assertTrue( + $checkoutCartBlock->isProductInShoppingCart($simple2), + 'Related product was not found in the shopping cart.' + ); + } +} diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/UpdateVirtualProductEntityTest/test.csv b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/UpdateVirtualProductEntityTest/test.csv index 8c4e634beabb1..c7ce0a25c7ea6 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/UpdateVirtualProductEntityTest/test.csv +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/UpdateVirtualProductEntityTest/test.csv @@ -1,5 +1,5 @@ "product/data/name";"product/data/sku";"product/data/price/value";"product/data/tax_class_id/dataSet";"product/data/quantity_and_stock_status/qty";"product/data/is_virtual";"product/data/category_ids/presets";"product/data/group_price/preset";"product/data/special_price";"product/data/tier_price/preset";"product/data/quantity_and_stock_status/is_in_stock";"product/data/custom_options/preset";"product/data/visibility";"constraint" -"VirtualProduct %isolation%";"virtual_sku_%isolation%";"99.99";"None";"999";"Yes";"default_subcategory";"-";"-";"MAGETWO-23002";"In Stock";"-";"Catalog";"assertProductSaveMessage, assertProductInGrid, assertProductForm, assertProductPage, assertProductVisibleInCategory, assertProductInCategory, assertProductTierPriceOnProductPage, assertProductSearchableBySku " +"VirtualProduct %isolation%";"virtual_sku_%isolation%";"99.99";"None";"999";"Yes";"default_subcategory";"-";"-";"MAGETWO-23002";"In Stock";"-";"Catalog";"assertProductSaveMessage, assertProductInGrid, assertProductForm, assertProductPage, assertProductVisibleInCategory, assertProductInCategory, assertProductTierPriceOnProductPage, assertProductSearchableBySku" "virtual_product_%isolation%";"virtual_sku_%isolation%";"120.00";"Taxable Goods";"999";"Yes";"-";"-";"45";"-";"In Stock";"-";"Catalog, Search";"assertProductSaveMessage, assertProductInGrid, assertProductForm, assertProductPage, assertProductVisibleInCategory, assertProductInCategory, assertProductPage, assertProductSpecialPriceOnProductPage, assertProductSearchableBySku" "VirtualProduct %isolation%";"virtual_sku_%isolation%";"185.00";"None";"999";"Yes";"default_subcategory";"-";"-";"MAGETWO-23002";"Out of Stock";"-";"Catalog, Search";"assertProductSaveMessage, assertProductInGrid, assertProductForm, assertProductPage, assertProductVisibleInCategory, assertProductPage, assertProductOutOfStock, assertProductTierPriceOnProductPage, assertProductSearchableBySku" "virtual_product_%isolation%";"virtual_sku_%isolation%";"99.99";"Taxable Goods";"-";"Yes";"-";"-";"-";"-";"Out of Stock";"-";"Search";"assertProductSaveMessage, assertProductInGrid, assertProductForm, assertProductPage, assertProductOutOfStock, assertProductSearchableBySku" diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/UpsellTest.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/UpsellTest.php new file mode 100644 index 0000000000000..4767fa3247420 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/UpsellTest.php @@ -0,0 +1,97 @@ +magentoBackendLoginUser(); + } + + /** + * Product Up-selling. Assign upselling to products and see them related on the front-end. + * + * @ZephirId MAGETWO-12391 + * @return void + */ + public function testCreateUpsell() + { + // Precondition: create simple product 1 + $simple1 = Factory::getFixtureFactory()->getMagentoCatalogSimpleProduct(); + $simple1->switchData('simple'); + $simple1->persist(); + $assignToSimple1 = Factory::getFixtureFactory()->getMagentoCatalogUpsellProducts(); + $assignToSimple1->switchData('add_up_sell_products'); + $verify = [$assignToSimple1->getProduct('simple'), $assignToSimple1->getProduct('configurable')]; + //Data + $productGridPage = Factory::getPageFactory()->getCatalogProductIndex(); + $editProductPage = Factory::getPageFactory()->getCatalogProductEdit(); + //Steps + $productGridPage->open(); + $productGridPage->getProductGrid()->searchAndOpen(['sku' => $simple1->getSku()]); + $editProductPage->getProductForm()->fill($assignToSimple1); + $editProductPage->getFormPageActions()->save(); + $editProductPage->getMessagesBlock()->waitSuccessMessage(); + + $productGridPage->open(); + $productGridPage->getProductGrid()->searchAndOpen( + ['sku' => $assignToSimple1->getProduct('configurable')->getSku()] + ); + $assignToSimple1->switchData('add_up_sell_product'); + $productForm = $editProductPage->getProductForm(); + $productForm->fill($assignToSimple1); + $editProductPage->getFormPageActions()->save(); + $editProductPage->getMessagesBlock()->waitSuccessMessage(); + + $this->assertOnTheFrontend($simple1, $verify); + } + + /** + * @param Product $product + * @param Product[] $assigned + * @return void + */ + protected function assertOnTheFrontEnd(Product $product, array $assigned) + { + /** @var Product $simple2 */ + /** @var Product $configurable */ + list($simple2, $configurable) = $assigned; + //Open up simple1 product page + $productPage = Factory::getPageFactory()->getCatalogProductView(); + Factory::getClientBrowser()->open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html'); + $this->assertEquals($product->getName(), $productPage->getViewBlock()->getProductName()); + + /** @var \Magento\Catalog\Test\Block\Product\ProductList\Upsell $upsellBlock */ + $upsellBlock = $productPage->getUpsellBlock(); + //Verify upsell simple2 and configurable on Simple1 product page + $this->assertTrue($upsellBlock->isUpsellProductVisible($simple2->getName())); + $this->assertTrue($upsellBlock->isUpsellProductVisible($configurable->getName())); + //Open and verify configurable page + $upsellBlock->openUpsellProduct($configurable->getName()); + $this->assertEquals($configurable->getName(), $productPage->getViewBlock()->getProductName()); + //Verify upsell simple2 on Configurable product page and open it + $upsellBlock = $productPage->getUpsellBlock(); + $this->assertTrue($upsellBlock->isUpsellProductVisible($simple2->getName())); + $upsellBlock->openUpsellProduct($simple2->getName()); + $this->assertEquals($simple2->getName(), $productPage->getViewBlock()->getProductName()); + $this->assertFalse($productPage->getUpsellBlock()->isVisible()); + } +} diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/ProductAttribute/CreateProductAttributeEntityFromProductPageTest/test.csv b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/ProductAttribute/CreateProductAttributeEntityFromProductPageTest/test.csv index fee0264704c24..85c887a70ea56 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/ProductAttribute/CreateProductAttributeEntityFromProductPageTest/test.csv +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/ProductAttribute/CreateProductAttributeEntityFromProductPageTest/test.csv @@ -1,5 +1,5 @@ -"attribute/data/frontend_label";"attribute/data/frontend_input";"attribute/data/options/preset";"attribute/data/is_required";"attribute/data/attribute_code";"attribute/data/is_global";"attribute/data/default_value_text";"attribute/data/default_value_textarea";"attribute/data/is_unique";"attribute/data/is_configurable";"attribute/data/manage_frontend_label";"attribute/data/is_searchable";"attribute/data/is_visible_in_advanced_search";"attribute/data/is_comparable";"attribute/data/is_filterable";"attribute/data/is_filterable_in_search";"attribute/data/is_used_for_promo_rules";"attribute/data/is_html_allowed_on_front";"attribute/data/is_visible_on_front";"attribute/data/used_in_product_listing";"attribute/data/used_for_sort_by";"constraint";"issue" -"Text_Field_Admin_%isolation%";"Text Field";"-";"No";"attr_text_%isolation%";"Global";"default_value_text%isolation%";"-";"Yes";"-";"-";"Yes";"Yes";"Yes";"-";"-";"-";"Yes";"Yes";"-";"Yes";"assertProductAttributeInGrid, assertAttributeForm, assertAddedProductAttributeOnProductForm, assertProductAttributeDisplayingOnSearchForm, assertProductAttributeIsGlobal, assertProductAttributeDisplayingOnFrontend, assertProductAttributeDisplayingOnSearchForm, assertProductAttributeIsComparable, assertProductAttributeIsHtmlAllowed, assertProductAttributeIsUsedInSortOnFrontend";"" -"Dropdown_Admin_%isolation%";"Dropdown";"default";"No";"attr_dropdown_%isolation%";"Global";"-";"-";"-";"Yes";"-";"-";"-";"-";"Filterable (with results)";"Yes";"-";"-";"-";"-";"-";"assertProductAttributeIsFilterable, assertProductAttributeIsFilterableInSearch, assertProductAttributeIsConfigurable";"" -"Text_Field_Admin_%isolation%";"Text Field";"-";"Yes";"attr_text_%isolation%";"-";"default_value_text%isolation%";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"assertProductAttributeIsRequired";"" -"Text_Field_Admin_%isolation%";"Text Field";"-";"No";"attr_text_%isolation%";"-";"default_value_text%isolation%";"-";"Yes";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"assertProductAttributeIsUnique";"BUG: MAGETWO-30474" \ No newline at end of file +"attribute/data/frontend_label";"attribute/data/frontend_input";"attribute/data/options/preset";"attribute/data/is_required";"attribute/data/attribute_code";"attribute/data/is_global";"attribute/data/default_value_text";"attribute/data/default_value_textarea";"attribute/data/is_unique";"attribute/data/is_configurable";"attribute/data/manage_frontend_label";"attribute/data/is_searchable";"attribute/data/is_visible_in_advanced_search";"attribute/data/is_comparable";"attribute/data/is_filterable";"attribute/data/is_filterable_in_search";"attribute/data/is_used_for_promo_rules";"attribute/data/is_html_allowed_on_front";"attribute/data/is_visible_on_front";"attribute/data/used_in_product_listing";"attribute/data/used_for_sort_by";"constraint" +"Text_Field_Admin_%isolation%";"Text Field";"-";"No";"attr_text_%isolation%";"Global";"default_value_text%isolation%";"-";"Yes";"-";"-";"Yes";"Yes";"Yes";"-";"-";"-";"Yes";"Yes";"-";"Yes";"assertProductAttributeInGrid, assertAttributeForm, assertAddedProductAttributeOnProductForm, assertProductAttributeDisplayingOnSearchForm, assertProductAttributeIsGlobal, assertProductAttributeDisplayingOnFrontend, assertProductAttributeDisplayingOnSearchForm, assertProductAttributeIsComparable, assertProductAttributeIsHtmlAllowed, assertProductAttributeIsUsedInSortOnFrontend" +"Dropdown_Admin_%isolation%";"Dropdown";"default";"No";"attr_dropdown_%isolation%";"Global";"-";"-";"-";"Yes";"-";"-";"-";"-";"Filterable (with results)";"Yes";"-";"-";"-";"-";"-";"assertProductAttributeIsFilterable, assertProductAttributeIsFilterableInSearch, assertProductAttributeIsConfigurable" +"Text_Field_Admin_%isolation%";"Text Field";"-";"Yes";"attr_text_%isolation%";"-";"default_value_text%isolation%";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"assertProductAttributeIsRequired" +"Text_Field_Admin_%isolation%";"Text Field";"-";"No";"attr_text_%isolation%";"-";"default_value_text%isolation%";"-";"Yes";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"assertProductAttributeIsUnique" \ No newline at end of file diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/ProductAttribute/CreateProductAttributeEntityTest/testCreateProductAttribute.csv b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/ProductAttribute/CreateProductAttributeEntityTest/testCreateProductAttribute.csv index 217e673ba44a8..c17decc4632f6 100755 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/ProductAttribute/CreateProductAttributeEntityTest/testCreateProductAttribute.csv +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/ProductAttribute/CreateProductAttributeEntityTest/testCreateProductAttribute.csv @@ -1,10 +1,10 @@ "productTemplate/dataSet";"productAttribute/data/frontend_label";"productAttribute/data/frontend_input";"productAttribute/data/options/preset";"productAttribute/data/is_required";"productAttribute/data/attribute_code";"productAttribute/data/is_global";"productAttribute/data/default_value_text";"productAttribute/data/default_value_textarea";"productAttribute/data/default_value_date/pattern";"productAttribute/data/default_value_yesno";"productAttribute/data/is_unique";"productAttribute/data/is_configurable";"productAttribute/data/manage_frontend_label";"productAttribute/data/is_searchable";"productAttribute/data/is_visible_in_advanced_search";"productAttribute/data/is_comparable";"productAttribute/data/is_filterable";"productAttribute/data/is_filterable_in_search";"productAttribute/data/is_used_for_promo_rules";"productAttribute/data/is_html_allowed_on_front";"productAttribute/data/is_visible_on_front";"productAttribute/data/used_in_product_listing";"productAttribute/data/used_for_sort_by";"constraint";"issue" "custom_attribute_set";"Text_Field_Admin_%isolation%";"Text Field";"-";"No";"attr_textfield_%isolation%";"-";"default_value_text%isolation%";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"assertProductAttributeInGrid, assertAttributeForm, assertAddedProductAttributeOnProductForm";"" "custom_attribute_set";"Text_Field_Admin_%isolation%";"Text Area";"-";"Yes";"attr_textarea_%isolation%";"Store View";"-";"default_value_textarea%isolation%";"-";"-";"No";"-";"Area_Field%isolation%";"Yes";"Yes";"Yes";"-";"-";"-";"-";"-";"-";"-";"assertProductAttributeInGrid, assertAttributeForm, assertAddedProductAttributeOnProductForm, assertProductAttributeIsRequired, assertAttributeSearchableByLabel, assertProductAttributeDisplayingOnSearchForm, assertProductAttributeIsComparable";"" -"custom_attribute_set";"Date_Admin_%isolation%";"Date";"-";"No";"attr_date_%isolation%";"-";"-";"-";"n/j/y";"-";"No";"-";"Date_Store_View";"No";"No";"No";"-";"-";"-";"-";"Yes";"Yes";"Yes";"assertProductAttributeInGrid, assertAttributeForm, assertAddedProductAttributeOnProductForm, assertProductAttributeIsUsedInSortOnFrontend, assertProductAttributeIsUsedPromoRules";"" +"custom_attribute_set";"Date_Admin_%isolation%";"Date";"-";"No";"attr_date_%isolation%";"-";"-";"-";"n/j/y";"-";"No";"-";"Date_Store_View";"Yes";"Yes";"No";"-";"-";"-";"-";"Yes";"Yes";"Yes";"assertProductAttributeInGrid, assertAttributeForm, assertAddedProductAttributeOnProductForm, assertProductAttributeIsUsedInSortOnFrontend, assertProductAttributeIsUsedPromoRules";"" "custom_attribute_set";"Yes/No_Admin_%isolation%";"Yes/No";"-";"Yes";"attr_yesno_%isolation%";"Global";"-";"-";"-";"No";"-";"-";"Yes/No_Global";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"assertProductAttributeInGrid, assertAttributeForm, assertAddedProductAttributeOnProductForm";"" "custom_attribute_set";"Multiple_Select_Admin_%isolation%";"Multiple Select";"default";"No";"attr_multiselect_%isolation%";"Website";"-";"-";"-";"-";"Yes";"-";"-";"Yes";"Yes";"Yes";"Filterable (with results)";"Yes";"-";"Yes";"Yes";"Yes";"-";"assertProductAttributeInGrid, assertAttributeForm, assertAddedProductAttributeOnProductForm, assertProductAttributeDisplayingOnFrontend, assertProductAttributeDisplayingOnSearchForm, assertProductAttributeIsComparable, assertProductAttributeIsFilterable, assertProductAttributeIsFilterableInSearch, assertAttributeSearchableByLabel, assertAttributeOptionsOnProductForm";"" "custom_attribute_set";"Dropdown_Admin_%isolation%";"Dropdown";"default";"Yes";"attr_dropdown_%isolation%";"Global";"-";"-";"-";"-";"No";"Yes";"-";"Yes";"Yes";"Yes";"Filterable (with results)";"Yes";"-";"Yes";"Yes";"Yes";"Yes";"assertProductAttributeInGrid, assertAttributeForm, assertAddedProductAttributeOnProductForm, assertProductAttributeIsRequired, assertProductAttributeIsGlobal, assertProductAttributeDisplayingOnFrontend, assertProductAttributeDisplayingOnSearchForm, assertAttributeSearchableByLabel, assertProductAttributeIsComparable, assertProductAttributeIsUsedInSortOnFrontend, assertProductAttributeIsFilterable, assertProductAttributeIsConfigurable, assertProductAttributeIsFilterableInSearch, assertAttributeOptionsOnProductForm";"" -"custom_attribute_set";"Price_Admin_%isolation%";"Price";"-";"No";"attr_price_%isolation%";"-";"1000";"-";"-";"-";"No";"-";"Price_StoreView";"Yes";"Yes";"No";"Filterable (with results)";"Yes";"-";"-";"-";"-";"-";"assertProductAttributeInGrid, assertAttributeForm, assertAddedProductAttributeOnProductForm, assertAttributeSearchableByLabel, assertProductAttributeDisplayingOnSearchForm, assertProductAttributeIsFilterable, assertProductAttributeIsFilterableInSearch";"" +"custom_attribute_set";"Price_Admin_%isolation%";"Price";"-";"No";"attr_price_%isolation%";"-";"1000";"-";"-";"-";"No";"-";"Price_StoreView";"Yes";"Yes";"No";"Filterable (with results)";"Yes";"-";"-";"-";"-";"-";"assertProductAttributeInGrid, assertAttributeForm, assertAddedProductAttributeOnProductForm, assertAttributeSearchableByLabel, assertProductAttributeDisplayingOnSearchForm, assertProductAttributeIsFilterable, assertProductAttributeIsFilterableInSearch";"Bug:MAGETWO-31560" "custom_attribute_set";"Fixed_Product_Tax_Admin_%isolation%";"Fixed Product Tax";"-";"-";"attr_fpt_code_%isolation%";"-";"-";"-";"-";"-";"-";"-";"Fixed_Product_Tax_Storeview";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"assertProductAttributeInGrid, assertAttributeForm, assertAddedProductAttributeOnProductForm";"" -"custom_attribute_set";"Text_Field_Admin_%isolation%";"Text Field";"-";"Yes";"attr_textfield_%isolation%";"Store View";"default_value_text%isolation%";"-";"-";"-";"Yes";"-";"Area_Field%isolation%";"Yes";"Yes";"Yes";"-";"-";"-";"-";"-";"-";"-";"assertProductAttributeIsUnique";"Bug: MAGETWO-30474" \ No newline at end of file +"custom_attribute_set";"Text_Field_Admin_%isolation%";"Text Field";"-";"Yes";"attr_textfield_%isolation%";"Store View";"default_value_text%isolation%";"-";"-";"-";"Yes";"-";"Area_Field%isolation%";"Yes";"Yes";"Yes";"-";"-";"-";"-";"-";"-";"-";"assertProductAttributeIsUnique";"" \ No newline at end of file diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestStep/AddAttributeToProductTemplateStep.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestStep/AddAttributeToProductTemplateStep.php new file mode 100644 index 0000000000000..18702297fcd8e --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestStep/AddAttributeToProductTemplateStep.php @@ -0,0 +1,97 @@ +catalogProductSetIndex = $catalogProductSetIndex; + $this->catalogProductSetEdit = $catalogProductSetEdit; + $this->attribute = $attribute; + $this->productTemplate = $productTemplate; + $this->fixtureFactory = $fixtureFactory; + } + + /** + * Move attribute To attribute set. + * + * @return array + */ + public function run() + { + $filterAttribute = ['set_name' => $this->productTemplate->getAttributeSetName()]; + $this->catalogProductSetIndex->open()->getGrid()->searchAndOpen($filterAttribute); + $this->catalogProductSetEdit->getAttributeSetEditBlock()->moveAttribute($this->attribute->getData()); + $this->catalogProductSetEdit->getPageActions()->save(); + + // Create product with attribute set mentioned above: + $product = $this->fixtureFactory->createByCode( + 'catalogProductSimple', + [ + 'dataSet' => 'product_with_category_with_anchor', + 'data' => [ + 'attribute_set_id' => ['attribute_set' => $this->productTemplate], + 'custom_attribute' => $this->attribute, + ], + ] + ); + $product->persist(); + + return ['product' => $product]; + } +} diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestStep/AddNewAttributeFromProductPageStep.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestStep/AddNewAttributeFromProductPageStep.php index 82f01cc14645e..7eb35a2357b62 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestStep/AddNewAttributeFromProductPageStep.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestStep/AddNewAttributeFromProductPageStep.php @@ -46,7 +46,6 @@ public function __construct(CatalogProductEdit $catalogProductEdit, $tabName) public function run() { $productForm = $this->catalogProductEdit->getProductForm(); - /** @var \Magento\Catalog\Test\Block\Adminhtml\Product\Edit\ProductTab $productDetailsTab */ $productForm->addNewAttribute($this->tabName); } } diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestStep/MoveAttributeToProductTemplateStep.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestStep/MoveAttributeToProductTemplateStep.php deleted file mode 100644 index 1b4ff42e4458d..0000000000000 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestStep/MoveAttributeToProductTemplateStep.php +++ /dev/null @@ -1,96 +0,0 @@ -catalogProductSetIndex = $catalogProductSetIndex; - $this->catalogProductSetEdit = $catalogProductSetEdit; - $this->attribute = $attribute; - $this->productTemplate = $productTemplate; - $this->fixtureFactory = $fixtureFactory; - } - - /** - * Move attribute To attribute set. - * - * @return array - */ - public function run() - { - $filterAttribute = ['set_name' => $this->productTemplate->getAttributeSetName()]; - $this->catalogProductSetIndex->open()->getGrid()->searchAndOpen($filterAttribute); - $this->catalogProductSetEdit->getAttributeSetEditBlock()->moveAttribute($this->attribute->getData()); - - // Create product with attribute set mentioned above: - $product = $this->fixtureFactory->createByCode( - 'catalogProductSimple', - [ - 'dataSet' => 'product_with_category_with_anchor', - 'data' => [ - 'attribute_set_id' => ['attribute_set' => $this->productTemplate], - 'custom_attribute' => $this->attribute, - ], - ] - ); - $product->persist(); - - return ['product' => $product]; - } -} diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/etc/constraint.xml b/dev/tests/functional/tests/app/Magento/Catalog/Test/etc/constraint.xml index b5d5da90aa905..1787c27b4c603 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/etc/constraint.xml +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/etc/constraint.xml @@ -6,34 +6,34 @@ --> - high + high - low + low - low + low - low + low - low + low @@ -42,7 +42,7 @@ - low + low @@ -51,7 +51,7 @@ - low + low @@ -59,7 +59,7 @@ - low + low @@ -68,7 +68,7 @@ - low + low @@ -76,55 +76,55 @@ - middle + middle - low + low - low + low - low + low - low + low - low + low - low + low - low + low - high + high @@ -135,33 +135,33 @@ - low + low - low + low - high + high - low + low - low + low - low + low @@ -174,46 +174,46 @@ - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low - middle + middle @@ -224,13 +224,13 @@ - high + high - middle + middle - middle + middle @@ -240,13 +240,13 @@ - high + high - middle + middle - middle + middle @@ -256,37 +256,37 @@ - high + high - middle + middle - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low @@ -294,20 +294,20 @@ - low + low - high + high - high + high @@ -316,14 +316,14 @@ - high + high - high + high @@ -334,109 +334,109 @@ - high + high - low + low - low + low - low + low - low + low - low + low - high + high - high + high - high + high - low + low - low + low - low + low - low + low - low + low - low + low - low + low - high + high - low + low - high + high - high + high - high + high - high + high - high + high - low + low - low + low - low + low - high + high - high + high - low + low - low + low - low + low diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/etc/scenario.xml b/dev/tests/functional/tests/app/Magento/Catalog/Test/etc/scenario.xml index 13e575ac29437..8a27acb812334 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/etc/scenario.xml +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/etc/scenario.xml @@ -51,12 +51,9 @@ saveAttribute - moveAttributeToProductTemplate + addAttributeToProductTemplate - - saveProductTemplate - - + diff --git a/dev/tests/functional/tests/app/Magento/CatalogRule/Test/Block/Adminhtml/FormPageActions.php b/dev/tests/functional/tests/app/Magento/CatalogRule/Test/Block/Adminhtml/FormPageActions.php new file mode 100644 index 0000000000000..c7ac4e1e5faf3 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/CatalogRule/Test/Block/Adminhtml/FormPageActions.php @@ -0,0 +1,32 @@ +_rootElement->find($this->saveAndApplyButton)->click(); + } +} diff --git a/dev/tests/functional/tests/app/Magento/CatalogRule/Test/Block/Adminhtml/Promo/Catalog.php b/dev/tests/functional/tests/app/Magento/CatalogRule/Test/Block/Adminhtml/Promo/Catalog.php new file mode 100644 index 0000000000000..3390387e5853d --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/CatalogRule/Test/Block/Adminhtml/Promo/Catalog.php @@ -0,0 +1,94 @@ + [ + 'selector' => '#promo_catalog_grid_filter_rule_id', + ], + 'name' => [ + 'selector' => '#promo_catalog_grid_filter_name', + ], + 'from_date' => [ + 'selector' => '[data-ui-id="widget-grid-column-filter-date-filter-from-date-from"]', + ], + 'to_date' => [ + 'selector' => '[data-ui-id="widget-grid-column-filter-date-1-filter-to-date-from"]', + ], + 'is_active' => [ + 'selector' => '#promo_catalog_grid_filter_is_active', + 'input' => 'select', + ], + 'rule_website' => [ + 'selector' => '#promo_catalog_grid_filter_rule_website', + 'input' => 'select', + ], + ]; + + /** + * Return row with given catalog price rule name. + * + * @param string $ruleName + * @return Element + */ + public function getGridRow($ruleName) + { + return $this->getRow(['name' => $ruleName]); + } + + /** + * Return id of catalog price rule with given name. + * + * @param string $ruleName + * @return string + */ + public function getCatalogPriceId($ruleName) + { + return $this->getGridRow($ruleName)->find('//td[@data-column="rule_id"]', Locator::SELECTOR_XPATH)->getText(); + } + + /** + * Check if specific row exists in grid. + * + * @param array $filter + * @param bool $isSearchable + * @param bool $isStrict + * @return bool + */ + public function isRowVisible(array $filter, $isSearchable = true, $isStrict = true) + { + $this->search(['name' => $filter['name']]); + return parent::isRowVisible($filter, $isSearchable, $isStrict); + } +} diff --git a/dev/tests/functional/tests/app/Magento/CatalogRule/Test/Block/Adminhtml/Promo/Catalog/Edit/PromoForm.php b/dev/tests/functional/tests/app/Magento/CatalogRule/Test/Block/Adminhtml/Promo/Catalog/Edit/PromoForm.php new file mode 100644 index 0000000000000..bfa8d3a4e1386 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/CatalogRule/Test/Block/Adminhtml/Promo/Catalog/Edit/PromoForm.php @@ -0,0 +1,58 @@ +getFieldsByTabs($fixture); + if ($replace) { + $tabs = $this->prepareData($tabs, $replace); + } + $this->fillTabs($tabs, $element); + } + + /** + * Replace placeholders in each values of data + * + * @param array $tabs + * @param array $replace + * @return array + */ + protected function prepareData(array $tabs, array $replace) + { + foreach ($replace as $tabName => $fields) { + foreach ($fields as $key => $pairs) { + if (isset($tabs[$tabName][$key])) { + $tabs[$tabName][$key]['value'] = str_replace( + array_keys($pairs), + array_values($pairs), + $tabs[$tabName][$key]['value'] + ); + } + } + } + + return $tabs; + } +} diff --git a/dev/tests/functional/tests/app/Magento/CatalogRule/Test/Block/Adminhtml/Promo/Catalog/Edit/PromoForm.xml b/dev/tests/functional/tests/app/Magento/CatalogRule/Test/Block/Adminhtml/Promo/Catalog/Edit/PromoForm.xml new file mode 100644 index 0000000000000..4c3adc4938149 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/CatalogRule/Test/Block/Adminhtml/Promo/Catalog/Edit/PromoForm.xml @@ -0,0 +1,47 @@ + + + + + \Magento\Backend\Test\Block\Widget\Tab + #promo_catalog_edit_tabs_main_section + css selector + + + select + + + [name='website_ids[]'] + multiselect + + + [name='customer_group_ids[]'] + multiselect + + + + + \Magento\Backend\Test\Block\Widget\Tab + #promo_catalog_edit_tabs_conditions_section + css selector + + + #rule_conditions_fieldset + conditions + + + + + \Magento\Backend\Test\Block\Widget\Tab + #promo_catalog_edit_tabs_actions_section + css selector + + + select + + + + diff --git a/dev/tests/functional/tests/app/Magento/CatalogRule/Test/Block/Adminhtml/Promo/Catalog/Edit/Tab/Conditions.php b/dev/tests/functional/tests/app/Magento/CatalogRule/Test/Block/Adminhtml/Promo/Catalog/Edit/Tab/Conditions.php new file mode 100644 index 0000000000000..d31b30b1a68c0 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/CatalogRule/Test/Block/Adminhtml/Promo/Catalog/Edit/Tab/Conditions.php @@ -0,0 +1,46 @@ +dataMapping($fields); + + $conditionsBlock = Factory::getBlockFactory()->getMagentoCatalogRuleConditions( + $element->find($this->ruleConditions) + ); + $conditionsBlock->clickAddNew(); + + $conditionsBlock->selectCondition($data['condition_type']['value']); + $conditionsBlock->clickEllipsis(); + $conditionsBlock->selectConditionValue($data['condition_value']['value']); + } +} diff --git a/dev/tests/functional/tests/app/Magento/CatalogRule/Test/Block/Adminhtml/Promo/GridPageActions.php b/dev/tests/functional/tests/app/Magento/CatalogRule/Test/Block/Adminhtml/Promo/GridPageActions.php new file mode 100644 index 0000000000000..f42fafd24c726 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/CatalogRule/Test/Block/Adminhtml/Promo/GridPageActions.php @@ -0,0 +1,31 @@ +_rootElement->find($this->applyRules)->click(); + } +} diff --git a/dev/tests/functional/tests/app/Magento/CatalogRule/Test/Block/Conditions.php b/dev/tests/functional/tests/app/Magento/CatalogRule/Test/Block/Conditions.php new file mode 100644 index 0000000000000..e4717f9ff45b4 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/CatalogRule/Test/Block/Conditions.php @@ -0,0 +1,72 @@ +_rootElement->find('img.rule-param-add.v-middle')->click(); + } + + /** + * Ellipsis image click + */ + public function clickEllipsis() + { + $this->_rootElement->find('//a[contains(text(),"...")]', Locator::SELECTOR_XPATH)->click(); + } + + /** + * Select Condition type + * @param string $type + */ + public function selectCondition($type) + { + $this->_rootElement->find($this->conditionType, Locator::SELECTOR_CSS, 'select')->setValue($type); + } + + /** + * Select Condition value + * @param string $value + */ + public function selectConditionValue($value) + { + $this->_rootElement->find($this->conditionValue, Locator::SELECTOR_CSS, 'input')->setValue($value); + } + + /** + * Click save and continue button on form + */ + public function clickSaveAndContinue() + { + $this->_rootElement->find('#save_and_continue_edit')->click(); + } +} diff --git a/dev/tests/functional/tests/app/Magento/CatalogRule/Test/Constraint/AssertCatalogPriceRuleAppliedCatalogPage.php b/dev/tests/functional/tests/app/Magento/CatalogRule/Test/Constraint/AssertCatalogPriceRuleAppliedCatalogPage.php new file mode 100755 index 0000000000000..f88141e403788 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/CatalogRule/Test/Constraint/AssertCatalogPriceRuleAppliedCatalogPage.php @@ -0,0 +1,82 @@ +open(); + $categoryName = $product->getCategoryIds()[0]; + $productName = $product->getName(); + $cmsIndex->getTopmenu()->selectCategoryByName($categoryName); + $productPriceBlock = $catalogCategoryView->getListProductBlock()->getProductPriceBlock($productName); + $actualPrice['regular'] = $productPriceBlock->getRegularPrice(); + $actualPrice['special'] = $productPriceBlock->getSpecialPrice(); + $actualPrice['discount_amount'] = $actualPrice['regular'] - $actualPrice['special']; + $diff = $this->verifyData($actualPrice, $price); + \PHPUnit_Framework_Assert::assertTrue( + empty($diff), + implode(' ', $diff) + ); + } + + /** + * Check if arrays have equal values + * + * @param array $formData + * @param array $fixtureData + * @return array + */ + protected function verifyData(array $formData, array $fixtureData) + { + $errorMessage = []; + foreach ($formData as $key => $value) { + if ($value != $fixtureData[$key]) { + $errorMessage[] = "Data not equal." + . "\nExpected: " . $fixtureData[$key] + . "\nActual: " . $value; + } + } + return $errorMessage; + } + + /** + * Text of catalog price rule visibility on catalog page (frontend) + * + * @return string + */ + public function toString() + { + return 'Displayed catalog price rule data on catalog page(frontend) equals to passed from fixture.'; + } +} diff --git a/dev/tests/functional/tests/app/Magento/CatalogRule/Test/Constraint/AssertCatalogPriceRuleAppliedProductPage.php b/dev/tests/functional/tests/app/Magento/CatalogRule/Test/Constraint/AssertCatalogPriceRuleAppliedProductPage.php new file mode 100755 index 0000000000000..92fdf8f0d6feb --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/CatalogRule/Test/Constraint/AssertCatalogPriceRuleAppliedProductPage.php @@ -0,0 +1,85 @@ +open(); + $categoryName = $product->getCategoryIds()[0]; + $productName = $product->getName(); + $cmsIndex->getTopmenu()->selectCategoryByName($categoryName); + $catalogCategoryView->getListProductBlock()->openProductViewPage($productName); + $productPriceBlock = $pageCatalogProductView->getViewBlock()->getPriceBlock(); + $actualPrice['regular'] = $productPriceBlock->getRegularPrice(); + $actualPrice['special'] = $productPriceBlock->getSpecialPrice(); + $actualPrice['discount_amount'] = $actualPrice['regular'] - $actualPrice['special']; + $diff = $this->verifyData($actualPrice, $price); + \PHPUnit_Framework_Assert::assertTrue( + empty($diff), + implode(' ', $diff) + ); + } + + /** + * Check if arrays have equal values + * + * @param array $formData + * @param array $fixtureData + * @return array + */ + protected function verifyData(array $formData, array $fixtureData) + { + $errorMessage = []; + foreach ($formData as $key => $value) { + if ($value != $fixtureData[$key]) { + $errorMessage[] = "Data not equal." + . "\nExpected: " . $fixtureData[$key] + . "\nActual: " . $value; + } + } + return $errorMessage; + } + + /** + * Text of catalog price rule visibility on product page (frontend) + * + * @return string + */ + public function toString() + { + return 'Displayed catalog price rule data on product page(frontend) equals to passed from fixture.'; + } +} diff --git a/dev/tests/functional/tests/app/Magento/CatalogRule/Test/Constraint/AssertCatalogPriceRuleAppliedShoppingCart.php b/dev/tests/functional/tests/app/Magento/CatalogRule/Test/Constraint/AssertCatalogPriceRuleAppliedShoppingCart.php new file mode 100755 index 0000000000000..c9165158602b7 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/CatalogRule/Test/Constraint/AssertCatalogPriceRuleAppliedShoppingCart.php @@ -0,0 +1,69 @@ +open(); + $categoryName = $product->getCategoryIds()[0]; + $productName = $product->getName(); + $cmsIndex->getTopmenu()->selectCategoryByName($categoryName); + $catalogCategoryView->getListProductBlock()->openProductViewPage($productName); + $pageCatalogProductView->getViewBlock()->clickAddToCartButton(); + $actualGrandTotal = $pageCheckoutCart->getCartBlock()->getCartItem($product)->getPrice(); + \PHPUnit_Framework_Assert::assertEquals( + $price['grand_total'], + $actualGrandTotal, + 'Wrong grand total price is displayed.' + . "\nExpected: " . $price['grand_total'] + . "\nActual: " . $actualGrandTotal + ); + } + + /** + * Text of catalog price rule visibility in Shopping Cart (frontend) + * + * @return string + */ + public function toString() + { + return 'Displayed catalog price rule data in shopping cart(frontend) equals to passed from fixture.'; + } +} diff --git a/dev/tests/functional/tests/app/Magento/CatalogRule/Test/Constraint/AssertCatalogPriceRuleForm.php b/dev/tests/functional/tests/app/Magento/CatalogRule/Test/Constraint/AssertCatalogPriceRuleForm.php new file mode 100644 index 0000000000000..c8a093983bdb8 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/CatalogRule/Test/Constraint/AssertCatalogPriceRuleForm.php @@ -0,0 +1,102 @@ +getData() + : array_merge($catalogPriceRuleOriginal->getData(), $catalogPriceRule->getData()); + $filter['name'] = $data['name']; + + $pageCatalogRuleIndex->open(); + $pageCatalogRuleIndex->getCatalogRuleGrid()->searchAndOpen($filter); + $formData = $pageCatalogRuleNew->getEditForm()->getData($catalogPriceRule); + $fixtureData = $catalogPriceRule->getData(); + //convert discount_amount to float to compare + if (isset($formData['discount_amount'])) { + $formData['discount_amount'] = floatval($formData['discount_amount']); + } + if (isset($fixtureData['discount_amount'])) { + $fixtureData['discount_amount'] = floatval($fixtureData['discount_amount']); + } + $diff = $this->verifyData($formData, $fixtureData); + \PHPUnit_Framework_Assert::assertTrue( + empty($diff), + implode(' ', $diff) + ); + } + + /** + * Check if arrays have equal values + * + * @param array $formData + * @param array $fixtureData + * @return array + */ + protected function verifyData(array $formData, array $fixtureData) + { + $errorMessage = []; + foreach ($fixtureData as $key => $value) { + if ($key == 'conditions') { + continue; + } + if (is_array($value)) { + $diff = array_diff($value, $formData[$key]); + $diff = array_merge($diff, array_diff($formData[$key], $value)); + if (!empty($diff)) { + $errorMessage[] = "Data in " . $key . " field not equal." + . "\nExpected: " . implode(", ", $value) + . "\nActual: " . implode(", ", $formData[$key]); + } + } else { + if ($value !== $formData[$key]) { + $errorMessage[] = "Data in " . $key . " field not equal." + . "\nExpected: " . $value + . "\nActual: " . $formData[$key]; + } + } + } + return $errorMessage; + } + + /** + * Text success verify Catalog Price Rule + * + * @return string + */ + public function toString() + { + return 'Displayed catalog price rule data on edit page(backend) equals to passed from fixture.'; + } +} diff --git a/dev/tests/functional/tests/app/Magento/CatalogRule/Test/Constraint/AssertCatalogPriceRuleInGrid.php b/dev/tests/functional/tests/app/Magento/CatalogRule/Test/Constraint/AssertCatalogPriceRuleInGrid.php new file mode 100644 index 0000000000000..d44220288676e --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/CatalogRule/Test/Constraint/AssertCatalogPriceRuleInGrid.php @@ -0,0 +1,72 @@ +getData() + : array_merge($catalogPriceRuleOriginal->getData(), $catalogPriceRule->getData()); + $filter = [ + 'name' => $data['name'], + 'is_active' => $data['is_active'], + ]; + //add ruleWebsite to filter if there is one + if ($catalogPriceRule->getWebsiteIds() != null) { + $ruleWebsite = $catalogPriceRule->getWebsiteIds(); + $ruleWebsite = is_array($ruleWebsite) ? reset($ruleWebsite) : $ruleWebsite; + $filter['rule_website'] = $ruleWebsite; + } + //add from_date & to_date to filter if there are ones + if (isset($data['from_date']) && isset($data['to_date'])) { + $dateArray['from_date'] = date("M j, Y", strtotime($catalogPriceRule->getFromDate())); + $dateArray['to_date'] = date("M j, Y", strtotime($catalogPriceRule->getToDate())); + $filter = array_merge($filter, $dateArray); + } + + $pageCatalogRuleIndex->open(); + $errorMessage = implode(', ', $filter); + \PHPUnit_Framework_Assert::assertTrue( + $pageCatalogRuleIndex->getCatalogRuleGrid()->isRowVisible($filter), + 'Catalog Price Rule with following data: \'' . $errorMessage . '\' ' + . 'is absent in Catalog Price Rule grid.' + ); + } + + /** + * Success text that Catalog Price Rule exists in grid + * + * @return string + */ + public function toString() + { + return 'Catalog Price Rule is present in Catalog Rule grid.'; + } +} diff --git a/dev/tests/functional/tests/app/Magento/CatalogRule/Test/Constraint/AssertCatalogPriceRuleNotInGrid.php b/dev/tests/functional/tests/app/Magento/CatalogRule/Test/Constraint/AssertCatalogPriceRuleNotInGrid.php new file mode 100644 index 0000000000000..794ebf12cf43f --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/CatalogRule/Test/Constraint/AssertCatalogPriceRuleNotInGrid.php @@ -0,0 +1,54 @@ + $catalogPriceRule->getId(), + 'name' => $catalogPriceRule->getName(), + ]; + $pageCatalogRuleIndex->open(); + \PHPUnit_Framework_Assert::assertFalse( + $pageCatalogRuleIndex->getCatalogRuleGrid()->isRowVisible($filter), + 'Catalog Price Rule \'' . $filter['rule_id'] . '\', ' + . 'with name \'' . $filter['name'] . '\', ' + . 'is present in Catalog Price Rule grid.' + ); + } + + /** + * Success text that Catalog Price Rule is NOT present in grid + * + * @return string + */ + public function toString() + { + return 'Catalog Price Rule is NOT present in Catalog Rule grid.'; + } +} diff --git a/dev/tests/functional/tests/app/Magento/CatalogRule/Test/Constraint/AssertCatalogPriceRuleNoticeMessage.php b/dev/tests/functional/tests/app/Magento/CatalogRule/Test/Constraint/AssertCatalogPriceRuleNoticeMessage.php new file mode 100644 index 0000000000000..222ac7beaf197 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/CatalogRule/Test/Constraint/AssertCatalogPriceRuleNoticeMessage.php @@ -0,0 +1,53 @@ +getMessagesBlock()->getNoticeMessages(); + \PHPUnit_Framework_Assert::assertEquals( + self::NOTICE_MESSAGE_RULES . self::NOTICE_MESSAGE_APPLY, + $actualMessage, + 'Wrong notice message is displayed.' + . "\nExpected: " . self::NOTICE_MESSAGE_RULES . self::NOTICE_MESSAGE_APPLY + . "\nActual: " . $actualMessage + ); + } + + /** + * Text notice message is displayed + * + * @return string + */ + public function toString() + { + return 'Assert that notice message is displayed'; + } +} diff --git a/dev/tests/functional/tests/app/Magento/CatalogRule/Test/Constraint/AssertCatalogPriceRuleSuccessDeleteMessage.php b/dev/tests/functional/tests/app/Magento/CatalogRule/Test/Constraint/AssertCatalogPriceRuleSuccessDeleteMessage.php new file mode 100644 index 0000000000000..338e6196fe135 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/CatalogRule/Test/Constraint/AssertCatalogPriceRuleSuccessDeleteMessage.php @@ -0,0 +1,49 @@ +getMessagesBlock()->getSuccessMessages(); + \PHPUnit_Framework_Assert::assertEquals( + self::SUCCESS_DELETE_MESSAGE, + $actualMessage, + 'Wrong success message is displayed.' + . "\nExpected: " . self::SUCCESS_DELETE_MESSAGE + . "\nActual: " . $actualMessage + ); + } + + /** + * Text success save message is displayed + * + * @return string + */ + public function toString() + { + return 'Assert that success message is displayed'; + } +} diff --git a/dev/tests/functional/tests/app/Magento/CatalogRule/Test/Constraint/AssertCatalogPriceRuleSuccessSaveMessage.php b/dev/tests/functional/tests/app/Magento/CatalogRule/Test/Constraint/AssertCatalogPriceRuleSuccessSaveMessage.php new file mode 100644 index 0000000000000..5a5b7fac30cf6 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/CatalogRule/Test/Constraint/AssertCatalogPriceRuleSuccessSaveMessage.php @@ -0,0 +1,52 @@ +getMessagesBlock()->getSuccessMessages(); + if (!is_array($actualMessages)) { + $actualMessages = [$actualMessages]; + } + \PHPUnit_Framework_Assert::assertContains( + self::SUCCESS_MESSAGE, + $actualMessages, + 'Wrong success message is displayed.' + . "\nExpected: " . self::SUCCESS_MESSAGE + . "\nActual: " . implode(',', $actualMessages) + ); + } + + /** + * Text success save message is displayed + * + * @return string + */ + public function toString() + { + return 'Assert that success message is displayed'; + } +} diff --git a/dev/tests/functional/tests/app/Magento/CatalogRule/Test/Fixture/CatalogPriceRule.php b/dev/tests/functional/tests/app/Magento/CatalogRule/Test/Fixture/CatalogPriceRule.php new file mode 100644 index 0000000000000..c38c3223c87e1 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/CatalogRule/Test/Fixture/CatalogPriceRule.php @@ -0,0 +1,45 @@ +_repository = Factory::getRepositoryFactory() + ->getMagentoCatalogRuleCatalogPriceRule($this->_dataConfig, $this->_data); + + //Default data set + $this->switchData(Repository::CATALOG_PRICE_RULE); + } + + /** + * Get the rule name value + */ + public function getRuleName() + { + return $this->getData('fields/name/value'); + } + + /** + * Get the discount amount value + */ + public function getDiscountAmount() + { + return $this->getData('fields/discount_amount/value'); + } +} diff --git a/dev/tests/functional/tests/app/Magento/CatalogRule/Test/Fixture/CatalogRule.php b/dev/tests/functional/tests/app/Magento/CatalogRule/Test/Fixture/CatalogRule.php new file mode 100644 index 0000000000000..6dd066d084542 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/CatalogRule/Test/Fixture/CatalogRule.php @@ -0,0 +1,242 @@ + 'CatalogPriceRule %isolation%', + 'description' => 'Catalog Price Rule Description', + 'is_active' => 'Active', + 'website_ids' => ['Main Website'], + 'customer_group_ids' => ['NOT LOGGED IN'], + 'simple_action' => 'By Percentage of the Original Price', + 'discount_amount' => '50', + ]; + + protected $name = [ + 'attribute_code' => 'name', + 'backend_type' => 'varchar', + 'is_required' => '1', + 'default_value' => '', + 'input' => 'text', + 'group' => 'rule_information', + ]; + + protected $description = [ + 'attribute_code' => 'description', + 'default_value' => '', + 'input' => 'text', + 'group' => 'rule_information', + ]; + + protected $is_active = [ + 'attribute_code' => 'is_active', + 'backend_type' => 'smallint', + 'is_required' => '1', + 'default_value' => '', + 'input' => 'select', + 'group' => 'rule_information', + ]; + + protected $website_ids = [ + 'attribute_code' => 'website_ids', + 'backend_type' => 'smallint', + 'is_required' => '1', + 'default_value' => '', + 'input' => 'multiselect', + 'group' => 'rule_information', + ]; + + protected $customer_group_ids = [ + 'attribute_code' => 'customer_group_ids', + 'backend_type' => 'smallint', + 'is_required' => '1', + 'default_value' => '', + 'input' => 'multiselect', + 'group' => 'rule_information', + ]; + + protected $from_date = [ + 'attribute_code' => 'from_date', + 'backend_type' => 'date', + 'is_required' => '0', + 'default_value' => '', + 'input' => 'text', + 'group' => 'rule_information', + ]; + + protected $to_date = [ + 'attribute_code' => 'to_date', + 'backend_type' => 'date', + 'is_required' => '0', + 'default_value' => '', + 'input' => 'text', + 'group' => 'rule_information', + ]; + + protected $simple_action = [ + 'attribute_code' => 'simple_action', + 'backend_type' => 'smallint', + 'is_required' => '0', + 'default_value' => '', + 'input' => 'select', + 'group' => 'actions', + ]; + + protected $discount_amount = [ + 'attribute_code' => 'discount_amount', + 'backend_type' => 'decimal', + 'is_required' => '1', + 'default_value' => '', + 'input' => 'text', + 'group' => 'actions', + ]; + + protected $condition_type = [ + 'attribute_code' => 'condition_type', + 'backend_type' => 'virtual', + 'is_required' => '0', + 'group' => 'conditions', + 'input' => 'select', + ]; + + protected $condition_value = [ + 'attribute_code' => 'condition_value', + 'backend_type' => 'virtual', + 'is_required' => '0', + 'group' => 'conditions', + ]; + + protected $rule = [ + 'attribute_code' => 'rule', + 'backend_type' => 'virtual', + 'is_required' => '0', + 'group' => 'conditions', + ]; + + protected $conditions = [ + 'attribute_code' => 'conditions', + 'backend_type' => 'virtual', + 'group' => 'conditions', + ]; + + protected $id = [ + 'attribute_code' => 'id', + 'backend_type' => 'virtual', + ]; + + protected $sort_order = [ + 'attribute_code' => 'sort_order', + 'default_value' => '', + 'input' => 'text', + 'group' => 'rule_information', + ]; + + protected $stop_rules_processing = [ + 'attribute_code' => 'stop_rules_processing', + 'default_value' => '', + 'input' => 'select', + 'group' => 'rule_information', + ]; + + public function getName() + { + return $this->getData('name'); + } + + public function getDescription() + { + return $this->getData('description'); + } + + public function getIsActive() + { + return $this->getData('is_active'); + } + + public function getWebsiteIds() + { + return $this->getData('website_ids'); + } + + public function getCustomerGroupIds() + { + return $this->getData('customer_group_ids'); + } + + public function getFromDate() + { + return $this->getData('from_date'); + } + + public function getToDate() + { + return $this->getData('to_date'); + } + + public function getSimpleAction() + { + return $this->getData('simple_action'); + } + + public function getDiscountAmount() + { + return $this->getData('discount_amount'); + } + + public function getConditionType() + { + return $this->getData('condition_type'); + } + + public function getConditionValue() + { + return $this->getData('condition_value'); + } + + public function getRule() + { + return $this->getData('rule'); + } + + public function getConditions() + { + return $this->getData('conditions'); + } + + public function getId() + { + return $this->getData('id'); + } + + public function getSortOrder() + { + return $this->getData('sort_order'); + } + + public function getStopRulesProcessing() + { + return $this->getData('stop_rules_processing'); + } +} diff --git a/dev/tests/functional/tests/app/Magento/CatalogRule/Test/Fixture/CatalogRule.xml b/dev/tests/functional/tests/app/Magento/CatalogRule/Test/Fixture/CatalogRule.xml new file mode 100644 index 0000000000000..26587fee40e86 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/CatalogRule/Test/Fixture/CatalogRule.xml @@ -0,0 +1,134 @@ + + + + Magento_CatalogRule + eav + catalog_rule + Magento\CatalogRule\Model\Resource\Rule\Product\Price\Collection + + + name + varchar + 1 + + text + rule_information + + + description + + text + rule_information + + + is_active + smallint + 1 + + select + rule_information + + + website_ids + smallint + 1 + + multiselect + rule_information + + + customer_group_ids + smallint + 1 + + multiselect + rule_information + + + website_ids + smallint + 1 + + multiselect + rule_information + + + from_date + date + 0 + + text + rule_information + + + to_date + date + 0 + + text + rule_information + + + simple_action + smallint + 0 + + select + actions + + + discount_amount + decimal + 1 + + text + actions + + + condition_type + virtual + 0 + conditions + select + + + condition_value + virtual + 0 + conditions + + + rule + virtual + 0l + conditions + + + conditions + virtual + conditions + + + id + virtual + + + sort_order + + text + rule_information + + + stop_rules_processing + + select + rule_information + + + Magento\CatalogRule\Test\Repository\CatalogRule + Magento\CatalogRule\Test\Handler\CatalogRule\CatalogRuleInterface + diff --git a/dev/tests/functional/tests/app/Magento/CatalogRule/Test/Fixture/CatalogRule/Conditions.php b/dev/tests/functional/tests/app/Magento/CatalogRule/Test/Fixture/CatalogRule/Conditions.php new file mode 100644 index 0000000000000..4bb888f59d9f7 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/CatalogRule/Test/Fixture/CatalogRule/Conditions.php @@ -0,0 +1,105 @@ + $value) { + $parts[$key] = trim($value); + } + + if ($parts[0] == 'Category') { + $this->data['conditions']['1--1']['attribute'] = 'category_ids'; + } elseif ($parts[1] == 'AttributeSet') { + $this->data['conditions']['1--1']['attribute'] = 'attribute_set_id'; + } + + if ($parts[1] == 'is') { + $this->data['conditions']['1--1']['operator'] = '=='; + } else { + $this->data['conditions']['1--1']['operator'] = '!='; + } + + $this->data['conditions']['1--1']['type'] = 'Magento\CatalogRule\Model\Rule\Condition\Product'; + + if (!empty($parts[2])) { + $this->data['conditions']['1--1']['value'] = $parts[2]; + } + } + + /** + * Persist custom selections conditions + * + * @return void + */ + public function persist() + { + // + } + + /** + * Return prepared data set + * + * @param string|null $key + * @return array|mixed + * + * @SuppressWarnings(PHPMD.UnusedFormalParameter) + */ + public function getData($key = null) + { + return $this->data; + } + + /** + * Return data set configuration settings + * + * @return string + */ + public function getDataConfig() + { + return $this->params; + } +} diff --git a/dev/tests/functional/tests/app/Magento/CatalogRule/Test/Fixture/Conditions.php b/dev/tests/functional/tests/app/Magento/CatalogRule/Test/Fixture/Conditions.php new file mode 100755 index 0000000000000..20e922488d0ee --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/CatalogRule/Test/Fixture/Conditions.php @@ -0,0 +1,88 @@ +params = $params; + if (isset($data['product'])) { + list($fixture, $dataSet) = explode('::', $data['product']); + $this->product = $fixtureFactory->createByCode($fixture, ['dataSet' => $dataSet]); + $this->product->persist(); + + /** @var CategoryIds $sourceCategories */ + $sourceCategories = $this->product->getDataFieldConfig('category_ids')['source']; + $this->data = $sourceCategories->getIds()[0]; + } + } + + /** + * Persist conditions + * + * @return void + */ + public function persist() + { + // + } + + /** + * Return prepared data set + * + * @param $key [optional] + * @return mixed + * + * @SuppressWarnings(PHPMD.UnusedFormalParameter) + */ + public function getData($key = null) + { + return $this->data; + } + + /** + * Return data set configuration settings + * + * @return string + */ + public function getDataConfig() + { + return $this->params; + } + + /** + * Get product for verification + * + * @return \Magento\Catalog\Test\Fixture\CatalogProductSimple + */ + public function getProduct() + { + return $this->product; + } +} diff --git a/dev/tests/functional/tests/app/Magento/CatalogRule/Test/Fixture/Product/Category.php b/dev/tests/functional/tests/app/Magento/CatalogRule/Test/Fixture/Product/Category.php new file mode 100644 index 0000000000000..d6674981d771d --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/CatalogRule/Test/Fixture/Product/Category.php @@ -0,0 +1,113 @@ +fixtureFactory = $fixtureFactory; + + $this->data = $data; + + if (isset($this->data['products'])) { + $products = explode(',', $this->data['products']); + $this->data['products'] = []; + foreach ($products as $key => $product) { + list($fixture, $dataSet) = explode('::', $product); + $this->data['products'][$key] = $this->fixtureFactory + ->createByCode($fixture, ['dataSet' => $dataSet]); + } + } + + $this->data['preset'] = $this->getPreset($this->data['preset']); + + $this->params = $params; + if ($persist) { + $this->persist(); + } + } + + /** + * Persist bundle selections products + * + * @return void + */ + public function persist() + { + if (isset($this->data['products'])) { + foreach ($this->data['products'] as $product) { + /** @var $product FixtureInterface */ + $product->persist(); + } + } + } + + /** + * Return prepared data set + * + * @param $key [optional] + * @return mixed + * + * @SuppressWarnings(PHPMD.UnusedFormalParameter) + */ + public function getData($key = null) + { + return $this->data; + } + + /** + * Return data set configuration settings + * + * @return string + */ + public function getDataConfig() + { + return $this->params; + } + + /** + * @param $name + * @return mixed + * @throws \InvalidArgumentException + */ + protected function getPreset($name) + { + $presets = [ + 'simple_category' => [ + 'name' => 'Simple With Category', + ], + ]; + if (!isset($presets[$name])) { + return null; + } + return $presets[$name]; + } +} diff --git a/dev/tests/functional/tests/app/Magento/CatalogRule/Test/Handler/CatalogRule/CatalogRuleInterface.php b/dev/tests/functional/tests/app/Magento/CatalogRule/Test/Handler/CatalogRule/CatalogRuleInterface.php new file mode 100644 index 0000000000000..036a0a54e90f7 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/CatalogRule/Test/Handler/CatalogRule/CatalogRuleInterface.php @@ -0,0 +1,15 @@ + [ + 'type' => 'Magento\CatalogRule\Model\Rule\Condition\Combine', + 'aggregator' => 'all', + 'value' => 1, + ], + 'Category' => [ + 'type' => 'Magento\CatalogRule\Model\Rule\Condition\Product', + 'attribute' => 'category_ids', + ], + ]; + + /** + * Mapping values for data. + * + * @var array + */ + protected $mappingData = [ + 'simple_action' => [ + 'By Percentage of the Original Price' => 'by_percent', + 'By Fixed Amount' => 'by_fixed', + 'To Percentage of the Original Price' => 'to_percent', + 'To Fixed Amount' => 'to_fixed', + ], + 'is_active' => [ + 'Active' => 1, + 'Inactive' => 0, + ], + 'stop_rules_processing' => [ + 'Yes' => 1, + 'No' => 0, + ], + ]; + + /** + * Mapping values for Websites + * + * @var array + */ + protected $websiteIds = [ + 'Main Website' => 1, + ]; + + /** + * Mapping values for Customer Groups + * + * @var array + */ + protected $customerGroupIds = [ + 'NOT LOGGED IN' => 0, + 'General' => 1, + 'Wholesale' => 2, + 'Retailer' => 3, + ]; + + /** + * POST request for creating Catalog Price Rule + * + * @param FixtureInterface $fixture + * @return mixed|void + * @throws \Exception + */ + public function persist(FixtureInterface $fixture = null) + { + $data = $this->prepareData($fixture); + $url = $_ENV['app_backend_url'] . 'catalog_rule/promo_catalog/save/'; + $curl = new BackendDecorator(new CurlTransport(), new Config()); + $curl->addOption(CURLOPT_HEADER, 1); + $curl->write(CurlInterface::POST, $url, '1.0', [], $data); + $response = $curl->read(); + $curl->close(); + + if (!strpos($response, 'data-ui-id="messages-message-success"')) { + throw new \Exception( + "Catalog Price Rule entity creating by curl handler was not successful! Response: $response" + ); + } + + return ['id' => $this->getCategoryPriceRuleId($data)]; + } + + /** + * Prepare data from text to values + * + * @param FixtureInterface $fixture + * @return array + */ + protected function prepareData($fixture) + { + $data = $this->replaceMappingData($fixture->getData()); + if (isset($data['website_ids'])) { + $websiteIds = []; + foreach ($data['website_ids'] as $websiteId) { + $websiteIds[] = isset($this->websiteIds[$websiteId]) ? $this->websiteIds[$websiteId] : $websiteId; + } + $data['website_ids'] = $websiteIds; + } + if (isset($data['customer_group_ids'])) { + $customerGroupIds = []; + foreach ($data['customer_group_ids'] as $customerGroupId) { + $customerGroupIds[] = isset($this->customerGroupIds[$customerGroupId]) + ? $this->customerGroupIds[$customerGroupId] + : $customerGroupId; + } + $data['customer_group_ids'] = $customerGroupIds; + } + if (!isset($data['stop_rules_processing'])) { + $data['stop_rules_processing'] = 0; + } + + if (!isset($data['rule'])) { + $data['rule'] = null; + } + $data['rule'] = ['conditions' => $this->prepareCondition($data['rule'])]; + + return $data; + } + + /** + * Get id after creating Category Price Rule + * + * @param array $data + * @return mixed + * @throws \Exception + */ + public function getCategoryPriceRuleId(array $data) + { + // Sort data in grid to define category price rule id if more than 20 items in grid + $url = $_ENV['app_backend_url'] . 'catalog_rule/promo_catalog/index/sort/rule_id/dir/desc'; + $curl = new BackendDecorator(new CurlTransport(), new Config()); + $curl->write(CurlInterface::POST, $url, '1.0'); + $response = $curl->read(); + $curl->close(); + + $pattern = '/class=\" col\-id col\-rule_id\W*>\W+(\d+)\W+<\/td>\W+\W+?' + . $data['name'] . '/siu'; + preg_match($pattern, $response, $matches); + if (empty($matches)) { + throw new \Exception('Cannot find Category Price Rule id'); + } + + return $matches[1]; + } +} diff --git a/dev/tests/functional/tests/app/Magento/CatalogRule/Test/Page/Adminhtml/CatalogRuleIndex.xml b/dev/tests/functional/tests/app/Magento/CatalogRule/Test/Page/Adminhtml/CatalogRuleIndex.xml new file mode 100644 index 0000000000000..95b43e8588355 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/CatalogRule/Test/Page/Adminhtml/CatalogRuleIndex.xml @@ -0,0 +1,25 @@ + + + + + + Magento\Core\Test\Block\Messages + #messages .messages + css selector + + + Magento\CatalogRule\Test\Block\Adminhtml\Promo\GridPageActions + .page-main-actions + css selector + + + Magento\CatalogRule\Test\Block\Adminhtml\Promo\Catalog + #promo_catalog_grid + css selector + + + diff --git a/dev/tests/functional/tests/app/Magento/CatalogRule/Test/Page/Adminhtml/CatalogRuleNew.xml b/dev/tests/functional/tests/app/Magento/CatalogRule/Test/Page/Adminhtml/CatalogRuleNew.xml new file mode 100644 index 0000000000000..0f39bc17004f7 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/CatalogRule/Test/Page/Adminhtml/CatalogRuleNew.xml @@ -0,0 +1,20 @@ + + + + + + Magento\CatalogRule\Test\Block\Adminhtml\FormPageActions + .page-main-actions + css selector + + + Magento\CatalogRule\Test\Block\Adminhtml\Promo\Catalog\Edit\PromoForm + [id="page:main-container"] + css selector + + + diff --git a/dev/tests/functional/tests/app/Magento/CatalogRule/Test/Repository/CatalogPriceRule.php b/dev/tests/functional/tests/app/Magento/CatalogRule/Test/Repository/CatalogPriceRule.php new file mode 100755 index 0000000000000..14fa29c94e01d --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/CatalogRule/Test/Repository/CatalogPriceRule.php @@ -0,0 +1,93 @@ +_data['default'] = ['config' => $defaultConfig, 'data' => $defaultData]; + $this->_data[self::CATALOG_PRICE_RULE] = $this->_getCatalogPriceRule(); + $this->_data[self::CATALOG_PRICE_RULE_ALL_GROUPS] = array_replace_recursive( + $this->_getCatalogPriceRule(), + $this->_getCatalogPriceRuleAllGroups() + ); + } + + protected function _getCatalogPriceRule() + { + return [ + 'data' => [ + 'fields' => [ + 'name' => ['value' => 'Rule %isolation%', 'group' => static::GROUP_RULE_INFORMATION], + 'is_active' => [ + 'value' => 'Active', + 'group' => static::GROUP_RULE_INFORMATION, + 'input' => 'select', + ], + 'website_ids' => [ + 'value' => ['Main Website'], + 'group' => static::GROUP_RULE_INFORMATION, + 'input' => 'multiselect', + 'input_value' => ['1'], + ], + 'customer_group_ids' => [ + 'value' => ['%group_value%'], + 'group' => static::GROUP_RULE_INFORMATION, + 'input' => 'multiselect', + 'input_value' => ['%group_id%'], + ], + 'simple_action' => [ + 'value' => 'By Percentage of the Original Price', + 'group' => static::GROUP_ACTIONS, + 'input' => 'select', + ], + 'discount_amount' => ['value' => '50.0000', 'group' => static::GROUP_ACTIONS], + 'conditions' => [ + 'value' => '[Category|is|%category_id%]', + 'group' => static::GROUP_CONDITIONS, + 'input' => 'conditions', + 'input_value' => 'Magento\CatalogRule\Model\Rule\Condition\Product|category_ids', + ], + ], + ] + ]; + } + + protected function _getCatalogPriceRuleAllGroups() + { + return [ + 'data' => [ + 'fields' => [ + 'customer_group_ids' => [ + 'value' => ['NOT LOGGED IN', 'General', 'Wholesale', 'Retailer'], + 'group' => static::GROUP_RULE_INFORMATION, + 'input' => 'multiselect', + 'input_value' => ['0', '1', '2', '3'], + ], + ], + ] + ]; + } +} diff --git a/dev/tests/functional/tests/app/Magento/CatalogRule/Test/Repository/CatalogRule.php b/dev/tests/functional/tests/app/Magento/CatalogRule/Test/Repository/CatalogRule.php new file mode 100755 index 0000000000000..b0ea023ce423f --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/CatalogRule/Test/Repository/CatalogRule.php @@ -0,0 +1,91 @@ +_data['active_catalog_rule'] = [ + 'name' => 'Active Catalog Rule', + 'description' => 'Rule Description', + 'is_active' => 'Active', + 'website_ids' => ['Main Website'], + 'customer_group_ids' => ['NOT LOGGED IN', 'General', 'Wholesale', 'Retailer'], + 'from_date' => '3/25/14', + 'to_date' => '3/29/14', + 'sort_order' => '1', + 'simple_action' => 'By Percentage of the Original Price', + 'discount_amount' => '50', + ]; + + $this->_data['inactive_catalog_price_rule'] = [ + 'name' => 'Inactive Catalog Price Rule', + 'is_active' => 'Inactive', + 'website_ids' => ['Main Website'], + 'customer_group_ids' => ['NOT LOGGED IN'], + 'simple_action' => 'By Percentage of the Original Price', + 'discount_amount' => '50', + ]; + + $this->_data['active_catalog_price_rule_with_conditions'] = [ + 'name' => 'Active Catalog Rule with conditions %isolation%', + 'description' => 'Rule Description', + 'is_active' => 'Active', + 'website_ids' => ['Main Website'], + 'customer_group_ids' => ['NOT LOGGED IN', 'General', 'Wholesale', 'Retailer'], + 'rule' => '[Category|is|2]', + 'simple_action' => 'By Percentage of the Original Price', + 'discount_amount' => '10', + ]; + + $this->_data['catalog_price_rule_priority_0'] = [ + 'name' => 'catalog_price_rule_priority_0', + 'description' => '-50% of price, Priority = 0', + 'is_active' => 'Active', + 'website_ids' => ['Main Website'], + 'customer_group_ids' => ['NOT LOGGED IN'], + 'sort_order' => '0', + 'simple_action' => 'By Percentage of the Original Price', + 'discount_amount' => '50', + ]; + + $this->_data['catalog_price_rule_priority_1_stop_further_rules'] = [ + 'name' => 'catalog_price_rule_priority_1_stop_further_rules', + 'description' => 'Priority 1, -5 By fixed amount', + 'is_active' => 'Active', + 'website_ids' => ['Main Website'], + 'customer_group_ids' => ['NOT LOGGED IN'], + 'sort_order' => '1', + 'simple_action' => 'By Fixed Amount', + 'discount_amount' => '5', + 'stop_rules_processing' => 'Yes', + ]; + + $this->_data['catalog_price_rule_priority_2'] = [ + 'name' => 'catalog_price_rule_priority_2', + 'description' => 'Priority 2, -10 By fixed amount', + 'is_active' => 'Active', + 'website_ids' => ['Main Website'], + 'customer_group_ids' => ['NOT LOGGED IN'], + 'sort_order' => '2', + 'simple_action' => 'By Fixed Amount', + 'discount_amount' => '10', + ]; + } +} diff --git a/dev/tests/functional/tests/app/Magento/CatalogRule/Test/TestCase/AbstractCatalogRuleEntityTest.php b/dev/tests/functional/tests/app/Magento/CatalogRule/Test/TestCase/AbstractCatalogRuleEntityTest.php new file mode 100644 index 0000000000000..e997f469198f3 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/CatalogRule/Test/TestCase/AbstractCatalogRuleEntityTest.php @@ -0,0 +1,91 @@ +catalogRuleIndex = $catalogRuleIndex; + $this->catalogRuleNew = $catalogRuleNew; + $this->adminCache = $adminCache; + $this->fixtureFactory = $fixtureFactory; + } + + /** + * Clear data after test + * + * @return void + */ + public function tearDown() + { + foreach ($this->catalogRules as $catalogRule) { + $filter = ['name' => $catalogRule->getName()]; + $this->catalogRuleIndex->open(); + $this->catalogRuleIndex->getCatalogRuleGrid()->searchAndOpen($filter); + $this->catalogRuleNew->getFormPageActions()->delete(); + } + $this->catalogRules = []; + } +} diff --git a/dev/tests/functional/tests/app/Magento/CatalogRule/Test/TestCase/ApplySeveralCatalogPriceRuleEntityTest.php b/dev/tests/functional/tests/app/Magento/CatalogRule/Test/TestCase/ApplySeveralCatalogPriceRuleEntityTest.php new file mode 100644 index 0000000000000..6b46ce912c548 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/CatalogRule/Test/TestCase/ApplySeveralCatalogPriceRuleEntityTest.php @@ -0,0 +1,63 @@ +catalogRuleIndex->open(); + foreach ($catalogRulesOriginal as $key => $catalogPriceRule) { + if ($catalogPriceRule == '-') { + continue; + } + $this->catalogRules[$key] = $this->fixtureFactory->createByCode( + 'catalogRule', + ['dataSet' => $catalogPriceRule] + ); + $this->catalogRules[$key]->persist(); + + $filter = [ + 'name' => $this->catalogRules[$key]->getName(), + 'rule_id' => $this->catalogRules[$key]->getId(), + ]; + $this->catalogRuleIndex->getCatalogRuleGrid()->searchAndOpen($filter); + $this->catalogRuleNew->getFormPageActions()->saveAndApply(); + } + // Create product + $productSimple = $this->fixtureFactory->createByCode( + 'catalogProductSimple', + ['dataSet' => 'simple_for_salesrule_1'] + ); + $productSimple->persist(); + + return ['product' => $productSimple]; + } +} diff --git a/dev/tests/functional/tests/app/Magento/CatalogRule/Test/TestCase/ApplySeveralCatalogPriceRuleEntityTest/testApplySeveralCatalogPriceRules.csv b/dev/tests/functional/tests/app/Magento/CatalogRule/Test/TestCase/ApplySeveralCatalogPriceRuleEntityTest/testApplySeveralCatalogPriceRules.csv new file mode 100644 index 0000000000000..02aee3be59146 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/CatalogRule/Test/TestCase/ApplySeveralCatalogPriceRuleEntityTest/testApplySeveralCatalogPriceRules.csv @@ -0,0 +1,3 @@ +"catalogRulesOriginal/priority_0";"catalogRulesOriginal/priority_1";"catalogRulesOriginal/priority_2";"price/sub_total";"price/grand_total";"price/discount_amount";"price/special";"price/regular";"constraint" +"catalog_price_rule_priority_0";"-";"catalog_price_rule_priority_2";"100";"40";"60";"40";"100";"assertCatalogPriceRuleAppliedCatalogPage, assertCatalogPriceRuleAppliedProductPage, assertCatalogPriceRuleAppliedShoppingCart" +"catalog_price_rule_priority_0";"catalog_price_rule_priority_1_stop_further_rules";"catalog_price_rule_priority_2";"100";"45";"55";"45";"100";"assertCatalogPriceRuleAppliedCatalogPage, assertCatalogPriceRuleAppliedProductPage, assertCatalogPriceRuleAppliedShoppingCart" \ No newline at end of file diff --git a/dev/tests/functional/tests/app/Magento/CatalogRule/Test/TestCase/CreateCatalogPriceRuleEntityTest.php b/dev/tests/functional/tests/app/Magento/CatalogRule/Test/TestCase/CreateCatalogPriceRuleEntityTest.php new file mode 100644 index 0000000000000..05a84316445c1 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/CatalogRule/Test/TestCase/CreateCatalogPriceRuleEntityTest.php @@ -0,0 +1,43 @@ + Catalog Price Rules + * 3. Press "+" button to start create new catalog price rule + * 4. Fill in all data according to data set + * 5. Save rule + * 6. Perform appropriate assertions + * + * @group Catalog_Price_Rules_(MX) + * @ZephyrId MAGETWO-24341 + */ +class CreateCatalogPriceRuleEntityTest extends AbstractCatalogRuleEntityTest +{ + /** + * Create Catalog Price Rule + * + * @param CatalogRule $catalogPriceRule + * @return void + */ + public function testCreateCatalogPriceRule(CatalogRule $catalogPriceRule) + { + // Steps + $this->catalogRuleIndex->open(); + $this->catalogRuleIndex->getGridPageActions()->addNew(); + $this->catalogRuleNew->getEditForm()->fill($catalogPriceRule); + $this->catalogRuleNew->getFormPageActions()->save(); + + // Prepare data for tear down + $this->catalogRules[] = $catalogPriceRule; + } +} diff --git a/dev/tests/functional/tests/app/Magento/CatalogRule/Test/TestCase/CreateCatalogPriceRuleEntityTest/testCreateCatalogPriceRule.csv b/dev/tests/functional/tests/app/Magento/CatalogRule/Test/TestCase/CreateCatalogPriceRuleEntityTest/testCreateCatalogPriceRule.csv new file mode 100755 index 0000000000000..0fb2a92b19cd0 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/CatalogRule/Test/TestCase/CreateCatalogPriceRuleEntityTest/testCreateCatalogPriceRule.csv @@ -0,0 +1,3 @@ +"catalogPriceRule/data/name";"catalogPriceRule/data/description";"catalogPriceRule/data/is_active";"catalogPriceRule/data/website_ids/option_0";"catalogPriceRule/data/customer_group_ids/option_0";"catalogPriceRule/data/condition";"catalogPriceRule/data/simple_action";"catalogPriceRule/data/discount_amount";"constraint" +"CatalogPriceRule %isolation%";"Catalog Price Rule Description";"Active";"Main Website";"Wholesale";"-";"By Percentage of the Original Price";50;"assertCatalogPriceRuleSuccessSaveMessage, assertCatalogPriceRuleNoticeMessage, assertCatalogPriceRuleForm, assertCatalogPriceRuleInGrid" +"CatalogPriceRule %isolation%";"Catalog Price Rule Description";"Inactive";"Main Website";"General";"-";"By Fixed Amount";10;"assertCatalogPriceRuleSuccessSaveMessage, assertCatalogPriceRuleNoticeMessage, assertCatalogPriceRuleForm, assertCatalogPriceRuleInGrid" \ No newline at end of file diff --git a/dev/tests/functional/tests/app/Magento/CatalogRule/Test/TestCase/CreateCatalogRuleTest.php b/dev/tests/functional/tests/app/Magento/CatalogRule/Test/TestCase/CreateCatalogRuleTest.php new file mode 100644 index 0000000000000..c769ca3898c57 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/CatalogRule/Test/TestCase/CreateCatalogRuleTest.php @@ -0,0 +1,73 @@ + Catalog Price Rules + * 3. Press "+" button to start create new catalog price rule + * 4. Fill in all data according to data set + * 5. Save rule + * 6. Apply newly created catalog rule + * 7. Create simple product + * 8. Clear cache + * 9. Perform all assertions + * + * @ticketId MAGETWO-23036 + */ +class CreateCatalogRuleTest extends AbstractCatalogRuleEntityTest +{ + /** + * Create Catalog Price Rule + * + * @param CatalogRule $catalogPriceRule + * @return array + */ + public function testCreate(CatalogRule $catalogPriceRule) + { + $productSimple = $this->fixtureFactory->createByCode('catalogProductSimple', ['dataSet' => 'MAGETWO-23036']); + // Prepare data + $replace = [ + 'conditions' => [ + 'conditions' => [ + '%category_1%' => $productSimple->getDataFieldConfig('category_ids')['source']->getIds()[0], + ], + ], + ]; + + // Open Catalog Price Rule page + $this->catalogRuleIndex->open(); + + // Add new Catalog Price Rule + $this->catalogRuleIndex->getGridPageActions()->addNew(); + + // Fill and Save the Form + $this->catalogRuleNew->getEditForm()->fill($catalogPriceRule, null, $replace); + $this->catalogRuleNew->getFormPageActions()->save(); + + // Apply Catalog Price Rule + $this->catalogRuleIndex->getGridPageActions()->applyRules(); + + // Create simple product + $productSimple->persist(); + + // Flush cache + $this->adminCache->open(); + $this->adminCache->getActionsBlock()->flushMagentoCache(); + $this->adminCache->getMessagesBlock()->waitSuccessMessage(); + + // Prepare data for tear down + $this->catalogRules[] = $catalogPriceRule; + + return ['product' => $productSimple]; + } +} diff --git a/dev/tests/functional/tests/app/Magento/CatalogRule/Test/TestCase/CreateCatalogRuleTest/testCreate.csv b/dev/tests/functional/tests/app/Magento/CatalogRule/Test/TestCase/CreateCatalogRuleTest/testCreate.csv new file mode 100755 index 0000000000000..c8e0bc5c62899 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/CatalogRule/Test/TestCase/CreateCatalogRuleTest/testCreate.csv @@ -0,0 +1,2 @@ +"catalogPriceRule/data/name"; "catalogPriceRule/data/is_active"; "catalogPriceRule/data/website_ids"; "catalogPriceRule/data/customer_group_ids"; "catalogPriceRule/data/conditions"; "catalogPriceRule/data/simple_action"; "catalogPriceRule/data/discount_amount";"price/sub_total";"price/grand_total";"price/discount_amount";"price/special";"price/regular";"constraint" +"rule_name%isolation%";"Active";"Main Website";"NOT LOGGED IN";"[Category|is|%category_1%]";"To Percentage of the Original Price"; "90";"100";"90";"10";"90";"100";"assertCatalogPriceRuleInGrid, assertCatalogPriceRuleAppliedCatalogPage, assertCatalogPriceRuleAppliedProductPage, assertCatalogPriceRuleAppliedShoppingCart" \ No newline at end of file diff --git a/dev/tests/functional/tests/app/Magento/CatalogRule/Test/TestCase/DeleteCatalogPriceRuleEntityTest.php b/dev/tests/functional/tests/app/Magento/CatalogRule/Test/TestCase/DeleteCatalogPriceRuleEntityTest.php new file mode 100644 index 0000000000000..fc83b0391d28c --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/CatalogRule/Test/TestCase/DeleteCatalogPriceRuleEntityTest.php @@ -0,0 +1,80 @@ + Catalog Price Rules + * 3. Select required catalog price rule from preconditions + * 4. Click on the "Delete" button + * 5. Perform all assertions + * + * @group Catalog_Price_Rules_(MX) + * @ZephyrId MAGETWO-25211 + */ +class DeleteCatalogPriceRuleEntityTest extends Injectable +{ + /** + * Page CatalogRuleIndex + * + * @var CatalogRuleIndex + */ + protected $catalogRuleIndex; + + /** + * Page CatalogRuleNew + * + * @var CatalogRuleNew + */ + protected $catalogRuleNew; + + /** + * Injection data + * + * @param CatalogRuleIndex $catalogRuleIndex + * @param CatalogRuleNew $catalogRuleNew + * @return void + */ + public function __inject( + CatalogRuleIndex $catalogRuleIndex, + CatalogRuleNew $catalogRuleNew + ) { + $this->catalogRuleIndex = $catalogRuleIndex; + $this->catalogRuleNew = $catalogRuleNew; + } + + /** + * Delete Catalog Price Rule test + * + * @param CatalogRule $catalogPriceRule + * @return void + */ + public function testDeleteCatalogPriceRule(CatalogRule $catalogPriceRule) + { + // Precondition + $catalogPriceRule->persist(); + + $filter = [ + 'name' => $catalogPriceRule->getName(), + 'rule_id' => $catalogPriceRule->getId(), + ]; + // Steps + $this->catalogRuleIndex->open(); + $this->catalogRuleIndex->getCatalogRuleGrid()->searchAndOpen($filter); + $this->catalogRuleNew->getFormPageActions()->delete(); + } +} diff --git a/dev/tests/functional/tests/app/Magento/CatalogRule/Test/TestCase/DeleteCatalogPriceRuleEntityTest/testDeleteCatalogPriceRule.csv b/dev/tests/functional/tests/app/Magento/CatalogRule/Test/TestCase/DeleteCatalogPriceRuleEntityTest/testDeleteCatalogPriceRule.csv new file mode 100644 index 0000000000000..91935a4dd35a7 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/CatalogRule/Test/TestCase/DeleteCatalogPriceRuleEntityTest/testDeleteCatalogPriceRule.csv @@ -0,0 +1,2 @@ +"catalogPriceRule/dataSet";"constraint" +"active_catalog_price_rule_with_conditions";"assertCatalogPriceRuleSuccessDeleteMessage, assertCatalogPriceRuleNotInGrid" \ No newline at end of file diff --git a/dev/tests/functional/tests/app/Magento/CatalogRule/Test/TestCase/UpdateCatalogPriceRuleEntityTest.php b/dev/tests/functional/tests/app/Magento/CatalogRule/Test/TestCase/UpdateCatalogPriceRuleEntityTest.php new file mode 100755 index 0000000000000..6afbd8c06eac3 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/CatalogRule/Test/TestCase/UpdateCatalogPriceRuleEntityTest.php @@ -0,0 +1,85 @@ + Catalog Price Rules + * 3. Click Catalog Price Rule from grid + * 4. Edit test value(s) according to dataSet + * 5. Click 'Save'/ 'Apply' button + * 6. Create simple product with category + * 7. Perform all asserts + * + * @group Catalog_Price_Rules_(MX) + * @ZephyrId MAGETWO-25187 + */ +class UpdateCatalogPriceRuleEntityTest extends AbstractCatalogRuleEntityTest +{ + /** + * Update catalog price rule + * + * @param CatalogRule $catalogPriceRule + * @param CatalogRule $catalogPriceRuleOriginal + * @param string $saveAction + * @return array + */ + public function testUpdateCatalogPriceRule( + CatalogRule $catalogPriceRule, + CatalogRule $catalogPriceRuleOriginal, + $saveAction + ) { + // Preconditions + $catalogPriceRuleOriginal->persist(); + + //Prepare data + $productSimple = $this->fixtureFactory->createByCode( + 'catalogProductSimple', + ['dataSet' => 'product_with_category'] + ); + if ($saveAction == 'saveAndApply') { + /** @var CategoryIds $sourceCategories */ + $sourceCategories = $productSimple->getDataFieldConfig('category_ids')['source']; + $replace = [ + 'conditions' => [ + 'conditions' => [ + '%category_1%' => $sourceCategories->getIds()[0], + ], + ], + ]; + } else { + $replace = []; + } + $filter = [ + 'name' => $catalogPriceRuleOriginal->getName(), + 'rule_id' => $catalogPriceRuleOriginal->getId(), + ]; + + // Steps + $this->catalogRuleIndex->open(); + $this->catalogRuleIndex->getCatalogRuleGrid()->searchAndOpen($filter); + $this->catalogRuleNew->getEditForm()->fill($catalogPriceRule, null, $replace); + $this->catalogRuleNew->getFormPageActions()->$saveAction(); + + // Create simple product with category + $productSimple->persist(); + + // Prepare data for tear down + $this->catalogRules[] = $catalogPriceRule; + + return ['product' => $productSimple]; + } +} diff --git a/dev/tests/functional/tests/app/Magento/CatalogRule/Test/TestCase/UpdateCatalogPriceRuleEntityTest/testUpdateCatalogPriceRule.csv b/dev/tests/functional/tests/app/Magento/CatalogRule/Test/TestCase/UpdateCatalogPriceRuleEntityTest/testUpdateCatalogPriceRule.csv new file mode 100755 index 0000000000000..b41e19a94f4d6 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/CatalogRule/Test/TestCase/UpdateCatalogPriceRuleEntityTest/testUpdateCatalogPriceRule.csv @@ -0,0 +1,3 @@ +"catalogPriceRuleOriginal/dataSet";"catalogPriceRule/data/name";"catalogPriceRule/data/description";"catalogPriceRule/data/is_active";"catalogPriceRule/data/conditions";"catalogPriceRule/data/simple_action";"catalogPriceRule/data/discount_amount";"saveAction";"price/sub_total";"price/grand_total";"price/discount_amount";"price/special";"price/regular";"constraint" +"active_catalog_price_rule_with_conditions";"New Catalog Price Rule Name %isolation%";"-";"Inactive";"-";"-";"-";"save";"-";"-";"-";"-";"-";"assertCatalogPriceRuleSuccessSaveMessage, assertCatalogPriceRuleNoticeMessage, assertCatalogPriceRuleForm, assertCatalogPriceRuleInGrid" +"active_catalog_price_rule_with_conditions";"New Catalog Price Rule Name %isolation%";"New Catalog Price Rule Description %isolation%";"Active";"[Category|is|%category_1%]";"By Fixed Amount";"35";"saveAndApply";"100";"65";"35";"65";"100";"assertCatalogPriceRuleSuccessSaveMessage, assertCatalogPriceRuleAppliedProductPage, assertCatalogPriceRuleForm, assertCatalogPriceRuleInGrid" \ No newline at end of file diff --git a/dev/tests/functional/tests/app/Magento/CatalogRule/Test/TestStep/DeleteAllCatalogRulesStep.php b/dev/tests/functional/tests/app/Magento/CatalogRule/Test/TestStep/DeleteAllCatalogRulesStep.php new file mode 100644 index 0000000000000..cacdb3ef57b93 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/CatalogRule/Test/TestStep/DeleteAllCatalogRulesStep.php @@ -0,0 +1,58 @@ +catalogRuleIndex = $catalogRuleIndex; + $this->catalogRuleNew = $catalogRuleNew; + } + + /** + * Delete Catalog Rule on backend + * + * @return array + */ + public function run() + { + $this->catalogRuleIndex->open(); + while ($this->catalogRuleIndex->getCatalogRuleGrid()->isFirstRowVisible()) { + $this->catalogRuleIndex->getCatalogRuleGrid()->openFirstRow(); + $this->catalogRuleNew->getFormPageActions()->delete(); + } + } +} diff --git a/dev/tests/functional/tests/app/Magento/CatalogRule/Test/etc/constraint.xml b/dev/tests/functional/tests/app/Magento/CatalogRule/Test/etc/constraint.xml new file mode 100644 index 0000000000000..31c1075a6f574 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/CatalogRule/Test/etc/constraint.xml @@ -0,0 +1,75 @@ + + + + + low + + + + + + low + + + + + + + + low + + + + + + + low + + + + + + high + + + + + + + + + low + + + + + + low + + + + + + + high + + + + + + + + high + + + + + + + + + diff --git a/dev/tests/functional/tests/app/Magento/CatalogRule/Test/etc/curl/di.xml b/dev/tests/functional/tests/app/Magento/CatalogRule/Test/etc/curl/di.xml new file mode 100644 index 0000000000000..9cb2058417bd8 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/CatalogRule/Test/etc/curl/di.xml @@ -0,0 +1,9 @@ + + + + + diff --git a/dev/tests/functional/tests/app/Magento/CatalogRule/Test/etc/fixture.xml b/dev/tests/functional/tests/app/Magento/CatalogRule/Test/etc/fixture.xml new file mode 100644 index 0000000000000..cc5cddf87c9d6 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/CatalogRule/Test/etc/fixture.xml @@ -0,0 +1,26 @@ + + + + + flat + catalogrule + Magento\CatalogRule\Model\Resource\Rule\Product\Price\Collection + + + + + category + virtual + 0 + conditions + Magento\CatalogRule\Test\Fixture\Product\Category + + + + + + diff --git a/dev/tests/functional/tests/app/Magento/CatalogRule/Test/etc/page.xml b/dev/tests/functional/tests/app/Magento/CatalogRule/Test/etc/page.xml new file mode 100644 index 0000000000000..ae8d782969ed8 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/CatalogRule/Test/etc/page.xml @@ -0,0 +1,18 @@ + + + + + catalog_rule/promo_catalog/new + adminhtml + Magento\CatalogRule\Test\Page\Adminhtml\CatalogRuleNew + + + catalog_rule/promo_catalog/index + adminhtml + Magento\CatalogRule\Test\Page\Adminhtml\CatalogRuleIndex + + diff --git a/dev/tests/functional/tests/app/Magento/CatalogRule/Test/etc/ui/di.xml b/dev/tests/functional/tests/app/Magento/CatalogRule/Test/etc/ui/di.xml new file mode 100644 index 0000000000000..ff4d4b655d448 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/CatalogRule/Test/etc/ui/di.xml @@ -0,0 +1,9 @@ + + + + + diff --git a/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Constraint/AssertAdvancedSearchProductsResult.php b/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Constraint/AssertAdvancedSearchProductsResult.php index fb988a54c9e0c..e7ecea285adf6 100644 --- a/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Constraint/AssertAdvancedSearchProductsResult.php +++ b/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Constraint/AssertAdvancedSearchProductsResult.php @@ -14,6 +14,10 @@ */ class AssertAdvancedSearchProductsResult extends AbstractConstraint { + /* tags */ + const SEVERITY = 'high'; + /* end tags */ + /** * Text for notice messages */ @@ -24,13 +28,6 @@ class AssertAdvancedSearchProductsResult extends AbstractConstraint */ const ERROR_MESSAGE = 'No items were found using the following search criteria.'; - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'high'; - /** * Search results page * diff --git a/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Constraint/AssertCatalogSearchResult.php b/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Constraint/AssertCatalogSearchResult.php index 22f7d602b5771..03035ce728f13 100644 --- a/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Constraint/AssertCatalogSearchResult.php +++ b/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Constraint/AssertCatalogSearchResult.php @@ -13,12 +13,9 @@ */ class AssertCatalogSearchResult extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'high'; + /* tags */ + const SEVERITY = 'high'; + /* end tags */ /** * Assert that result page contains all products, according to search request, from fixture diff --git a/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Constraint/AssertSearchSynonymMassActionNotOnFrontend.php b/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Constraint/AssertSearchSynonymMassActionNotOnFrontend.php index 901a10844f7ae..1078c8628cc8a 100644 --- a/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Constraint/AssertSearchSynonymMassActionNotOnFrontend.php +++ b/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Constraint/AssertSearchSynonymMassActionNotOnFrontend.php @@ -15,12 +15,9 @@ */ class AssertSearchSynonymMassActionNotOnFrontend extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'high'; + /* tags */ + const SEVERITY = 'high'; + /* end tags */ /** * Assert that you will be not redirected to url from dataset after mass delete search term diff --git a/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Constraint/AssertSearchSynonymNotOnFrontend.php b/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Constraint/AssertSearchSynonymNotOnFrontend.php index 82e9e2fe2752e..66a345529c253 100644 --- a/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Constraint/AssertSearchSynonymNotOnFrontend.php +++ b/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Constraint/AssertSearchSynonymNotOnFrontend.php @@ -16,12 +16,9 @@ */ class AssertSearchSynonymNotOnFrontend extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'high'; + /* tags */ + const SEVERITY = 'high'; + /* end tags */ /** * Assert that you will be not redirected to url from dataset diff --git a/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Constraint/AssertSearchTermForm.php b/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Constraint/AssertSearchTermForm.php index da7bdbfb93162..132885d14d23f 100644 --- a/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Constraint/AssertSearchTermForm.php +++ b/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Constraint/AssertSearchTermForm.php @@ -16,12 +16,9 @@ */ class AssertSearchTermForm extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'high'; + /* tags */ + const SEVERITY = 'high'; + /* end tags */ /** * Assert that after save a search term on edit term search page displays: diff --git a/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Constraint/AssertSearchTermInGrid.php b/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Constraint/AssertSearchTermInGrid.php index 52d874cf09c50..0be98506864fb 100644 --- a/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Constraint/AssertSearchTermInGrid.php +++ b/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Constraint/AssertSearchTermInGrid.php @@ -15,12 +15,9 @@ */ class AssertSearchTermInGrid extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'high'; + /* tags */ + const SEVERITY = 'high'; + /* end tags */ /** * Assert that after save a term search on edit term search page displays: diff --git a/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Constraint/AssertSearchTermMassActionNotOnFrontend.php b/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Constraint/AssertSearchTermMassActionNotOnFrontend.php index 33bc31bdc9b16..5571ccc2f8fee 100644 --- a/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Constraint/AssertSearchTermMassActionNotOnFrontend.php +++ b/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Constraint/AssertSearchTermMassActionNotOnFrontend.php @@ -16,12 +16,9 @@ */ class AssertSearchTermMassActionNotOnFrontend extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'high'; + /* tags */ + const SEVERITY = 'high'; + /* end tags */ /** * Assert that after mass delete a search term not redirect to url in dataset diff --git a/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Constraint/AssertSearchTermMassActionsNotInGrid.php b/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Constraint/AssertSearchTermMassActionsNotInGrid.php index 654ca3f08b48a..c266bd3e243f0 100644 --- a/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Constraint/AssertSearchTermMassActionsNotInGrid.php +++ b/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Constraint/AssertSearchTermMassActionsNotInGrid.php @@ -15,12 +15,9 @@ */ class AssertSearchTermMassActionsNotInGrid extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'high'; + /* tags */ + const SEVERITY = 'high'; + /* end tags */ /** * Assert that after mass delete search terms on grid page are not displayed diff --git a/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Constraint/AssertSearchTermNotInGrid.php b/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Constraint/AssertSearchTermNotInGrid.php index 41dcdd8d7dc7e..b408d176d2d4c 100644 --- a/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Constraint/AssertSearchTermNotInGrid.php +++ b/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Constraint/AssertSearchTermNotInGrid.php @@ -15,12 +15,9 @@ */ class AssertSearchTermNotInGrid extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'high'; + /* tags */ + const SEVERITY = 'high'; + /* end tags */ /** * Assert that after delete a search term on grid page not displayed diff --git a/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Constraint/AssertSearchTermNotOnFrontend.php b/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Constraint/AssertSearchTermNotOnFrontend.php index 0e7271aa1b46d..581cd1488e9f3 100644 --- a/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Constraint/AssertSearchTermNotOnFrontend.php +++ b/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Constraint/AssertSearchTermNotOnFrontend.php @@ -16,12 +16,9 @@ */ class AssertSearchTermNotOnFrontend extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'high'; + /* tags */ + const SEVERITY = 'high'; + /* end tags */ /** * Assert that after delete a search term not redirect to url in dataset diff --git a/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Constraint/AssertSearchTermOnFrontend.php b/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Constraint/AssertSearchTermOnFrontend.php index 8b1e0bf5a1272..49f557382be90 100644 --- a/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Constraint/AssertSearchTermOnFrontend.php +++ b/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Constraint/AssertSearchTermOnFrontend.php @@ -17,12 +17,9 @@ */ class AssertSearchTermOnFrontend extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'high'; + /* tags */ + const SEVERITY = 'high'; + /* end tags */ /** * Search block on CMS index page diff --git a/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Constraint/AssertSearchTermSuccessDeleteMessage.php b/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Constraint/AssertSearchTermSuccessDeleteMessage.php index 063d3ebfd7176..b452330b1448b 100644 --- a/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Constraint/AssertSearchTermSuccessDeleteMessage.php +++ b/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Constraint/AssertSearchTermSuccessDeleteMessage.php @@ -14,18 +14,15 @@ */ class AssertSearchTermSuccessDeleteMessage extends AbstractConstraint { + /* tags */ + const SEVERITY = 'high'; + /* end tags */ + /** * Text value to be checked */ const SUCCESS_DELETE_MESSAGE = 'You deleted the search.'; - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'high'; - /** * Assert that success message is displayed after search term deleted * diff --git a/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Constraint/AssertSearchTermSuccessMassDeleteMessage.php b/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Constraint/AssertSearchTermSuccessMassDeleteMessage.php index 6ebbf7422aaba..56387dee5fd36 100644 --- a/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Constraint/AssertSearchTermSuccessMassDeleteMessage.php +++ b/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Constraint/AssertSearchTermSuccessMassDeleteMessage.php @@ -14,18 +14,15 @@ */ class AssertSearchTermSuccessMassDeleteMessage extends AbstractConstraint { + /* tags */ + const SEVERITY = 'high'; + /* end tags */ + /** * Text value to be checked */ const SUCCESS_MESSAGE = 'Total of %d record(s) were deleted'; - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'high'; - /** * Assert that success message is displayed after search terms were mass deleted * diff --git a/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Constraint/AssertSearchTermSuccessSaveMessage.php b/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Constraint/AssertSearchTermSuccessSaveMessage.php index b4ab1860ac90e..bec2ac3324ebd 100644 --- a/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Constraint/AssertSearchTermSuccessSaveMessage.php +++ b/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Constraint/AssertSearchTermSuccessSaveMessage.php @@ -14,18 +14,15 @@ */ class AssertSearchTermSuccessSaveMessage extends AbstractConstraint { + /* tags */ + const SEVERITY = 'high'; + /* end tags */ + /** * Text value to be checked */ const SUCCESS_MESSAGE = 'You saved the search term.'; - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'high'; - /** * Assert that success message is displayed after search term save * diff --git a/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Constraint/AssertSearchTermSynonymOnFrontend.php b/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Constraint/AssertSearchTermSynonymOnFrontend.php index 8ebd22f29949f..d8684a2ec5855 100644 --- a/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Constraint/AssertSearchTermSynonymOnFrontend.php +++ b/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Constraint/AssertSearchTermSynonymOnFrontend.php @@ -16,12 +16,9 @@ */ class AssertSearchTermSynonymOnFrontend extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'high'; + /* tags */ + const SEVERITY = 'high'; + /* end tags */ /** * Assert that you will be redirected to url from dataset diff --git a/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Constraint/AssertSuggestSearchingResult.php b/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Constraint/AssertSuggestSearchingResult.php index 9e5e3c3f242b0..c0f89989b0be2 100644 --- a/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Constraint/AssertSuggestSearchingResult.php +++ b/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Constraint/AssertSuggestSearchingResult.php @@ -14,12 +14,9 @@ */ class AssertSuggestSearchingResult extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'high'; + /* tags */ + const SEVERITY = 'high'; + /* end tags */ /** * Check that after input some text(e.g. product name) into search field, drop-down window is appeared. diff --git a/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/TestCase/AdvancedSearchEntityTest/test.csv b/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/TestCase/AdvancedSearchEntityTest/test.csv index 25bbad9bcc99f..687344b622bc9 100644 --- a/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/TestCase/AdvancedSearchEntityTest/test.csv +++ b/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/TestCase/AdvancedSearchEntityTest/test.csv @@ -1,13 +1,13 @@ -"products/simple_1";"products/simple_2";"productSearch/data/name";"productSearch/data/sku";"productSearch/data/description";"productSearch/data/short_description";"productSearch/data/price/value/price_from";"productSearch/data/price/value/price_to";"constraint";"issue" -"Yes";"-";"abc_dfj";"abc_dfj";"adc_Full";"abc_short";49;500;"assertAdvancedSearchProductsResult";"" -"Yes";"-";"abc";"-";"-";"-";"-";"-";"assertAdvancedSearchProductsResult";"MAGETWO-30318" -"-";"Yes";"adc_123";"-";"-";"-";"-";"-";"assertAdvancedSearchProductsResult";"" -"Yes";"-";"-";"abc";"-";"-";"-";"-";"assertAdvancedSearchProductsResult";"" -"Yes";"-";"-";"abc_dfj";"-";"-";"-";"-";"assertAdvancedSearchProductsResult";"" -"Yes";"-";"-";"abc";"full";"-";"-";"-";"assertAdvancedSearchProductsResult";"MAGETWO-30318" -"-";"Yes";"-";"-";"dfj_full";"-";"-";"-";"assertAdvancedSearchProductsResult";"" -"Yes";"-";"-";"-";"-";"short";"-";"-";"assertAdvancedSearchProductsResult";"MAGETWO-30318" -"-";"-";"-";"-";"-";"dfj_short";"-";"-";"assertAdvancedSearchProductsResult";"" -"Yes";"-";"-";"-";"-";"-";50;50;"assertAdvancedSearchProductsResult";"MAGETWO-30318" -"Yes";"Yes";"-";"-";"-";"-";"-";100;"assertAdvancedSearchProductsResult";"MAGETWO-30318" -"Yes";"-";"abc_dfj";"abc_dfj";"adc_Full";"abc_short";49;50;"assertAdvancedSearchProductsResult";"MAGETWO-30318" +"products/simple_1";"products/simple_2";"productSearch/data/name";"productSearch/data/sku";"productSearch/data/description";"productSearch/data/short_description";"productSearch/data/price/value/price_from";"productSearch/data/price/value/price_to";"constraint" +"Yes";"-";"abc_dfj";"abc_dfj";"adc_Full";"abc_short";49;500;"assertAdvancedSearchProductsResult" +"Yes";"-";"abc";"-";"-";"-";"-";"-";"assertAdvancedSearchProductsResult" +"-";"Yes";"adc_123";"-";"-";"-";"-";"-";"assertAdvancedSearchProductsResult" +"Yes";"-";"-";"abc";"-";"-";"-";"-";"assertAdvancedSearchProductsResult" +"Yes";"-";"-";"abc_dfj";"-";"-";"-";"-";"assertAdvancedSearchProductsResult" +"Yes";"-";"-";"abc";"adc_full";"-";"-";"-";"assertAdvancedSearchProductsResult" +"-";"Yes";"-";"-";"dfj_full";"-";"-";"-";"assertAdvancedSearchProductsResult" +"Yes";"-";"-";"-";"-";"abc_short";"-";"-";"assertAdvancedSearchProductsResult" +"-";"-";"-";"-";"-";"dfj_short";"-";"-";"assertAdvancedSearchProductsResult" +"Yes";"-";"-";"-";"-";"-";50;50;"assertAdvancedSearchProductsResult" +"Yes";"Yes";"-";"-";"-";"-";"-";100;"assertAdvancedSearchProductsResult" +"Yes";"-";"abc_dfj";"abc_dfj";"adc_Full";"abc_short";49;50;"assertAdvancedSearchProductsResult" diff --git a/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/etc/constraint.xml b/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/etc/constraint.xml index b5d5a966c43bf..5cb45afd90ea7 100644 --- a/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/etc/constraint.xml +++ b/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/etc/constraint.xml @@ -6,21 +6,21 @@ --> - high + high - high + high - high + high @@ -28,7 +28,7 @@ - high + high @@ -36,14 +36,14 @@ - high + high - high + high @@ -51,13 +51,13 @@ - high + high - high + high @@ -65,20 +65,20 @@ - high + high - high + high - high + high @@ -86,7 +86,7 @@ - high + high @@ -94,26 +94,26 @@ - high + high - high + high - high + high - high + high diff --git a/dev/tests/functional/tests/app/Magento/Checkout/Test/Block/Cart/CartItem.php b/dev/tests/functional/tests/app/Magento/Checkout/Test/Block/Cart/CartItem.php index 326152515a195..c16fd46bb9660 100755 --- a/dev/tests/functional/tests/app/Magento/Checkout/Test/Block/Cart/CartItem.php +++ b/dev/tests/functional/tests/app/Magento/Checkout/Test/Block/Cart/CartItem.php @@ -39,7 +39,7 @@ class CartItem extends AbstractCartItem * * @var string */ - protected $wishlistButton = '.actions .towishlist'; + protected $wishlistButton = '.towishlist'; /** * Quantity input selector diff --git a/dev/tests/functional/tests/app/Magento/Checkout/Test/Block/Cart/Totals.php b/dev/tests/functional/tests/app/Magento/Checkout/Test/Block/Cart/Totals.php index a08c1320d5687..a9db2d568234b 100644 --- a/dev/tests/functional/tests/app/Magento/Checkout/Test/Block/Cart/Totals.php +++ b/dev/tests/functional/tests/app/Magento/Checkout/Test/Block/Cart/Totals.php @@ -75,7 +75,7 @@ class Totals extends Block * * @var string */ - protected $discount = '//tr[normalize-space(td)="Discount"]//span'; + protected $discount = '//tr[normalize-space(th)="Discount"]//span'; /** * Get shipping price including tax selector diff --git a/dev/tests/functional/tests/app/Magento/Checkout/Test/Block/Onepage/Link.php b/dev/tests/functional/tests/app/Magento/Checkout/Test/Block/Onepage/Link.php new file mode 100644 index 0000000000000..803935d884390 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Checkout/Test/Block/Onepage/Link.php @@ -0,0 +1,26 @@ +_rootElement->click(); + } +} diff --git a/dev/tests/functional/tests/app/Magento/Checkout/Test/Constraint/AssertAddedProductToCartSuccessMessage.php b/dev/tests/functional/tests/app/Magento/Checkout/Test/Constraint/AssertAddedProductToCartSuccessMessage.php index 37f9240b5ea13..7e3bf2a25091e 100644 --- a/dev/tests/functional/tests/app/Magento/Checkout/Test/Constraint/AssertAddedProductToCartSuccessMessage.php +++ b/dev/tests/functional/tests/app/Magento/Checkout/Test/Constraint/AssertAddedProductToCartSuccessMessage.php @@ -15,18 +15,15 @@ */ class AssertAddedProductToCartSuccessMessage extends AbstractConstraint { + /* tags */ + const SEVERITY = 'low'; + /* end tags */ + /** * Success add to cart message */ const SUCCESS_MESSAGE = 'You added %s to your shopping cart.'; - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; - /** * Assert success message is appeared on Shopping Cart page * diff --git a/dev/tests/functional/tests/app/Magento/Checkout/Test/Constraint/AssertCartIsEmpty.php b/dev/tests/functional/tests/app/Magento/Checkout/Test/Constraint/AssertCartIsEmpty.php index b8a2b0b6ded93..c3bf38ed68bc8 100644 --- a/dev/tests/functional/tests/app/Magento/Checkout/Test/Constraint/AssertCartIsEmpty.php +++ b/dev/tests/functional/tests/app/Magento/Checkout/Test/Constraint/AssertCartIsEmpty.php @@ -16,18 +16,15 @@ */ class AssertCartIsEmpty extends AbstractConstraint { + /* tags */ + const SEVERITY = 'middle'; + /* end tags */ + /** * Text of empty cart. */ const TEXT_EMPTY_CART = 'You have no items in your shopping cart. Click here to continue shopping.'; - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'middle'; - /** * Check that Shopping Cart is empty, opened page contains text "You have no items in your shopping cart. * Click here to continue shopping." where 'here' is link that leads to index page diff --git a/dev/tests/functional/tests/app/Magento/Checkout/Test/Constraint/AssertCartItemsOptions.php b/dev/tests/functional/tests/app/Magento/Checkout/Test/Constraint/AssertCartItemsOptions.php index 9d322ee6cccc6..012b8c93d959a 100644 --- a/dev/tests/functional/tests/app/Magento/Checkout/Test/Constraint/AssertCartItemsOptions.php +++ b/dev/tests/functional/tests/app/Magento/Checkout/Test/Constraint/AssertCartItemsOptions.php @@ -20,12 +20,9 @@ */ class AssertCartItemsOptions extends AbstractAssertForm { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Error message for verify options diff --git a/dev/tests/functional/tests/app/Magento/Checkout/Test/Constraint/AssertGrandTotalInShoppingCart.php b/dev/tests/functional/tests/app/Magento/Checkout/Test/Constraint/AssertGrandTotalInShoppingCart.php index 4f72a39ecc97a..2ebf1fdf8739d 100644 --- a/dev/tests/functional/tests/app/Magento/Checkout/Test/Constraint/AssertGrandTotalInShoppingCart.php +++ b/dev/tests/functional/tests/app/Magento/Checkout/Test/Constraint/AssertGrandTotalInShoppingCart.php @@ -15,12 +15,9 @@ */ class AssertGrandTotalInShoppingCart extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that grand total is equal to expected diff --git a/dev/tests/functional/tests/app/Magento/Checkout/Test/Constraint/AssertOrderSuccessPlacedMessage.php b/dev/tests/functional/tests/app/Magento/Checkout/Test/Constraint/AssertOrderSuccessPlacedMessage.php index ec9d5fc410723..366a932b7d4f9 100644 --- a/dev/tests/functional/tests/app/Magento/Checkout/Test/Constraint/AssertOrderSuccessPlacedMessage.php +++ b/dev/tests/functional/tests/app/Magento/Checkout/Test/Constraint/AssertOrderSuccessPlacedMessage.php @@ -14,18 +14,15 @@ */ class AssertOrderSuccessPlacedMessage extends AbstractConstraint { + /* tags */ + const SEVERITY = 'high'; + /* end tags */ + /** * Message of success checkout */ const SUCCESS_MESSAGE = 'Thank you for your purchase!'; - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'high'; - /** * Assert that success message is correct * diff --git a/dev/tests/functional/tests/app/Magento/Checkout/Test/Constraint/AssertOrderTotalOnReviewPage.php b/dev/tests/functional/tests/app/Magento/Checkout/Test/Constraint/AssertOrderTotalOnReviewPage.php index 05b0a19ab813b..3a6519e8a0149 100644 --- a/dev/tests/functional/tests/app/Magento/Checkout/Test/Constraint/AssertOrderTotalOnReviewPage.php +++ b/dev/tests/functional/tests/app/Magento/Checkout/Test/Constraint/AssertOrderTotalOnReviewPage.php @@ -14,12 +14,9 @@ */ class AssertOrderTotalOnReviewPage extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'high'; + /* tags */ + const SEVERITY = 'high'; + /* end tags */ /** * Assert that Order Grand Total is correct on checkoutOnePage diff --git a/dev/tests/functional/tests/app/Magento/Checkout/Test/Constraint/AssertPriceInShoppingCart.php b/dev/tests/functional/tests/app/Magento/Checkout/Test/Constraint/AssertPriceInShoppingCart.php index e847d4a94941f..d78462b09b197 100755 --- a/dev/tests/functional/tests/app/Magento/Checkout/Test/Constraint/AssertPriceInShoppingCart.php +++ b/dev/tests/functional/tests/app/Magento/Checkout/Test/Constraint/AssertPriceInShoppingCart.php @@ -18,12 +18,9 @@ */ class AssertPriceInShoppingCart extends AbstractAssertForm { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that price in the shopping cart equals to expected price from data set diff --git a/dev/tests/functional/tests/app/Magento/Checkout/Test/Constraint/AssertProductAbsentInMiniShoppingCart.php b/dev/tests/functional/tests/app/Magento/Checkout/Test/Constraint/AssertProductAbsentInMiniShoppingCart.php index 8f6e5bab5f11b..2330375ed3d61 100644 --- a/dev/tests/functional/tests/app/Magento/Checkout/Test/Constraint/AssertProductAbsentInMiniShoppingCart.php +++ b/dev/tests/functional/tests/app/Magento/Checkout/Test/Constraint/AssertProductAbsentInMiniShoppingCart.php @@ -15,12 +15,9 @@ */ class AssertProductAbsentInMiniShoppingCart extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert product is absent on mini shopping cart diff --git a/dev/tests/functional/tests/app/Magento/Checkout/Test/Constraint/AssertProductIsNotEditable.php b/dev/tests/functional/tests/app/Magento/Checkout/Test/Constraint/AssertProductIsNotEditable.php index 831e30d772b1b..b3d5a8e839135 100644 --- a/dev/tests/functional/tests/app/Magento/Checkout/Test/Constraint/AssertProductIsNotEditable.php +++ b/dev/tests/functional/tests/app/Magento/Checkout/Test/Constraint/AssertProductIsNotEditable.php @@ -14,12 +14,9 @@ */ class AssertProductIsNotEditable extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that after adding products by sku to shopping cart products are not editable diff --git a/dev/tests/functional/tests/app/Magento/Checkout/Test/Constraint/AssertProductPresentInMiniShoppingCart.php b/dev/tests/functional/tests/app/Magento/Checkout/Test/Constraint/AssertProductPresentInMiniShoppingCart.php index 666bd03faef90..3406dcd5a13e1 100644 --- a/dev/tests/functional/tests/app/Magento/Checkout/Test/Constraint/AssertProductPresentInMiniShoppingCart.php +++ b/dev/tests/functional/tests/app/Magento/Checkout/Test/Constraint/AssertProductPresentInMiniShoppingCart.php @@ -14,12 +14,9 @@ */ class AssertProductPresentInMiniShoppingCart extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert product is present on mini shopping cart diff --git a/dev/tests/functional/tests/app/Magento/Checkout/Test/Constraint/AssertProductPresentInShoppingCart.php b/dev/tests/functional/tests/app/Magento/Checkout/Test/Constraint/AssertProductPresentInShoppingCart.php index 8972eb988c19f..e6462f1d6bd3e 100644 --- a/dev/tests/functional/tests/app/Magento/Checkout/Test/Constraint/AssertProductPresentInShoppingCart.php +++ b/dev/tests/functional/tests/app/Magento/Checkout/Test/Constraint/AssertProductPresentInShoppingCart.php @@ -14,12 +14,9 @@ */ class AssertProductPresentInShoppingCart extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that products are present in shopping cart diff --git a/dev/tests/functional/tests/app/Magento/Checkout/Test/Constraint/AssertProductQtyInMiniShoppingCart.php b/dev/tests/functional/tests/app/Magento/Checkout/Test/Constraint/AssertProductQtyInMiniShoppingCart.php index 15afe1b503173..40965b58dba31 100644 --- a/dev/tests/functional/tests/app/Magento/Checkout/Test/Constraint/AssertProductQtyInMiniShoppingCart.php +++ b/dev/tests/functional/tests/app/Magento/Checkout/Test/Constraint/AssertProductQtyInMiniShoppingCart.php @@ -18,12 +18,9 @@ */ class AssertProductQtyInMiniShoppingCart extends AbstractAssertForm { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that product quantity in the mini shopping cart is equals to expected quantity from data set diff --git a/dev/tests/functional/tests/app/Magento/Checkout/Test/Constraint/AssertProductQtyInShoppingCart.php b/dev/tests/functional/tests/app/Magento/Checkout/Test/Constraint/AssertProductQtyInShoppingCart.php index eafcb8e8254c9..9eb776fbe0441 100755 --- a/dev/tests/functional/tests/app/Magento/Checkout/Test/Constraint/AssertProductQtyInShoppingCart.php +++ b/dev/tests/functional/tests/app/Magento/Checkout/Test/Constraint/AssertProductQtyInShoppingCart.php @@ -18,12 +18,9 @@ */ class AssertProductQtyInShoppingCart extends AbstractAssertForm { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that quantity in the shopping cart is equals to expected quantity from data set diff --git a/dev/tests/functional/tests/app/Magento/Checkout/Test/Constraint/AssertProductsAbsentInShoppingCart.php b/dev/tests/functional/tests/app/Magento/Checkout/Test/Constraint/AssertProductsAbsentInShoppingCart.php index d6afd6ead57d4..afdc84c3e1175 100644 --- a/dev/tests/functional/tests/app/Magento/Checkout/Test/Constraint/AssertProductsAbsentInShoppingCart.php +++ b/dev/tests/functional/tests/app/Magento/Checkout/Test/Constraint/AssertProductsAbsentInShoppingCart.php @@ -13,12 +13,9 @@ */ class AssertProductsAbsentInShoppingCart extends AbstractConstraint { - /** - * Constraint severeness. - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that products are absent in shopping cart. diff --git a/dev/tests/functional/tests/app/Magento/Checkout/Test/Constraint/AssertSubtotalInShoppingCart.php b/dev/tests/functional/tests/app/Magento/Checkout/Test/Constraint/AssertSubtotalInShoppingCart.php index b1737d081ff4e..714c892ebb992 100755 --- a/dev/tests/functional/tests/app/Magento/Checkout/Test/Constraint/AssertSubtotalInShoppingCart.php +++ b/dev/tests/functional/tests/app/Magento/Checkout/Test/Constraint/AssertSubtotalInShoppingCart.php @@ -18,12 +18,9 @@ */ class AssertSubtotalInShoppingCart extends AbstractAssertForm { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that subtotal total in the shopping cart is equals to expected total from data set diff --git a/dev/tests/functional/tests/app/Magento/Checkout/Test/Fixture/Cart.php b/dev/tests/functional/tests/app/Magento/Checkout/Test/Fixture/Cart.php new file mode 100644 index 0000000000000..ddbb77ac1b28b --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Checkout/Test/Fixture/Cart.php @@ -0,0 +1,716 @@ + 'entity_id', + 'backend_type' => 'int', + 'is_required' => '1', + 'default_value' => '', + 'input' => '', + ]; + + protected $store_id = [ + 'attribute_code' => 'store_id', + 'backend_type' => 'smallint', + 'is_required' => '', + 'default_value' => '0', + 'input' => '', + ]; + + protected $created_at = [ + 'attribute_code' => 'created_at', + 'backend_type' => 'timestamp', + 'is_required' => '', + 'default_value' => 'CURRENT_TIMESTAMP', + 'input' => '', + ]; + + protected $updated_at = [ + 'attribute_code' => 'updated_at', + 'backend_type' => 'timestamp', + 'is_required' => '', + 'default_value' => '0000-00-00 00:00:00', + 'input' => '', + ]; + + protected $converted_at = [ + 'attribute_code' => 'converted_at', + 'backend_type' => 'timestamp', + 'is_required' => '', + 'default_value' => '', + 'input' => '', + ]; + + protected $is_active = [ + 'attribute_code' => 'is_active', + 'backend_type' => 'smallint', + 'is_required' => '', + 'default_value' => '1', + 'input' => '', + ]; + + protected $is_virtual = [ + 'attribute_code' => 'is_virtual', + 'backend_type' => 'smallint', + 'is_required' => '', + 'default_value' => '0', + 'input' => '', + ]; + + protected $is_multi_shipping = [ + 'attribute_code' => 'is_multi_shipping', + 'backend_type' => 'smallint', + 'is_required' => '', + 'default_value' => '0', + 'input' => '', + ]; + + protected $items = [ + 'attribute_code' => 'items', + 'backend_type' => 'virtual', + 'source' => 'Magento\Checkout\Test\Fixture\Cart\Items', + ]; + + protected $items_count = [ + 'attribute_code' => 'items_count', + 'backend_type' => 'int', + 'is_required' => '', + 'default_value' => '0', + 'input' => '', + ]; + + protected $items_qty = [ + 'attribute_code' => 'items_qty', + 'backend_type' => 'decimal', + 'is_required' => '', + 'default_value' => '0.0000', + 'input' => '', + ]; + + protected $orig_order_id = [ + 'attribute_code' => 'orig_order_id', + 'backend_type' => 'int', + 'is_required' => '', + 'default_value' => '0', + 'input' => '', + ]; + + protected $store_to_base_rate = [ + 'attribute_code' => 'store_to_base_rate', + 'backend_type' => 'decimal', + 'is_required' => '', + 'default_value' => '0.0000', + 'input' => '', + ]; + + protected $store_to_quote_rate = [ + 'attribute_code' => 'store_to_quote_rate', + 'backend_type' => 'decimal', + 'is_required' => '', + 'default_value' => '0.0000', + 'input' => '', + ]; + + protected $base_currency_code = [ + 'attribute_code' => 'base_currency_code', + 'backend_type' => 'varchar', + 'is_required' => '', + 'default_value' => '', + 'input' => '', + ]; + + protected $store_currency_code = [ + 'attribute_code' => 'store_currency_code', + 'backend_type' => 'varchar', + 'is_required' => '', + 'default_value' => '', + 'input' => '', + ]; + + protected $quote_currency_code = [ + 'attribute_code' => 'quote_currency_code', + 'backend_type' => 'varchar', + 'is_required' => '', + 'default_value' => '', + 'input' => '', + ]; + + protected $grand_total = [ + 'attribute_code' => 'grand_total', + 'backend_type' => 'decimal', + 'is_required' => '', + 'default_value' => '0.0000', + 'input' => '', + ]; + + protected $base_grand_total = [ + 'attribute_code' => 'base_grand_total', + 'backend_type' => 'decimal', + 'is_required' => '', + 'default_value' => '0.0000', + 'input' => '', + ]; + + protected $checkout_method = [ + 'attribute_code' => 'checkout_method', + 'backend_type' => 'varchar', + 'is_required' => '', + 'default_value' => '', + 'input' => '', + ]; + + protected $customer_id = [ + 'attribute_code' => 'customer_id', + 'backend_type' => 'int', + 'is_required' => '', + 'default_value' => '0', + 'input' => '', + ]; + + protected $customer_tax_class_id = [ + 'attribute_code' => 'customer_tax_class_id', + 'backend_type' => 'int', + 'is_required' => '', + 'default_value' => '0', + 'input' => '', + ]; + + protected $customer_group_id = [ + 'attribute_code' => 'customer_group_id', + 'backend_type' => 'int', + 'is_required' => '', + 'default_value' => '0', + 'input' => '', + ]; + + protected $customer_email = [ + 'attribute_code' => 'customer_email', + 'backend_type' => 'varchar', + 'is_required' => '', + 'default_value' => '', + 'input' => '', + ]; + + protected $customer_prefix = [ + 'attribute_code' => 'customer_prefix', + 'backend_type' => 'varchar', + 'is_required' => '', + 'default_value' => '', + 'input' => '', + ]; + + protected $customer_firstname = [ + 'attribute_code' => 'customer_firstname', + 'backend_type' => 'varchar', + 'is_required' => '', + 'default_value' => '', + 'input' => '', + ]; + + protected $customer_middlename = [ + 'attribute_code' => 'customer_middlename', + 'backend_type' => 'varchar', + 'is_required' => '', + 'default_value' => '', + 'input' => '', + ]; + + protected $customer_lastname = [ + 'attribute_code' => 'customer_lastname', + 'backend_type' => 'varchar', + 'is_required' => '', + 'default_value' => '', + 'input' => '', + ]; + + protected $customer_suffix = [ + 'attribute_code' => 'customer_suffix', + 'backend_type' => 'varchar', + 'is_required' => '', + 'default_value' => '', + 'input' => '', + ]; + + protected $customer_dob = [ + 'attribute_code' => 'customer_dob', + 'backend_type' => 'datetime', + 'is_required' => '', + 'default_value' => '', + 'input' => '', + ]; + + protected $customer_note = [ + 'attribute_code' => 'customer_note', + 'backend_type' => 'varchar', + 'is_required' => '', + 'default_value' => '', + 'input' => '', + ]; + + protected $customer_note_notify = [ + 'attribute_code' => 'customer_note_notify', + 'backend_type' => 'smallint', + 'is_required' => '', + 'default_value' => '1', + 'input' => '', + ]; + + protected $customer_is_guest = [ + 'attribute_code' => 'customer_is_guest', + 'backend_type' => 'smallint', + 'is_required' => '', + 'default_value' => '0', + 'input' => '', + ]; + + protected $remote_ip = [ + 'attribute_code' => 'remote_ip', + 'backend_type' => 'varchar', + 'is_required' => '', + 'default_value' => '', + 'input' => '', + ]; + + protected $applied_rule_ids = [ + 'attribute_code' => 'applied_rule_ids', + 'backend_type' => 'varchar', + 'is_required' => '', + 'default_value' => '', + 'input' => '', + ]; + + protected $reserved_order_id = [ + 'attribute_code' => 'reserved_order_id', + 'backend_type' => 'varchar', + 'is_required' => '', + 'default_value' => '', + 'input' => '', + ]; + + protected $password_hash = [ + 'attribute_code' => 'password_hash', + 'backend_type' => 'varchar', + 'is_required' => '', + 'default_value' => '', + 'input' => '', + ]; + + protected $coupon_code = [ + 'attribute_code' => 'coupon_code', + 'backend_type' => 'varchar', + 'is_required' => '', + 'default_value' => '', + 'input' => '', + ]; + + protected $global_currency_code = [ + 'attribute_code' => 'global_currency_code', + 'backend_type' => 'varchar', + 'is_required' => '', + 'default_value' => '', + 'input' => '', + ]; + + protected $base_to_global_rate = [ + 'attribute_code' => 'base_to_global_rate', + 'backend_type' => 'decimal', + 'is_required' => '', + 'default_value' => '', + 'input' => '', + ]; + + protected $base_to_quote_rate = [ + 'attribute_code' => 'base_to_quote_rate', + 'backend_type' => 'decimal', + 'is_required' => '', + 'default_value' => '', + 'input' => '', + ]; + + protected $customer_taxvat = [ + 'attribute_code' => 'customer_taxvat', + 'backend_type' => 'varchar', + 'is_required' => '', + 'default_value' => '', + 'input' => '', + ]; + + protected $customer_gender = [ + 'attribute_code' => 'customer_gender', + 'backend_type' => 'varchar', + 'is_required' => '', + 'default_value' => '', + 'input' => '', + ]; + + protected $subtotal = [ + 'attribute_code' => 'subtotal', + 'backend_type' => 'decimal', + 'is_required' => '', + 'default_value' => '', + 'input' => '', + ]; + + protected $base_subtotal = [ + 'attribute_code' => 'base_subtotal', + 'backend_type' => 'decimal', + 'is_required' => '', + 'default_value' => '', + 'input' => '', + ]; + + protected $subtotal_with_discount = [ + 'attribute_code' => 'subtotal_with_discount', + 'backend_type' => 'decimal', + 'is_required' => '', + 'default_value' => '', + 'input' => '', + ]; + + protected $base_subtotal_with_discount = [ + 'attribute_code' => 'base_subtotal_with_discount', + 'backend_type' => 'decimal', + 'is_required' => '', + 'default_value' => '', + 'input' => '', + ]; + + protected $is_changed = [ + 'attribute_code' => 'is_changed', + 'backend_type' => 'int', + 'is_required' => '', + 'default_value' => '', + 'input' => '', + ]; + + protected $trigger_recollect = [ + 'attribute_code' => 'trigger_recollect', + 'backend_type' => 'smallint', + 'is_required' => '', + 'default_value' => '0', + 'input' => '', + ]; + + protected $ext_shipping_info = [ + 'attribute_code' => 'ext_shipping_info', + 'backend_type' => 'text', + 'is_required' => '', + 'default_value' => '', + 'input' => '', + ]; + + protected $is_persistent = [ + 'attribute_code' => 'is_persistent', + 'backend_type' => 'smallint', + 'is_required' => '', + 'default_value' => '0', + 'input' => '', + ]; + + protected $gift_message_id = [ + 'attribute_code' => 'gift_message_id', + 'backend_type' => 'int', + 'is_required' => '', + 'default_value' => '', + 'input' => '', + ]; + + protected $checkout_data = [ + 'attribute_code' => 'checkout_data', + 'backend_type' => 'virtual', + 'group' => '', + 'source' => 'Magento\Checkout\Test\Fixture\Cart\CheckoutData', + ]; + + public function getEntityId() + { + return $this->getData('entity_id'); + } + + public function getStoreId() + { + return $this->getData('store_id'); + } + + public function getCreatedAt() + { + return $this->getData('created_at'); + } + + public function getUpdatedAt() + { + return $this->getData('updated_at'); + } + + public function getConvertedAt() + { + return $this->getData('converted_at'); + } + + public function getIsActive() + { + return $this->getData('is_active'); + } + + public function getIsVirtual() + { + return $this->getData('is_virtual'); + } + + public function getIsMultiShipping() + { + return $this->getData('is_multi_shipping'); + } + + public function getItems() + { + return $this->getData('items'); + } + + public function getItemsCount() + { + return $this->getData('items_count'); + } + + public function getItemsQty() + { + return $this->getData('items_qty'); + } + + public function getOrigOrderId() + { + return $this->getData('orig_order_id'); + } + + public function getStoreToBaseRate() + { + return $this->getData('store_to_base_rate'); + } + + public function getStoreToQuoteRate() + { + return $this->getData('store_to_quote_rate'); + } + + public function getBaseCurrencyCode() + { + return $this->getData('base_currency_code'); + } + + public function getStoreCurrencyCode() + { + return $this->getData('store_currency_code'); + } + + public function getQuoteCurrencyCode() + { + return $this->getData('quote_currency_code'); + } + + public function getGrandTotal() + { + return $this->getData('grand_total'); + } + + public function getBaseGrandTotal() + { + return $this->getData('base_grand_total'); + } + + public function getCheckoutMethod() + { + return $this->getData('checkout_method'); + } + + public function getCustomerId() + { + return $this->getData('customer_id'); + } + + public function getCustomerTaxClassId() + { + return $this->getData('customer_tax_class_id'); + } + + public function getCustomerGroupId() + { + return $this->getData('customer_group_id'); + } + + public function getCustomerEmail() + { + return $this->getData('customer_email'); + } + + public function getCustomerPrefix() + { + return $this->getData('customer_prefix'); + } + + public function getCustomerFirstname() + { + return $this->getData('customer_firstname'); + } + + public function getCustomerMiddlename() + { + return $this->getData('customer_middlename'); + } + + public function getCustomerLastname() + { + return $this->getData('customer_lastname'); + } + + public function getCustomerSuffix() + { + return $this->getData('customer_suffix'); + } + + public function getCustomerDob() + { + return $this->getData('customer_dob'); + } + + public function getCustomerNote() + { + return $this->getData('customer_note'); + } + + public function getCustomerNoteNotify() + { + return $this->getData('customer_note_notify'); + } + + public function getCustomerIsGuest() + { + return $this->getData('customer_is_guest'); + } + + public function getRemoteIp() + { + return $this->getData('remote_ip'); + } + + public function getAppliedRuleIds() + { + return $this->getData('applied_rule_ids'); + } + + public function getReservedOrderId() + { + return $this->getData('reserved_order_id'); + } + + public function getPasswordHash() + { + return $this->getData('password_hash'); + } + + public function getCouponCode() + { + return $this->getData('coupon_code'); + } + + public function getGlobalCurrencyCode() + { + return $this->getData('global_currency_code'); + } + + public function getBaseToGlobalRate() + { + return $this->getData('base_to_global_rate'); + } + + public function getBaseToQuoteRate() + { + return $this->getData('base_to_quote_rate'); + } + + public function getCustomerTaxvat() + { + return $this->getData('customer_taxvat'); + } + + public function getCustomerGender() + { + return $this->getData('customer_gender'); + } + + public function getSubtotal() + { + return $this->getData('subtotal'); + } + + public function getBaseSubtotal() + { + return $this->getData('base_subtotal'); + } + + public function getSubtotalWithDiscount() + { + return $this->getData('subtotal_with_discount'); + } + + public function getBaseSubtotalWithDiscount() + { + return $this->getData('base_subtotal_with_discount'); + } + + public function getIsChanged() + { + return $this->getData('is_changed'); + } + + public function getTriggerRecollect() + { + return $this->getData('trigger_recollect'); + } + + public function getExtShippingInfo() + { + return $this->getData('ext_shipping_info'); + } + + public function getIsPersistent() + { + return $this->getData('is_persistent'); + } + + public function getGiftMessageId() + { + return $this->getData('gift_message_id'); + } + + public function getCheckoutData() + { + return $this->getData('checkout_data'); + } +} diff --git a/dev/tests/functional/tests/app/Magento/Checkout/Test/Fixture/Cart.xml b/dev/tests/functional/tests/app/Magento/Checkout/Test/Fixture/Cart.xml new file mode 100644 index 0000000000000..730a27399704b --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Checkout/Test/Fixture/Cart.xml @@ -0,0 +1,384 @@ + + + + Magento_Checkout + flat + sales_quote + Magento\Checkout\Model\Resource\Cart + + + entity_id + int + 1 + + + + + store_id + smallint + + 0 + + + + created_at + timestamp + + CURRENT_TIMESTAMP + + + + updated_at + timestamp + + 0000-00-00 00:00:00 + + + + converted_at + timestamp + + + + + + is_active + smallint + + 1 + + + + is_virtual + smallint + + 0 + + + + is_multi_shipping + smallint + + 0 + + + + items + virtual + Magento\Checkout\Test\Fixture\Cart\Items + + + items_count + int + + 0 + + + + items_qty + decimal + + 0.0000 + + + + orig_order_id + int + + 0 + + + + store_to_base_rate + decimal + + 0.0000 + + + + store_to_quote_rate + decimal + + 0.0000 + + + + base_currency_code + varchar + + + + + + store_currency_code + varchar + + + + + + quote_currency_code + varchar + + + + + + grand_total + decimal + + 0.0000 + + + + base_grand_total + decimal + + 0.0000 + + + + checkout_method + varchar + + + + + + customer_id + int + + 0 + + + + customer_tax_class_id + int + + 0 + + + + customer_group_id + int + + 0 + + + + customer_email + varchar + + + + + + customer_prefix + varchar + + + + + + customer_firstname + varchar + + + + + + customer_middlename + varchar + + + + + + customer_lastname + varchar + + + + + + customer_suffix + varchar + + + + + + customer_dob + datetime + + + + + + customer_note + varchar + + + + + + customer_note_notify + smallint + + 1 + + + + customer_is_guest + smallint + + 0 + + + + remote_ip + varchar + + + + + + applied_rule_ids + varchar + + + + + + reserved_order_id + varchar + + + + + + password_hash + varchar + + + + + + coupon_code + varchar + + + + + + global_currency_code + varchar + + + + + + base_to_global_rate + decimal + + + + + + base_to_quote_rate + decimal + + + + + + customer_taxvat + varchar + + + + + + customer_gender + varchar + + + + + + subtotal + decimal + + + + + + base_subtotal + decimal + + + + + + subtotal_with_discount + decimal + + + + + + base_subtotal_with_discount + decimal + + + + + + is_changed + int + + + + + + trigger_recollect + smallint + + 0 + + + + ext_shipping_info + text + + + + + + is_persistent + smallint + + 0 + + + + gift_message_id + int + + + + + + checkout_data + virtual + + Magento\Checkout\Test\Fixture\Cart\CheckoutData + + + Magento\Checkout\Test\Repository\Cart + Magento\Checkout\Test\Handler\Cart\CartInterface + diff --git a/dev/tests/functional/tests/app/Magento/Checkout/Test/Fixture/Cart/Items.php b/dev/tests/functional/tests/app/Magento/Checkout/Test/Fixture/Cart/Items.php new file mode 100644 index 0000000000000..7fa9527d5a8ac --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Checkout/Test/Fixture/Cart/Items.php @@ -0,0 +1,113 @@ +params = $params; + $this->products = isset($data['products']) ? $data['products'] : []; + + foreach ($this->products as $product) { + $classItem = 'Magento\\' . $this->getModuleName($product) . '\Test\Fixture\Cart\Item'; + $item = ObjectManager::getInstance()->create($classItem, ['product' => $product]); + + $this->data[] = $item; + } + } + + /** + * Get module name from fixture + * + * @param FixtureInterface $product + * @return string + */ + protected function getModuleName(FixtureInterface $product) + { + preg_match('/^Magento\\\\([^\\\\]+)\\\\Test/', get_class($product), $match); + return isset($match[1]) ? $match[1] : ''; + } + + /** + * Persist fixture + * + * @return void + */ + public function persist() + { + // + } + + /** + * Return prepared data set + * + * @param string $key [optional] + * @return mixed + * + * @SuppressWarnings(PHPMD.UnusedFormalParameter) + */ + public function getData($key = null) + { + return $this->data; + } + + /** + * Return data set configuration settings + * + * @return string + */ + public function getDataConfig() + { + return $this->params; + } + + /** + * Get source products + * + * @return array + */ + public function getProducts() + { + return $this->products; + } +} diff --git a/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/AddProductsToShoppingCartEntityTest.php b/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/AddProductsToShoppingCartEntityTest.php new file mode 100644 index 0000000000000..9d46030727da6 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/AddProductsToShoppingCartEntityTest.php @@ -0,0 +1,133 @@ +browser = $browser; + $this->fixtureFactory = $fixtureFactory; + $this->catalogProductView = $catalogProductView; + $this->cartPage = $cartPage; + } + + /** + * Run test add products to shopping cart + * + * @param string $productsData + * @param array $cart + * @return array + */ + public function test($productsData, array $cart) + { + // Preconditions + $products = $this->prepareProducts($productsData); + + // Steps + $this->addToCart($products); + + $cart['data']['items'] = ['products' => $products]; + return ['cart' => $this->fixtureFactory->createByCode('cart', $cart)]; + } + + /** + * Create products + * + * @param string $productList + * @return array + */ + protected function prepareProducts($productList) + { + $addToCartStep = ObjectManager::getInstance()->create( + 'Magento\Catalog\Test\TestStep\CreateProductsStep', + ['products' => $productList] + ); + + $result = $addToCartStep->run(); + return $result['products']; + } + + /** + * Add products to cart + * + * @param array $products + * @return void + */ + protected function addToCart(array $products) + { + $addToCartStep = ObjectManager::getInstance()->create( + 'Magento\Checkout\Test\TestStep\AddProductsToTheCartStep', + ['products' => $products] + ); + $addToCartStep->run(); + } +} diff --git a/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/AddProductsToShoppingCartEntityTest/test.csv b/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/AddProductsToShoppingCartEntityTest/test.csv new file mode 100644 index 0000000000000..632334968d951 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/AddProductsToShoppingCartEntityTest/test.csv @@ -0,0 +1,9 @@ +"productsData";"cart/data/grand_total";"constraint";"issue" +"bundleProduct::bundle_dynamic_product";"200";"assertPriceInShoppingCart, assertProductQtyInShoppingCart, assertSubtotalInShoppingCart, assertCartItemsOptions, assertGrandTotalInShoppingCart";"" +"bundleProduct::bundle_fixed_product";"756";"assertPriceInShoppingCart, assertProductQtyInShoppingCart, assertSubtotalInShoppingCart, assertCartItemsOptions, assertGrandTotalInShoppingCart";"Bug: MAGETWO-28350" +"catalogProductSimple::with_two_custom_option";"340";"assertPriceInShoppingCart, assertProductQtyInShoppingCart, assertSubtotalInShoppingCart, assertCartItemsOptions, assertGrandTotalInShoppingCart";"" +"catalogProductVirtual::50_dollar_product";"50";"assertPriceInShoppingCart, assertProductQtyInShoppingCart, assertSubtotalInShoppingCart, assertCartItemsOptions, assertGrandTotalInShoppingCart";"" +"configurableProductInjectable::default";"516";"assertPriceInShoppingCart, assertProductQtyInShoppingCart, assertSubtotalInShoppingCart, assertCartItemsOptions, assertGrandTotalInShoppingCart";"" +"downloadableProductInjectable::with_two_separately_links";"46";"assertPriceInShoppingCart, assertProductQtyInShoppingCart, assertSubtotalInShoppingCart, assertCartItemsOptions, assertGrandTotalInShoppingCart";"Bug: MAGETWO-24195" +"groupedProductInjectable::three_simple_products";"1920";"assertPriceInShoppingCart, assertProductQtyInShoppingCart, assertSubtotalInShoppingCart, assertCartItemsOptions, assertGrandTotalInShoppingCart";"" +"catalogProductSimple::with_two_custom_option, catalogProductVirtual::50_dollar_product, downloadableProductInjectable::with_two_separately_links, groupedProductInjectable::three_simple_products, configurableProductInjectable::default, bundleProduct::bundle_dynamic_product, bundleProduct::bundle_dynamic_product";"3272";"assertPriceInShoppingCart, assertProductQtyInShoppingCart, assertSubtotalInShoppingCart, assertCartItemsOptions, assertGrandTotalInShoppingCart";"Bug: MAGETWO-28350" diff --git a/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/DeleteProductFromMiniShoppingCartTest.php b/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/DeleteProductFromMiniShoppingCartTest.php new file mode 100644 index 0000000000000..debee97389c11 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/DeleteProductFromMiniShoppingCartTest.php @@ -0,0 +1,130 @@ +cmsIndex = $cmsIndex; + $this->cartPage = $cartPage; + } + + /** + * Run test add products to shopping cart + * + * @param string $products + * @param int $deletedProductIndex + * @return array + */ + public function test($products, $deletedProductIndex) + { + // Preconditions + $products = $this->prepareProducts($products); + $this->cartPage->open(); + $this->cartPage->getCartBlock()->clearShoppingCart(); + + // Steps + $this->addToCart($products); + $this->cartPage->getMessagesBlock()->waitSuccessMessage(); + $this->removeProduct($products[$deletedProductIndex]); + $deletedProduct = $products[$deletedProductIndex]; + unset($products[$deletedProductIndex]); + + return ['products' => $products, 'deletedProduct' => $deletedProduct]; + } + + /** + * Create products + * + * @param string $productList + * @return InjectableFixture[] + */ + protected function prepareProducts($productList) + { + $productsStep = ObjectManager::getInstance()->create( + 'Magento\Catalog\Test\TestStep\CreateProductsStep', + ['products' => $productList] + ); + + $result = $productsStep->run(); + return $result['products']; + } + + /** + * Add products to cart + * + * @param array $products + * @return void + */ + protected function addToCart(array $products) + { + $addToCartStep = ObjectManager::getInstance()->create( + 'Magento\Checkout\Test\TestStep\AddProductsToTheCartStep', + ['products' => $products] + ); + $addToCartStep->run(); + } + + /** + * Remove product form cart + * + * @param FixtureInterface $product + * @return void + */ + protected function removeProduct(FixtureInterface $product) + { + $this->cmsIndex->open(); + $this->cmsIndex->getCartSidebarBlock()->openMiniCart(); + $this->cmsIndex->getCartSidebarBlock()->getCartItem($product)->removeItemFromMiniCart(); + } +} diff --git a/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/DeleteProductFromMiniShoppingCartTest/test.csv b/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/DeleteProductFromMiniShoppingCartTest/test.csv new file mode 100644 index 0000000000000..8b0dc5a5f50dd --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/DeleteProductFromMiniShoppingCartTest/test.csv @@ -0,0 +1,3 @@ +"description";"products";"deletedProductIndex";"constraint" +"delete Simple";"catalogProductSimple::default, catalogProductVirtual::default";"0";"assertProductAbsentInMiniShoppingCart, assertProductPresentInMiniShoppingCart" +"delete Simple";"catalogProductSimple::default";"0";"assertCartIsEmpty" diff --git a/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/DeleteProductsFromShoppingCartTest.php b/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/DeleteProductsFromShoppingCartTest.php new file mode 100644 index 0000000000000..6e2760eb681d4 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/DeleteProductsFromShoppingCartTest.php @@ -0,0 +1,142 @@ +browser = $browser; + $this->fixtureFactory = $fixtureFactory; + $this->catalogProductView = $catalogProductView; + $this->cartPage = $cartPage; + } + + /** + * Run test add products to shopping cart + * + * @param string $productsData + * @return void + */ + public function test($productsData) + { + // Preconditions + $products = $this->prepareProducts($productsData); + + // Steps + $this->addToCart($products); + $this->removeProducts($products); + } + + /** + * Create products + * + * @param string $productList + * @return InjectableFixture[] + */ + protected function prepareProducts($productList) + { + $createProductsStep = ObjectManager::getInstance()->create( + 'Magento\Catalog\Test\TestStep\CreateProductsStep', + ['products' => $productList] + ); + + $result = $createProductsStep->run(); + return $result['products']; + } + + /** + * Add products to cart + * + * @param array $products + * @return void + */ + protected function addToCart(array $products) + { + $addToCartStep = ObjectManager::getInstance()->create( + 'Magento\Checkout\Test\TestStep\AddProductsToTheCartStep', + ['products' => $products] + ); + $addToCartStep->run(); + } + + /** + * Remove products form cart + * + * @param array $products + * @return void + */ + protected function removeProducts(array $products) + { + foreach ($products as $product) { + $this->cartPage->getCartBlock()->getCartItem($product)->removeItem(); + } + } +} diff --git a/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/DeleteProductsFromShoppingCartTest/test.csv b/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/DeleteProductsFromShoppingCartTest/test.csv new file mode 100644 index 0000000000000..a1d9b4beef900 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/DeleteProductsFromShoppingCartTest/test.csv @@ -0,0 +1,9 @@ +"productsData";"constraint";"issue" +"bundleProduct::bundle_dynamic_product";"assertCartIsEmpty";"" +"bundleProduct::bundle_fixed_product";"assertCartIsEmpty";"Bug: MAGETWO-28350" +"catalogProductSimple::with_two_custom_option";"assertCartIsEmpty";"" +"catalogProductVirtual::50_dollar_product";"assertCartIsEmpty";"" +"configurableProductInjectable::default";"assertCartIsEmpty";"" +"downloadableProductInjectable::with_two_separately_links";"assertCartIsEmpty";"" +"groupedProductInjectable::three_simple_products";"assertCartIsEmpty";"" +"catalogProductSimple::with_two_custom_option, catalogProductVirtual::50_dollar_product, downloadableProductInjectable::with_two_separately_links, groupedProductInjectable::three_simple_products, configurableProductInjectable::default, bundleProduct::bundle_dynamic_product, bundleProduct::bundle_dynamic_product";"assertCartIsEmpty";"Bug: MAGETWO-28350" diff --git a/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/UpdateProductFromMiniShoppingCartEntityTest.php b/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/UpdateProductFromMiniShoppingCartEntityTest.php new file mode 100644 index 0000000000000..52de060195026 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/UpdateProductFromMiniShoppingCartEntityTest.php @@ -0,0 +1,135 @@ +cmsIndex = $cmsIndex; + $this->catalogProductView = $catalogProductView; + $this->fixtureFactory = $fixtureFactory; + } + + /** + * Update product from mini shopping cart. + * + * @param string $originalProduct + * @param array $checkoutData + * @return array + */ + public function test($originalProduct, $checkoutData) + { + // Preconditions: + $product = $this->createProduct($originalProduct); + $this->addToCart($product); + + // Steps: + $productData = $product->getData(); + $productData['checkout_data'] = $checkoutData; + $newProduct = $this->createProduct(explode('::', $originalProduct)[0], [$productData]); + $miniShoppingCart = $this->cmsIndex->getCartSidebarBlock(); + $miniShoppingCart->openMiniCart(); + $miniShoppingCart->getCartItem($newProduct)->clickEditItem(); + $this->catalogProductView->getViewBlock()->addToCart($newProduct); + + // Prepare data for asserts: + $cart['data']['items'] = ['products' => [$newProduct]]; + $deletedCart['data']['items'] = ['products' => [$product]]; + + return [ + 'deletedCart' => $this->fixtureFactory->createByCode('cart', $deletedCart), + 'cart' => $this->fixtureFactory->createByCode('cart', $cart) + ]; + } + + /** + * Create product. + * + * @param string $product + * @param array $data [optional] + * @return FixtureInterface + */ + protected function createProduct($product, array $data = []) + { + $createProductsStep = $this->objectManager->create( + 'Magento\Catalog\Test\TestStep\CreateProductsStep', + ['products' => $product, 'data' => $data] + ); + return $createProductsStep->run()['products'][0]; + } + + /** + * Add product to cart. + * + * @param FixtureInterface $product + * @return void + */ + protected function addToCart(FixtureInterface $product) + { + $addToCartStep = $this->objectManager->create( + 'Magento\Checkout\Test\TestStep\AddProductsToTheCartStep', + ['products' => [$product]] + ); + $addToCartStep->run(); + } +} diff --git a/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/UpdateProductFromMiniShoppingCartEntityTest/test.csv b/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/UpdateProductFromMiniShoppingCartEntityTest/test.csv new file mode 100644 index 0000000000000..9c6f1765f49da --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/UpdateProductFromMiniShoppingCartEntityTest/test.csv @@ -0,0 +1,5 @@ +"description";"originalProduct";"checkoutData/preset";"constraint";"issue" +"Update Simple";"catalogProductSimple::with_two_custom_option";"forUpdateMiniShoppingCart";"assertProductQtyInMiniShoppingCart, assertProductQtyInShoppingCart";"" +"Update Configurable and verify previous product was updated to new one in shopping cart and mini shopping cart";"configurableProductInjectable::default";"forUpdateMiniShoppingCart";"assertCartItemsOptions, assertProductQtyInMiniShoppingCart, assertProductQtyInShoppingCart, assertProductOptionsAbsentInShoppingCart";"" +"Update Bundle and verify previous product was updated to new one in shopping cart and mini shopping cart";"bundleProduct::bundle_fixed_product";"forUpdateMiniShoppingCart";"assertCartItemsOptions, assertProductQtyInMiniShoppingCart, assertProductQtyInShoppingCart, assertProductOptionsAbsentInShoppingCart";"" +"Update Downloadable and check previous link was updated to new one in shopping cart and mini shopping cart";"downloadableProductInjectable::with_two_separately_links";"forUpdateMiniShoppingCart";"assertCartItemsOptions, assertProductQtyInMiniShoppingCart, assertProductQtyInShoppingCart, assertProductOptionsAbsentInShoppingCart";"Bug: MAGETWO-24195" diff --git a/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/UpdateShoppingCartTest.php b/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/UpdateShoppingCartTest.php new file mode 100755 index 0000000000000..31aa86e537523 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/UpdateShoppingCartTest.php @@ -0,0 +1,119 @@ +browser = $browser; + $this->fixtureFactory = $fixtureFactory; + } + + /** + * Inject data + * + * @param CatalogProductView $catalogProductView + * @param CheckoutCart $checkoutCart + * @return void + */ + public function __inject( + CatalogProductView $catalogProductView, + CheckoutCart $checkoutCart + ) { + $this->catalogProductView = $catalogProductView; + $this->checkoutCart = $checkoutCart; + } + + /** + * Update Shopping Cart + * + * @param CatalogProductSimple $product + * @return array + */ + public function test(CatalogProductSimple $product) + { + // Preconditions + $product->persist(); + $this->checkoutCart->getCartBlock()->clearShoppingCart(); + + // Steps + $this->browser->open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html'); + $productView = $this->catalogProductView->getViewBlock(); + $productView->fillOptions($product); + $productView->setQty(1); + $productView->clickAddToCart(); + + $qty = $product->getCheckoutData()['qty']; + $this->checkoutCart->open(); + $this->checkoutCart->getCartBlock()->getCartItem($product)->setQty($qty); + $this->checkoutCart->getCartBlock()->updateShoppingCart(); + + $cart['data']['items'] = ['products' => [$product]]; + return ['cart' => $this->fixtureFactory->createByCode('cart', $cart)]; + } +} diff --git a/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/UpdateShoppingCartTest/test.csv b/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/UpdateShoppingCartTest/test.csv new file mode 100644 index 0000000000000..1866177cfcd78 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/UpdateShoppingCartTest/test.csv @@ -0,0 +1,3 @@ +"product/dataSet";"product/data/price/value";"product/data/checkout_data/qty";"product/data/checkout_data/cartItem/price";"product/data/checkout_data/cartItem/subtotal";"constraint" +"default";"100";"3";"100";"300";"assertPriceInShoppingCart, assertProductQtyInShoppingCart, assertProductQtyInMiniShoppingCart, assertSubtotalInShoppingCart" +"with_two_custom_option";"50";"11";"65";"715";"assertPriceInShoppingCart, assertProductQtyInShoppingCart, assertProductQtyInMiniShoppingCart, assertSubtotalInShoppingCart" diff --git a/dev/tests/functional/tests/app/Magento/Checkout/Test/etc/constraint.xml b/dev/tests/functional/tests/app/Magento/Checkout/Test/etc/constraint.xml index d69ba6b2b4d3a..3fe824217264b 100644 --- a/dev/tests/functional/tests/app/Magento/Checkout/Test/etc/constraint.xml +++ b/dev/tests/functional/tests/app/Magento/Checkout/Test/etc/constraint.xml @@ -6,51 +6,51 @@ --> - middle + middle - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low diff --git a/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/Block/Adminhtml/AgreementGrid.php b/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/Block/Adminhtml/AgreementGrid.php deleted file mode 100644 index f838a3d5cb365..0000000000000 --- a/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/Block/Adminhtml/AgreementGrid.php +++ /dev/null @@ -1,40 +0,0 @@ - [ - 'selector' => 'input[name="name"]', - ], - ]; -} diff --git a/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/Block/Adminhtml/Block/Agreement/Edit/AgreementsForm.php b/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/Block/Adminhtml/Block/Agreement/Edit/AgreementsForm.php deleted file mode 100644 index 1cf1a490778e2..0000000000000 --- a/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/Block/Adminhtml/Block/Agreement/Edit/AgreementsForm.php +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - select - - - select - - - [name="stores[]"] - multiselectgrouplist - - - - - - diff --git a/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/Block/Onepage/AgreementReview.php b/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/Block/Onepage/AgreementReview.php deleted file mode 100644 index 12e5d831d91e0..0000000000000 --- a/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/Block/Onepage/AgreementReview.php +++ /dev/null @@ -1,71 +0,0 @@ -_rootElement->find($this->notification)->getText(); - } - - /** - * Set agreement - * - * @param string $value - * @return void - */ - public function setAgreement($value) - { - $this->_rootElement->find($this->agreementCheckbox, Locator::SELECTOR_XPATH, 'checkbox')->setValue($value); - } - - /** - * Check agreement - * - * @param CheckoutAgreement $agreement - * @return bool - */ - public function checkAgreement(CheckoutAgreement $agreement) - { - return $this->_rootElement - ->find(sprintf($this->agreement, $agreement->getCheckboxText()), Locator::SELECTOR_XPATH)->isVisible(); - } -} diff --git a/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/Constraint/AssertTermAbsentInGrid.php b/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/Constraint/AssertTermAbsentInGrid.php deleted file mode 100644 index 759cde768461a..0000000000000 --- a/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/Constraint/AssertTermAbsentInGrid.php +++ /dev/null @@ -1,50 +0,0 @@ -open(); - \PHPUnit_Framework_Assert::assertFalse( - $agreementIndex->getAgreementGridBlock()->isRowVisible(['name' => $agreement->getName()]), - 'Checkout Agreement \'' . $agreement->getName() . '\' is present in agreement grid.' - ); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Checkout Agreement is absent in agreement grid.'; - } -} diff --git a/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/Constraint/AssertTermAbsentOnCheckout.php b/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/Constraint/AssertTermAbsentOnCheckout.php deleted file mode 100644 index 448210dccd934..0000000000000 --- a/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/Constraint/AssertTermAbsentOnCheckout.php +++ /dev/null @@ -1,94 +0,0 @@ -create( - 'Magento\Catalog\Test\TestStep\CreateProductsStep', - ['products' => $product] - ); - $product = $createProductsStep->run(); - - $billingAddress = $fixtureFactory->createByCode('addressInjectable', ['dataSet' => 'default']); - - $browser->open($_ENV['app_frontend_url'] . $product['products'][0]->getUrlKey() . '.html'); - $catalogProductView->getViewBlock()->clickAddToCartButton(); - $checkoutCart->getCartBlock()->getOnepageLinkBlock()->proceedToCheckout(); - $checkoutOnepage->getLoginBlock()->guestCheckout(); - $checkoutOnepage->getLoginBlock()->clickContinue(); - $checkoutOnepage->getBillingBlock()->fill($billingAddress); - $checkoutOnepage->getBillingBlock()->clickContinue(); - $checkoutOnepage->getShippingMethodBlock()->selectShippingMethod($shipping); - $checkoutOnepage->getShippingMethodBlock()->clickContinue(); - $checkoutOnepage->getPaymentMethodsBlock()->selectPaymentMethod($payment); - $checkoutOnepage->getPaymentMethodsBlock()->clickContinue(); - - \PHPUnit_Framework_Assert::assertFalse( - $checkoutOnepage->getAgreementReview()->checkAgreement($agreement), - 'Checkout Agreement \'' . $agreement->getName() . '\' is present in the Place order step.' - ); - } - - /** - * Returns a string representation of the object - * - * @return string - */ - public function toString() - { - return 'Checkout Agreement is absent in the Place order step.'; - } -} diff --git a/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/Constraint/AssertTermInGrid.php b/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/Constraint/AssertTermInGrid.php deleted file mode 100644 index 7b2e8e2e0c784..0000000000000 --- a/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/Constraint/AssertTermInGrid.php +++ /dev/null @@ -1,50 +0,0 @@ -open(); - \PHPUnit_Framework_Assert::assertTrue( - $agreementIndex->getAgreementGridBlock()->isRowVisible(['name' => $agreement->getName()]), - 'Checkout Agreement \'' . $agreement->getName() . '\' is absent in agreement grid.' - ); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Checkout Agreement is present in agreement grid.'; - } -} diff --git a/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/Constraint/AssertTermOnCheckout.php b/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/Constraint/AssertTermOnCheckout.php deleted file mode 100644 index cefceb9faef82..0000000000000 --- a/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/Constraint/AssertTermOnCheckout.php +++ /dev/null @@ -1,111 +0,0 @@ -create( - 'Magento\Catalog\Test\TestStep\CreateProductsStep', - ['products' => $product] - ); - $product = $createProductsStep->run(); - - $billingAddress = $fixtureFactory->createByCode('addressInjectable', ['dataSet' => 'default']); - - $browser->open($_ENV['app_frontend_url'] . $product['products'][0]->getUrlKey() . '.html'); - $catalogProductView->getViewBlock()->clickAddToCartButton(); - $checkoutCart->getCartBlock()->getOnepageLinkBlock()->proceedToCheckout(); - $checkoutOnepage->getLoginBlock()->guestCheckout(); - $checkoutOnepage->getLoginBlock()->clickContinue(); - $checkoutOnepage->getBillingBlock()->fill($billingAddress); - $checkoutOnepage->getBillingBlock()->clickContinue(); - $checkoutOnepage->getShippingMethodBlock()->selectShippingMethod($shipping); - $checkoutOnepage->getShippingMethodBlock()->clickContinue(); - $checkoutOnepage->getPaymentMethodsBlock()->selectPaymentMethod($payment); - $checkoutOnepage->getPaymentMethodsBlock()->clickContinue(); - $checkoutOnepage->getAgreementReview()->placeOrder(); - - \PHPUnit_Framework_Assert::assertEquals( - self::NOTIFICATION_MESSAGE, - $checkoutOnepage->getAgreementReview()->getNotificationMassage(), - 'Notification required message of Terms and Conditions is absent.' - ); - - $checkoutOnepage->getAgreementReview()->setAgreement('Yes'); - $checkoutOnepage->getAgreementReview()->placeOrder(); - $assertOrderSuccessPlacedMessage->processAssert($checkoutOnepageSuccess); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Order was placed with checkout agreement successfully.'; - } -} diff --git a/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/Constraint/AssertTermSuccessDeleteMessage.php b/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/Constraint/AssertTermSuccessDeleteMessage.php deleted file mode 100644 index 45609ba6cf6fe..0000000000000 --- a/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/Constraint/AssertTermSuccessDeleteMessage.php +++ /dev/null @@ -1,53 +0,0 @@ -getMessagesBlock()->getSuccessMessages(), - 'Wrong success delete message is displayed.' - ); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Terms and Conditions success delete message is present.'; - } -} diff --git a/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/Constraint/AssertTermSuccessSaveMessage.php b/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/Constraint/AssertTermSuccessSaveMessage.php deleted file mode 100644 index 826e7074ed2c8..0000000000000 --- a/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/Constraint/AssertTermSuccessSaveMessage.php +++ /dev/null @@ -1,53 +0,0 @@ -getMessagesBlock()->getSuccessMessages(), - 'Wrong success message is displayed.' - ); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Terms and Conditions success create message is present.'; - } -} diff --git a/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/Fixture/CheckoutAgreement.php b/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/Fixture/CheckoutAgreement.php deleted file mode 100644 index cec5bef2e6084..0000000000000 --- a/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/Fixture/CheckoutAgreement.php +++ /dev/null @@ -1,138 +0,0 @@ - 'DefaultName%isolation%', - 'is_active' => 'Enabled', - 'is_html' => 'Text', - 'stores' => ['dataSet' => ['default']], - 'checkbox_text' => 'test_checkbox%isolation%', - 'content' => 'TestMessage%isolation%', - ]; - - protected $agreement_id = [ - 'attribute_code' => 'agreement_id', - 'backend_type' => 'int', - 'is_required' => '1', - 'default_value' => '', - 'input' => '', - ]; - - protected $name = [ - 'attribute_code' => 'name', - 'backend_type' => 'varchar', - 'is_required' => '', - 'default_value' => '', - 'input' => '', - ]; - - protected $content = [ - 'attribute_code' => 'content', - 'backend_type' => 'text', - 'is_required' => '', - 'default_value' => '', - 'input' => '', - ]; - - protected $content_height = [ - 'attribute_code' => 'content_height', - 'backend_type' => 'varchar', - 'is_required' => '', - 'default_value' => '', - 'input' => '', - ]; - - protected $checkbox_text = [ - 'attribute_code' => 'checkbox_text', - 'backend_type' => 'text', - 'is_required' => '', - 'default_value' => '', - 'input' => '', - ]; - - protected $is_active = [ - 'attribute_code' => 'is_active', - 'backend_type' => 'smallint', - 'is_required' => '', - 'default_value' => '0', - 'input' => '', - ]; - - protected $is_html = [ - 'attribute_code' => 'is_html', - 'backend_type' => 'smallint', - 'is_required' => '', - 'default_value' => '0', - 'input' => '', - ]; - - protected $stores = [ - 'attribute_code' => 'store_ids', - 'backend_type' => 'virtual', - 'source' => 'Magento\CheckoutAgreements\Test\Fixture\CheckoutAgreement\Stores', - ]; - - public function getAgreementId() - { - return $this->getData('agreement_id'); - } - - public function getName() - { - return $this->getData('name'); - } - - public function getContent() - { - return $this->getData('content'); - } - - public function getContentHeight() - { - return $this->getData('content_height'); - } - - public function getCheckboxText() - { - return $this->getData('checkbox_text'); - } - - public function getIsActive() - { - return $this->getData('is_active'); - } - - public function getIsHtml() - { - return $this->getData('is_html'); - } - - public function getStores() - { - return $this->getData('stores'); - } -} diff --git a/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/Fixture/CheckoutAgreement.xml b/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/Fixture/CheckoutAgreement.xml deleted file mode 100644 index 045e2e2bc89d0..0000000000000 --- a/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/Fixture/CheckoutAgreement.xml +++ /dev/null @@ -1,73 +0,0 @@ - - - - Magento_CheckoutAgreements - flat - checkout_agreement - Magento\CheckoutAgreements\Model\Resource\Agreement\Collection - - - agreement_id - int - 1 - - - - - name - varchar - - - - - - content - text - - - - - - content_height - varchar - - - - - - checkbox_text - text - - - - - - is_active - smallint - - 0 - - - - is_html - smallint - - 0 - - - - store_ids - virtual - 1 - 0 - multiselectgrouplist - Magento\CheckoutAgreements\Test\Fixture\CheckoutAgreement\Stores - - - Magento\CheckoutAgreements\Test\Repository\Term - Magento\CheckoutAgreements\Test\Handler\Term\TermInterface - diff --git a/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/Fixture/CheckoutAgreement/Stores.php b/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/Fixture/CheckoutAgreement/Stores.php deleted file mode 100644 index 6443d9d34bc88..0000000000000 --- a/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/Fixture/CheckoutAgreement/Stores.php +++ /dev/null @@ -1,104 +0,0 @@ -params = $params; - if (isset($data['dataSet'])) { - foreach ($data['dataSet'] as $store) { - $store = $fixtureFactory->createByCode('store', ['dataSet' => $store]); - /** @var Store $store */ - if (!$store->getStoreId()) { - $store->persist(); - } - $this->stores[] = $store; - $this->data[] = $store->getGroupId() . '/' . $store->getName(); - } - } - } - - /** - * Persist stores - * - * @return void - */ - public function persist() - { - // - } - - /** - * Return prepared data set - * - * @param string|null $key [optional] - * @return mixed - * - * @SuppressWarnings(PHPMD.UnusedFormalParameter) - */ - public function getData($key = null) - { - return $this->data; - } - - /** - * Return data set configuration settings - * - * @return array - */ - public function getDataConfig() - { - return $this->params; - } - - /** - * Return array - * - * @return Store[] - */ - public function getStores() - { - return $this->stores; - } -} diff --git a/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/Handler/CheckoutAgreement/CheckoutAgreementInterface.php b/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/Handler/CheckoutAgreement/CheckoutAgreementInterface.php deleted file mode 100644 index cf158c782b487..0000000000000 --- a/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/Handler/CheckoutAgreement/CheckoutAgreementInterface.php +++ /dev/null @@ -1,16 +0,0 @@ - [ - 'Enabled' => 1, - 'Disabled' => 0, - ], - 'is_html' => [ - 'HTML' => 1, - 'Text' => 0, - ], - ]; - - /** - * Url for save checkout agreement - * - * @var string - */ - protected $url = 'checkout/agreement/save/'; - - /** - * Post request for creating new checkout agreement - * - * @param FixtureInterface|null $fixture - * @return array - * @throws \Exception - */ - public function persist(FixtureInterface $fixture = null) - { - $url = $_ENV['app_backend_url'] . $this->url; - $data = $this->prepareData($fixture); - $curl = new BackendDecorator(new CurlTransport(), new Config()); - $curl->write(CurlInterface::POST, $url, '1.1', [], $data); - $response = $curl->read(); - $curl->close(); - if (!strpos($response, 'data-ui-id="messages-message-success"')) { - throw new \Exception("Checkout agreement creating by curl handler was not successful! Response: $response"); - } - preg_match('~id\/(\d*?)\/~', $response, $matches); - $id = isset($matches[1]) ? $matches[1] : null; - - return ['agreement_id' => $id]; - } - - /** - * Prepare data - * - * @param FixtureInterface $fixture - * @return array - */ - protected function prepareData($fixture) - { - $data = []; - /** @var \Magento\CheckoutAgreements\Test\Fixture\CheckoutAgreement $fixture */ - $stores = $fixture->getDataFieldConfig('stores')['source']->getStores(); - foreach ($stores as $store) { - /** @var \Magento\Store\Test\Fixture\Store $store */ - $data['stores'][] = $store->getStoreId(); - } - $data = $this->replaceMappingData(array_merge($fixture->getData(), $data)); - - return $data; - } -} diff --git a/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/Page/Adminhtml/CheckoutAgreementIndex.xml b/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/Page/Adminhtml/CheckoutAgreementIndex.xml deleted file mode 100644 index 5e7d392702f91..0000000000000 --- a/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/Page/Adminhtml/CheckoutAgreementIndex.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - Magento\Core\Test\Block\Messages - #messages - css selector - - - Magento\Backend\Test\Block\GridPageActions - .page-main-actions - css selector - - - Magento\CheckoutAgreements\Test\Block\Adminhtml\AgreementGrid - #agreementGrid - css selector - - - diff --git a/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/Page/Adminhtml/CheckoutAgreementNew.xml b/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/Page/Adminhtml/CheckoutAgreementNew.xml deleted file mode 100644 index 01520514fda37..0000000000000 --- a/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/Page/Adminhtml/CheckoutAgreementNew.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - Magento\Backend\Test\Block\FormPageActions - .page-main-actions - css selector - - - Magento\CheckoutAgreements\Test\Block\Adminhtml\Block\Agreement\Edit\AgreementsForm - #edit_form - css selector - - - diff --git a/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/Page/CheckoutOnepage.xml b/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/Page/CheckoutOnepage.xml deleted file mode 100644 index 6b18c6de2c8d3..0000000000000 --- a/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/Page/CheckoutOnepage.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - Magento\CheckoutAgreements\Test\Block\Onepage\AgreementReview - #checkout-step-review - css selector - - - diff --git a/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/Repository/CheckoutAgreement.php b/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/Repository/CheckoutAgreement.php deleted file mode 100644 index 5018ca6a88451..0000000000000 --- a/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/Repository/CheckoutAgreement.php +++ /dev/null @@ -1,55 +0,0 @@ -_data['term_disabled_text'] = [ - 'name' => 'TermDisabledTextName%isolation%', - 'is_active' => 'Disabled', - 'is_html' => 'Text', - 'stores' => ['dataSet' => ['default']], - 'checkbox_text' => 'test_checkbox%isolation%', - 'content' => 'TestMessage%isolation%', - 'content_height' => '', - ]; - - $this->_data['term_disabled_html'] = [ - 'name' => 'TermDisabledHtml%isolation%', - 'is_active' => 'Disabled', - 'is_html' => 'HTML', - 'stores' => ['dataSet' => ['default']], - 'checkbox_text' => 'test_checkbox%isolation%', - 'content' => 'TestMessage%isolation%', - 'content_height' => '', - ]; - - $this->_data['term_enabled_text'] = [ - 'name' => 'TermEnabledTextName%isolation%', - 'is_active' => 'Enabled', - 'is_html' => 'Text', - 'stores' => ['dataSet' => ['default']], - 'checkbox_text' => 'test_checkbox%isolation%', - 'content' => 'TestMessage%isolation%', - 'content_height' => '', - ]; - } -} diff --git a/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/TestCase/CreateTermEntityTest.php b/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/TestCase/CreateTermEntityTest.php deleted file mode 100644 index fa3e9b3974b85..0000000000000 --- a/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/TestCase/CreateTermEntityTest.php +++ /dev/null @@ -1,83 +0,0 @@ - Configuration > Sales > Checkout > Checkout Options - * - * Steps: - * 1. Open Backend Stores > Terms and Conditions - * 2. Create new "Terms and Conditions" - * 3. Fill data from dataSet - * 4. Save - * 5. Perform all assertions - * - * @group Terms_and_Conditions_(CS) - * @ZephyrId MAGETWO-29586 - */ -class CreateTermEntityTest extends Injectable -{ - // TODO: Move set up configuration to "__prepare" method after fix bug MAGETWO-29331 - /** - * Set up configuration. - * - * @return void - */ - public function __inject() - { - $this->objectManager->create( - 'Magento\Core\Test\TestStep\SetupConfigurationStep', - ['configData' => 'checkout_term_condition'] - )->run(); - } - - /** - * Create Term Entity test. - * - * @param CheckoutAgreementNew $agreementNew - * @param CheckoutAgreementIndex $agreementIndex - * @param CheckoutAgreement $agreement - * @return void - */ - public function test( - CheckoutAgreementNew $agreementNew, - CheckoutAgreementIndex $agreementIndex, - CheckoutAgreement $agreement - ) { - // Steps - $agreementIndex->open(); - $agreementIndex->getPageActionsBlock()->addNew(); - $agreementNew->getAgreementsForm()->fill($agreement); - $agreementNew->getPageActionsBlock()->save(); - } - - /** - * Clear data after test. - * - * @return void - */ - public function tearDown() - { - $this->objectManager->create('Magento\CheckoutAgreements\Test\TestStep\DeleteAllTermsEntityStep')->run(); - - // TODO: Move set default configuration to "tearDownAfterClass" method after fix bug MAGETWO-29331 - ObjectManager::getInstance()->create( - 'Magento\Core\Test\TestStep\SetupConfigurationStep', - ['configData' => 'checkout_term_condition', 'rollback' => true] - )->run(); - } -} diff --git a/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/TestCase/CreateTermEntityTest/test.csv b/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/TestCase/CreateTermEntityTest/test.csv deleted file mode 100644 index 45ac149ca4243..0000000000000 --- a/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/TestCase/CreateTermEntityTest/test.csv +++ /dev/null @@ -1,5 +0,0 @@ -"product";"agreement/data/name";"agreement/data/is_active";"agreement/data/is_html";"agreement/data/stores/dataSet/0";"agreement/data/checkbox_text";"agreement/data/content";"shipping/shipping_service";"shipping/shipping_method";"payment/method";"constraint" -"catalogProductSimple::default";"name%isolation%";"Enabled";"Text";"default";"test_checkbox%isolation%";"TestMessage%isolation%";"Flat Rate";"Fixed";"checkmo";"assertTermSuccessSaveMessage, assertTermInGrid, assertTermOnCheckout" -"catalogProductSimple::default";"name%isolation%";"Enabled";"HTML";"default";"test_checkbox%isolation%";"";"Flat Rate";"Fixed";"checkmo";"assertTermSuccessSaveMessage, assertTermInGrid, assertTermOnCheckout" -"catalogProductSimple::default";"name%isolation%";"Enabled";"Text";"default";"test_checkbox%isolation%";"TestMessage%isolation%";"Flat Rate";"Fixed";"checkmo";"assertTermSuccessSaveMessage, assertTermInGrid, assertTermOnCheckout" -"catalogProductSimple::default";"name%isolation%";"Disabled";"Text";"default";"test_checkbox%isolation%";"TestMessage%isolation%";"Flat Rate";"Fixed";"checkmo";"assertTermSuccessSaveMessage, assertTermInGrid, assertTermAbsentOnCheckout" diff --git a/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/TestCase/DeleteTermEntityTest.php b/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/TestCase/DeleteTermEntityTest.php deleted file mode 100644 index bbc1f97d43cbd..0000000000000 --- a/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/TestCase/DeleteTermEntityTest.php +++ /dev/null @@ -1,98 +0,0 @@ - Configuration > Sales > Checkout > Checkout Options - * 2. Create term according to dataSet - * - * Steps: - * 1. Open Backend Stores > Terms and Conditions - * 2. Open created Term from preconditions - * 3. Click on 'Delete' button - * 4. Perform all assertions - * - * @group Terms_and_Conditions_(CS) - * @ZephyrId MAGETWO-29687 - */ -class DeleteTermEntityTest extends Injectable -{ - /** - * Checkout agreement index page. - * - * @var CheckoutAgreementIndex - */ - protected $agreementIndex; - - /** - * Checkout agreement new page. - * - * @var CheckoutAgreementNew - */ - protected $agreementNew; - - /** - * Inject data. - * - * @param CheckoutAgreementNew $agreementNew - * @param CheckoutAgreementIndex $agreementIndex - * @return void - */ - public function __inject( - CheckoutAgreementNew $agreementNew, - CheckoutAgreementIndex $agreementIndex - ) { - $this->agreementNew = $agreementNew; - $this->agreementIndex = $agreementIndex; - - // TODO: Move set up configuration to "__prepare" method after fix bug MAGETWO-29331 - $this->objectManager->create( - 'Magento\Core\Test\TestStep\SetupConfigurationStep', - ['configData' => 'checkout_term_condition'] - )->run(); - } - - /** - * Delete Term Entity test. - * - * @param CheckoutAgreement $agreement - * @return void - */ - public function test(CheckoutAgreement $agreement) - { - // Precondition - $agreement->persist(); - - // Steps - $this->agreementIndex->open()->getAgreementGridBlock()->searchAndOpen(['name' => $agreement->getName()]); - $this->agreementNew->getPageActionsBlock()->delete(); - } - - // TODO: Move set default configuration to "tearDownAfterClass" method after fix bug MAGETWO-29331 - /** - * Set default configuration. - * - * @return void - */ - public function tearDown() - { - ObjectManager::getInstance()->create( - 'Magento\Core\Test\TestStep\SetupConfigurationStep', - ['configData' => 'checkout_term_condition', 'rollback' => true] - )->run(); - } -} diff --git a/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/TestCase/DeleteTermEntityTest/test.csv b/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/TestCase/DeleteTermEntityTest/test.csv deleted file mode 100644 index 6824357498e27..0000000000000 --- a/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/TestCase/DeleteTermEntityTest/test.csv +++ /dev/null @@ -1,2 +0,0 @@ -"product";"agreement/dataSet";"shipping/shipping_service";"shipping/shipping_method";"payment/method";"constraint" -"catalogProductSimple::default";"term_enabled_text";"Flat Rate";"Fixed";"checkmo";"assertTermSuccessDeleteMessage, assertTermAbsentInGrid, assertTermAbsentOnCheckout" diff --git a/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/TestCase/UpdateTermEntityTest.php b/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/TestCase/UpdateTermEntityTest.php deleted file mode 100644 index dbbb0c0b75b28..0000000000000 --- a/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/TestCase/UpdateTermEntityTest.php +++ /dev/null @@ -1,89 +0,0 @@ - Configuration > Sales > Checkout > Checkout Options - * 2. Create term according to dataSet - * - * Steps: - * 1. Open Backend Stores > Terms and Conditions - * 2. Open created Term from preconditions - * 3. Fill data from dataSet - * 4. Save - * 5. Perform all assertions - * - * @group Terms_and_Conditions_(CS) - * @ZephyrId MAGETWO-29635 - */ -class UpdateTermEntityTest extends Injectable -{ - // TODO: Move set up configuration to "__prepare" method after fix bug MAGETWO-29331 - /** - * Set up configuration. - * - * @return void - */ - public function __inject() - { - $this->objectManager->create( - 'Magento\Core\Test\TestStep\SetupConfigurationStep', - ['configData' => 'checkout_term_condition'] - )->run(); - } - - /** - * Update Term Entity test. - * - * @param CheckoutAgreementNew $agreementNew - * @param CheckoutAgreementIndex $agreementIndex - * @param CheckoutAgreement $agreement - * @param CheckoutAgreement $agreementOrigin - * @return void - */ - public function test( - CheckoutAgreementNew $agreementNew, - CheckoutAgreementIndex $agreementIndex, - CheckoutAgreement $agreement, - CheckoutAgreement $agreementOrigin - ) { - // Precondition - $agreementOrigin->persist(); - - // Steps - $agreementIndex->open(); - $agreementIndex->getAgreementGridBlock()->searchAndOpen(['name' => $agreementOrigin->getName()]); - $agreementNew->getAgreementsForm()->fill($agreement); - $agreementNew->getPageActionsBlock()->save(); - } - - /** - * Clear data after test. - * - * @return void - */ - public function tearDown() - { - $this->objectManager->create('Magento\CheckoutAgreements\Test\TestStep\DeleteAllTermsEntityStep')->run(); - - // TODO: Move set default configuration to "tearDownAfterClass" method after fix bug MAGETWO-29331 - ObjectManager::getInstance()->create( - 'Magento\Core\Test\TestStep\SetupConfigurationStep', - ['configData' => 'checkout_term_condition', 'rollback' => true] - )->run(); - } -} diff --git a/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/TestCase/UpdateTermEntityTest/test.csv b/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/TestCase/UpdateTermEntityTest/test.csv deleted file mode 100644 index 5c9fa47f3d824..0000000000000 --- a/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/TestCase/UpdateTermEntityTest/test.csv +++ /dev/null @@ -1,4 +0,0 @@ -"product";"agreementOrigin/dataSet";"agreement/data/name";"agreement/data/is_active";"agreement/data/is_html";"agreement/data/stores/dataSet/0";"agreement/data/checkbox_text";"agreement/data/content";"shipping/shipping_service";"shipping/shipping_method";"payment/method";"constraint" -"catalogProductSimple::default";"term_disabled_text";"name%isolation%";"Enabled";"HTML";"default";"test_checkbox%isolation%";"TestMessage%isolation%";"Flat Rate";"Fixed";"checkmo";"assertTermSuccessSaveMessage, assertTermInGrid, assertTermOnCheckout" -"catalogProductSimple::default";"term_disabled_html";"name%isolation%";"Enabled";"Text";"default";"test_checkbox%isolation%";"";"Flat Rate";"Fixed";"checkmo";"assertTermSuccessSaveMessage, assertTermInGrid, assertTermOnCheckout" -"catalogProductSimple::default";"term_enabled_text";"name%isolation%";"Disabled";"HTML";"default";"test_checkbox%isolation%";"TestMessage%isolation%";"Flat Rate";"Fixed";"checkmo";"assertTermSuccessSaveMessage, assertTermInGrid, assertTermAbsentOnCheckout" diff --git a/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/TestStep/DeleteAllTermsEntityStep.php b/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/TestStep/DeleteAllTermsEntityStep.php deleted file mode 100644 index 48c27bf65a3e9..0000000000000 --- a/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/TestStep/DeleteAllTermsEntityStep.php +++ /dev/null @@ -1,59 +0,0 @@ -agreementNew = $agreementNew; - $this->agreementIndex = $agreementIndex; - } - - /** - * Delete terms on backend - * - * @return void - */ - public function run() - { - $this->agreementIndex->open(); - while ($this->agreementIndex->getAgreementGridBlock()->isFirstRowVisible()) { - $this->agreementIndex->getAgreementGridBlock()->openFirstRow(); - $this->agreementNew->getPageActionsBlock()->delete(); - } - } -} diff --git a/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/etc/constraint.xml b/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/etc/constraint.xml deleted file mode 100644 index 2ef9a4714aa9e..0000000000000 --- a/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/etc/constraint.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - low - - - low - - - low - - - low - - - low - - - low - - diff --git a/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/etc/curl/di.xml b/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/etc/curl/di.xml deleted file mode 100644 index d788da104b3f7..0000000000000 --- a/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/etc/curl/di.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - diff --git a/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/etc/fixture.xml b/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/etc/fixture.xml deleted file mode 100644 index e8f8c41fc0fef..0000000000000 --- a/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/etc/fixture.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - flat - checkout_agreement - Magento\CheckoutAgreements\Model\Resource\Agreement\Collection - - diff --git a/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/etc/page.xml b/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/etc/page.xml deleted file mode 100644 index cb4ecb0e12b09..0000000000000 --- a/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/etc/page.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - checkout/agreement/index - adminhtml - Magento\CheckoutAgreements\Test\Page\Adminhtml\CheckoutAgreementIndex - - - checkout/agreement/new - adminhtml - Magento\CheckoutAgreements\Test\Page\Adminhtml\CheckoutAgreementNew - - diff --git a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Constraint/AssertChildProductIsNotDisplayedSeparately.php b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Constraint/AssertChildProductIsNotDisplayedSeparately.php index e3b2228f619a8..51b56ffe5da6f 100644 --- a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Constraint/AssertChildProductIsNotDisplayedSeparately.php +++ b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Constraint/AssertChildProductIsNotDisplayedSeparately.php @@ -16,12 +16,9 @@ */ class AssertChildProductIsNotDisplayedSeparately extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'middle'; + /* tags */ + const SEVERITY = 'middle'; + /* end tags */ /** * Assert that products generated during configurable product creation - are not visible on frontend(by default). diff --git a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Constraint/AssertChildProductsInGrid.php b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Constraint/AssertChildProductsInGrid.php index 8705104e198d4..7beb7d05683e4 100755 --- a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Constraint/AssertChildProductsInGrid.php +++ b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Constraint/AssertChildProductsInGrid.php @@ -15,18 +15,15 @@ */ class AssertChildProductsInGrid extends AbstractConstraint { + /* tags */ + const SEVERITY = 'low'; + /* end tags */ + /** * Default status visibility on child products */ const NOT_VISIBLE_INDIVIDUALLY = 'Not Visible Individually'; - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; - /** * Assert that child products generated during configurable product are present in products grid * diff --git a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Constraint/AssertConfigurableAttributesAbsentOnProductPage.php b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Constraint/AssertConfigurableAttributesAbsentOnProductPage.php index 4aee31a50d837..59a23c1e9e1f9 100644 --- a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Constraint/AssertConfigurableAttributesAbsentOnProductPage.php +++ b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Constraint/AssertConfigurableAttributesAbsentOnProductPage.php @@ -16,12 +16,9 @@ */ class AssertConfigurableAttributesAbsentOnProductPage extends AbstractConstraint { - /** - * Constraint severeness. - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that deleted configurable attributes are absent on product page on frontend. diff --git a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Constraint/AssertConfigurableAttributesBlockIsAbsentOnProductPage.php b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Constraint/AssertConfigurableAttributesBlockIsAbsentOnProductPage.php index 08c590daf1ec3..4c565a232550a 100644 --- a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Constraint/AssertConfigurableAttributesBlockIsAbsentOnProductPage.php +++ b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Constraint/AssertConfigurableAttributesBlockIsAbsentOnProductPage.php @@ -15,12 +15,9 @@ */ class AssertConfigurableAttributesBlockIsAbsentOnProductPage extends AbstractConstraint { - /** - * Constraint severeness. - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that all configurable attributes is absent on product page on frontend. diff --git a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Constraint/AssertConfigurableProductDuplicateForm.php b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Constraint/AssertConfigurableProductDuplicateForm.php index cfeb9d1b8e4da..4c6ea9e268ee9 100644 --- a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Constraint/AssertConfigurableProductDuplicateForm.php +++ b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Constraint/AssertConfigurableProductDuplicateForm.php @@ -10,20 +10,16 @@ use Mtf\Fixture\FixtureInterface; /** - * Class AssertConfigurableProductDuplicateForm - * Assert form data equals duplicate product configurable data + * Assert form data equals duplicate product configurable data. */ class AssertConfigurableProductDuplicateForm extends AssertConfigurableProductForm { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** - * Assert form data equals duplicate product configurable data + * Assert form data equals duplicate product configurable data. * * @param FixtureInterface $product * @param CatalogProductIndex $productGrid @@ -50,7 +46,33 @@ public function processAssert( } /** - * Returns a string representation of the object + * Prepares fixture data for comparison. + * + * @param array $data + * @param array $sortFields [optional] + * @return array + */ + protected function prepareFixtureData(array $data, array $sortFields = []) + { + $data['url_key'] = $this->prepareUrlKey($data['url_key']); + return parent::prepareFixtureData($data, $sortFields); + } + + /** + * Prepare url key. + * + * @param string $urlKey + * @return string + */ + protected function prepareUrlKey($urlKey) + { + preg_match("~\d+$~", $urlKey, $matches); + $key = intval($matches[0]) + 1; + return str_replace($matches[0], $key, $urlKey); + } + + /** + * Returns a string representation of the object. * * @return string */ diff --git a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Constraint/AssertConfigurableProductForm.php b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Constraint/AssertConfigurableProductForm.php index a7de0406e861e..840dd0a6f9f80 100755 --- a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Constraint/AssertConfigurableProductForm.php +++ b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Constraint/AssertConfigurableProductForm.php @@ -13,6 +13,10 @@ */ class AssertConfigurableProductForm extends AssertProductForm { + /* tags */ + const SEVERITY = 'high'; + /* end tags */ + /** * List skipped fixture fields in verify * @@ -56,13 +60,6 @@ class AssertConfigurableProductForm extends AssertProductForm 'configurable_attribute', ]; - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'high'; - /** * Prepares fixture data for comparison * diff --git a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Constraint/AssertProductAttributeAbsenceInVariationsSearch.php b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Constraint/AssertProductAttributeAbsenceInVariationsSearch.php index 6d7eb4257b510..dde6688d19a5d 100644 --- a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Constraint/AssertProductAttributeAbsenceInVariationsSearch.php +++ b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Constraint/AssertProductAttributeAbsenceInVariationsSearch.php @@ -18,18 +18,15 @@ */ class AssertProductAttributeAbsenceInVariationsSearch extends AbstractConstraint { + /* tags */ + const SEVERITY = 'low'; + /* end tags */ + /** * Label "Variations" tab */ const TAB_VARIATIONS = 'variations'; - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; - /** * Assert that deleted attribute can't be added to product template on Product Page via Add Attribute control * diff --git a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Constraint/AssertProductAttributeIsConfigurable.php b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Constraint/AssertProductAttributeIsConfigurable.php index d2beabb26f30c..8e75bb524c611 100644 --- a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Constraint/AssertProductAttributeIsConfigurable.php +++ b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Constraint/AssertProductAttributeIsConfigurable.php @@ -16,12 +16,9 @@ */ class AssertProductAttributeIsConfigurable extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'high'; + /* tags */ + const SEVERITY = 'high'; + /* end tags */ /** * Assert check whether the attribute is used to create a configurable products. diff --git a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/etc/constraint.xml b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/etc/constraint.xml index 57573eab9f0b9..afba8d58b2c35 100644 --- a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/etc/constraint.xml +++ b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/etc/constraint.xml @@ -6,39 +6,39 @@ --> - low + low - high + high - middle + middle - low + low - low + low - low + low - high + high - low + low - high + high - low + low - low + low - low + low diff --git a/dev/tests/functional/tests/app/Magento/Core/Test/Constraint/AssertCustomVariableForm.php b/dev/tests/functional/tests/app/Magento/Core/Test/Constraint/AssertCustomVariableForm.php index e58d3903ec42d..5eb80ff77d1d9 100644 --- a/dev/tests/functional/tests/app/Magento/Core/Test/Constraint/AssertCustomVariableForm.php +++ b/dev/tests/functional/tests/app/Magento/Core/Test/Constraint/AssertCustomVariableForm.php @@ -17,12 +17,9 @@ */ class AssertCustomVariableForm extends AbstractAssertForm { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Skipped fields for verify data diff --git a/dev/tests/functional/tests/app/Magento/Core/Test/Constraint/AssertCustomVariableInGrid.php b/dev/tests/functional/tests/app/Magento/Core/Test/Constraint/AssertCustomVariableInGrid.php index d389eb798b6a8..56e36a60aeaa9 100644 --- a/dev/tests/functional/tests/app/Magento/Core/Test/Constraint/AssertCustomVariableInGrid.php +++ b/dev/tests/functional/tests/app/Magento/Core/Test/Constraint/AssertCustomVariableInGrid.php @@ -16,12 +16,9 @@ */ class AssertCustomVariableInGrid extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert custom variable is displayed on backend in custom variable grid diff --git a/dev/tests/functional/tests/app/Magento/Core/Test/Constraint/AssertCustomVariableInPage.php b/dev/tests/functional/tests/app/Magento/Core/Test/Constraint/AssertCustomVariableInPage.php index 5a3cab10ee50a..62b2df94d024b 100644 --- a/dev/tests/functional/tests/app/Magento/Core/Test/Constraint/AssertCustomVariableInPage.php +++ b/dev/tests/functional/tests/app/Magento/Core/Test/Constraint/AssertCustomVariableInPage.php @@ -17,12 +17,9 @@ */ class AssertCustomVariableInPage extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Add created variable to page and assert that Custom Variable is displayed on frontend page and has diff --git a/dev/tests/functional/tests/app/Magento/Core/Test/Constraint/AssertCustomVariableNotInCmsPageForm.php b/dev/tests/functional/tests/app/Magento/Core/Test/Constraint/AssertCustomVariableNotInCmsPageForm.php index 2597200cfe38e..0eb9acb770eca 100644 --- a/dev/tests/functional/tests/app/Magento/Core/Test/Constraint/AssertCustomVariableNotInCmsPageForm.php +++ b/dev/tests/functional/tests/app/Magento/Core/Test/Constraint/AssertCustomVariableNotInCmsPageForm.php @@ -14,12 +14,9 @@ */ class AssertCustomVariableNotInCmsPageForm extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that custom system variable not in cms page form diff --git a/dev/tests/functional/tests/app/Magento/Core/Test/Constraint/AssertCustomVariableNotInGrid.php b/dev/tests/functional/tests/app/Magento/Core/Test/Constraint/AssertCustomVariableNotInGrid.php index 9f07e5912f745..130d940682d2f 100644 --- a/dev/tests/functional/tests/app/Magento/Core/Test/Constraint/AssertCustomVariableNotInGrid.php +++ b/dev/tests/functional/tests/app/Magento/Core/Test/Constraint/AssertCustomVariableNotInGrid.php @@ -14,12 +14,9 @@ */ class AssertCustomVariableNotInGrid extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert Custom System Variable not available in System Variable grid diff --git a/dev/tests/functional/tests/app/Magento/Core/Test/Constraint/AssertCustomVariableSuccessDeleteMessage.php b/dev/tests/functional/tests/app/Magento/Core/Test/Constraint/AssertCustomVariableSuccessDeleteMessage.php index 79df2412d06f2..c33b618a4e0e0 100644 --- a/dev/tests/functional/tests/app/Magento/Core/Test/Constraint/AssertCustomVariableSuccessDeleteMessage.php +++ b/dev/tests/functional/tests/app/Magento/Core/Test/Constraint/AssertCustomVariableSuccessDeleteMessage.php @@ -13,14 +13,11 @@ */ class AssertCustomVariableSuccessDeleteMessage extends AbstractConstraint { - const SUCCESS_DELETE_MESSAGE = 'You deleted the custom variable.'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + const SUCCESS_DELETE_MESSAGE = 'You deleted the custom variable.'; /** * Assert that success delete message is correct after Custom System Variable deleted diff --git a/dev/tests/functional/tests/app/Magento/Core/Test/Constraint/AssertCustomVariableSuccessSaveMessage.php b/dev/tests/functional/tests/app/Magento/Core/Test/Constraint/AssertCustomVariableSuccessSaveMessage.php index 24480eb498402..2583597add05b 100644 --- a/dev/tests/functional/tests/app/Magento/Core/Test/Constraint/AssertCustomVariableSuccessSaveMessage.php +++ b/dev/tests/functional/tests/app/Magento/Core/Test/Constraint/AssertCustomVariableSuccessSaveMessage.php @@ -14,14 +14,11 @@ */ class AssertCustomVariableSuccessSaveMessage extends AbstractConstraint { - const SUCCESS_SAVE_MESSAGE = 'You saved the custom variable.'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + const SUCCESS_SAVE_MESSAGE = 'You saved the custom variable.'; /** * Assert that success delete message is correct after Custom System Variable deleted diff --git a/dev/tests/functional/tests/app/Magento/Core/Test/Fixture/ConfigData.php b/dev/tests/functional/tests/app/Magento/Core/Test/Fixture/ConfigData.php new file mode 100644 index 0000000000000..df2cc4e9d7ec4 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Core/Test/Fixture/ConfigData.php @@ -0,0 +1,103 @@ + 'section', + 'backend_type' => 'virtual', + ]; + + protected $config_id = [ + 'attribute_code' => 'config_id', + 'backend_type' => 'int', + 'is_required' => '1', + 'default_value' => '', + 'input' => '', + ]; + + protected $scope = [ + 'attribute_code' => 'scope', + 'backend_type' => 'varchar', + 'is_required' => '', + 'default_value' => 'default', + 'input' => '', + ]; + + protected $scope_id = [ + 'attribute_code' => 'scope_id', + 'backend_type' => 'int', + 'is_required' => '', + 'default_value' => '0', + 'input' => '', + ]; + + protected $path = [ + 'attribute_code' => 'path', + 'backend_type' => 'varchar', + 'is_required' => '', + 'default_value' => 'general', + 'input' => '', + ]; + + protected $value = [ + 'attribute_code' => 'value', + 'backend_type' => 'text', + 'is_required' => '', + 'default_value' => '', + 'input' => '', + ]; + + public function getSection() + { + return $this->getData('section'); + } + + public function getConfigId() + { + return $this->getData('config_id'); + } + + public function getScope() + { + return $this->getData('scope'); + } + + public function getScopeId() + { + return $this->getData('scope_id'); + } + + public function getPath() + { + return $this->getData('path'); + } + + public function getValue() + { + return $this->getData('value'); + } +} diff --git a/dev/tests/functional/tests/app/Magento/Core/Test/Fixture/ConfigData.xml b/dev/tests/functional/tests/app/Magento/Core/Test/Fixture/ConfigData.xml new file mode 100644 index 0000000000000..efde4b4e8547c --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Core/Test/Fixture/ConfigData.xml @@ -0,0 +1,55 @@ + + + + Magento_Core + flat + core_config_data + Magento\Core\Model\Resource\Config\Data\Collection + +
+ section + virtual +
+ + config_id + int + 1 + + + + + scope + varchar + + default + + + + scope_id + int + + 0 + + + + path + varchar + + general + + + + value + text + + + + +
+ Magento\Core\Test\Repository\ConfigData + Magento\Core\Test\Handler\ConfigData\ConfigDataInterface +
diff --git a/dev/tests/functional/tests/app/Magento/Core/Test/Fixture/SystemVariable.php b/dev/tests/functional/tests/app/Magento/Core/Test/Fixture/SystemVariable.php new file mode 100644 index 0000000000000..ecccbf7075f26 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Core/Test/Fixture/SystemVariable.php @@ -0,0 +1,128 @@ + 'variableCode%isolation%', + 'name' => 'variableName%isolation%', + 'html_value' => "

html_value

", + 'plain_value' => 'plain_value', + ]; + + protected $variable_id = [ + 'attribute_code' => 'variable_id', + 'backend_type' => 'int', + 'is_required' => '', + 'default_value' => '0', + 'input' => '', + ]; + + protected $code = [ + 'attribute_code' => 'code', + 'backend_type' => 'varchar', + 'is_required' => '', + 'default_value' => '', + 'input' => '', + ]; + + protected $name = [ + 'attribute_code' => 'name', + 'backend_type' => 'varchar', + 'is_required' => '', + 'default_value' => '', + 'input' => '', + ]; + + protected $value_id = [ + 'attribute_code' => 'value_id', + 'backend_type' => 'int', + 'is_required' => '1', + 'default_value' => '', + 'input' => '', + ]; + + protected $store_id = [ + 'attribute_code' => 'store_id', + 'backend_type' => 'smallint', + 'is_required' => '', + 'default_value' => '0', + 'input' => '', + ]; + + protected $plain_value = [ + 'attribute_code' => 'plain_value', + 'backend_type' => 'text', + 'is_required' => '', + 'default_value' => '', + 'input' => '', + ]; + + protected $html_value = [ + 'attribute_code' => 'html_value', + 'backend_type' => 'text', + 'is_required' => '', + 'default_value' => '', + 'input' => '', + ]; + + protected $use_default_value = [ + 'attribute_code' => 'use_default_value', + 'backend_type' => 'virtual', + 'input' => 'select', + ]; + + public function getVariableId() + { + return $this->getData('variable_id'); + } + + public function getCode() + { + return $this->getData('code'); + } + + public function getName() + { + return $this->getData('name'); + } + + public function getValueId() + { + return $this->getData('value_id'); + } + + public function getStoreId() + { + return $this->getData('store_id'); + } + + public function getPlainValue() + { + return $this->getData('plain_value'); + } + + public function getHtmlValue() + { + return $this->getData('html_value'); + } + + public function getUseDefaultValue() + { + return $this->getData('use_default_value'); + } +} diff --git a/dev/tests/functional/tests/app/Magento/Core/Test/Fixture/SystemVariable.xml b/dev/tests/functional/tests/app/Magento/Core/Test/Fixture/SystemVariable.xml new file mode 100644 index 0000000000000..aceef486e57ed --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Core/Test/Fixture/SystemVariable.xml @@ -0,0 +1,72 @@ + + + + Magento_Core + composite + + core_variable + core_variable_value + + Magento\Core\Model\Resource\Variable\Collection + + + variable_id + int + + 0 + + + + code + varchar + + + + + + name + varchar + + + + + + value_id + int + 1 + + + + + store_id + smallint + + 0 + + + + plain_value + text + + + + + + html_value + text + + + + + + use_default_value + virtual + select + + + Magento\Core\Test\Handler\SystemVariable\SystemVariableInterface + diff --git a/dev/tests/functional/tests/app/Magento/Core/Test/Handler/ConfigData/ConfigDataInterface.php b/dev/tests/functional/tests/app/Magento/Core/Test/Handler/ConfigData/ConfigDataInterface.php new file mode 100644 index 0000000000000..4fbeb63b13780 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Core/Test/Handler/ConfigData/ConfigDataInterface.php @@ -0,0 +1,16 @@ + [ + 'Website' => 'website', + 'Store' => 'group', + 'Store View' => 'store', + ], + ]; + + /** + * Post request for setting configuration + * + * @param FixtureInterface|null $fixture [optional] + * @return void + */ + public function persist(FixtureInterface $fixture = null) + { + $data = $this->prepareData($fixture); + foreach ($data as $scope => $item) { + $this->applyConfigSettings($item, $scope); + } + } + + /** + * Prepare POST data for setting configuration + * + * @param FixtureInterface $fixture + * @return array + */ + protected function prepareData(FixtureInterface $fixture) + { + $result = []; + $fields = $fixture->getData(); + if (isset($fields['section'])) { + foreach ($fields['section'] as $itemSection) { + list($scope, $group, $field) = explode('/', $itemSection['path']); + $value = isset($this->mappingData[$field]) + ? $this->mappingData[$field][$itemSection['value']] + : $itemSection['value']; + $result[$scope]['groups'][$group]['fields'][$field]['value'] = $value; + } + } + return $result; + } + + /** + * Apply config settings via curl + * + * @param array $data + * @param string $section + * @throws \Exception + */ + protected function applyConfigSettings(array $data, $section) + { + $url = $this->getUrl($section); + $curl = new BackendDecorator(new CurlTransport(), new Config()); + $curl->addOption(CURLOPT_HEADER, 1); + $curl->write(CurlInterface::POST, $url, '1.0', [], $data); + $response = $curl->read(); + $curl->close(); + + if (strpos($response, 'data-ui-id="messages-message-success"') === false) { + throw new \Exception("Settings are not applied! Response: $response"); + } + } + + /** + * Retrieve URL for request + * + * @param string $section + * @return string + */ + protected function getUrl($section) + { + return $_ENV['app_backend_url'] . 'admin/system_config/save/section/' . $section; + } +} diff --git a/dev/tests/functional/tests/app/Magento/Core/Test/Handler/SystemVariable/Curl.php b/dev/tests/functional/tests/app/Magento/Core/Test/Handler/SystemVariable/Curl.php new file mode 100644 index 0000000000000..2d92b0698bdd4 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Core/Test/Handler/SystemVariable/Curl.php @@ -0,0 +1,47 @@ +getData(); + + $url = $_ENV['app_backend_url'] . 'admin/system_variable/save/back/edit/'; + $curl = new BackendDecorator(new CurlTransport(), new Config()); + $curl->addOption(CURLOPT_HEADER, 1); + $curl->write(CurlInterface::POST, $url, '1.0', [], $data); + $response = $curl->read(); + $curl->close(); + + if (!strpos($response, 'data-ui-id="messages-message-success"')) { + throw new \Exception("System Variable creation by curl handler was not successful! Response: $response"); + } + + preg_match("~Location: [^\\s]*system_variable\\/edit\\/variable_id\\/(\\d+)~", $response, $matches); + $id = isset($matches[1]) ? $matches[1] : null; + return ['variable_id' => $id]; + } +} diff --git a/dev/tests/functional/tests/app/Magento/Core/Test/Handler/SystemVariable/SystemVariableInterface.php b/dev/tests/functional/tests/app/Magento/Core/Test/Handler/SystemVariable/SystemVariableInterface.php new file mode 100644 index 0000000000000..d873b4e63b2b5 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Core/Test/Handler/SystemVariable/SystemVariableInterface.php @@ -0,0 +1,16 @@ +_data['custom_variable'] = [ + 'variable[code]' => 'variableCode%isolation%', + 'variable[name]' => 'variableName%isolation%', + 'variable[html_value]' => "

variableName%isolation%

", + 'variable[plain_value]' => 'variableName%isolation%', + ]; + } +} diff --git a/dev/tests/functional/tests/app/Magento/Core/Test/TestCase/CreateCustomVariableEntityTest.php b/dev/tests/functional/tests/app/Magento/Core/Test/TestCase/CreateCustomVariableEntityTest.php deleted file mode 100644 index d9fc36ff9f3a6..0000000000000 --- a/dev/tests/functional/tests/app/Magento/Core/Test/TestCase/CreateCustomVariableEntityTest.php +++ /dev/null @@ -1,73 +0,0 @@ -Other Settings->Custom Variables. - * 3. Click on 'Add new variable' button. - * 4. Fill in all data according to data set. - * 5. Click 'Save' button. - * 6. Perform all asserts. - * - * @group Variables_(PS) - * @ZephyrId MAGETWO-23293 - */ -class CreateCustomVariableEntityTest extends Injectable -{ - /** - * Custom System Variable grid page - * - * @var SystemVariableIndex - */ - protected $systemVariableIndexPage; - - /** - * Custom System Variable new and edit page - * - * @var SystemVariableNew - */ - protected $systemVariableNewPage; - - /** - * Injection data - * - * @param SystemVariableIndex $systemVariableIndex - * @param SystemVariableNew $systemVariableNew - * @return void - */ - public function __inject( - SystemVariableIndex $systemVariableIndex, - SystemVariableNew $systemVariableNew - ) { - $this->systemVariableIndexPage = $systemVariableIndex; - $this->systemVariableNewPage = $systemVariableNew; - } - - /** - * Delete Custom System Variable Entity test - * - * @param SystemVariable $customVariable - * @return void - */ - public function test(SystemVariable $customVariable) - { - // Steps - $this->systemVariableIndexPage->open(); - $this->systemVariableIndexPage->getGridPageActions()->addNew(); - $this->systemVariableNewPage->getSystemVariableForm()->fill($customVariable); - $this->systemVariableNewPage->getFormPageActions()->save(); - } -} diff --git a/dev/tests/functional/tests/app/Magento/Core/Test/TestCase/CreateCustomVariableEntityTest/test.csv b/dev/tests/functional/tests/app/Magento/Core/Test/TestCase/CreateCustomVariableEntityTest/test.csv deleted file mode 100644 index 6808d297faf51..0000000000000 --- a/dev/tests/functional/tests/app/Magento/Core/Test/TestCase/CreateCustomVariableEntityTest/test.csv +++ /dev/null @@ -1,3 +0,0 @@ -"customVariable/data/code";"customVariable/data/name";"customVariable/data/html_value";"customVariable/data/plain_value";"constraint" -"variableCode%isolation%";"variableName%isolation%";"

variableName%isolation%

";"

variablePlainText%isolation%

";"assertCustomVariableSuccessSaveMessage, assertCustomVariableInGrid, assertCustomVariableForm, assertCustomVariableInPage" -"variableCode%isolation%";"variableName%isolation%";"

variableName%isolation%

";"variablePlainText%isolation%";"assertCustomVariableSuccessSaveMessage, assertCustomVariableInGrid, assertCustomVariableForm, assertCustomVariableInPage" \ No newline at end of file diff --git a/dev/tests/functional/tests/app/Magento/Core/Test/TestCase/DeleteCustomVariableEntityTest.php b/dev/tests/functional/tests/app/Magento/Core/Test/TestCase/DeleteCustomVariableEntityTest.php deleted file mode 100644 index 304e9d50c97ee..0000000000000 --- a/dev/tests/functional/tests/app/Magento/Core/Test/TestCase/DeleteCustomVariableEntityTest.php +++ /dev/null @@ -1,81 +0,0 @@ -Other Settings->Custom Variables. - * 3. Open Variable. - * 4. Click 'Delete' button. - * 5. Perform asserts. - * - * @group Variables_(PS) - * @ZephyrId MAGETWO-25535 - */ -class DeleteCustomVariableEntityTest extends Injectable -{ - /** - * Custom System Variable grid page - * - * @var SystemVariableIndex - */ - protected $systemVariableIndexPage; - - /** - * Custom System Variable new and edit page - * - * @var SystemVariableNew - */ - protected $systemVariableNewPage; - - /** - * Injection data - * - * @param SystemVariableIndex $systemVariableIndex - * @param SystemVariableNew $systemVariableNew - * @return void - */ - public function __inject( - SystemVariableIndex $systemVariableIndex, - SystemVariableNew $systemVariableNew - ) { - $this->systemVariableIndexPage = $systemVariableIndex; - $this->systemVariableNewPage = $systemVariableNew; - } - - /** - * Delete Custom System Variable Entity test - * - * @param SystemVariable $systemVariable - * @return void - */ - public function test(SystemVariable $systemVariable) - { - // Precondition - $systemVariable->persist(); - - // Steps - $filter = [ - 'code' => $systemVariable->getCode(), - 'name' => $systemVariable->getName(), - ]; - $this->systemVariableIndexPage->open(); - $this->systemVariableIndexPage->getSystemVariableGrid()->searchAndOpen($filter); - $this->systemVariableNewPage->getFormPageActions()->delete(); - } -} diff --git a/dev/tests/functional/tests/app/Magento/Core/Test/TestCase/DeleteCustomVariableEntityTest/test.csv b/dev/tests/functional/tests/app/Magento/Core/Test/TestCase/DeleteCustomVariableEntityTest/test.csv deleted file mode 100644 index 250384c701b4c..0000000000000 --- a/dev/tests/functional/tests/app/Magento/Core/Test/TestCase/DeleteCustomVariableEntityTest/test.csv +++ /dev/null @@ -1,2 +0,0 @@ -"constraint" -"assertCustomVariableSuccessDeleteMessage, assertCustomVariableNotInGrid, assertCustomVariableNotInCmsPageForm" \ No newline at end of file diff --git a/dev/tests/functional/tests/app/Magento/Core/Test/TestCase/UpdateCustomVariableEntityTest.php b/dev/tests/functional/tests/app/Magento/Core/Test/TestCase/UpdateCustomVariableEntityTest.php deleted file mode 100644 index ef9ff97885bb2..0000000000000 --- a/dev/tests/functional/tests/app/Magento/Core/Test/TestCase/UpdateCustomVariableEntityTest.php +++ /dev/null @@ -1,140 +0,0 @@ -Other Settings->Custom Variables. - * 3. Open from grid created custom system variable. - * 4. Navigate to the Store Switcher. - * 5. Choose Appropriate Storeview (non default). - * 6. Set Use Default Variable Values. - * 7. Edit necessary fields. - * 8. Save Custom variable using correspond saveActions. - * 9. Perform all assertions. - * - * @group Variables_(PS) - * @ZephyrId MAGETWO-26104 - */ -class UpdateCustomVariableEntityTest extends Injectable -{ - /** - * Custom System Variable grid page - * - * @var SystemVariableIndex - */ - protected $systemVariableIndexPage; - - /** - * Custom System Variable new and edit page - * - * @var SystemVariableNew - */ - protected $systemVariableNewPage; - - /** - * Store Name - * - * @var array - */ - public static $storeName; - - /** - * Prepare data - * - * @param FixtureFactory $factory - * @return array - */ - public function __prepare(FixtureFactory $factory) - { - /** @var Store $storeOrigin */ - $storeOrigin = $factory->createByCode('store', ['dataSet' => 'custom']); - $storeOrigin->persist(); - self::$storeName = $storeOrigin->getName(); - - return ['storeOrigin' => $storeOrigin]; - } - - /** - * Injection data - * - * @param SystemVariableIndex $systemVariableIndex - * @param SystemVariableNew $systemVariableNew - * @param SystemVariable $customVariableOrigin - * @return array - */ - public function __inject( - SystemVariableIndex $systemVariableIndex, - SystemVariableNew $systemVariableNew, - SystemVariable $customVariableOrigin - ) { - $this->systemVariableIndexPage = $systemVariableIndex; - $this->systemVariableNewPage = $systemVariableNew; - - $customVariableOrigin->persist(); - - return ['customVariableOrigin' => $customVariableOrigin]; - } - - /** - * Update Custom System Variable Entity test - * - * @param SystemVariable $customVariable - * @param SystemVariable $customVariableOrigin - * @param Store $storeOrigin - * @param $saveAction - * @return void - */ - public function test( - SystemVariable $customVariable, - SystemVariable $customVariableOrigin, - Store $storeOrigin, - $saveAction - ) { - $filter = ['code' => $customVariableOrigin->getCode()]; - - // Steps - $this->systemVariableIndexPage->open(); - $this->systemVariableIndexPage->getSystemVariableGrid()->searchAndOpen($filter); - $this->systemVariableNewPage->getFormPageActions()->selectStoreView($storeOrigin->getData('name')); - $this->systemVariableNewPage->getSystemVariableForm()->fill($customVariable); - $this->systemVariableNewPage->getFormPageActions()->$saveAction(); - } - - /** - * Delete Store after test - * - * @return void - */ - public static function tearDownAfterClass() - { - $filter['store_title'] = self::$storeName; - $storeIndex = ObjectManager::getInstance()->create('Magento\Backend\Test\Page\Adminhtml\StoreIndex'); - $storeIndex->open(); - $storeIndex->getStoreGrid()->searchAndOpen($filter); - $storeNew = ObjectManager::getInstance()->create('Magento\Backend\Test\Page\Adminhtml\StoreNew'); - $storeNew->getFormPageActions()->delete(); - $storeDelete = ObjectManager::getInstance()->create('Magento\Backend\Test\Page\Adminhtml\StoreDelete'); - $storeDelete->getStoreForm()->fillForm(['create_backup' => 'No']); - $storeDelete->getFormPageFooterActions()->delete(); - } -} diff --git a/dev/tests/functional/tests/app/Magento/Core/Test/TestCase/UpdateCustomVariableEntityTest/test.csv b/dev/tests/functional/tests/app/Magento/Core/Test/TestCase/UpdateCustomVariableEntityTest/test.csv deleted file mode 100644 index da2cd79dfef66..0000000000000 --- a/dev/tests/functional/tests/app/Magento/Core/Test/TestCase/UpdateCustomVariableEntityTest/test.csv +++ /dev/null @@ -1,5 +0,0 @@ -"customVariable/data/code";"customVariable/data/name";"customVariable/data/use_default_value";"customVariable/data/html_value";"customVariable/data/plain_value";"saveAction";"constraint" -"variableCode%isolation%";"variableName%isolation%";"No";"

variableName%isolation%

";"";"save";"assertCustomVariableSuccessSaveMessage, assertCustomVariableInGrid, assertCustomVariableForm, assertCustomVariableInPage" -"variableCode%isolation%";"variableName%isolation%";"No";"";"

variablePlainText%isolation%

";"saveAndContinue";"assertCustomVariableSuccessSaveMessage, assertCustomVariableInGrid, assertCustomVariableForm, assertCustomVariableInPage" -"variableCode%isolation%";"variableName%isolation%";"No";"

variableName%isolation%

";"

variablePlainText%isolation%

";"saveAndContinue";"assertCustomVariableSuccessSaveMessage, assertCustomVariableInGrid, assertCustomVariableForm, assertCustomVariableInPage" -"variableCode%isolation%";"variableName%isolation%";"No";"

variableName%isolation%

";"

variablePlainText%isolation%

";"save";"assertCustomVariableSuccessSaveMessage, assertCustomVariableInGrid, assertCustomVariableInPage" diff --git a/dev/tests/functional/tests/app/Magento/Core/Test/TestStep/SetupConfigurationStep.php b/dev/tests/functional/tests/app/Magento/Core/Test/TestStep/SetupConfigurationStep.php deleted file mode 100644 index a61c5856d6adb..0000000000000 --- a/dev/tests/functional/tests/app/Magento/Core/Test/TestStep/SetupConfigurationStep.php +++ /dev/null @@ -1,78 +0,0 @@ -fixtureFactory = $fixtureFactory; - $this->configData = $configData; - $this->rollback = $rollback; - } - - /** - * Set config - * - * @return array - */ - public function run() - { - if ($this->configData === '-') { - return []; - } - $prefix = ($this->rollback == false) ? '' : '_rollback'; - - $configData = array_map('trim', explode(',', $this->configData)); - $result = []; - - foreach ($configData as $configDataSet) { - $config = $this->fixtureFactory->createByCode('configData', ['dataSet' => $configDataSet . $prefix]); - if ($config->hasData('section')) { - $config->persist(); - $result[] = $config; - } - } - - return ['config' => $result]; - } -} diff --git a/dev/tests/functional/tests/app/Magento/Core/Test/etc/constraint.xml b/dev/tests/functional/tests/app/Magento/Core/Test/etc/constraint.xml index 1e66bbe7ac451..9d55de2150388 100644 --- a/dev/tests/functional/tests/app/Magento/Core/Test/etc/constraint.xml +++ b/dev/tests/functional/tests/app/Magento/Core/Test/etc/constraint.xml @@ -6,27 +6,27 @@ --> - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/Block/Adminhtml/Edit/CustomerForm.xml b/dev/tests/functional/tests/app/Magento/Customer/Test/Block/Adminhtml/Edit/CustomerForm.xml index 8e4af46e3ba2d..edd9de53702cb 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/Block/Adminhtml/Edit/CustomerForm.xml +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/Block/Adminhtml/Edit/CustomerForm.xml @@ -27,7 +27,7 @@ \Magento\Customer\Test\Block\Adminhtml\Edit\Tab\Addresses - #customer_info_tabs_addresses + #tab_customer_address css selector diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/Block/Adminhtml/Edit/FormPageActions.php b/dev/tests/functional/tests/app/Magento/Customer/Test/Block/Adminhtml/Edit/FormPageActions.php index 697cd9bd57ac5..5d185b181e8c4 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/Block/Adminhtml/Edit/FormPageActions.php +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/Block/Adminhtml/Edit/FormPageActions.php @@ -29,4 +29,15 @@ public function createOrder() { $this->_rootElement->find($this->createOrderButton)->click(); } + + /** + * Wait for User before click on any Button which calls JS validation on correspondent form. + * See details in MAGETWO-31121. + * + * @return void + */ + protected function waitBeforeClick() + { + sleep(0.2); + } } diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/Block/Adminhtml/Edit/Tab/Addresses.php b/dev/tests/functional/tests/app/Magento/Customer/Test/Block/Adminhtml/Edit/Tab/Addresses.php index 7cf921551e869..3fa6c1f373f8e 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/Block/Adminhtml/Edit/Tab/Addresses.php +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/Block/Adminhtml/Edit/Tab/Addresses.php @@ -22,14 +22,14 @@ class Addresses extends Tab * * @var string */ - protected $addNewAddress = '#add_address_button'; + protected $addNewAddress = '.address-list-actions .add'; /** * Open customer address * * @var string */ - protected $customerAddress = '//*[@id="address_list"]/li[%d]/a'; + protected $customerAddress = '//*[contains(@class, "address-list-item")][%d]'; /** * Magento loader diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/Block/Adminhtml/Edit/Tab/Addresses.xml b/dev/tests/functional/tests/app/Magento/Customer/Test/Block/Adminhtml/Edit/Tab/Addresses.xml index 1b28870768415..877cdbedaab9c 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/Block/Adminhtml/Edit/Tab/Addresses.xml +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/Block/Adminhtml/Edit/Tab/Addresses.xml @@ -7,65 +7,65 @@ - #address_form_container [aria-hidden="false"] [name^="address"][name$="[prefix]"] + .address-item-edit:not([style="display: none;"]) [name$="[prefix]"] css selector - #address_form_container [aria-hidden="false"] [name^="address"][name$="[firstname]"] + .address-item-edit:not([style="display: none;"]) [name$="[firstname]"] css selector - #address_form_container [aria-hidden="false"] [name^="address"][name$="[middlename]"] + .address-item-edit:not([style="display: none;"]) [name$="[middlename]"] css selector - #address_form_container [aria-hidden="false"] [name^="address"][name$="[lastname]"] + .address-item-edit:not([style="display: none;"]) [name$="[lastname]"] css selector - #address_form_container [aria-hidden="false"] [name^="address"][name$="[suffix]"] + .address-item-edit:not([style="display: none;"]) [name$="[suffix]"] css selector - #address_form_container [aria-hidden="false"] [name^="address"][name$="[company]"] + .address-item-edit:not([style="display: none;"]) [name$="[company]"] css selector - #address_form_container [aria-hidden="false"] [name^="address"][name$="[street][0]"] + .address-item-edit:not([style="display: none;"]) [name$="[street][0]"] css selector - #address_form_container [aria-hidden="false"] [name^="address"][name$="[city]"] + .address-item-edit:not([style="display: none;"]) [name$="[city]"] css selector select - #address_form_container [aria-hidden="false"] [name^="address"][name$="[country_id]"] + .address-item-edit:not([style="display: none;"]) [name$="[country_id]"] css selector select - #address_form_container [aria-hidden="false"] [name^="address"][name$="[region_id]"] + .address-item-edit:not([style="display: none;"]) [name$="[region_id]"] css selector - #address_form_container [aria-hidden="false"] [name^="address"][name$="[region]"] + .address-item-edit:not([style="display: none;"]) [name$="[region]"] css selector - #address_form_container [aria-hidden="false"] [name^="address"][name$="[postcode]"] + .address-item-edit:not([style="display: none;"]) [name$="[postcode]"] css selector - #address_form_container [aria-hidden="false"] [name^="address"][name$="[telephone]"] + .address-item-edit:not([style="display: none;"]) [name$="[telephone]"] css selector - #address_form_container [aria-hidden="false"] [name^="address"][name$="[fax]"] + .address-item-edit:not([style="display: none;"]) [name$="[fax]"] css selector - #address_form_container [aria-hidden="false"] [name^="address"][name$="[vat_id]"] + .address-item-edit:not([style="display: none;"]) [name$="[vat_id]"] css selector diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/Block/Form/CustomerForm.php b/dev/tests/functional/tests/app/Magento/Customer/Test/Block/Form/CustomerForm.php index 1f205adcf4bde..2239c93e3c384 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/Block/Form/CustomerForm.php +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/Block/Form/CustomerForm.php @@ -6,29 +6,36 @@ namespace Magento\Customer\Test\Block\Form; use Mtf\Block\Form; +use Magento\Customer\Test\Fixture\CustomerInjectable; /** - * Class CustomerForm - * Customer account edit form + * Customer account edit form. */ class CustomerForm extends Form { /** - * Save button button css selector + * Save button button css selector. * * @var string */ protected $saveButton = '[type="submit"]'; /** - * Locator for customer attribute on Edit Account Information page + * Locator for customer attribute on Edit Account Information page. * * @var string */ protected $customerAttribute = "[name='%s[]']"; /** - * Click on save button + * Validation text message for a field. + * + * @var string + */ + protected $validationText = '.mage-error[for="%s"]'; + + /** + * Click on save button. * * @return void */ @@ -36,4 +43,23 @@ public function submit() { $this->_rootElement->find($this->saveButton)->click(); } + + /** + * Get all error validation messages for fields. + * + * @param CustomerInjectable $customer + * @return array + */ + public function getValidationMessages(CustomerInjectable $customer) + { + $messages = []; + foreach (array_keys($customer->getData()) as $field) { + $element = $this->_rootElement->find(sprintf($this->validationText, str_replace('_', '-', $field))); + if ($element->isVisible()) { + $messages[$field] = $element->getText(); + } + } + + return $messages; + } } diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertAddressDeletedBackend.php b/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertAddressDeletedBackend.php index e982b0679ec4b..1324e570887fd 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertAddressDeletedBackend.php +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertAddressDeletedBackend.php @@ -17,12 +17,9 @@ */ class AssertAddressDeletedBackend extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that deleted customers address is not displayed on backend during order creation diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertAddressDeletedFrontend.php b/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertAddressDeletedFrontend.php index 0cb8b92283136..715f486d2ea37 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertAddressDeletedFrontend.php +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertAddressDeletedFrontend.php @@ -14,18 +14,15 @@ */ class AssertAddressDeletedFrontend extends AbstractConstraint { + /* tags */ + const SEVERITY = 'low'; + /* end tags */ + /** * Expected message */ const EXPECTED_MESSAGE = 'You have no additional address entries in your address book.'; - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; - /** * Asserts that Asserts that 'Additional Address Entries' contains expected message * diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertChangePasswordFailMessage.php b/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertChangePasswordFailMessage.php index 303396983dd64..8aa04ec41ebae 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertChangePasswordFailMessage.php +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertChangePasswordFailMessage.php @@ -14,18 +14,15 @@ */ class AssertChangePasswordFailMessage extends AbstractConstraint { + /* tags */ + const SEVERITY = 'low'; + /* end tags */ + /** * Fail message */ const FAIL_MESSAGE = "Password doesn't match for this account."; - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; - /** * Assert that fail message is present * diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerAddressSuccessSaveMessage.php b/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerAddressSuccessSaveMessage.php index f3f15e0e595e4..f67967415e805 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerAddressSuccessSaveMessage.php +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerAddressSuccessSaveMessage.php @@ -13,14 +13,11 @@ */ class AssertCustomerAddressSuccessSaveMessage extends AbstractConstraint { - const SUCCESS_MESSAGE = 'The address has been saved.'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + const SUCCESS_MESSAGE = 'The address has been saved.'; /** * Asserts that success message equals to expected message diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerDefaultAddresses.php b/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerDefaultAddresses.php index 705fc4fe3b6ee..4c4e0444ef18e 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerDefaultAddresses.php +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerDefaultAddresses.php @@ -14,12 +14,9 @@ */ class AssertCustomerDefaultAddresses extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Asserts that Default Billing Address and Default Shipping Address equal to data from fixture diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerFailRegisterMessage.php b/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerFailRegisterMessage.php index 7011fc186ed04..fe58f72b4ea5c 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerFailRegisterMessage.php +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerFailRegisterMessage.php @@ -13,12 +13,9 @@ */ class AssertCustomerFailRegisterMessage extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'high'; + /* tags */ + const SEVERITY = 'high'; + /* end tags */ /** * Assert that error message is displayed on "Create New Customer Account" page(frontend) diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerForm.php b/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerForm.php index ad6c854fc6e5d..8a5d7eccb108e 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerForm.php +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerForm.php @@ -17,12 +17,9 @@ */ class AssertCustomerForm extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'middle'; + /* tags */ + const SEVERITY = 'middle'; + /* end tags */ /** * Skipped fields for verify data diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerGroupAlreadyExists.php b/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerGroupAlreadyExists.php index a25028f2fca1f..2110b965f27a5 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerGroupAlreadyExists.php +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerGroupAlreadyExists.php @@ -13,14 +13,11 @@ */ class AssertCustomerGroupAlreadyExists extends AbstractConstraint { - const ERROR_MESSAGE = 'Customer Group already exists.'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + const ERROR_MESSAGE = 'Customer Group already exists.'; /** * Assert that customer group already exist diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerGroupForm.php b/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerGroupForm.php index e3802aec8ef22..e351c823a5b17 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerGroupForm.php +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerGroupForm.php @@ -15,12 +15,9 @@ */ class AssertCustomerGroupForm extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Skipped fields while verifying diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerGroupInGrid.php b/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerGroupInGrid.php index 103079c891f93..01a077bc67cf8 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerGroupInGrid.php +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerGroupInGrid.php @@ -14,12 +14,9 @@ */ class AssertCustomerGroupInGrid extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that customer group in grid diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerGroupNotInGrid.php b/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerGroupNotInGrid.php index 030fd19b007b1..0e15cae8dc4a8 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerGroupNotInGrid.php +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerGroupNotInGrid.php @@ -14,12 +14,9 @@ */ class AssertCustomerGroupNotInGrid extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that customer group not in grid diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerGroupOnCustomerForm.php b/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerGroupOnCustomerForm.php index 43e5f337e7917..b9f65ebc6a135 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerGroupOnCustomerForm.php +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerGroupOnCustomerForm.php @@ -17,12 +17,9 @@ */ class AssertCustomerGroupOnCustomerForm extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that customer group find on account information page diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerGroupSuccessDeleteMessage.php b/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerGroupSuccessDeleteMessage.php index b405b2592df2a..0e41d813a855b 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerGroupSuccessDeleteMessage.php +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerGroupSuccessDeleteMessage.php @@ -13,14 +13,11 @@ */ class AssertCustomerGroupSuccessDeleteMessage extends AbstractConstraint { - const SUCCESS_DELETE_MESSAGE = "The customer group has been deleted."; + /* tags */ + const SEVERITY = 'high'; + /* end tags */ - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'high'; + const SUCCESS_DELETE_MESSAGE= "The customer group has been deleted."; /** * Assert that message "The customer group has been deleted." is displayed on Customer Group page. diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerGroupSuccessSaveMessage.php b/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerGroupSuccessSaveMessage.php index 63778b9060f2a..51c7bd74cede4 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerGroupSuccessSaveMessage.php +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerGroupSuccessSaveMessage.php @@ -13,14 +13,11 @@ */ class AssertCustomerGroupSuccessSaveMessage extends AbstractConstraint { - const SUCCESS_MESSAGE = 'The customer group has been saved.'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + const SUCCESS_MESSAGE = 'The customer group has been saved.'; /** * Assert that success message is displayed after customer group save diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerInGrid.php b/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerInGrid.php index 88bcc70e9dc80..8b0e33b22ba80 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerInGrid.php +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerInGrid.php @@ -15,12 +15,9 @@ */ class AssertCustomerInGrid extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'middle'; + /* tags */ + const SEVERITY = 'middle'; + /* end tags */ /** * Assert customer availability in Customer Grid diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerInfoSuccessSavedMessage.php b/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerInfoSuccessSavedMessage.php index 0ebe3f78886fc..6f52c76daf006 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerInfoSuccessSavedMessage.php +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerInfoSuccessSavedMessage.php @@ -13,14 +13,11 @@ */ class AssertCustomerInfoSuccessSavedMessage extends AbstractConstraint { - const SUCCESS_MESSAGE = 'The account information has been saved.'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + const SUCCESS_MESSAGE = 'The account information has been saved.'; /** * Asserts that success message equals to expected message diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerInvalidEmail.php b/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerInvalidEmail.php index c2c3b7384f313..4c2126fdebd3d 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerInvalidEmail.php +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerInvalidEmail.php @@ -15,14 +15,11 @@ */ class AssertCustomerInvalidEmail extends AbstractConstraint { - const ERROR_EMAIL_MESSAGE = 'Please correct this email address: "%email%".'; + /* tags */ + const SEVERITY = 'middle'; + /* end tags */ - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'middle'; + const ERROR_EMAIL_MESSAGE = 'Please correct this email address: "%email%".'; /** * Assert that error message "Please correct this email address: "%email%"." is displayed diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerMassDeleteInGrid.php b/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerMassDeleteInGrid.php index 1816ba92d482a..38d155bd06df4 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerMassDeleteInGrid.php +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerMassDeleteInGrid.php @@ -15,12 +15,9 @@ */ class AssertCustomerMassDeleteInGrid extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that customers which haven't been deleted are present in customer grid diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerMassDeleteNotInGrid.php b/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerMassDeleteNotInGrid.php index 9f07488b73bbf..2a591e1f32294 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerMassDeleteNotInGrid.php +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerMassDeleteNotInGrid.php @@ -15,12 +15,9 @@ */ class AssertCustomerMassDeleteNotInGrid extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Asserts that mass deleted customers are not in customer's grid diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerMassDeleteSuccessMessage.php b/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerMassDeleteSuccessMessage.php index b30037df9b044..7c65b45050019 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerMassDeleteSuccessMessage.php +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerMassDeleteSuccessMessage.php @@ -14,18 +14,15 @@ */ class AssertCustomerMassDeleteSuccessMessage extends AbstractConstraint { + /* tags */ + const SEVERITY = 'low'; + /* end tags */ + /** * Message that appears after deletion via mass actions */ const SUCCESS_DELETE_MESSAGE = 'A total of %d record(s) were deleted.'; - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; - /** * Assert that message "A total of "x" record(s) were deleted." * diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerNotInGrid.php b/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerNotInGrid.php index b449817f0d1a5..7f9ea84155b5d 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerNotInGrid.php +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerNotInGrid.php @@ -15,12 +15,9 @@ */ class AssertCustomerNotInGrid extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'middle'; + /* tags */ + const SEVERITY = 'middle'; + /* end tags */ /** * Asserts that customer is not in customer's grid diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerPasswordChanged.php b/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerPasswordChanged.php index 8782b7fc05c42..9e749fff3625d 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerPasswordChanged.php +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerPasswordChanged.php @@ -12,28 +12,18 @@ use Mtf\Fixture\FixtureFactory; /** - * Class AssertCustomerPasswordChanged - * Check that login again to frontend with new password was success + * Check that login again to frontend with new password was success. */ class AssertCustomerPasswordChanged extends AbstractConstraint { - /** - * Welcome message after login - */ - const SUCCESS_MESSAGE = 'Hello, %s!'; - - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** - * Assert that login again to frontend with new password was success + * Assert that login again to frontend with new password was success. * * @param FixtureFactory $fixtureFactory - * @param CmsIndex $cmsIndex * @param CustomerAccountIndex $customerAccountIndex * @param CustomerInjectable $initialCustomer * @param CustomerInjectable $customer @@ -41,16 +31,10 @@ class AssertCustomerPasswordChanged extends AbstractConstraint */ public function processAssert( FixtureFactory $fixtureFactory, - CmsIndex $cmsIndex, CustomerAccountIndex $customerAccountIndex, CustomerInjectable $initialCustomer, CustomerInjectable $customer ) { - $cmsIndex->open(); - if ($cmsIndex->getLinksBlock()->isVisible()) { - $cmsIndex->getLinksBlock()->openLink('Log Out'); - } - $customer = $fixtureFactory->createByCode( 'customerInjectable', [ @@ -63,21 +47,19 @@ public function processAssert( ] ); - $loginCustomer = $this->objectManager->create( + $this->objectManager->create( 'Magento\Customer\Test\TestStep\LoginCustomerOnFrontendStep', ['customer' => $customer] - ); - $loginCustomer->run(); + )->run(); - $customerName = $initialCustomer->getFirstname() . " " . $initialCustomer->getLastname(); - \PHPUnit_Framework_Assert::assertEquals( - sprintf(self::SUCCESS_MESSAGE, $customerName), - $customerAccountIndex->getInfoBlock()->getWelcomeText() + \PHPUnit_Framework_Assert::assertTrue( + $customerAccountIndex->getAccountMenuBlock()->isVisible(), + 'Customer Account Dashboard is not visible.' ); } /** - * Returns a string representation of the object + * Returns a string representation of the object. * * @return string */ diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerSuccessDeleteMessage.php b/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerSuccessDeleteMessage.php index 067452aad8d8a..88ab8881dac7b 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerSuccessDeleteMessage.php +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerSuccessDeleteMessage.php @@ -13,14 +13,11 @@ */ class AssertCustomerSuccessDeleteMessage extends AbstractConstraint { - const DELETE_MESSAGE = 'You deleted the customer.'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + const DELETE_MESSAGE = 'You deleted the customer.'; /** * Asserts that actual delete message equals expected diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerSuccessRegisterMessage.php b/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerSuccessRegisterMessage.php index 76e729d7a36f8..460299ed2bb06 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerSuccessRegisterMessage.php +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerSuccessRegisterMessage.php @@ -14,14 +14,11 @@ */ class AssertCustomerSuccessRegisterMessage extends AbstractConstraint { - const SUCCESS_MESSAGE = 'Thank you for registering with Main Website Store.'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + const SUCCESS_MESSAGE = 'Thank you for registering with Main Website Store.'; /** * Assert that success message is displayed after customer registered on frontend diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerSuccessSaveMessage.php b/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerSuccessSaveMessage.php index 943c391734474..1cbfa225cbf62 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerSuccessSaveMessage.php +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerSuccessSaveMessage.php @@ -14,14 +14,11 @@ */ class AssertCustomerSuccessSaveMessage extends AbstractConstraint { - const SUCCESS_MESSAGE = 'You saved the customer.'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + const SUCCESS_MESSAGE = 'You saved the customer.'; /** * Assert that success message is displayed after customer save diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertMassActionSuccessUpdateMessage.php b/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertMassActionSuccessUpdateMessage.php index 8c6c03f915e04..fb3385e37ea79 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertMassActionSuccessUpdateMessage.php +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertMassActionSuccessUpdateMessage.php @@ -15,18 +15,15 @@ */ class AssertMassActionSuccessUpdateMessage extends AbstractConstraint { + /* tags */ + const SEVERITY = 'low'; + /* end tags */ + /** * Text value to be checked */ const UPDATE_MESSAGE = 'A total of %d record(s) were updated.'; - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; - /** * Assert update message is appears on customer grid (Customers > All Customers) * diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertWrongPassConfirmationMessage.php b/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertWrongPassConfirmationMessage.php index 07419bbe8929b..1d5ac6eaa5d12 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertWrongPassConfirmationMessage.php +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertWrongPassConfirmationMessage.php @@ -5,48 +5,52 @@ namespace Magento\Customer\Test\Constraint; +use Magento\Customer\Test\Fixture\CustomerInjectable; use Magento\Customer\Test\Page\CustomerAccountEdit; use Mtf\Constraint\AbstractConstraint; /** - * Class AssertWrongPassConfirmationMessage - * Check that conformation message is present + * Check that conformation message is present. */ class AssertWrongPassConfirmationMessage extends AbstractConstraint { - /** - * Conformation message - */ - const CONFIRMATION_MESSAGE = 'Confirm your new password'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** - * Constraint severeness - * - * @var string + * Conformation message */ - protected $severeness = 'low'; + const CONFIRMATION_MESSAGE = 'Please enter the same value again.'; /** - * Assert that conformation message is present + * Assert that conformation message is present. * + * @param CustomerInjectable $customer * @param CustomerAccountEdit $customerAccountEdit * @return void */ - public function processAssert(CustomerAccountEdit $customerAccountEdit) + public function processAssert(CustomerInjectable $customer, CustomerAccountEdit $customerAccountEdit) { - \PHPUnit_Framework_Assert::assertEquals( - self::CONFIRMATION_MESSAGE, - $customerAccountEdit->getMessages()->getErrorMessages() - ); + $validationMessages = $customerAccountEdit->getAccountInfoForm()->getValidationMessages($customer); + if (isset($validationMessages['password_confirmation'])) { + \PHPUnit_Framework_Assert::assertEquals( + self::CONFIRMATION_MESSAGE, + $validationMessages['password_confirmation'], + 'Wrong password confirmation validation text message.' + ); + } else { + \PHPUnit_Framework_TestCase::fail('Password confirmation validation message is absent.'); + } } /** - * Returns a string representation of the object + * Returns a string representation of the object. * * @return string */ public function toString() { - return 'Conformation message is displayed.'; + return 'Password confirmation validation text message is displayed.'; } } diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/Handler/Curl/RemoveCustomerGroup.php b/dev/tests/functional/tests/app/Magento/Customer/Test/Handler/Curl/RemoveCustomerGroup.php deleted file mode 100644 index faaf939ed2d74..0000000000000 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/Handler/Curl/RemoveCustomerGroup.php +++ /dev/null @@ -1,49 +0,0 @@ -getGroupsIds(); - $curl = new BackendDecorator(new CurlTransport(), new Config()); - $curl->addOption(CURLOPT_HEADER, 1); - $response = ''; - foreach ($groups as $groupId) { - $url = sprintf($_ENV['app_backend_url'] . $this->deleteUrl, $groupId); - $curl->write(CurlInterface::GET, $url, '1.0', []); - $response = $curl->read(); - } - $curl->close(); - return $response; - } -} diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/Handler/CustomerInjectable/Curl.php b/dev/tests/functional/tests/app/Magento/Customer/Test/Handler/CustomerInjectable/Curl.php index e5fd1b32a46ac..737a31217f859 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/Handler/CustomerInjectable/Curl.php +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/Handler/CustomerInjectable/Curl.php @@ -22,7 +22,7 @@ class Curl extends AbstractCurl implements CustomerInjectableInterface /** * Default customer group */ - const GENERAL_GROUP = 'General'; + const GENERAL_GROUP = '1'; /** * Mapping values for data @@ -30,13 +30,8 @@ class Curl extends AbstractCurl implements CustomerInjectableInterface * @var array */ protected $mappingData = [ - 'group_id' => [ - self::GENERAL_GROUP => 1, - 'Wholesale' => 2, - 'Retailer' => 3, - ], 'country_id' => [ - 'United States' => 'US', + 'United States' => 'US' ], 'region_id' => [ 'California' => 12, @@ -58,8 +53,8 @@ class Curl extends AbstractCurl implements CustomerInjectableInterface 'email', 'dob', 'taxvat', - 'gender', - ], + 'gender' + ] ]; /** @@ -76,6 +71,7 @@ public function persist(FixtureInterface $customer = null) /** @var CustomerInjectable $customer */ $url = $_ENV['app_frontend_url'] . 'customer/account/createpost/?nocookie=true'; $data = $customer->getData(); + $data['group_id'] = $this->getCustomerGroup($customer); if ($customer->hasData('address')) { $address = $customer->getAddress(); @@ -120,6 +116,19 @@ protected function getCustomerId($email) return empty($match[1]) ? null : $match[1]; } + /** + * Prepare customer for curl + * + * @param FixtureInterface $customer + * @return string + */ + protected function getCustomerGroup(FixtureInterface $customer) + { + return $customer->hasData('group_id') + ? $customer->getDataFieldConfig('group_id')['source']->getCustomerGroup()->getCustomerGroupId() + : self::GENERAL_GROUP; + } + /** * Add addresses in to customer account * @@ -130,7 +139,7 @@ protected function getCustomerId($email) protected function addAddress(array $data) { $curlData = []; - $url = $_ENV['app_backend_url'] . 'customer/index/save'; + $url = $_ENV['app_backend_url'] . 'customer/index/save/id/' . $data['customer_id']; foreach ($data as $key => $value) { foreach ($this->curlMapping as $prefix => $prefixValues) { if (in_array($key, $prefixValues)) { @@ -140,9 +149,6 @@ protected function addAddress(array $data) } } unset($data['password'], $data['password_confirmation']); - $curlData['account']['group_id'] = isset($curlData['account']['group_id']) - ? $curlData['account']['group_id'] - : self::GENERAL_GROUP; $curlData = $this->replaceMappingData(array_merge($curlData, $data)); $curlData = $this->prepareAddressData($curlData); @@ -173,18 +179,18 @@ protected function prepareAddressData(array $curlData) $curlData['address'][$key]['street'] = []; $curlData['address'][$key]['street'][] = $street; } - $newKey = '_item' . ($key + 1); - if ($curlData['address'][$key]['default_billing'] === 'Yes') { - unset($curlData['address'][$key]['default_billing']); - $curlData['account']['default_billing'] = $newKey; + $newKey = 'new_' . ($key); + if (isset($curlData['address'][$key]['default_billing'])) { + $value = $curlData['address'][$key]['default_billing'] === 'Yes' ? 'true' : 'false'; + $curlData['address'][$key]['default_billing'] = $value; } - if ($curlData['address'][$key]['default_shipping'] === 'Yes') { - unset($curlData['address'][$key]['default_shipping']); - $curlData['account']['default_shipping'] = $newKey; + if (isset($curlData['address'][$key]['default_shipping'])) { + $value = $curlData['address'][$key]['default_shipping'] === 'Yes' ? 'true' : 'false'; + $curlData['address'][$key]['default_shipping'] = $value; } - $curlData['address'][$newKey] = $curlData['address'][$key]; - unset($curlData['address'][$key]); + $curlData['account']['customer_address'][$newKey] = $curlData['address'][$key]; } + unset($curlData['address']); return $curlData; } diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/Page/CustomerAccountIndex.xml b/dev/tests/functional/tests/app/Magento/Customer/Test/Page/CustomerAccountIndex.xml index 3d4e165acba63..ef6ffe23e31a6 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/Page/CustomerAccountIndex.xml +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/Page/CustomerAccountIndex.xml @@ -33,7 +33,7 @@ Magento\Catalog\Test\Block\Product\Compare\Sidebar - .block.compare + .block-compare css selector diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/Repository/CustomerInjectable.php b/dev/tests/functional/tests/app/Magento/Customer/Test/Repository/CustomerInjectable.php index 55d3af3d2ec2b..9a0b737ef2733 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/Repository/CustomerInjectable.php +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/Repository/CustomerInjectable.php @@ -64,6 +64,7 @@ public function __construct(array $defaultConfig = [], array $defaultData = []) ]; $this->_data['defaultBackend'] = [ + 'website_id' => 'Main Website', 'firstname' => 'John', 'lastname' => 'Doe', 'email' => 'JohnDoe_%isolation%@example.com', diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/ChangeCustomerPasswordTest.php b/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/ChangeCustomerPasswordTest.php deleted file mode 100644 index d429628177a7e..0000000000000 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/ChangeCustomerPasswordTest.php +++ /dev/null @@ -1,108 +0,0 @@ -cmsIndex = $cmsIndex; - $this->customerAccountLogin = $customerAccountLogin; - $this->customerAccountIndex = $customerAccountIndex; - $this->customerAccountEdit = $customerAccountEdit; - } - - /** - * Run Change customer password test - * - * @param CustomerInjectable $initialCustomer - * @param CustomerInjectable $customer - * @return void - */ - public function test(CustomerInjectable $initialCustomer, CustomerInjectable $customer) - { - // Preconditions - $initialCustomer->persist(); - - // Steps - $loginCustomer = $this->objectManager->create( - 'Magento\Customer\Test\TestStep\LoginCustomerOnFrontendStep', - ['customer' => $initialCustomer] - ); - $loginCustomer->run(); - - $this->cmsIndex->getLinksBlock()->openLink('My Account'); - $this->customerAccountIndex->getInfoBlock()->openChangePassword(); - $this->customerAccountEdit->getAccountInfoForm()->fill($customer); - $this->customerAccountEdit->getAccountInfoForm()->submit(); - } -} diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/ChangeCustomerPasswordTest/test.csv b/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/ChangeCustomerPasswordTest/test.csv deleted file mode 100644 index 726c0a3d22d1f..0000000000000 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/ChangeCustomerPasswordTest/test.csv +++ /dev/null @@ -1,4 +0,0 @@ -"initialCustomer/dataSet";"customer/data/current_password";"customer/data/password";"customer/data/password_confirmation";"constraint";"issue" -"default";"123123q";"123123a";"123123a";"assertCustomerInfoSuccessSavedMessage, assertCustomerPasswordChanged";"Bug: MAGETWO-29412" -"default";"123123";"123123a";"123123a";"assertChangePasswordFailMessage";"" -"default";"123123q";"123123a";"123123";"assertWrongPassConfirmationMessage";"" diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/CreateCustomerBackendEntityTest/testCreateCustomerBackendEntity.csv b/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/CreateCustomerBackendEntityTest/testCreateCustomerBackendEntity.csv index e6e356a43c234..47b35a7511a61 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/CreateCustomerBackendEntityTest/testCreateCustomerBackendEntity.csv +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/CreateCustomerBackendEntityTest/testCreateCustomerBackendEntity.csv @@ -1,6 +1,6 @@ -"customer/data/website_id";"customer/data/group_id/dataSet";"customer/data/prefix";"customer/data/firstname";"customer/data/middlename";"customer/data/lastname";"customer/data/suffix";"customer/data/email";"customer/data/dob";"customer/data/taxvat";"customer/data/gender";"address/data/firstname";"address/data/lastname";"address/data/street";"address/data/city";"address/data/country_id";"address/data/region_id";"address/data/postcode";"address/data/telephone";"constraint";"issue" -"Main Website";"General";"-";"John%isolation%";"-";"Doe%isolation%";"-";"JohnDoe%isolation%@example.com";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"assertCustomerSuccessSaveMessage, assertCustomerInGrid, assertCustomerForm";"" -"Admin";"Wholesale";"M";"John%isolation%";"Jack";"Doe%isolation%";"S";"JohnDoe%isolation%@example.com";"3/16/2004";"-";"Male";"-";"-";"-";"-";"-";"-";"-";"-";"assertCustomerSuccessSaveMessage, assertCustomerInGrid, assertCustomerForm";"" -"Main Website";"General";"-";"John%isolation%";"-";"Doe%isolation%";"-";"JohnDoe%isolation%@example.com";"-";"-";"-";"Joe";"Doe";"1 Main Street";"Culver City";"United States";"California";"90230";"3109450345";"assertCustomerSuccessSaveMessage, assertCustomerInGrid, assertCustomerForm";"Bug: MAGETWO-30226" -"Main Website";"Retailer";"-";"John%isolation%";"-";"Doe%isolation%";"-";"JohnDoe%isolation%@example.ccc";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"assertCustomerInvalidEmail";"Bug: MAGETWO-28875" -"Main Website";"General";"-";"Thomas%isolation%";"-";"Oster%isolation%";"-";"Thomas%isolation%@example.com";"-";"5250008057";"-";"Thomas";"Oster";"Chmielna 113";"Bielsko-Biala";"Poland";"-";"43-310 ";"799885616";"assertCustomerSuccessSaveMessage, assertCustomerInGrid, assertCustomerForm";"Bug: MAGETWO-30226" +"customer/data/website_id";"customer/data/group_id/dataSet";"customer/data/prefix";"customer/data/firstname";"customer/data/middlename";"customer/data/lastname";"customer/data/suffix";"customer/data/email";"customer/data/dob";"customer/data/taxvat";"customer/data/gender";"address/data/firstname";"address/data/lastname";"address/data/street";"address/data/city";"address/data/country_id";"address/data/region_id";"address/data/postcode";"address/data/telephone";"constraint" +"Main Website";"General";"-";"John%isolation%";"-";"Doe%isolation%";"-";"JohnDoe%isolation%@example.com";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"assertCustomerSuccessSaveMessage, assertCustomerInGrid, assertCustomerForm" +"Admin";"Wholesale";"M";"John%isolation%";"Jack";"Doe%isolation%";"S";"JohnDoe%isolation%@example.com";"3/16/2004";"-";"Male";"-";"-";"-";"-";"-";"-";"-";"-";"assertCustomerSuccessSaveMessage, assertCustomerInGrid, assertCustomerForm" +"Main Website";"General";"-";"John%isolation%";"-";"Doe%isolation%";"-";"JohnDoe%isolation%@example.com";"-";"-";"-";"Joe";"Doe";"1 Main Street";"Culver City";"United States";"California";"90230";"3109450345";"assertCustomerSuccessSaveMessage, assertCustomerInGrid, assertCustomerForm" +"Main Website";"Retailer";"-";"John%isolation%";"-";"Doe%isolation%";"-";"JohnDoe%isolation%@example.ccc";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"assertCustomerInvalidEmail" +"Main Website";"General";"-";"Thomas%isolation%";"-";"Oster%isolation%";"-";"Thomas%isolation%@example.com";"-";"5250008057";"-";"Thomas";"Oster";"Chmielna 113";"Bielsko-Biala";"Poland";"-";"43-310 ";"799885616";"assertCustomerSuccessSaveMessage, assertCustomerInGrid, assertCustomerForm" diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/UpdateCustomerBackendEntityTest/testUpdateCustomerBackendEntity.csv b/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/UpdateCustomerBackendEntityTest/testUpdateCustomerBackendEntity.csv index aabdfc2d31fb4..649c9f7842c9f 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/UpdateCustomerBackendEntityTest/testUpdateCustomerBackendEntity.csv +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/UpdateCustomerBackendEntityTest/testUpdateCustomerBackendEntity.csv @@ -1,4 +1,4 @@ "initialCustomer/dataSet";"customer/data/group_id/dataSet";"customer/data/prefix";"customer/data/firstname";"customer/data/middlename";"customer/data/lastname";"customer/data/suffix";"customer/data/email";"customer/data/dob";"customer/data/taxvat";"customer/data/gender";"address/data/prefix";"address/data/firstname";"address/data/middlename";"address/data/lastname";"address/data/suffix";"address/data/company";"address/data/street";"address/data/city";"address/data/country_id";"address/data/region_id";"address/data/region";"address/data/postcode";"address/data/telephone";"address/data/fax";"address/data/vat_id";"constraint";"issue" -"default";"Wholesale";"%isolation%Prefix_";"John_%isolation%";"Middle Name %isolation%";"Doe%isolation%";"_Suffix%isolation%";"JohnDoe%isolation%@example.com";1/8/1986;123456789001;"Male";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"assertCustomerSuccessSaveMessage, assertCustomerForm, assertCustomerInGrid";"" -"default";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"Prefix%isolation%_";"Doe%isolation%";"Middle Name %isolation%";"Doe%isolation%";"_Suffix%isolation%";"Company%isolation%";"3962 Horner Street";"Dothan";"United States";"Alabama";"-";36303;"334-200-4060";"555-666-777-8910";"U1234567890";"assertCustomerSuccessSaveMessage, assertCustomerForm, assertCustomerInGrid";"Bug: MAGETWO-30226" -"default";"Retailer";"%isolation%Prefix_";"Jane_%isolation%";"Jane Middle Name %isolation%";"Doe%isolation%";"_JaneSuffix%isolation%";"Jane%isolation%@example.com";1/12/2000;987654321;"Female";"Prefix%isolation%_";"Doe%isolation%";"Middle Name %isolation%";"Doe%isolation%";"_Suffix%isolation%";"Company%isolation%";"39 Northgate Street";"BICKTON";"United Kingdom";"-";"PINMINNOCH";"KA26 1PF ";"999-777-111-2345";"-";987654321;"assertCustomerSuccessSaveMessage, assertCustomerForm, assertCustomerInGrid";"Bug: MAGETWO-30226" +"default";"Wholesale";"%isolation%Prefix_";"John_%isolation%";"Middle Name %isolation%";"Doe%isolation%";"_Suffix%isolation%";"JohnDoe%isolation%@example.com";1/8/1986;123456789001;"Male";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"assertCustomerSuccessSaveMessage, assertCustomerForm, assertCustomerInGrid";"Bug: MAGETWO-31689" +"default";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"Prefix%isolation%_";"Doe%isolation%";"Middle Name %isolation%";"Doe%isolation%";"_Suffix%isolation%";"Company%isolation%";"3962 Horner Street";"Dothan";"United States";"Alabama";"-";36303;"334-200-4060";"555-666-777-8910";"U1234567890";"assertCustomerSuccessSaveMessage, assertCustomerForm, assertCustomerInGrid";"" +"default";"Retailer";"%isolation%Prefix_";"Jane_%isolation%";"Jane Middle Name %isolation%";"Doe%isolation%";"_JaneSuffix%isolation%";"Jane%isolation%@example.com";1/12/2000;987654321;"Female";"Prefix%isolation%_";"Doe%isolation%";"Middle Name %isolation%";"Doe%isolation%";"_Suffix%isolation%";"Company%isolation%";"39 Northgate Street";"BICKTON";"United Kingdom";"-";"PINMINNOCH";"KA26 1PF ";"999-777-111-2345";"-";987654321;"assertCustomerSuccessSaveMessage, assertCustomerForm, assertCustomerInGrid";"" diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/UpdateCustomerFrontendEntity.php b/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/UpdateCustomerFrontendEntity.php index 1e38cf75dc121..ee0b3fbc58322 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/UpdateCustomerFrontendEntity.php +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/UpdateCustomerFrontendEntity.php @@ -34,6 +34,8 @@ * * @group Customer_Account_(CS) * @ZephyrId MAGETWO-25925 + * + * @SuppressWarnings(PHPMD.CouplingBetweenObjects) */ class UpdateCustomerFrontendEntity extends Injectable { diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/etc/constraint.xml b/dev/tests/functional/tests/app/Magento/Customer/Test/etc/constraint.xml index fc4197089a59f..8d2d4b7694e95 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/etc/constraint.xml +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/etc/constraint.xml @@ -6,39 +6,39 @@ --> - low + low - low + low - low + low - middle + middle - middle + middle - middle + middle @@ -46,7 +46,7 @@ - middle + middle @@ -54,79 +54,79 @@ - low + low - low + low - low + low - low + low - low + low - high + high - high + high - low + low - low + low - low + low - low + low
- low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low diff --git a/dev/tests/functional/tests/app/Magento/Downloadable/Test/Constraint/AssertDownloadableDuplicateForm.php b/dev/tests/functional/tests/app/Magento/Downloadable/Test/Constraint/AssertDownloadableDuplicateForm.php index 5101e25b5885e..7f970611ba238 100644 --- a/dev/tests/functional/tests/app/Magento/Downloadable/Test/Constraint/AssertDownloadableDuplicateForm.php +++ b/dev/tests/functional/tests/app/Magento/Downloadable/Test/Constraint/AssertDownloadableDuplicateForm.php @@ -15,12 +15,9 @@ */ class AssertDownloadableDuplicateForm extends AssertProductDuplicateForm { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert form data equals duplicate product downloadable data diff --git a/dev/tests/functional/tests/app/Magento/Downloadable/Test/Constraint/AssertDownloadableLinksData.php b/dev/tests/functional/tests/app/Magento/Downloadable/Test/Constraint/AssertDownloadableLinksData.php index 0bd66102e5358..e2fe6770bafa2 100644 --- a/dev/tests/functional/tests/app/Magento/Downloadable/Test/Constraint/AssertDownloadableLinksData.php +++ b/dev/tests/functional/tests/app/Magento/Downloadable/Test/Constraint/AssertDownloadableLinksData.php @@ -17,6 +17,10 @@ */ class AssertDownloadableLinksData extends AbstractAssertForm { + /* tags */ + const SEVERITY = 'low'; + /* end tags */ + /** * List downloadable link fields for verify * @@ -38,13 +42,6 @@ class AssertDownloadableLinksData extends AbstractAssertForm 'price', ]; - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; - /** * Assert Link block for downloadable product on front-end * diff --git a/dev/tests/functional/tests/app/Magento/Downloadable/Test/Constraint/AssertDownloadableSamplesData.php b/dev/tests/functional/tests/app/Magento/Downloadable/Test/Constraint/AssertDownloadableSamplesData.php index be912e602950c..1c216b2325626 100644 --- a/dev/tests/functional/tests/app/Magento/Downloadable/Test/Constraint/AssertDownloadableSamplesData.php +++ b/dev/tests/functional/tests/app/Magento/Downloadable/Test/Constraint/AssertDownloadableSamplesData.php @@ -17,6 +17,10 @@ */ class AssertDownloadableSamplesData extends AbstractAssertForm { + /* tags */ + const SEVERITY = 'low'; + /* end tags */ + /** * List downloadable sample links fields for verify * @@ -36,13 +40,6 @@ class AssertDownloadableSamplesData extends AbstractAssertForm 'title', ]; - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; - /** * Assert Sample block for downloadable product on front-end * diff --git a/dev/tests/functional/tests/app/Magento/Downloadable/Test/TestCase/CreateDownloadableProductEntityTest/test.csv b/dev/tests/functional/tests/app/Magento/Downloadable/Test/TestCase/CreateDownloadableProductEntityTest/test.csv index 1b875f13b3663..486f051573ba4 100644 --- a/dev/tests/functional/tests/app/Magento/Downloadable/Test/TestCase/CreateDownloadableProductEntityTest/test.csv +++ b/dev/tests/functional/tests/app/Magento/Downloadable/Test/TestCase/CreateDownloadableProductEntityTest/test.csv @@ -1,15 +1,15 @@ -"product/data/name";"product/data/sku";"product/data/price/value";"product/data/tax_class_id/dataSet";"product/data/quantity_and_stock_status/qty";"product/data/quantity_and_stock_status/is_in_stock";"product/data/is_virtual";"product/data/category";"product/data/description";"product/data/short_description";"product/data/stock_data/manage_stock";"product/data/stock_data/qty";"product/data/stock_data/use_config_min_qty";"product/data/stock_data/min_qty";"product/data/downloadable_sample/preset";"product/data/downloadable_links/preset";"product/data/custom_options/preset";"product/data/custom_options/import_products";"product/data/special_price";"product/data/group_price/preset";"product/data/tier_price/preset";"product/data/url_key";"constraint";"issue" -"DownloadableProduct_%isolation%";"DownloadableProduct_%isolation%";"100";"Taxable Goods";"1";"In Stock";"Yes";"Default Category";"-";"-";"-";"-";"-";"-";"-";"default";"-";"-";"-";"-";"-";"downloadableproduct-%isolation%";"assertProductSaveMessage, assertProductInGrid, assertDownloadableProductForm, assertProductVisibleInCategory, assertProductPage, assertProductInStock";"" -"DownloadableProduct_%isolation%";"DownloadableProduct_%isolation%";"1";"Taxable Goods";"10";"In Stock";"Yes";"category %isolation%";"-";"-";"-";"-";"-";"-";"default";"default";"-";"-";"-";"-";"-";"downloadableproduct-%isolation%";"assertProductSaveMessage, assertProductInGrid, assertDownloadableProductForm, assertProductVisibleInCategory, assertDownloadableSamplesData, assertDownloadableLinksData";"" -"DownloadableProduct_%isolation%";"DownloadableProduct_%isolation%";"33";"Taxable Goods";"10";"In Stock";"Yes";"category %isolation%";"-";"-";"-";"-";"-";"-";"-";"default";"default";"-";"-";"-";"-";"downloadableproduct-%isolation%";"assertProductSaveMessage, assertDownloadableProductForm, assertProductCustomOptionsOnProductPage, assertProductVisibleInCategory, assertProductPage, assertDownloadableLinksData";"" -"DownloadableProduct_%isolation%";"DownloadableProduct_%isolation%";"55";"Taxable Goods";"10";"In Stock";"Yes";"-";"-";"-";"-";"-";"-";"-";"with_three_samples";"with_three_links";"two_options";"-";"-";"-";"-";"downloadableproduct-%isolation%";"assertProductSaveMessage, assertProductCustomOptionsOnProductPage, assertProductInGrid, assertDownloadableProductForm, assertProductVisibleInCategory, assertProductPage, assertDownloadableLinksData, assertProductInStock, assertProductSearchableBySku";"" -"DownloadableProduct_%isolation%";"DownloadableProduct_%isolation%";"100";"Taxable Goods";"50";"Out of Stock";"Yes";"Default Category";"-";"-";"-";"-";"-";"-";"-";"default";"-";"-";"-";"-";"-";"downloadableproduct-%isolation%";"assertProductSaveMessage, assertProductOutOfStock, assertProductInGrid, assertDownloadableProductForm";"" -"DownloadableProduct_%isolation%";"DownloadableProduct_%isolation%";"9999";"Taxable Goods";"-";"-";"Yes";"Default Category";"-";"-";"Yes";"123";"No";"123";"-";"default";"-";"-";"-";"-";"-";"downloadableproduct-%isolation%";"assertProductSaveMessage, assertProductInGrid, assertDownloadableProductForm, assertProductOutOfStock";"" -"DownloadableProduct_%isolation%";"DownloadableProduct_%isolation%";"98";"None";"5";"In Stock";"Yes";"Default Category";"This is description for downloadable product";"-";"-";"-";"-";"-";"-";"default";"-";"-";"-";"-";"-";"downloadableproduct-%isolation%";"assertProductSaveMessage, assertProductInGrid, assertDownloadableProductForm, assertProductPage";"" -"DownloadableProduct_%isolation%";"DownloadableProduct_%isolation%";"57";"Taxable Goods";"10";"In Stock";"Yes";"category %isolation%";"-";"This is short description for downloadable product";"-";"-";"-";"-";"default";"with_three_links";"default";"catalogProductSimple::with_two_custom_option,catalogProductSimple::with_all_custom_option";"-";"-";"-";"downloadableproduct-%isolation%";"assertProductSaveMessage, assertProductInGrid, assertDownloadableProductForm, assertProductPage, assertProductCustomOptionsOnProductPage, assertDownloadableSamplesData, assertDownloadableLinksData";"" -"DownloadableProduct_%isolation%";"DownloadableProduct_%isolation%";"65";"Taxable Goods";"11";"In Stock";"Yes";"category %isolation%";"This is description for downloadable product";"This is short description for downloadable product";"-";"-";"-";"-";"default";"with_three_links";"default";"-";"-";"-";"-";"downloadableproduct-%isolation%";"assertProductSaveMessage, assertProductPage, assertProductInGrid, assertDownloadableProductForm, assertProductCustomOptionsOnProductPage, assertDownloadableSamplesData, assertDownloadableLinksData";"" -"DownloadableProduct_%isolation%";"DownloadableProduct_%isolation%";"65";"Taxable Goods";"11";"In Stock";"Yes";"category %isolation%";"-";"-";"-";"-";"-";"-";"default";"with_three_links";"default";"-";"-";"-";"-";"downloadableproduct-%isolation%";"assertProductSaveMessage, assertProductInGrid, assertDownloadableProductForm, assertProductPage, assertDownloadableLinksData, assertProductCustomOptionsOnProductPage";"" -"DownloadableProduct_%isolation%";"DownloadableProduct_%isolation%";"100";"Taxable Goods";"-";"-";"Yes";"Default Category";"-";"-";"-";"-";"-";"-";"-";"default";"-";"-";"-";"-";"-";"downloadableproduct-%isolation%";"assertProductSaveMessage, assertDownloadableProductForm, assertProductVisibleInCategory, assertProductPage";"" -"DownloadableProduct_%isolation%";"DownloadableProduct_%isolation%";"10";"Taxable Goods";"10";"In Stock";"Yes";"category %isolation%";"-";"-";"-";"-";"-";"-";"-";"default";"-";"-";"5";"-";"-";"downloadableproduct-%isolation%";"assertProductSaveMessage, assertProductInGrid, assertDownloadableProductForm, assertProductPage, assertProductSpecialPriceOnProductPage";"" -"DownloadableProduct_%isolation%";"DownloadableProduct_%isolation%";"365";"Taxable Goods";"23";"In Stock";"Yes";"category %isolation%";"-";"-";"-";"-";"-";"-";"-";"default";"-";"-";"-";"default";"-";"downloadableproduct-%isolation%";"assertProductSaveMessage, assertProductInGrid, assertDownloadableProductForm, assertProductPage, assertProductGroupedPriceOnProductPage";"" -"DownloadableProduct_%isolation%";"DownloadableProduct_%isolation%";"250";"Taxable Goods";"65";"In Stock";"Yes";"category %isolation%";"-";"-";"-";"-";"-";"-";"-";"default";"-";"-";"-";"-";"default";"downloadableproduct-%isolation%";"assertProductSaveMessage, assertProductInGrid, assertDownloadableProductForm, assertProductPage, assertProductTierPriceOnProductPage";"" +"product/data/name";"product/data/sku";"product/data/price/value";"product/data/tax_class_id/dataSet";"product/data/quantity_and_stock_status/qty";"product/data/quantity_and_stock_status/is_in_stock";"product/data/is_virtual";"product/data/category";"product/data/description";"product/data/short_description";"product/data/stock_data/manage_stock";"product/data/stock_data/qty";"product/data/stock_data/use_config_min_qty";"product/data/stock_data/min_qty";"product/data/downloadable_sample/preset";"product/data/downloadable_links/preset";"product/data/custom_options/preset";"product/data/custom_options/import_products";"product/data/special_price";"product/data/group_price/preset";"product/data/tier_price/preset";"product/data/url_key";"constraint" +"DownloadableProduct_%isolation%";"DownloadableProduct_%isolation%";"100";"Taxable Goods";"1";"In Stock";"Yes";"Default Category";"-";"-";"-";"-";"-";"-";"-";"default";"-";"-";"-";"-";"-";"downloadableproduct-%isolation%";"assertProductSaveMessage, assertProductInGrid, assertDownloadableProductForm, assertProductVisibleInCategory, assertProductPage, assertProductInStock" +"DownloadableProduct_%isolation%";"DownloadableProduct_%isolation%";"1";"Taxable Goods";"10";"In Stock";"Yes";"category %isolation%";"-";"-";"-";"-";"-";"-";"default";"default";"-";"-";"-";"-";"-";"downloadableproduct-%isolation%";"assertProductSaveMessage, assertProductInGrid, assertDownloadableProductForm, assertProductVisibleInCategory, assertDownloadableSamplesData, assertDownloadableLinksData" +"DownloadableProduct_%isolation%";"DownloadableProduct_%isolation%";"33";"Taxable Goods";"10";"In Stock";"Yes";"category %isolation%";"-";"-";"-";"-";"-";"-";"-";"default";"default";"-";"-";"-";"-";"downloadableproduct-%isolation%";"assertProductSaveMessage, assertDownloadableProductForm, assertProductCustomOptionsOnProductPage, assertProductVisibleInCategory, assertProductPage, assertDownloadableLinksData" +"DownloadableProduct_%isolation%";"DownloadableProduct_%isolation%";"55";"Taxable Goods";"10";"In Stock";"Yes";"-";"-";"-";"-";"-";"-";"-";"with_three_samples";"with_three_links";"two_options";"-";"-";"-";"-";"downloadableproduct-%isolation%";"assertProductSaveMessage, assertProductCustomOptionsOnProductPage, assertProductInGrid, assertDownloadableProductForm, assertProductVisibleInCategory, assertProductPage, assertDownloadableLinksData, assertProductInStock, assertProductSearchableBySku" +"DownloadableProduct_%isolation%";"DownloadableProduct_%isolation%";"100";"Taxable Goods";"50";"Out of Stock";"Yes";"Default Category";"-";"-";"-";"-";"-";"-";"-";"default";"-";"-";"-";"-";"-";"downloadableproduct-%isolation%";"assertProductSaveMessage, assertProductOutOfStock, assertProductInGrid, assertDownloadableProductForm" +"DownloadableProduct_%isolation%";"DownloadableProduct_%isolation%";"9999";"Taxable Goods";"-";"-";"Yes";"Default Category";"-";"-";"Yes";"123";"No";"123";"-";"default";"-";"-";"-";"-";"-";"downloadableproduct-%isolation%";"assertProductSaveMessage, assertProductInGrid, assertDownloadableProductForm, assertProductOutOfStock" +"DownloadableProduct_%isolation%";"DownloadableProduct_%isolation%";"98";"None";"5";"In Stock";"Yes";"Default Category";"This is description for downloadable product";"-";"-";"-";"-";"-";"-";"default";"-";"-";"-";"-";"-";"downloadableproduct-%isolation%";"assertProductSaveMessage, assertProductInGrid, assertDownloadableProductForm, assertProductPage" +"DownloadableProduct_%isolation%";"DownloadableProduct_%isolation%";"57";"Taxable Goods";"10";"In Stock";"Yes";"category %isolation%";"-";"This is short description for downloadable product";"-";"-";"-";"-";"default";"with_three_links";"default";"catalogProductSimple::with_two_custom_option,catalogProductSimple::with_all_custom_option";"-";"-";"-";"downloadableproduct-%isolation%";"assertProductSaveMessage, assertProductInGrid, assertDownloadableProductForm, assertProductPage, assertProductCustomOptionsOnProductPage, assertDownloadableSamplesData, assertDownloadableLinksData" +"DownloadableProduct_%isolation%";"DownloadableProduct_%isolation%";"65";"Taxable Goods";"11";"In Stock";"Yes";"category %isolation%";"This is description for downloadable product";"This is short description for downloadable product";"-";"-";"-";"-";"default";"with_three_links";"default";"-";"-";"-";"-";"downloadableproduct-%isolation%";"assertProductSaveMessage, assertProductPage, assertProductInGrid, assertDownloadableProductForm, assertProductCustomOptionsOnProductPage, assertDownloadableSamplesData, assertDownloadableLinksData" +"DownloadableProduct_%isolation%";"DownloadableProduct_%isolation%";"65";"Taxable Goods";"11";"In Stock";"Yes";"category %isolation%";"-";"-";"-";"-";"-";"-";"default";"with_three_links";"default";"-";"-";"-";"-";"downloadableproduct-%isolation%";"assertProductSaveMessage, assertProductInGrid, assertDownloadableProductForm, assertProductPage, assertDownloadableLinksData, assertProductCustomOptionsOnProductPage" +"DownloadableProduct_%isolation%";"DownloadableProduct_%isolation%";"100";"Taxable Goods";"-";"-";"Yes";"Default Category";"-";"-";"-";"-";"-";"-";"-";"default";"-";"-";"-";"-";"-";"downloadableproduct-%isolation%";"assertProductSaveMessage, assertDownloadableProductForm, assertProductVisibleInCategory, assertProductPage" +"DownloadableProduct_%isolation%";"DownloadableProduct_%isolation%";"10";"Taxable Goods";"10";"In Stock";"Yes";"category %isolation%";"-";"-";"-";"-";"-";"-";"-";"default";"-";"-";"5";"-";"-";"downloadableproduct-%isolation%";"assertProductSaveMessage, assertProductInGrid, assertDownloadableProductForm, assertProductPage, assertProductSpecialPriceOnProductPage" +"DownloadableProduct_%isolation%";"DownloadableProduct_%isolation%";"365";"Taxable Goods";"23";"In Stock";"Yes";"category %isolation%";"-";"-";"-";"-";"-";"-";"-";"default";"-";"-";"-";"default";"-";"downloadableproduct-%isolation%";"assertProductSaveMessage, assertProductInGrid, assertDownloadableProductForm, assertProductPage, assertProductGroupedPriceOnProductPage" +"DownloadableProduct_%isolation%";"DownloadableProduct_%isolation%";"250";"Taxable Goods";"65";"In Stock";"Yes";"category %isolation%";"-";"-";"-";"-";"-";"-";"-";"default";"-";"-";"-";"-";"default";"downloadableproduct-%isolation%";"assertProductSaveMessage, assertProductInGrid, assertDownloadableProductForm, assertProductPage, assertProductTierPriceOnProductPage" diff --git a/dev/tests/functional/tests/app/Magento/Downloadable/Test/etc/constraint.xml b/dev/tests/functional/tests/app/Magento/Downloadable/Test/etc/constraint.xml index f121e08d53c56..b10f5bbe51463 100644 --- a/dev/tests/functional/tests/app/Magento/Downloadable/Test/etc/constraint.xml +++ b/dev/tests/functional/tests/app/Magento/Downloadable/Test/etc/constraint.xml @@ -6,16 +6,16 @@ --> - low + low - low + low - low + low - high + high @@ -23,6 +23,6 @@ - low + low diff --git a/dev/tests/functional/tests/app/Magento/GiftMessage/Test/Constraint/AssertGiftMessageInBackendOrder.php b/dev/tests/functional/tests/app/Magento/GiftMessage/Test/Constraint/AssertGiftMessageInBackendOrder.php index af6b504bacc99..d8358b6df9d1c 100644 --- a/dev/tests/functional/tests/app/Magento/GiftMessage/Test/Constraint/AssertGiftMessageInBackendOrder.php +++ b/dev/tests/functional/tests/app/Magento/GiftMessage/Test/Constraint/AssertGiftMessageInBackendOrder.php @@ -16,12 +16,9 @@ */ class AssertGiftMessageInBackendOrder extends AbstractAssertForm { - /** - * Constraint severeness. - * - * @var string - */ - protected $severeness = 'high'; + /* tags */ + const SEVERITY = 'high'; + /* end tags */ /** * Skipped fields for verify data. diff --git a/dev/tests/functional/tests/app/Magento/GiftMessage/Test/Constraint/AssertGiftMessageInFrontendOrder.php b/dev/tests/functional/tests/app/Magento/GiftMessage/Test/Constraint/AssertGiftMessageInFrontendOrder.php index a5739bcf1e3ce..e21c1a245cd09 100644 --- a/dev/tests/functional/tests/app/Magento/GiftMessage/Test/Constraint/AssertGiftMessageInFrontendOrder.php +++ b/dev/tests/functional/tests/app/Magento/GiftMessage/Test/Constraint/AssertGiftMessageInFrontendOrder.php @@ -18,12 +18,9 @@ */ class AssertGiftMessageInFrontendOrder extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'high'; + /* tags */ + const SEVERITY = 'high'; + /* end tags */ /** * Assert that message from dataSet is displayed on order(s) view page on frontend diff --git a/dev/tests/functional/tests/app/Magento/GiftMessage/Test/Constraint/AssertGiftMessageInFrontendOrderItems.php b/dev/tests/functional/tests/app/Magento/GiftMessage/Test/Constraint/AssertGiftMessageInFrontendOrderItems.php index 34ea83cdcce70..15d740f2412cf 100644 --- a/dev/tests/functional/tests/app/Magento/GiftMessage/Test/Constraint/AssertGiftMessageInFrontendOrderItems.php +++ b/dev/tests/functional/tests/app/Magento/GiftMessage/Test/Constraint/AssertGiftMessageInFrontendOrderItems.php @@ -18,12 +18,9 @@ */ class AssertGiftMessageInFrontendOrderItems extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'high'; + /* tags */ + const SEVERITY = 'high'; + /* end tags */ /** * Assert that message from dataSet is displayed for each items on order(s) view page on frontend diff --git a/dev/tests/functional/tests/app/Magento/GiftMessage/Test/TestCase/CheckoutWithGiftMessagesTest.php b/dev/tests/functional/tests/app/Magento/GiftMessage/Test/TestCase/CheckoutWithGiftMessagesTest.php deleted file mode 100644 index 9280a88bf8ec5..0000000000000 --- a/dev/tests/functional/tests/app/Magento/GiftMessage/Test/TestCase/CheckoutWithGiftMessagesTest.php +++ /dev/null @@ -1,41 +0,0 @@ -markTestIncomplete("Bug: MAGETWO-30593"); - $this->executeScenario(); - } -} diff --git a/dev/tests/functional/tests/app/Magento/GiftMessage/Test/TestCase/CheckoutWithGiftMessagesTest/test.csv b/dev/tests/functional/tests/app/Magento/GiftMessage/Test/TestCase/CheckoutWithGiftMessagesTest/test.csv deleted file mode 100644 index a11cab46509db..0000000000000 --- a/dev/tests/functional/tests/app/Magento/GiftMessage/Test/TestCase/CheckoutWithGiftMessagesTest/test.csv +++ /dev/null @@ -1,3 +0,0 @@ -"products";"customer/dataSet";"billingAddress/dataSet";"checkoutMethod";"shipping/shipping_service";"shipping/shipping_method";"giftMessage/data/allow_gift_options";"giftMessage/data/allow_gift_messages_for_order";"giftMessage/data/allow_gift_options_for_items";"giftMessage/data/sender";"giftMessage/data/recipient";"giftMessage/data/message";"payment/method";"constraint" -"catalogProductSimple::default, catalogProductVirtual::default";"customer_US";"customer_US";"login";"Flat Rate";"Fixed";"Yes";"Yes";"-";"John Doe";"Jane Doe";"text_gift_message";"cashondelivery";"assertOrderSuccessPlacedMessage, assertGiftMessageInFrontendOrder" -"catalogProductSimple::default, catalogProductVirtual::default";"customer_US";"customer_US";"login";"Flat Rate";"Fixed";"Yes";"-";"Yes";"John Doe";"Jane Doe";"text_gift_message";"cashondelivery";"assertOrderSuccessPlacedMessage, assertGiftMessageInFrontendOrderItems" diff --git a/dev/tests/functional/tests/app/Magento/GiftMessage/Test/TestCase/CreateGiftMessageOnBackendTest.php b/dev/tests/functional/tests/app/Magento/GiftMessage/Test/TestCase/CreateGiftMessageOnBackendTest.php deleted file mode 100644 index ccc1aafaf63ec..0000000000000 --- a/dev/tests/functional/tests/app/Magento/GiftMessage/Test/TestCase/CreateGiftMessageOnBackendTest.php +++ /dev/null @@ -1,54 +0,0 @@ -Orders - * 3. Create new order - * 4. Fill data form dataSet - * 5. Perform all asserts - * - * @group Gift_Messages_(CS) - * @ZephyrId MAGETWO-29642 - */ -class CreateGiftMessageOnBackendTest extends Scenario -{ - /** - * Run CreateGiftMessageOnBackend test. - * - * @return void - */ - public function test() - { - $this->executeScenario(); - } - - /** - * Disable enabled config after test. - * - * @return void - */ - public function tearDown() - { - $setConfigStep = $this->objectManager->create( - 'Magento\Core\Test\TestStep\SetupConfigurationStep', - ['configData' => 'cashondelivery', 'rollback' => true] - ); - $setConfigStep->run(); - } -} diff --git a/dev/tests/functional/tests/app/Magento/GiftMessage/Test/TestCase/CreateGiftMessageOnBackendTest/test.csv b/dev/tests/functional/tests/app/Magento/GiftMessage/Test/TestCase/CreateGiftMessageOnBackendTest/test.csv deleted file mode 100644 index eceb66e4d4caf..0000000000000 --- a/dev/tests/functional/tests/app/Magento/GiftMessage/Test/TestCase/CreateGiftMessageOnBackendTest/test.csv +++ /dev/null @@ -1,4 +0,0 @@ -"products";"customer/dataSet";"billingAddress/dataSet";"shipping/shipping_service";"shipping/shipping_method";"giftMessage/data/allow_gift_options";"giftMessage/data/allow_gift_messages_for_order";"giftMessage/data/allow_gift_options_for_items";"giftMessage/data/sender";"giftMessage/data/recipient";"giftMessage/data/message";"giftMessage/data/items/dataSets";"payment/method";"constraint" -"catalogProductSimple::default, catalogProductVirtual::default";"customer_US";"customer_US";"Flat Rate";"Fixed";"Yes";"-";"Yes";"John Doe";"Jane Doe";"text_gift_message";"default, default";"cashondelivery";"assertOrderSuccessCreateMessage, assertGiftMessageInBackendOrder, assertGiftMessageInFrontendOrderItems" -"catalogProductSimple::default, catalogProductVirtual::default";"customer_US";"customer_US";"Flat Rate";"Fixed";"Yes";"Yes";"-";"John Doe";"Jane Doe";"text_gift_message";"-";"cashondelivery";"assertOrderSuccessCreateMessage, assertGiftMessageInBackendOrder, assertGiftMessageInFrontendOrder" -"catalogProductSimple::default, catalogProductVirtual::default";"customer_US";"customer_US";"Flat Rate";"Fixed";"Yes";"Yes";"Yes";"John Doe";"Jane Doe";"text_gift_message";"default, default";"cashondelivery";"assertOrderSuccessCreateMessage, assertGiftMessageInBackendOrder, assertGiftMessageInFrontendOrder, assertGiftMessageInFrontendOrderItems" \ No newline at end of file diff --git a/dev/tests/functional/tests/app/Magento/GiftMessage/Test/etc/constraint.xml b/dev/tests/functional/tests/app/Magento/GiftMessage/Test/etc/constraint.xml index 571bc650957c6..9edbcc7193389 100644 --- a/dev/tests/functional/tests/app/Magento/GiftMessage/Test/etc/constraint.xml +++ b/dev/tests/functional/tests/app/Magento/GiftMessage/Test/etc/constraint.xml @@ -6,12 +6,12 @@ --> - high + high - high + high - high + high diff --git a/dev/tests/functional/tests/app/Magento/GoogleShopping/Test/Block/Adminhtml/Types/Edit/GoogleShoppingForm.php b/dev/tests/functional/tests/app/Magento/GoogleShopping/Test/Block/Adminhtml/Types/Edit/GoogleShoppingForm.php index 2f6e5aa7df7f1..88a833c9bd469 100644 --- a/dev/tests/functional/tests/app/Magento/GoogleShopping/Test/Block/Adminhtml/Types/Edit/GoogleShoppingForm.php +++ b/dev/tests/functional/tests/app/Magento/GoogleShopping/Test/Block/Adminhtml/Types/Edit/GoogleShoppingForm.php @@ -23,11 +23,11 @@ class GoogleShoppingForm extends Form protected $attributeOptions = '//select[@id="gcontent_attribute_0_attribute"]//option'; /** - * Loading Mask locator + * Locator for root elements * * @var string */ - protected $loadingMask = '//ancestor::body/div[@id="loading-mask"]'; + protected $loaderRootLocator = 'body'; /** * Fill specified form data @@ -43,7 +43,10 @@ protected function _fill(array $fields, Element $element = null) $element = $this->getElement($context, $field); if ($this->mappingMode || ($element->isVisible() && !$element->isDisabled())) { $element->setValue($field['value']); - $this->waitForElementNotVisible($this->loadingMask, Locator::SELECTOR_XPATH); + $this->blockFactory->create( + 'Magento\Backend\Test\Block\Template', + ['element' => $this->browser->find($this->loaderRootLocator)] + )->waitLoader(); } } } diff --git a/dev/tests/functional/tests/app/Magento/GoogleShopping/Test/Constraint/AssertProductAttributeAbsenceForAttributeMapping.php b/dev/tests/functional/tests/app/Magento/GoogleShopping/Test/Constraint/AssertProductAttributeAbsenceForAttributeMapping.php index 34073127adf82..5ea98e194dae5 100644 --- a/dev/tests/functional/tests/app/Magento/GoogleShopping/Test/Constraint/AssertProductAttributeAbsenceForAttributeMapping.php +++ b/dev/tests/functional/tests/app/Magento/GoogleShopping/Test/Constraint/AssertProductAttributeAbsenceForAttributeMapping.php @@ -17,12 +17,9 @@ */ class AssertProductAttributeAbsenceForAttributeMapping extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that deleted attribute can't be mapped to Google Attribute (attribute doesn't appear in Attributes diff --git a/dev/tests/functional/tests/app/Magento/GoogleShopping/Test/etc/constraint.xml b/dev/tests/functional/tests/app/Magento/GoogleShopping/Test/etc/constraint.xml index 0884f0c88fa2c..6850ea9c550f3 100644 --- a/dev/tests/functional/tests/app/Magento/GoogleShopping/Test/etc/constraint.xml +++ b/dev/tests/functional/tests/app/Magento/GoogleShopping/Test/etc/constraint.xml @@ -6,6 +6,6 @@ --> - low + low diff --git a/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Constraint/AssertGroupedPriceOnGroupedProductPage.php b/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Constraint/AssertGroupedPriceOnGroupedProductPage.php index 5222da7b40367..3b487c34e10bc 100644 --- a/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Constraint/AssertGroupedPriceOnGroupedProductPage.php +++ b/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Constraint/AssertGroupedPriceOnGroupedProductPage.php @@ -16,12 +16,9 @@ */ class AssertGroupedPriceOnGroupedProductPage extends AbstractAssertPriceOnGroupedProductPage { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Format error message diff --git a/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Constraint/AssertGroupedProductForm.php b/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Constraint/AssertGroupedProductForm.php index 6bca2665fbc84..b1e63455ab07e 100644 --- a/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Constraint/AssertGroupedProductForm.php +++ b/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Constraint/AssertGroupedProductForm.php @@ -15,12 +15,9 @@ */ class AssertGroupedProductForm extends AssertProductForm { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert form data equals fixture data diff --git a/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Constraint/AssertGroupedProductInItemsOrderedGrid.php b/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Constraint/AssertGroupedProductInItemsOrderedGrid.php index 629deeb3489a1..7ac9a7d6c9ccc 100644 --- a/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Constraint/AssertGroupedProductInItemsOrderedGrid.php +++ b/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Constraint/AssertGroupedProductInItemsOrderedGrid.php @@ -15,12 +15,9 @@ */ class AssertGroupedProductInItemsOrderedGrid extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Fields for assert diff --git a/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Constraint/AssertGroupedProductsDefaultQty.php b/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Constraint/AssertGroupedProductsDefaultQty.php index efd8aceafff82..a1002454955ec 100644 --- a/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Constraint/AssertGroupedProductsDefaultQty.php +++ b/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Constraint/AssertGroupedProductsDefaultQty.php @@ -16,12 +16,9 @@ */ class AssertGroupedProductsDefaultQty extends AbstractAssertForm { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that default qty for sub products in grouped product displays according to dataset on product page diff --git a/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Constraint/AssertSpecialPriceOnGroupedProductPage.php b/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Constraint/AssertSpecialPriceOnGroupedProductPage.php index 2ed585d04503f..d0d23336d90da 100644 --- a/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Constraint/AssertSpecialPriceOnGroupedProductPage.php +++ b/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Constraint/AssertSpecialPriceOnGroupedProductPage.php @@ -15,12 +15,9 @@ */ class AssertSpecialPriceOnGroupedProductPage extends AbstractAssertPriceOnGroupedProductPage { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Format error message diff --git a/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Constraint/AssertTierPriceOnGroupedProductPage.php b/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Constraint/AssertTierPriceOnGroupedProductPage.php index 7ba05a579a764..754ddefe0621b 100644 --- a/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Constraint/AssertTierPriceOnGroupedProductPage.php +++ b/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Constraint/AssertTierPriceOnGroupedProductPage.php @@ -16,12 +16,9 @@ */ class AssertTierPriceOnGroupedProductPage extends AbstractAssertPriceOnGroupedProductPage { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Format error message diff --git a/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/etc/constraint.xml b/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/etc/constraint.xml index d3a7eec9ae9e3..60649f87112c9 100644 --- a/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/etc/constraint.xml +++ b/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/etc/constraint.xml @@ -6,24 +6,24 @@ --> - low + low - low + low - low + low - low + low - low + low - low + low - low + low diff --git a/dev/tests/functional/tests/app/Magento/ImportExport/Test/Constraint/AssertProductAttributeAbsenceForExport.php b/dev/tests/functional/tests/app/Magento/ImportExport/Test/Constraint/AssertProductAttributeAbsenceForExport.php index c8fda92ba3872..e3c735a261a93 100644 --- a/dev/tests/functional/tests/app/Magento/ImportExport/Test/Constraint/AssertProductAttributeAbsenceForExport.php +++ b/dev/tests/functional/tests/app/Magento/ImportExport/Test/Constraint/AssertProductAttributeAbsenceForExport.php @@ -16,12 +16,9 @@ */ class AssertProductAttributeAbsenceForExport extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'high'; + /* tags */ + const SEVERITY = 'high'; + /* end tags */ /** * Assert that deleted attribute can't be used for Products' Export diff --git a/dev/tests/functional/tests/app/Magento/ImportExport/Test/etc/constraint.xml b/dev/tests/functional/tests/app/Magento/ImportExport/Test/etc/constraint.xml index 5351e708af77c..bb39c61e343f3 100644 --- a/dev/tests/functional/tests/app/Magento/ImportExport/Test/etc/constraint.xml +++ b/dev/tests/functional/tests/app/Magento/ImportExport/Test/etc/constraint.xml @@ -6,6 +6,6 @@ --> - high + high diff --git a/dev/tests/functional/tests/app/Magento/Integration/Test/Block/Adminhtml/Integration/Edit/IntegrationForm.php b/dev/tests/functional/tests/app/Magento/Integration/Test/Block/Adminhtml/Integration/Edit/IntegrationForm.php new file mode 100644 index 0000000000000..cb403ab4ff722 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Integration/Test/Block/Adminhtml/Integration/Edit/IntegrationForm.php @@ -0,0 +1,17 @@ + + + + + \Magento\Backend\Test\Block\Widget\Tab + #integration_edit_tabs_info_section + css selector + + + + + + + [name="consumer_key"] + + + + + + + + \Magento\Backend\Test\Block\Widget\Tab + #integration_edit_tabs_api_section + css selector + + + [name='all_resources'] + css selector + select + + + [data-role="resource-tree"] + css selector + jquerytree + + + + diff --git a/dev/tests/functional/tests/app/Magento/Integration/Test/Block/Adminhtml/Integration/Edit/IntegrationFormPageActions.php b/dev/tests/functional/tests/app/Magento/Integration/Test/Block/Adminhtml/Integration/Edit/IntegrationFormPageActions.php new file mode 100644 index 0000000000000..65721c65e35c8 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Integration/Test/Block/Adminhtml/Integration/Edit/IntegrationFormPageActions.php @@ -0,0 +1,32 @@ +_rootElement->find($this->saveNewButton)->click(); + } +} diff --git a/dev/tests/functional/tests/app/Magento/Integration/Test/Block/Adminhtml/Integration/IntegrationGrid.php b/dev/tests/functional/tests/app/Magento/Integration/Test/Block/Adminhtml/Integration/IntegrationGrid.php new file mode 100644 index 0000000000000..7c1ef5d21327a --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Integration/Test/Block/Adminhtml/Integration/IntegrationGrid.php @@ -0,0 +1,150 @@ + [ + 'selector' => 'input[name="name"]', + ], + 'status' => [ + 'selector' => 'input[name="status"]', + 'input' => 'select', + ], + ]; + + /** + * Locator value for link in action column + * + * @var string + */ + protected $editLink = '[data-column="edit"] button'; + + /** + * Locator value for delete link + * + * @var string + */ + protected $deleteLink = '[data-column="delete"] button'; + + /** + * Locator value for activate link + * + * @var string + */ + protected $activateLink = '[data-column="activate"] a'; + + /** + * Selector for delete block confirmation window + * + * @var string + */ + protected $deleteBlockSelector = './/ancestor::body/div[div[@id="integration-delete-container"]]'; + + /** + * Selector for Integration resources popup container + * + * @var string + */ + protected $resourcesPopupSelector = './/ancestor::body/div[descendant::div[@id="integration-popup-container"]]'; + + /** + * Selector for Integration tokens popup container + * + * @var string + */ + protected $tokensPopupSelector = './/ancestor::body/div[descendant::fieldset[contains(@id,"integration_token")]]'; + + /** + * Search and delete current item + * + * @param array $item + * @return void + */ + public function searchAndDelete(array $item) + { + $this->search($item); + $this->_rootElement->find($this->deleteLink)->click(); + + /** @var \Magento\Integration\Test\Block\Adminhtml\Integration\IntegrationGrid\DeleteDialog $deleteDialog */ + $deleteDialog = $this->blockFactory->create( + 'Magento\Integration\Test\Block\Adminhtml\Integration\IntegrationGrid\DeleteDialog', + ['element' => $this->_rootElement->find($this->deleteBlockSelector, Locator::SELECTOR_XPATH)] + ); + $deleteDialog->acceptDeletion(); + } + + /** + * Search and activate current item + * + * @param array $filter + * @return void + */ + public function searchAndActivate(array $filter) + { + $this->search($filter); + $this->_rootElement->find($this->activateLink)->click(); + } + + /** + * Search and reauthorize current item + * + * @param array $filter + * @return void + */ + public function searchAndReauthorize(array $filter) + { + $this->search($filter); + $this->_rootElement->find($this->activateLink)->click(); + } + + /** + * Return Integration resources popup block + * + * @return ResourcesPopup + */ + public function getResourcesPopup() + { + $resourcesPopup = $this->blockFactory->create( + 'Magento\Integration\Test\Block\Adminhtml\Integration\IntegrationGrid\ResourcesPopup', + ['element' => $this->_rootElement->find($this->resourcesPopupSelector, Locator::SELECTOR_XPATH)] + ); + $this->waitForElementVisible($this->resourcesPopupSelector, Locator::SELECTOR_XPATH); + + return $resourcesPopup; + } + + /** + * Return Integration tokens popup block + * + * @return TokensPopup + */ + public function getTokensPopup() + { + $tokensPopup = $this->blockFactory->create( + 'Magento\Integration\Test\Block\Adminhtml\Integration\IntegrationGrid\TokensPopup', + ['element' => $this->_rootElement->find($this->tokensPopupSelector, Locator::SELECTOR_XPATH)] + ); + $this->waitForElementVisible($this->tokensPopupSelector, Locator::SELECTOR_XPATH); + + return $tokensPopup; + } +} diff --git a/dev/tests/functional/tests/app/Magento/Integration/Test/Block/Adminhtml/Integration/IntegrationGrid/DeleteDialog.php b/dev/tests/functional/tests/app/Magento/Integration/Test/Block/Adminhtml/Integration/IntegrationGrid/DeleteDialog.php new file mode 100644 index 0000000000000..22f2c6759f75d --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Integration/Test/Block/Adminhtml/Integration/IntegrationGrid/DeleteDialog.php @@ -0,0 +1,33 @@ +_rootElement->find($this->deleteButton, Locator::SELECTOR_XPATH)->click(); + } +} diff --git a/dev/tests/functional/tests/app/Magento/Integration/Test/Block/Adminhtml/Integration/IntegrationGrid/ResourcesPopup.php b/dev/tests/functional/tests/app/Magento/Integration/Test/Block/Adminhtml/Integration/IntegrationGrid/ResourcesPopup.php new file mode 100644 index 0000000000000..3bec845d51b47 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Integration/Test/Block/Adminhtml/Integration/IntegrationGrid/ResourcesPopup.php @@ -0,0 +1,49 @@ +_rootElement->find($this->allowButtonSelector)->click(); + } + + /** + * Click reauthorize button in integration resources popup window. + * + * @return void + */ + public function clickReauthorizeButton() + { + $this->_rootElement->find($this->reauthorizeButtonSelector)->click(); + } +} diff --git a/dev/tests/functional/tests/app/Magento/Integration/Test/Block/Adminhtml/Integration/IntegrationGrid/ResourcesPopup.xml b/dev/tests/functional/tests/app/Magento/Integration/Test/Block/Adminhtml/Integration/IntegrationGrid/ResourcesPopup.xml new file mode 100644 index 0000000000000..7f41cce1614d2 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Integration/Test/Block/Adminhtml/Integration/IntegrationGrid/ResourcesPopup.xml @@ -0,0 +1,15 @@ + + + + + + [data-role="tree-resources-container"] + css selector + jquerytree + + + diff --git a/dev/tests/functional/tests/app/Magento/Integration/Test/Block/Adminhtml/Integration/IntegrationGrid/TokensPopup.php b/dev/tests/functional/tests/app/Magento/Integration/Test/Block/Adminhtml/Integration/IntegrationGrid/TokensPopup.php new file mode 100644 index 0000000000000..36be9659f1f9c --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Integration/Test/Block/Adminhtml/Integration/IntegrationGrid/TokensPopup.php @@ -0,0 +1,32 @@ +_rootElement->find($this->doneButtonSelector)->click(); + } +} diff --git a/dev/tests/functional/tests/app/Magento/Integration/Test/Block/Adminhtml/Integration/IntegrationGrid/TokensPopup.xml b/dev/tests/functional/tests/app/Magento/Integration/Test/Block/Adminhtml/Integration/IntegrationGrid/TokensPopup.xml new file mode 100644 index 0000000000000..237ec1fbff2c8 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Integration/Test/Block/Adminhtml/Integration/IntegrationGrid/TokensPopup.xml @@ -0,0 +1,16 @@ + + + + + + [name="consumer_key"] + + + + + + diff --git a/dev/tests/functional/tests/app/Magento/Integration/Test/Constraint/AssertIntegrationForm.php b/dev/tests/functional/tests/app/Magento/Integration/Test/Constraint/AssertIntegrationForm.php new file mode 100644 index 0000000000000..a63736cd0586e --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Integration/Test/Constraint/AssertIntegrationForm.php @@ -0,0 +1,119 @@ +getData() + : array_merge($initialIntegration->getData(), $integration->getData()); + $filter = [ + 'name' => $data['name'], + ]; + + $integrationIndexPage->open(); + $integrationIndexPage->getIntegrationGrid()->searchAndOpen($filter); + $formData = $integrationNewPage->getIntegrationForm()->getData(); + $dataDiff = $this->verifyForm($formData, $data); + \PHPUnit_Framework_Assert::assertEmpty( + $dataDiff, + 'Integration form was filled incorrectly.' + . "\nLog:\n" . implode(";\n", $dataDiff) + ); + } + + /** + * Verifying that form is filled correctly + * + * @param array $formData + * @param array $fixtureData + * @return array $errorMessages + * + * @SuppressWarnings(PHPMD.CyclomaticComplexity) + */ + protected function verifyForm(array $formData, array $fixtureData) + { + $issetResources = []; + $errorMessages = []; + $errorMessage = "Data in '%s' field not equal.\nExpected: %s\nActual: %s"; + + foreach ($fixtureData as $key => $value) { + if (in_array($key, $this->skippedFields)) { + continue; + } + if ($key === 'resources') { + $fixtureData[$key] = is_array($fixtureData[$key]) ? $fixtureData[$key] : [$fixtureData[$key]]; + foreach ($fixtureData[$key] as $fixtureResource) { + foreach ($formData[$key] as $formResource) { + if (preg_match('|^' . preg_quote($fixtureResource) . '|', $formResource)) { + $issetResources[] = $formResource; + } + } + } + $diff = array_diff($formData[$key], $issetResources); + if (!empty($diff)) { + $errorMessages[] = sprintf( + $errorMessage, + $key, + implode(",\n", $fixtureData[$key]), + implode(",\n", $formData[$key]) + ); + } + } elseif ($value !== $formData[$key]) { + $errorMessages[] = sprintf($errorMessage, $key, $value, $formData[$key]); + } + } + + return $errorMessages; + } + + /** + * Returns a string representation of successful assertion + * + * @return string + */ + public function toString() + { + return 'Integration form was filled correctly.'; + } +} diff --git a/dev/tests/functional/tests/app/Magento/Integration/Test/Constraint/AssertIntegrationInGrid.php b/dev/tests/functional/tests/app/Magento/Integration/Test/Constraint/AssertIntegrationInGrid.php new file mode 100644 index 0000000000000..9f951bf4cbbf0 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Integration/Test/Constraint/AssertIntegrationInGrid.php @@ -0,0 +1,57 @@ + ($initialIntegration !== null && !$integration->hasData('name')) + ? $initialIntegration->getName() + : $integration->getName(), + ]; + + $integrationIndexPage->open(); + \PHPUnit_Framework_Assert::assertTrue( + $integrationIndexPage->getIntegrationGrid()->isRowVisible($filter), + 'Integration \'' . $filter['name'] . '\' is absent in Integration grid.' + ); + } + + /** + * Returns a string representation of successful assertion + * + * @return string + */ + public function toString() + { + return 'Integration is present in grid.'; + } +} diff --git a/dev/tests/functional/tests/app/Magento/Integration/Test/Constraint/AssertIntegrationNotInGrid.php b/dev/tests/functional/tests/app/Magento/Integration/Test/Constraint/AssertIntegrationNotInGrid.php new file mode 100644 index 0000000000000..4ede24580af26 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Integration/Test/Constraint/AssertIntegrationNotInGrid.php @@ -0,0 +1,49 @@ + $integration->getName()]; + + $integrationIndexPage->open(); + \PHPUnit_Framework_Assert::assertFalse( + $integrationIndexPage->getIntegrationGrid()->isRowVisible($filter), + 'Integration \'' . $filter['name'] . '\' is present in Integration grid.' + ); + } + + /** + * Returns a string representation of successful assertion + * + * @return string + */ + public function toString() + { + return 'Integration is absent in grid.'; + } +} diff --git a/dev/tests/functional/tests/app/Magento/Integration/Test/Constraint/AssertIntegrationResourcesPopup.php b/dev/tests/functional/tests/app/Magento/Integration/Test/Constraint/AssertIntegrationResourcesPopup.php new file mode 100644 index 0000000000000..0775f54fb5946 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Integration/Test/Constraint/AssertIntegrationResourcesPopup.php @@ -0,0 +1,84 @@ +getResources()) + ? $integration->getResources() + : [$integration->getResources()]; + $formResources = $integrationIndex->getIntegrationGrid()->getResourcesPopup()->getData(); + $result = $this->verifyResources($formResources['resources'], $fixtureResources); + \PHPUnit_Framework_Assert::assertEmpty( + $result, + "Integration resources is not correct.\nLog:\n" . $result + ); + $integrationIndex->getIntegrationGrid()->getResourcesPopup()->clickAllowButton(); + } + + /** + * Verify that resources are correct + * + * @param array $formResources + * @param array $fixtureResources + * @return string + */ + protected function verifyResources(array $formResources, array $fixtureResources) + { + $errorMessage = ''; + $topFormResources = []; + + foreach ($fixtureResources as $fixtureResource) { + foreach ($formResources as $formResource) { + if (preg_match('|^' . preg_quote($fixtureResource) . '|', $formResource)) { + $topFormResources[] = $formResource; + } + } + } + $diff = array_diff($formResources, $topFormResources); + if (!empty($diff)) { + $errorMessage = sprintf( + "Resources are not equal.\nExpected: %s\nActual: %s", + implode(",\n", $fixtureResources), + implode(",\n", $formResources) + ); + } + + return $errorMessage; + } + + /** + * Returns a string representation of successful assertion + * + * @return string + */ + public function toString() + { + return 'Resources in popup window are shown correctly.'; + } +} diff --git a/dev/tests/functional/tests/app/Magento/Integration/Test/Constraint/AssertIntegrationSuccessActivationMessage.php b/dev/tests/functional/tests/app/Magento/Integration/Test/Constraint/AssertIntegrationSuccessActivationMessage.php new file mode 100644 index 0000000000000..b01706c3357e6 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Integration/Test/Constraint/AssertIntegrationSuccessActivationMessage.php @@ -0,0 +1,55 @@ +getName()); + $actualMessage = $integrationIndexPage->getMessagesBlock()->getSuccessMessages(); + \PHPUnit_Framework_Assert::assertEquals( + $expectedMessage, + $actualMessage, + 'Wrong success message is displayed.' + . "\nExpected: " . $expectedMessage + . "\nActual: " . $actualMessage + ); + } + + /** + * Returns a string representation of successful assertion + * + * @return string + */ + public function toString() + { + return 'Integration success activation message is correct.'; + } +} diff --git a/dev/tests/functional/tests/app/Magento/Integration/Test/Constraint/AssertIntegrationSuccessDeleteMessage.php b/dev/tests/functional/tests/app/Magento/Integration/Test/Constraint/AssertIntegrationSuccessDeleteMessage.php new file mode 100644 index 0000000000000..b4eebeb1be76e --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Integration/Test/Constraint/AssertIntegrationSuccessDeleteMessage.php @@ -0,0 +1,53 @@ +getName()); + $actualMessage = $integrationIndexPage->getMessagesBlock()->getSuccessMessages(); + \PHPUnit_Framework_Assert::assertEquals( + $expectedMessage, + $actualMessage, + 'Wrong success message is displayed.' + . "\nExpected: " . $expectedMessage + . "\nActual: " . $actualMessage + ); + } + + /** + * Returns a string representation of successful assertion + * + * @return string + */ + public function toString() + { + return 'Integrations success delete message is correct.'; + } +} diff --git a/dev/tests/functional/tests/app/Magento/Integration/Test/Constraint/AssertIntegrationSuccessReauthorizeMessage.php b/dev/tests/functional/tests/app/Magento/Integration/Test/Constraint/AssertIntegrationSuccessReauthorizeMessage.php new file mode 100644 index 0000000000000..a9ebd1799a305 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Integration/Test/Constraint/AssertIntegrationSuccessReauthorizeMessage.php @@ -0,0 +1,54 @@ +getName()), + $integrationIndexPage->getMessagesBlock()->getSuccessMessages(), + "Wrong success message is displayed." + ); + } + + /** + * Returns a string representation of successful assertion. + * + * @return string + */ + public function toString() + { + return 'Integration success reauthorize message is correct.'; + } +} diff --git a/dev/tests/functional/tests/app/Magento/Integration/Test/Constraint/AssertIntegrationSuccessSaveMessage.php b/dev/tests/functional/tests/app/Magento/Integration/Test/Constraint/AssertIntegrationSuccessSaveMessage.php new file mode 100644 index 0000000000000..2e0d060bad29b --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Integration/Test/Constraint/AssertIntegrationSuccessSaveMessage.php @@ -0,0 +1,60 @@ +hasData('name')) + ? $initialIntegration->getName() + : $integration->getName(); + $expectedMessage = sprintf(self::SUCCESS_SAVE_MESSAGE, $name); + $actualMessage = $integrationIndexPage->getMessagesBlock()->getSuccessMessages(); + \PHPUnit_Framework_Assert::assertEquals( + $expectedMessage, + $actualMessage, + 'Wrong success message is displayed.' + . "\nExpected: " . $expectedMessage + . "\nActual: " . $actualMessage + ); + } + + /** + * Returns a string representation of successful assertion + * + * @return string + */ + public function toString() + { + return 'Integration success save message is correct.'; + } +} diff --git a/dev/tests/functional/tests/app/Magento/Integration/Test/Constraint/AssertIntegrationTokensAfterReauthorize.php b/dev/tests/functional/tests/app/Magento/Integration/Test/Constraint/AssertIntegrationTokensAfterReauthorize.php new file mode 100644 index 0000000000000..8d94bb2da09fd --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Integration/Test/Constraint/AssertIntegrationTokensAfterReauthorize.php @@ -0,0 +1,105 @@ + $integration->getName()]; + $integrationIndex->open(); + $integrationIndex->getIntegrationGrid()->searchAndOpen($filter); + $actualData = $integrationNew->getIntegrationForm()->getData(); + $errors = $this->checkTokens($actualData, $integration->getData()); + + \PHPUnit_Framework_Assert::assertEmpty( + $errors, + "Integration tokens was changed incorrectly.\nLog:\n" . implode(";\n", $errors) + ); + } + + /** + * Check tokens was changed correctly. + * + * @param array $actualData + * @param array $tokens + * @return array + */ + protected function checkTokens(array $actualData, array $tokens) + { + $errors = []; + foreach ($this->consumerKeys as $consumerKey) { + if ($actualData[$consumerKey] !== $tokens[$consumerKey]) { + $errors[] = "Field '" . $consumerKey . "' was changed."; + } + } + foreach ($this->accessTokens as $accessToken) { + if ($actualData[$accessToken] === $tokens[$accessToken]) { + $errors[] = "Field '" . $accessToken . "' was not changed."; + } + } + return $errors; + } + + /** + * Returns a string representation of successful assertion. + * + * @return string + */ + public function toString() + { + return 'Access tokens were reauthorized correctly.'; + } +} diff --git a/dev/tests/functional/tests/app/Magento/Integration/Test/Constraint/AssertIntegrationTokensPopup.php b/dev/tests/functional/tests/app/Magento/Integration/Test/Constraint/AssertIntegrationTokensPopup.php new file mode 100644 index 0000000000000..65c56809d69f7 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Integration/Test/Constraint/AssertIntegrationTokensPopup.php @@ -0,0 +1,75 @@ +getIntegrationGrid()->getTokensPopup()->getData(); + $tokensKeys = array_keys($tokensData); + $diff = array_diff($this->fields, $tokensKeys); + if (!empty($diff)) { + $errors[] = 'Field(s) "' . implode(', ', $diff) . '" is absent in integration tokens.'; + } + foreach ($tokensData as $key => $value) { + if (empty($value)) { + $errors[] = 'Field with key: ' . $key . '" is empty in integration tokens.'; + } + } + \PHPUnit_Framework_Assert::assertEmpty( + $errors, + "Integration tokens is not correct.\nLog:\n" . implode(";\n", $errors) + ); + $integrationIndex->getIntegrationGrid()->getTokensPopup()->clickDoneButton(); + } + + /** + * Returns a string representation of successful assertion + * + * @return string + */ + public function toString() + { + return 'Tokens is shown and not empty.'; + } +} diff --git a/dev/tests/functional/tests/app/Magento/Integration/Test/Fixture/Integration.php b/dev/tests/functional/tests/app/Magento/Integration/Test/Fixture/Integration.php new file mode 100644 index 0000000000000..d065ded8f848b --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Integration/Test/Fixture/Integration.php @@ -0,0 +1,380 @@ + 'default_integration_%isolation%', + 'email' => 'test_%isolation%@example.com', + 'resource_access' => 'All', + ]; + + protected $integration_id = [ + 'attribute_code' => 'integration_id', + 'backend_type' => 'int', + 'is_required' => '1', + 'default_value' => '', + 'input' => '', + ]; + + protected $name = [ + 'attribute_code' => 'name', + 'backend_type' => 'varchar', + 'is_required' => '', + 'default_value' => '', + 'input' => '', + 'group' => 'integration_info', + ]; + + protected $email = [ + 'attribute_code' => 'email', + 'backend_type' => 'varchar', + 'is_required' => '', + 'default_value' => '', + 'input' => '', + 'group' => 'integration_info', + ]; + + protected $endpoint = [ + 'attribute_code' => 'endpoint', + 'backend_type' => 'varchar', + 'is_required' => '', + 'default_value' => '', + 'input' => '', + 'group' => 'integration_info', + ]; + + protected $status = [ + 'attribute_code' => 'status', + 'backend_type' => 'smallint', + 'is_required' => '', + 'default_value' => '', + 'input' => '', + ]; + + protected $consumer_id = [ + 'attribute_code' => 'consumer_id', + 'backend_type' => 'int', + 'is_required' => '', + 'default_value' => '', + 'input' => '', + ]; + + protected $created_at = [ + 'attribute_code' => 'created_at', + 'backend_type' => 'timestamp', + 'is_required' => '', + 'default_value' => 'CURRENT_TIMESTAMP', + 'input' => '', + ]; + + protected $updated_at = [ + 'attribute_code' => 'updated_at', + 'backend_type' => 'timestamp', + 'is_required' => '', + 'default_value' => '', + 'input' => '', + ]; + + protected $setup_type = [ + 'attribute_code' => 'setup_type', + 'backend_type' => 'smallint', + 'is_required' => '', + 'default_value' => '0', + 'input' => '', + ]; + + protected $identity_link_url = [ + 'attribute_code' => 'identity_link_url', + 'backend_type' => 'varchar', + 'is_required' => '', + 'default_value' => '', + 'input' => '', + 'group' => 'integration_info', + ]; + + protected $entity_id = [ + 'attribute_code' => 'entity_id', + 'backend_type' => 'int', + 'is_required' => '1', + 'default_value' => '', + 'input' => '', + ]; + + protected $admin_id = [ + 'attribute_code' => 'admin_id', + 'backend_type' => 'int', + 'is_required' => '', + 'default_value' => '', + 'input' => '', + ]; + + protected $customer_id = [ + 'attribute_code' => 'customer_id', + 'backend_type' => 'int', + 'is_required' => '', + 'default_value' => '', + 'input' => '', + ]; + + protected $type = [ + 'attribute_code' => 'type', + 'backend_type' => 'varchar', + 'is_required' => '', + 'default_value' => '', + 'input' => '', + ]; + + protected $token = [ + 'attribute_code' => 'token', + 'backend_type' => 'varchar', + 'is_required' => '', + 'default_value' => '', + 'input' => '', + ]; + + protected $secret = [ + 'attribute_code' => 'secret', + 'backend_type' => 'varchar', + 'is_required' => '', + 'default_value' => '', + 'input' => '', + ]; + + protected $verifier = [ + 'attribute_code' => 'verifier', + 'backend_type' => 'varchar', + 'is_required' => '', + 'default_value' => '', + 'input' => '', + ]; + + protected $callback_url = [ + 'attribute_code' => 'callback_url', + 'backend_type' => 'varchar', + 'is_required' => '', + 'default_value' => '', + 'input' => '', + ]; + + protected $revoked = [ + 'attribute_code' => 'revoked', + 'backend_type' => 'smallint', + 'is_required' => '', + 'default_value' => '0', + 'input' => '', + ]; + + protected $authorized = [ + 'attribute_code' => 'authorized', + 'backend_type' => 'smallint', + 'is_required' => '', + 'default_value' => '0', + 'input' => '', + ]; + + protected $user_type = [ + 'attribute_code' => 'user_type', + 'backend_type' => 'int', + 'is_required' => '', + 'default_value' => '', + 'input' => '', + ]; + + protected $key = [ + 'attribute_code' => 'key', + 'backend_type' => 'varchar', + 'is_required' => '', + 'default_value' => '', + 'input' => '', + ]; + + protected $rejected_callback_url = [ + 'attribute_code' => 'rejected_callback_url', + 'backend_type' => 'varchar', + 'is_required' => '', + 'default_value' => '', + 'input' => '', + ]; + + protected $resource_access = [ + 'attribute_code' => 'resource_access', + 'backend_type' => 'virtual', + 'group' => 'api', + ]; + + protected $resources = [ + 'attribute_code' => 'resources', + 'backend_type' => 'virtual', + 'group' => 'api', + ]; + + protected $token_secret = [ + 'attribute_code' => 'token_secret', + 'backend_type' => 'virtual', + 'group' => 'integration_info', + ]; + + protected $consumer_secret = [ + 'attribute_code' => 'consumer_secret', + 'backend_type' => 'virtual', + 'group' => 'integration_info', + ]; + + public function getIntegrationId() + { + return $this->getData('integration_id'); + } + + public function getName() + { + return $this->getData('name'); + } + + public function getEmail() + { + return $this->getData('email'); + } + + public function getEndpoint() + { + return $this->getData('endpoint'); + } + + public function getStatus() + { + return $this->getData('status'); + } + + public function getConsumerId() + { + return $this->getData('consumer_id'); + } + + public function getCreatedAt() + { + return $this->getData('created_at'); + } + + public function getUpdatedAt() + { + return $this->getData('updated_at'); + } + + public function getSetupType() + { + return $this->getData('setup_type'); + } + + public function getIdentityLinkUrl() + { + return $this->getData('identity_link_url'); + } + + public function getEntityId() + { + return $this->getData('entity_id'); + } + + public function getAdminId() + { + return $this->getData('admin_id'); + } + + public function getCustomerId() + { + return $this->getData('customer_id'); + } + + public function getType() + { + return $this->getData('type'); + } + + public function getToken() + { + return $this->getData('token'); + } + + public function getSecret() + { + return $this->getData('secret'); + } + + public function getVerifier() + { + return $this->getData('verifier'); + } + + public function getCallbackUrl() + { + return $this->getData('callback_url'); + } + + public function getRevoked() + { + return $this->getData('revoked'); + } + + public function getAuthorized() + { + return $this->getData('authorized'); + } + + public function getUserType() + { + return $this->getData('user_type'); + } + + public function getKey() + { + return $this->getData('key'); + } + + public function getRejectedCallbackUrl() + { + return $this->getData('rejected_callback_url'); + } + + public function getResourceAccess() + { + return $this->getData('resource_access'); + } + + public function getResources() + { + return $this->getData('resources'); + } + + public function getTokenSecret() + { + return $this->getData('token_secret'); + } + + public function getConsumerSecret() + { + return $this->getData('consumer_secret'); + } +} diff --git a/dev/tests/functional/tests/app/Magento/Integration/Test/Fixture/Integration.xml b/dev/tests/functional/tests/app/Magento/Integration/Test/Fixture/Integration.xml new file mode 100644 index 0000000000000..2fa6a33efd8ca --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Integration/Test/Fixture/Integration.xml @@ -0,0 +1,206 @@ + + + + Magento_Integration + composite + + integration + oauth_token + oauth_consumer + + integration + Magento\Integration\Model\Resource\Integration\Collection + + + integration_id + int + 1 + + + + + name + varchar + + + + integration_info + + + email + varchar + + + + integration_info + + + endpoint + varchar + + + + integration_info + + + status + smallint + + + + + + consumer_id + int + + + + + + created_at + timestamp + + CURRENT_TIMESTAMP + + + + updated_at + timestamp + + 0000-00-00 00:00:00 + + + + setup_type + smallint + + 0 + + + + identity_link_url + varchar + + + + integration_info + + + entity_id + int + 1 + + + + + admin_id + int + + + + + + customer_id + int + + + + + + type + varchar + + + + + + token + varchar + + + + + + secret + varchar + + + + + + verifier + varchar + + + + + + callback_url + varchar + + + + + + revoked + smallint + + 0 + + + + authorized + smallint + + 0 + + + + user_type + int + + + + + + key + varchar + + + + + + rejected_callback_url + varchar + + + + + + resource_access + virtual + api + + + resources + virtual + api + + + token_secret + virtual + api + + + consumer_secret + virtual + api + + + Magento\Integration\Test\Repository\Integration + Magento\Integration\Test\Handler\Integration\IntegrationInterface + diff --git a/dev/tests/functional/tests/app/Magento/Integration/Test/Handler/Integration/Curl.php b/dev/tests/functional/tests/app/Magento/Integration/Test/Handler/Integration/Curl.php new file mode 100644 index 0000000000000..ec0cddeffb726 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Integration/Test/Handler/Integration/Curl.php @@ -0,0 +1,50 @@ +getData(); + $data['all_resources'] = ($data['resource_access'] === 'All') ? 1 : 0; + /** Initialize cURL client which is authenticated to the Magento backend */ + $curl = new BackendDecorator(new CurlTransport(), new Config()); + /** Create new integration via cURL */ + $url = $_ENV['app_backend_url'] . 'admin/integration/save'; + $curl->write(CurlInterface::POST, $url, '1.0', [], $data); + $response = $curl->read(); + $curl->close(); + + if (!strpos($response, 'data-ui-id="messages-message-success"')) { + throw new \Exception("Integration creation by curl handler was not successful! Response: $response"); + } + + preg_match('~.*?' . $data['name'] . '.*?/integration/edit/id/(\d+)/~siu', $response, $matches); + $id = isset($matches[1]) ? $matches[1] : null; + + return ['integration_id' => $id]; + } +} diff --git a/dev/tests/functional/tests/app/Magento/Integration/Test/Handler/Integration/IntegrationInterface.php b/dev/tests/functional/tests/app/Magento/Integration/Test/Handler/Integration/IntegrationInterface.php new file mode 100644 index 0000000000000..a660f93f5b87b --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Integration/Test/Handler/Integration/IntegrationInterface.php @@ -0,0 +1,16 @@ + + + + + + Magento\Backend\Test\Block\GridPageActions + .page-main-actions + css selector + + + Magento\Integration\Test\Block\Adminhtml\Integration\IntegrationGrid + #integrationGrid + css selector + + + Magento\Core\Test\Block\Messages + #messages + css selector + + + diff --git a/dev/tests/functional/tests/app/Magento/Integration/Test/Page/Adminhtml/IntegrationNew.xml b/dev/tests/functional/tests/app/Magento/Integration/Test/Page/Adminhtml/IntegrationNew.xml new file mode 100644 index 0000000000000..b43b637eae607 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Integration/Test/Page/Adminhtml/IntegrationNew.xml @@ -0,0 +1,20 @@ + + + + + + Magento\Integration\Test\Block\Adminhtml\Integration\Edit\IntegrationFormPageActions + .page-main-actions + css selector + + + Magento\Integration\Test\Block\Adminhtml\Integration\Edit\IntegrationForm + [id="page:main-container"] + css selector + + + diff --git a/dev/tests/functional/tests/app/Magento/Integration/Test/Repository/Integration.php b/dev/tests/functional/tests/app/Magento/Integration/Test/Repository/Integration.php new file mode 100644 index 0000000000000..ed694f2a775c7 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Integration/Test/Repository/Integration.php @@ -0,0 +1,43 @@ +_data['default_with_all_resources'] = [ + 'name' => 'default_integration_%isolation%', + 'email' => 'test_%isolation%@example.com', + 'resource_access' => 'All', + 'resources' => [ + 'Dashboard', + 'Sales', + 'Products', + 'Customers', + 'My Account', + 'Marketing', + 'Content', + 'Reports', + 'Stores', + 'System', + 'Global Search', + ], + ]; + } +} diff --git a/dev/tests/functional/tests/app/Magento/Integration/Test/TestCase/ActivateIntegrationEntityTest.php b/dev/tests/functional/tests/app/Magento/Integration/Test/TestCase/ActivateIntegrationEntityTest.php new file mode 100644 index 0000000000000..c665073f124b7 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Integration/Test/TestCase/ActivateIntegrationEntityTest.php @@ -0,0 +1,64 @@ + Extensions > Integrations + * 3. Click on the "Activate" link near required integration. + * 4. Perform all assertions. + * + * @group Web_API_Framework_(PS) + * @ZephyrId MAGETWO-26119 + */ +class ActivateIntegrationEntityTest extends Injectable +{ + /** + * Integration grid page + * + * @var IntegrationIndex + */ + protected $integrationIndexPage; + + /** + * Injection data + * + * @param IntegrationIndex $integrationIndex + * @return void + */ + public function __inject(IntegrationIndex $integrationIndex) + { + $this->integrationIndexPage = $integrationIndex; + } + + /** + * Activate Integration Entity Test + * + * @param Integration $integration + * @return void + */ + public function test(Integration $integration) + { + // Preconditions + $integration->persist(); + + // Steps + $filter = ['name' => $integration->getName()]; + $this->integrationIndexPage->open(); + $this->integrationIndexPage->getIntegrationGrid()->searchAndActivate($filter); + } +} diff --git a/dev/tests/functional/tests/app/Magento/Integration/Test/TestCase/ActivateIntegrationEntityTest/test.csv b/dev/tests/functional/tests/app/Magento/Integration/Test/TestCase/ActivateIntegrationEntityTest/test.csv new file mode 100644 index 0000000000000..b45762c3f39bc --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Integration/Test/TestCase/ActivateIntegrationEntityTest/test.csv @@ -0,0 +1,2 @@ +"integration/dataSet";"constraint" +"default_with_all_resources";"assertIntegrationResourcesPopup, assertIntegrationTokensPopup, assertIntegrationSuccessActivationMessage" \ No newline at end of file diff --git a/dev/tests/functional/tests/app/Magento/Integration/Test/TestCase/CreateIntegrationEntityTest.php b/dev/tests/functional/tests/app/Magento/Integration/Test/TestCase/CreateIntegrationEntityTest.php new file mode 100644 index 0000000000000..7c308b09a8e14 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Integration/Test/TestCase/CreateIntegrationEntityTest.php @@ -0,0 +1,71 @@ + Extensions > Integrations + * 3. Start to create new Integration. + * 4. Fill in all data according to data set. + * 5. Click "Save" button. + * 6. Perform all assertions. + * + * @group Web_API_Framework_(PS) + * @ZephyrId MAGETWO-26009 + */ +class CreateIntegrationEntityTest extends Injectable +{ + /** + * Integration grid page + * + * @var IntegrationIndex + */ + protected $integrationIndexPage; + + /** + * Integration new page + * + * @var IntegrationNew + */ + protected $integrationNewPage; + + /** + * Injection data + * + * @param IntegrationIndex $integrationIndex + * @param IntegrationNew $integrationNew + * @return void + */ + public function __inject(IntegrationIndex $integrationIndex, IntegrationNew $integrationNew) + { + $this->integrationIndexPage = $integrationIndex; + $this->integrationNewPage = $integrationNew; + } + + /** + * Create Integration Entity test + * + * @param Integration $integration + * @return void + */ + public function test(Integration $integration) + { + // Steps + $this->integrationIndexPage->open(); + $this->integrationIndexPage->getGridPageActions()->addNew(); + $this->integrationNewPage->getIntegrationForm()->fill($integration); + $this->integrationNewPage->getFormPageActions()->saveNew(); + } +} diff --git a/dev/tests/functional/tests/app/Magento/Integration/Test/TestCase/CreateIntegrationEntityTest/test.csv b/dev/tests/functional/tests/app/Magento/Integration/Test/TestCase/CreateIntegrationEntityTest/test.csv new file mode 100644 index 0000000000000..c9919097b4208 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Integration/Test/TestCase/CreateIntegrationEntityTest/test.csv @@ -0,0 +1,4 @@ +"integration/data/name";"integration/data/email";"integration/data/endpoint";"integration/data/identity_link_url";"integration/data/resource_access";"integration/data/resources";"constraint" +"Integration%isolation%";"test@example.com";"https://endpoint.com";"https://testlink.com";"All";"-";"assertIntegrationSuccessSaveMessage, assertIntegrationForm, assertIntegrationInGrid" +"Integration%isolation%";"-";"-";"-";"Custom";"Sales";"assertIntegrationSuccessSaveMessage, assertIntegrationForm, assertIntegrationInGrid" +"Integration%isolation%";"-";"-";"-";"All";"-";"assertIntegrationSuccessSaveMessage, assertIntegrationForm, assertIntegrationInGrid" diff --git a/dev/tests/functional/tests/app/Magento/Integration/Test/TestCase/DeleteIntegrationEntityTest.php b/dev/tests/functional/tests/app/Magento/Integration/Test/TestCase/DeleteIntegrationEntityTest.php new file mode 100644 index 0000000000000..d4042f8e03777 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Integration/Test/TestCase/DeleteIntegrationEntityTest.php @@ -0,0 +1,65 @@ + Extensions > Integrations + * 3. Click on the "Remove" icon for required integration + * 4. Click "Delete" button. + * 5. Perform all assertions. + * + * @group Web_API_Framework_(PS) + * @ZephyrId MAGETWO-26058 + */ +class DeleteIntegrationEntityTest extends Injectable +{ + /** + * Integration grid page + * + * @var IntegrationIndex + */ + protected $integrationIndexPage; + + /** + * Injection data + * + * @param IntegrationIndex $integrationIndex + * @return void + */ + public function __inject(IntegrationIndex $integrationIndex) + { + $this->integrationIndexPage = $integrationIndex; + } + + /** + * Delete Integration Entity test + * + * @param Integration $integration + * @return void + */ + public function test(Integration $integration) + { + // Precondition + $integration->persist(); + + // Steps + $filter = ['name' => $integration->getName()]; + $this->integrationIndexPage->open(); + $this->integrationIndexPage->getIntegrationGrid()->searchAndDelete($filter); + } +} diff --git a/dev/tests/functional/tests/app/Magento/Integration/Test/TestCase/DeleteIntegrationEntityTest/test.csv b/dev/tests/functional/tests/app/Magento/Integration/Test/TestCase/DeleteIntegrationEntityTest/test.csv new file mode 100644 index 0000000000000..e27376a13f05c --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Integration/Test/TestCase/DeleteIntegrationEntityTest/test.csv @@ -0,0 +1,2 @@ +"constraint" +"assertIntegrationSuccessDeleteMessage, assertIntegrationNotInGrid" \ No newline at end of file diff --git a/dev/tests/functional/tests/app/Magento/Integration/Test/TestCase/ReAuthorizeTokensIntegrationEntityTest.php b/dev/tests/functional/tests/app/Magento/Integration/Test/TestCase/ReAuthorizeTokensIntegrationEntityTest.php new file mode 100644 index 0000000000000..5e1618b941e0b --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Integration/Test/TestCase/ReAuthorizeTokensIntegrationEntityTest.php @@ -0,0 +1,90 @@ +integrationIndex = $integrationIndex; + $this->fixtureFactory = $fixtureFactory; + } + + /** + * Test for Reauthorize tokens for the Integration Entity. + * + * @param Integration $integration + * @return array + */ + public function test(Integration $integration) + { + $this->markTestIncomplete('MAGETWO-26850'); + // Precondition + $integration->persist(); + $filter = ['name' => $integration->getName()]; + $this->integrationIndex->open(); + $this->integrationIndex->getIntegrationGrid()->searchAndActivate($filter); + $this->integrationIndex->getIntegrationGrid()->getResourcesPopup()->clickAllowButton(); + $tokens = $this->integrationIndex->getIntegrationGrid()->getTokensPopup()->getData(); + $this->integrationIndex->getIntegrationGrid()->getTokensPopup()->clickDoneButton(); + $integration = $this->fixtureFactory->createByCode( + 'integration', + ['data' => array_merge($integration->getData(), $tokens)] + ); + + // Steps + $this->integrationIndex->getIntegrationGrid()->searchAndReauthorize($filter); + $this->integrationIndex->getIntegrationGrid()->getResourcesPopup()->clickReauthorizeButton(); + $this->integrationIndex->getIntegrationGrid()->getTokensPopup()->clickDoneButton(); + + return ['integration' => $integration]; + } +} diff --git a/dev/tests/functional/tests/app/Magento/Integration/Test/TestCase/ReAuthorizeTokensIntegrationEntityTest/test.csv b/dev/tests/functional/tests/app/Magento/Integration/Test/TestCase/ReAuthorizeTokensIntegrationEntityTest/test.csv new file mode 100644 index 0000000000000..13f1a2efee0f3 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Integration/Test/TestCase/ReAuthorizeTokensIntegrationEntityTest/test.csv @@ -0,0 +1,2 @@ +"description";"constraint" +"Re-authorize integration";"assertIntegrationSuccessReauthorizeMessage, assertIntegrationForm, assertIntegrationTokensAfterReauthorize" diff --git a/dev/tests/functional/tests/app/Magento/Integration/Test/TestCase/UpdateIntegrationEntityTest.php b/dev/tests/functional/tests/app/Magento/Integration/Test/TestCase/UpdateIntegrationEntityTest.php new file mode 100644 index 0000000000000..856b7b3acf252 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Integration/Test/TestCase/UpdateIntegrationEntityTest.php @@ -0,0 +1,79 @@ + Extensions > Integrations + * 3. Select an integration in the grid. + * 4. Edit test value(s) according to dataset. + * 5. Click "Save" button. + * 6. Perform all assertions. + * + * @group Web_API_Framework_(PS) + * @ZephyrId MAGETWO-26102 + */ +class UpdateIntegrationEntityTest extends Injectable +{ + /** + * Integration grid page + * + * @var IntegrationIndex + */ + protected $integrationIndexPage; + + /** + * Integration edit page + * + * @var IntegrationNew + */ + protected $integrationNewPage; + + /** + * Injection data + * + * @param IntegrationIndex $integrationIndex + * @param IntegrationNew $integrationNew + * @return void + */ + public function __inject(IntegrationIndex $integrationIndex, IntegrationNew $integrationNew) + { + $this->integrationIndexPage = $integrationIndex; + $this->integrationNewPage = $integrationNew; + } + + /** + * Update Integration Entity test + * + * @param Integration $initialIntegration + * @param Integration $integration + * @return void + */ + public function test(Integration $initialIntegration, Integration $integration) + { + // Precondition + $initialIntegration->persist(); + + // Steps + $filter = ['name' => $initialIntegration->getName()]; + $this->integrationIndexPage->open(); + $this->integrationIndexPage->getIntegrationGrid()->searchAndOpen($filter); + $this->integrationNewPage->getIntegrationForm()->fill($integration); + $this->integrationNewPage->getFormPageActions()->save(); + } +} diff --git a/dev/tests/functional/tests/app/Magento/Integration/Test/TestCase/UpdateIntegrationEntityTest/test.csv b/dev/tests/functional/tests/app/Magento/Integration/Test/TestCase/UpdateIntegrationEntityTest/test.csv new file mode 100644 index 0000000000000..30b011826520f --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Integration/Test/TestCase/UpdateIntegrationEntityTest/test.csv @@ -0,0 +1,3 @@ +"integration/data/name";"integration/data/email";"integration/data/endpoint";"integration/data/identity_link_url";"integration/data/resource_access";"integration/data/resources";"constraint" +"Integration_%isolation%";"-";"https://endpoint.com";"https://testlink.com";"-";"-";"assertIntegrationSuccessSaveMessage, assertIntegrationForm, assertIntegrationInGrid" +"Integration_%isolation%";"-";"-";"-";"Custom";"Sales";"assertIntegrationSuccessSaveMessage, assertIntegrationForm, assertIntegrationInGrid" diff --git a/dev/tests/functional/tests/app/Magento/Integration/Test/etc/constraint.xml b/dev/tests/functional/tests/app/Magento/Integration/Test/etc/constraint.xml new file mode 100644 index 0000000000000..d07530258b25d --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Integration/Test/etc/constraint.xml @@ -0,0 +1,79 @@ + + + + + high + + + + + + + high + + + + + + + high + + + + + + + + low + + + + + + + high + + + + + + + high + + + + + + + high + + + + + + high + + + + + + + high + + + + + + + high + + + + + + + diff --git a/dev/tests/functional/tests/app/Magento/Integration/Test/etc/curl/di.xml b/dev/tests/functional/tests/app/Magento/Integration/Test/etc/curl/di.xml new file mode 100644 index 0000000000000..06c7df5e63cc1 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Integration/Test/etc/curl/di.xml @@ -0,0 +1,9 @@ + + + + + diff --git a/dev/tests/functional/tests/app/Magento/Integration/Test/etc/fixture.xml b/dev/tests/functional/tests/app/Magento/Integration/Test/etc/fixture.xml new file mode 100644 index 0000000000000..392e61ed47eac --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Integration/Test/etc/fixture.xml @@ -0,0 +1,40 @@ + + + + + composite + + integration + oauth_token + oauth_consumer + + integration + Magento\Integration\Model\Resource\Integration\Collection + + + resource_access + virtual + api + + + resources + virtual + api + + + token_secret + virtual + api + + + consumer_secret + virtual + api + + + + diff --git a/dev/tests/functional/tests/app/Magento/Integration/Test/etc/page.xml b/dev/tests/functional/tests/app/Magento/Integration/Test/etc/page.xml new file mode 100644 index 0000000000000..bde76ec54b7e3 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Integration/Test/etc/page.xml @@ -0,0 +1,18 @@ + + + + + admin/integration/index + adminhtml + Magento\Integration\Test\Page\Adminhtml\IntegrationIndex + + + admin/integration/new + adminhtml + Magento\Integration\Test\Page\Adminhtml\IntegrationNew + + diff --git a/dev/tests/functional/tests/app/Magento/LayeredNavigation/Test/Block/Navigation.php b/dev/tests/functional/tests/app/Magento/LayeredNavigation/Test/Block/Navigation.php deleted file mode 100644 index 02ff5bc282e0f..0000000000000 --- a/dev/tests/functional/tests/app/Magento/LayeredNavigation/Test/Block/Navigation.php +++ /dev/null @@ -1,99 +0,0 @@ -reinitRootElement(); - $this->_rootElement->find($this->clearAll, locator::SELECTOR_CSS)->click(); - } - - /** - * Select product price range. - * - * @param string $range - * @return void - */ - public function selectPriceRange($range) - { - $this->reinitRootElement(); - $this->_rootElement->find(sprintf($this->priceRange, $range))->click(); - } - - /** - * Select attribute option. - * - * @param string $optionName - * @return void - */ - public function selectAttributeOption($optionName) - { - $this->reinitRootElement(); - $this->_rootElement->find(sprintf($this->attributeOption, $optionName), Locator::SELECTOR_XPATH)->click(); - } - - /** - * Get array of available filters. - * - * @return array - */ - public function getFilters() - { - $options = $this->_rootElement->find($this->optionTitle)->getElements(); - $data = []; - foreach ($options as $option) { - $data[] = $option->getText(); - } - return $data; - } -} diff --git a/dev/tests/functional/tests/app/Magento/Newsletter/Test/Constraint/AssertCustomerIsSubscribedToNewsletter.php b/dev/tests/functional/tests/app/Magento/Newsletter/Test/Constraint/AssertCustomerIsSubscribedToNewsletter.php index d4df4c5f18ba4..e495cc5c26b6f 100644 --- a/dev/tests/functional/tests/app/Magento/Newsletter/Test/Constraint/AssertCustomerIsSubscribedToNewsletter.php +++ b/dev/tests/functional/tests/app/Magento/Newsletter/Test/Constraint/AssertCustomerIsSubscribedToNewsletter.php @@ -15,12 +15,9 @@ */ class AssertCustomerIsSubscribedToNewsletter extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert customer is subscribed to newsletter diff --git a/dev/tests/functional/tests/app/Magento/Newsletter/Test/Constraint/AssertNewsletterForm.php b/dev/tests/functional/tests/app/Magento/Newsletter/Test/Constraint/AssertNewsletterForm.php index f07cb841b2d8f..87ecaab62d783 100644 --- a/dev/tests/functional/tests/app/Magento/Newsletter/Test/Constraint/AssertNewsletterForm.php +++ b/dev/tests/functional/tests/app/Magento/Newsletter/Test/Constraint/AssertNewsletterForm.php @@ -16,12 +16,9 @@ */ class AssertNewsletterForm extends AbstractAssertForm { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that newsletter template form data equals to data passed from fixture diff --git a/dev/tests/functional/tests/app/Magento/Newsletter/Test/Constraint/AssertNewsletterInGrid.php b/dev/tests/functional/tests/app/Magento/Newsletter/Test/Constraint/AssertNewsletterInGrid.php index 3a8978e4e2241..6413cb74527e3 100644 --- a/dev/tests/functional/tests/app/Magento/Newsletter/Test/Constraint/AssertNewsletterInGrid.php +++ b/dev/tests/functional/tests/app/Magento/Newsletter/Test/Constraint/AssertNewsletterInGrid.php @@ -16,12 +16,9 @@ */ class AssertNewsletterInGrid extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that newsletter template is present in grid diff --git a/dev/tests/functional/tests/app/Magento/Newsletter/Test/Constraint/AssertNewsletterPreview.php b/dev/tests/functional/tests/app/Magento/Newsletter/Test/Constraint/AssertNewsletterPreview.php index 631e908de3c39..358d9577e582c 100644 --- a/dev/tests/functional/tests/app/Magento/Newsletter/Test/Constraint/AssertNewsletterPreview.php +++ b/dev/tests/functional/tests/app/Magento/Newsletter/Test/Constraint/AssertNewsletterPreview.php @@ -16,12 +16,9 @@ */ class AssertNewsletterPreview extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that newsletter preview opened in new window and template content correct diff --git a/dev/tests/functional/tests/app/Magento/Newsletter/Test/Constraint/AssertNewsletterQueue.php b/dev/tests/functional/tests/app/Magento/Newsletter/Test/Constraint/AssertNewsletterQueue.php index 912fe3596534b..2ce269d38a27f 100644 --- a/dev/tests/functional/tests/app/Magento/Newsletter/Test/Constraint/AssertNewsletterQueue.php +++ b/dev/tests/functional/tests/app/Magento/Newsletter/Test/Constraint/AssertNewsletterQueue.php @@ -15,6 +15,10 @@ */ class AssertNewsletterQueue extends AbstractAssertForm { + /* tags */ + const SEVERITY = 'low'; + /* end tags */ + /** * Skipped fields for verify data * @@ -22,13 +26,6 @@ class AssertNewsletterQueue extends AbstractAssertForm */ protected $skippedFields = ['code']; - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; - /** * Assert that "Edit Queue" page opened and subject, sender name, sender email and template content correct * diff --git a/dev/tests/functional/tests/app/Magento/Newsletter/Test/Constraint/AssertNewsletterSuccessCreateMessage.php b/dev/tests/functional/tests/app/Magento/Newsletter/Test/Constraint/AssertNewsletterSuccessCreateMessage.php index 0301b63722ab6..f6fd7b3160427 100644 --- a/dev/tests/functional/tests/app/Magento/Newsletter/Test/Constraint/AssertNewsletterSuccessCreateMessage.php +++ b/dev/tests/functional/tests/app/Magento/Newsletter/Test/Constraint/AssertNewsletterSuccessCreateMessage.php @@ -15,14 +15,11 @@ */ class AssertNewsletterSuccessCreateMessage extends AbstractConstraint { - const SUCCESS_MESSAGE = 'The newsletter template has been saved.'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + const SUCCESS_MESSAGE = 'The newsletter template has been saved.'; /** * Assert that success message is displayed after newsletter template save diff --git a/dev/tests/functional/tests/app/Magento/Newsletter/Test/etc/constraint.xml b/dev/tests/functional/tests/app/Magento/Newsletter/Test/etc/constraint.xml index a0e9aa600a287..c8f0a34ba60ed 100644 --- a/dev/tests/functional/tests/app/Magento/Newsletter/Test/etc/constraint.xml +++ b/dev/tests/functional/tests/app/Magento/Newsletter/Test/etc/constraint.xml @@ -6,21 +6,21 @@ --> - low + low - low + low - low + low - low + low - low + low - low + low diff --git a/dev/tests/functional/tests/app/Magento/Reports/Test/Block/Adminhtml/Product/Sold/Grid.php b/dev/tests/functional/tests/app/Magento/Reports/Test/Block/Adminhtml/Product/Sold/Grid.php deleted file mode 100644 index 235d6773383e9..0000000000000 --- a/dev/tests/functional/tests/app/Magento/Reports/Test/Block/Adminhtml/Product/Sold/Grid.php +++ /dev/null @@ -1,104 +0,0 @@ - 'datepicker', - 'report_to' => 'datepicker', - 'report_period' => 'select', - ]; - - /** - * Product in grid locator - * - * @var string - */ - protected $product = './/*[contains(.,"%s")]/*[contains(@class,"col-qty")]'; - - /** - * Filter locator - * - * @var string - */ - protected $filter = '[name=%s]'; - - /** - * Refresh button locator - * - * @var string - */ - protected $refreshButton = '[data-ui-id="adminhtml-report-grid-refresh-button"]'; - - /** - * Search accounts in report grid - * - * @var array $customersReport - * @return void - */ - public function searchAccounts(array $customersReport) - { - $customersReport = $this->prepareData($customersReport); - foreach ($customersReport as $name => $value) { - $this->_rootElement - ->find(sprintf($this->filter, $name), Locator::SELECTOR_CSS, $this->dataMapping[$name]) - ->setValue($value); - } - $this->_rootElement->find($this->refreshButton)->click(); - } - - /** - * Prepare data - * - * @param array $customersReport - * @return array - */ - protected function prepareData(array $customersReport) - { - foreach ($customersReport as $name => $reportFilter) { - if ($name === 'report_period') { - continue; - } - $date = ObjectManager::getInstance()->create( - '\Magento\Backend\Test\Fixture\Date', - ['params' => [], 'data' => ['pattern' => $reportFilter]] - ); - $customersReport[$name] = $date->getData(); - } - return $customersReport; - } - - /** - * Get orders quantity from Ordered Products Report grid - * - * @param OrderInjectable $order - * @return array - */ - public function getOrdersResults(OrderInjectable $order) - { - $products = $order->getEntityId()['products']; - $views = []; - foreach ($products as $key => $product) { - $views[$key] = $this->_rootElement - ->find(sprintf($this->product, $product->getName()), Locator::SELECTOR_XPATH)->getText(); - } - return $views; - } -} diff --git a/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AbstractAssertCustomerOrderReportResult.php b/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AbstractAssertCustomerOrderReportResult.php index 2197bb7258ed6..c4ba864da99ce 100644 --- a/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AbstractAssertCustomerOrderReportResult.php +++ b/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AbstractAssertCustomerOrderReportResult.php @@ -14,12 +14,9 @@ */ abstract class AbstractAssertCustomerOrderReportResult extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Prepare filter diff --git a/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertAbandonedCartCustomerInfoResult.php b/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertAbandonedCartCustomerInfoResult.php index 72ef4692cb1b8..58c6d072f8808 100644 --- a/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertAbandonedCartCustomerInfoResult.php +++ b/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertAbandonedCartCustomerInfoResult.php @@ -15,12 +15,9 @@ */ class AssertAbandonedCartCustomerInfoResult extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert customer info in Abandoned Carts report (Reports > Abandoned carts): diff --git a/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertBestsellerReportResult.php b/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertBestsellerReportResult.php index 99703e7f14997..2d69337a2909f 100644 --- a/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertBestsellerReportResult.php +++ b/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertBestsellerReportResult.php @@ -15,12 +15,9 @@ */ class AssertBestsellerReportResult extends AbstractConstraint { - /** - * Constraint severeness. - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert bestseller info in report: date, product name and qty. diff --git a/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertCouponReportResult.php b/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertCouponReportResult.php index 85139327f6569..41c8dc7474129 100644 --- a/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertCouponReportResult.php +++ b/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertCouponReportResult.php @@ -15,12 +15,9 @@ */ class AssertCouponReportResult extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert coupon info in report: code, rule name, subtotal, discount on coupons report page diff --git a/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertCustomerOrderCountReportResult.php b/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertCustomerOrderCountReportResult.php index 66921b008c9c0..619f3061d7b24 100644 --- a/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertCustomerOrderCountReportResult.php +++ b/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertCustomerOrderCountReportResult.php @@ -14,12 +14,9 @@ */ class AssertCustomerOrderCountReportResult extends AbstractAssertCustomerOrderReportResult { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert OrderCountReport grid for all params diff --git a/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertCustomerOrderTotalReportResult.php b/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertCustomerOrderTotalReportResult.php index 61e58c60849ab..de236974bff77 100644 --- a/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertCustomerOrderTotalReportResult.php +++ b/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertCustomerOrderTotalReportResult.php @@ -14,12 +14,9 @@ */ class AssertCustomerOrderTotalReportResult extends AbstractAssertCustomerOrderReportResult { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert OrderTotalReport grid for all params diff --git a/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertDownloadsReportResult.php b/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertDownloadsReportResult.php index 7d66a5cefe730..5705a052403c0 100644 --- a/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertDownloadsReportResult.php +++ b/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertDownloadsReportResult.php @@ -15,12 +15,9 @@ */ class AssertDownloadsReportResult extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert product info in report: product name, link title, sku, downloads number (Reports > Products > Downloads) diff --git a/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertInvoiceReportIntervalResult.php b/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertInvoiceReportIntervalResult.php index 5ed497d6efce8..7562f5be5f154 100644 --- a/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertInvoiceReportIntervalResult.php +++ b/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertInvoiceReportIntervalResult.php @@ -13,12 +13,9 @@ */ class AssertInvoiceReportIntervalResult extends AbstractAssertInvoiceReportResult { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that sales info in report grid is actual diff --git a/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertInvoiceReportTotalResult.php b/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertInvoiceReportTotalResult.php index 61735bb586722..f09e7a50affa3 100644 --- a/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertInvoiceReportTotalResult.php +++ b/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertInvoiceReportTotalResult.php @@ -13,12 +13,9 @@ */ class AssertInvoiceReportTotalResult extends AbstractAssertInvoiceReportResult { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that total invoice info in report grid is actual diff --git a/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertLowStockProductInGrid.php b/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertLowStockProductInGrid.php index 199810bc32f93..ced870e865592 100644 --- a/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertLowStockProductInGrid.php +++ b/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertLowStockProductInGrid.php @@ -15,12 +15,9 @@ */ class AssertLowStockProductInGrid extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that product with Low Stock is present in Low Stock grid diff --git a/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertNewAccountsReportTotalResult.php b/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertNewAccountsReportTotalResult.php index bd6f24bfd7453..6631a8ece4db7 100644 --- a/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertNewAccountsReportTotalResult.php +++ b/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertNewAccountsReportTotalResult.php @@ -14,12 +14,9 @@ */ class AssertNewAccountsReportTotalResult extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that new account total result is equals to data from dataSet diff --git a/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertOrderedProductResult.php b/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertOrderedProductResult.php index 8e0b5576be2fa..83687af93e8f4 100644 --- a/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertOrderedProductResult.php +++ b/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertOrderedProductResult.php @@ -18,12 +18,9 @@ */ class AssertOrderedProductResult extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert product name and qty in Ordered Products report diff --git a/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertProductInCartResult.php b/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertProductInCartResult.php index 1f83b9c77a1fc..d5a216645c46e 100644 --- a/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertProductInCartResult.php +++ b/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertProductInCartResult.php @@ -15,12 +15,9 @@ */ class AssertProductInCartResult extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that product is present in Products in Carts report grid by name, price, carts diff --git a/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertProductReportByCustomerInGrid.php b/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertProductReportByCustomerInGrid.php index 7ccd652e8f8d4..a2f4ca35015a3 100644 --- a/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertProductReportByCustomerInGrid.php +++ b/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertProductReportByCustomerInGrid.php @@ -19,12 +19,9 @@ */ class AssertProductReportByCustomerInGrid extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that Customer review is displayed in grid diff --git a/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertProductReportByCustomerNotInGrid.php b/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertProductReportByCustomerNotInGrid.php index f0b7973314819..14378862d84bb 100644 --- a/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertProductReportByCustomerNotInGrid.php +++ b/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertProductReportByCustomerNotInGrid.php @@ -19,12 +19,9 @@ */ class AssertProductReportByCustomerNotInGrid extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Asserts Customer Product Review not available in grid diff --git a/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertProductReviewIsAvailableForProduct.php b/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertProductReviewIsAvailableForProduct.php index 36d7e3836301f..5495e693b1969 100644 --- a/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertProductReviewIsAvailableForProduct.php +++ b/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertProductReviewIsAvailableForProduct.php @@ -17,12 +17,9 @@ */ class AssertProductReviewIsAvailableForProduct extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that review is visible in review grid for select product diff --git a/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertProductReviewReportIsVisibleInGrid.php b/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertProductReviewReportIsVisibleInGrid.php index 8a3871a33d2f7..594ecd50ad655 100644 --- a/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertProductReviewReportIsVisibleInGrid.php +++ b/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertProductReviewReportIsVisibleInGrid.php @@ -15,12 +15,9 @@ */ class AssertProductReviewReportIsVisibleInGrid extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that Product Review Report is visible in reports grid diff --git a/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertProductReviewsQtyByCustomer.php b/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertProductReviewsQtyByCustomer.php index d1db5751fb722..f83785a49b3fe 100644 --- a/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertProductReviewsQtyByCustomer.php +++ b/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertProductReviewsQtyByCustomer.php @@ -15,12 +15,9 @@ */ class AssertProductReviewsQtyByCustomer extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert product reviews qty column in Review Report by Customer grid diff --git a/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertProductViewsReportTotalResult.php b/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertProductViewsReportTotalResult.php index cd2d4364ee8b1..91f1b347c51d8 100644 --- a/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertProductViewsReportTotalResult.php +++ b/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertProductViewsReportTotalResult.php @@ -14,12 +14,9 @@ */ class AssertProductViewsReportTotalResult extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert product info in report: product name, price and views diff --git a/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertRefundReportIntervalResult.php b/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertRefundReportIntervalResult.php index cc889537e6795..7594a817f428f 100644 --- a/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertRefundReportIntervalResult.php +++ b/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertRefundReportIntervalResult.php @@ -14,12 +14,9 @@ */ class AssertRefundReportIntervalResult extends AbstractAssertSalesReportResult { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert Credit Memo info in report: Refunds Orders, Total Refunded diff --git a/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertSalesReportIntervalResult.php b/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertSalesReportIntervalResult.php index 670107a0b517b..50e3af977febb 100644 --- a/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertSalesReportIntervalResult.php +++ b/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertSalesReportIntervalResult.php @@ -14,12 +14,9 @@ */ class AssertSalesReportIntervalResult extends AbstractAssertSalesReportResult { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that sales info in report grid is actual diff --git a/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertSalesReportTotalResult.php b/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertSalesReportTotalResult.php index 8da6fd7c516f8..182e5b37b14a2 100644 --- a/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertSalesReportTotalResult.php +++ b/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertSalesReportTotalResult.php @@ -14,12 +14,9 @@ */ class AssertSalesReportTotalResult extends AbstractAssertSalesReportResult { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that total sales info in report grid is actual diff --git a/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertSearchTermReportForm.php b/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertSearchTermReportForm.php index b30f247001cb3..489cdee9895a4 100644 --- a/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertSearchTermReportForm.php +++ b/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertSearchTermReportForm.php @@ -15,12 +15,9 @@ */ class AssertSearchTermReportForm extends AbstractAssertForm { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that Search Term Report form data equals to passed from dataSet diff --git a/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertSearchTermsInGrid.php b/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertSearchTermsInGrid.php index 3e0117c6cbe91..a0d6cf11102d3 100644 --- a/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertSearchTermsInGrid.php +++ b/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertSearchTermsInGrid.php @@ -14,12 +14,9 @@ */ class AssertSearchTermsInGrid extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that Search Terms report in grid diff --git a/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertTaxReportInGrid.php b/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertTaxReportInGrid.php index d1217c71a596e..b52a73595d614 100644 --- a/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertTaxReportInGrid.php +++ b/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertTaxReportInGrid.php @@ -16,12 +16,9 @@ */ class AssertTaxReportInGrid extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert sales info in report: Tax, Rate, Orders, Tax Amount on tax report page diff --git a/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertTaxReportNotInGrid.php b/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertTaxReportNotInGrid.php index 8247473c9df3b..c40d46f8dca27 100644 --- a/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertTaxReportNotInGrid.php +++ b/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertTaxReportNotInGrid.php @@ -16,12 +16,9 @@ */ class AssertTaxReportNotInGrid extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert Tax report is absent on tax report page diff --git a/dev/tests/functional/tests/app/Magento/Reports/Test/Page/Adminhtml/ProductReportView.xml b/dev/tests/functional/tests/app/Magento/Reports/Test/Page/Adminhtml/ProductReportView.xml index 1766c3dfd88fa..a7f9b858f4cd3 100644 --- a/dev/tests/functional/tests/app/Magento/Reports/Test/Page/Adminhtml/ProductReportView.xml +++ b/dev/tests/functional/tests/app/Magento/Reports/Test/Page/Adminhtml/ProductReportView.xml @@ -12,12 +12,12 @@ css selector - Magento\Reports\Test\Block\Adminhtml\Viewed\FilterGrid + Magento\Reports\Test\Block\Adminhtml\Review\Products\Viewed\ProductGrid .grid css selector - Magento\Reports\Test\Block\Adminhtml\Viewed\Filter + Magento\Sales\Test\Block\Adminhtml\Report\Filter\Form #filter_form css selector diff --git a/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/AbandonedCartsReportEntityTest.php b/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/AbandonedCartsReportEntityTest.php index e808d05dc5b53..a7acfcfb81df5 100644 --- a/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/AbandonedCartsReportEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/AbandonedCartsReportEntityTest.php @@ -80,6 +80,7 @@ public function __inject( */ public function test($products, CustomerInjectable $customer) { + $this->markTestIncomplete('Bug: MAGETWO-31737'); // Precondition $products = $this->createProducts($products); $customer->persist(); diff --git a/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/BestsellerProductsReportEntityTest.php b/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/BestsellerProductsReportEntityTest.php deleted file mode 100644 index bce6e809526c7..0000000000000 --- a/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/BestsellerProductsReportEntityTest.php +++ /dev/null @@ -1,68 +0,0 @@ - Products > Bestsellers. - * 3. Select time range, report period. - * 4. Click "Show report". - * 5. Perform all assertions. - * - * @group Reports_(MX) - * @ZephyrId MAGETWO-28222 - */ -class BestsellerProductsReportEntityTest extends Injectable -{ - /** - * Bestsellers page. - * - * @var Bestsellers - */ - protected $bestsellers; - - /** - * Inject pages. - * - * @param Bestsellers $bestsellers - * @return void - */ - public function __inject(Bestsellers $bestsellers) - { - $this->bestsellers = $bestsellers; - } - - /** - * Bestseller Products Report. - * - * @param OrderInjectable $order - * @param array $bestsellerReport - * @return void - */ - public function test(OrderInjectable $order, array $bestsellerReport) - { - // Preconditions - $order->persist(); - $this->bestsellers->open(); - $this->bestsellers->getMessagesBlock()->clickLinkInMessages('notice', 'here'); - - // Steps - $this->bestsellers->getFilterBlock()->viewsReport($bestsellerReport); - $this->bestsellers->getActionsBlock()->showReport(); - } -} diff --git a/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/BestsellerProductsReportEntityTest/test.csv b/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/BestsellerProductsReportEntityTest/test.csv deleted file mode 100644 index 78dc238148326..0000000000000 --- a/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/BestsellerProductsReportEntityTest/test.csv +++ /dev/null @@ -1,4 +0,0 @@ -"order/dataSet";"bestsellerReport/period_type";"bestsellerReport/from";"bestsellerReport/to";"bestsellerReport/show_empty_rows";"date";"constraint" -"simple_big_qty";"Year";"m/d/Y -1 year";"m/d/Y";"No";"Y";"assertBestsellerReportResult" -"virtual_big_qty";"Month";"m/d/Y -1 month";"m/d/Y";"Yes";"n/Y";"assertBestsellerReportResult" -"simple_big_qty";"Day";"m/d/Y -1 day";"m/d/Y +1 day";"No";"M d, Y";"assertBestsellerReportResult" diff --git a/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/CustomersOrderCountReportEntityTest.php b/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/CustomersOrderCountReportEntityTest.php deleted file mode 100644 index 9390659c252a1..0000000000000 --- a/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/CustomersOrderCountReportEntityTest.php +++ /dev/null @@ -1,82 +0,0 @@ - Customer > Order Count - * 3. Fill data from dataSet - * 4. Click button Refresh - * 5. Perform all assertions - * - * @group Reports_(MX) - * @ZephyrId MAGETWO-28521 - */ -class CustomersOrderCountReportEntityTest extends Injectable -{ - /** - * Order count report page - * - * @var CustomerOrdersReport - */ - protected $customerOrdersReport; - - /** - * Inject page - * - * @param CustomerOrdersReport $customerOrdersReport - * @return void - */ - public function __inject(CustomerOrdersReport $customerOrdersReport) - { - $this->customerOrdersReport = $customerOrdersReport; - } - - /** - * Order count report view - * - * @param CustomerInjectable $customer - * @param string $orders - * @param array $report - * @param FixtureFactory $fixtureFactory - * @return array - */ - public function test(CustomerInjectable $customer, $orders, array $report, FixtureFactory $fixtureFactory) - { - // Precondition - $customer->persist(); - $orders = explode(',', $orders); - foreach ($orders as $order) { - $order = $fixtureFactory->createByCode( - 'orderInjectable', - ['dataSet' => $order, 'data' => ['customer_id' => ['customer' => $customer]]] - ); - $order->persist(); - } - - // Steps - $this->customerOrdersReport->open(); - $this->customerOrdersReport->getFilterBlock()->viewsReport($report); - $this->customerOrdersReport->getFilterBlock()->refreshFilter(); - - return['customer' => $customer]; - } -} diff --git a/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/CustomersOrderCountReportEntityTest/test.csv b/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/CustomersOrderCountReportEntityTest/test.csv deleted file mode 100644 index 37a31a8ba8591..0000000000000 --- a/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/CustomersOrderCountReportEntityTest/test.csv +++ /dev/null @@ -1,4 +0,0 @@ -"orders";"report/report_from";"report/report_to";"report/report_period";"columns/orders";"columns/average";"columns/total";"constraint" -"default,virtual_product";"m/d/Y";"m/d/Y";"Day";"2";"285";"570";"assertCustomerOrderCountReportResult" -"default,virtual_product";"m/d/Y";"m/d/Y";"Month";"2";"285";"570";"assertCustomerOrderCountReportResult" -"default";"m/d/Y";"m/d/Y";"Year";"1";"560";"560";"assertCustomerOrderCountReportResult" diff --git a/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/CustomersOrderTotalReportEntityTest.php b/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/CustomersOrderTotalReportEntityTest.php deleted file mode 100644 index c53974562eb62..0000000000000 --- a/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/CustomersOrderTotalReportEntityTest.php +++ /dev/null @@ -1,82 +0,0 @@ - Customer > Order Total - * 3. Fill data from dataSet - * 4. Click button Refresh - * 5. Perform all assertions - * - * @group Reports_(MX) - * @ZephyrId MAGETWO-28358 - */ -class CustomersOrderTotalReportEntityTest extends Injectable -{ - /** - * Order total report page - * - * @var CustomerTotalsReport - */ - protected $customerTotalsReport; - - /** - * Inject page - * - * @param CustomerTotalsReport $customerTotalsReport - * @return void - */ - public function __inject(CustomerTotalsReport $customerTotalsReport) - { - $this->customerTotalsReport = $customerTotalsReport; - } - - /** - * Order total report view - * - * @param CustomerInjectable $customer - * @param string $orders - * @param array $report - * @param FixtureFactory $fixtureFactory - * @return array - */ - public function test(CustomerInjectable $customer, $orders, array $report, FixtureFactory $fixtureFactory) - { - // Precondition - $customer->persist(); - $orders = explode(',', $orders); - foreach ($orders as $order) { - $order = $fixtureFactory->createByCode( - 'orderInjectable', - ['dataSet' => $order, 'data' => ['customer_id' => ['customer' => $customer]]] - ); - $order->persist(); - } - - // Steps - $this->customerTotalsReport->open(); - $this->customerTotalsReport->getFilterBlock()->viewsReport($report); - $this->customerTotalsReport->getFilterBlock()->refreshFilter(); - - return['customer' => $customer]; - } -} diff --git a/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/CustomersOrderTotalReportEntityTest/test.csv b/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/CustomersOrderTotalReportEntityTest/test.csv deleted file mode 100644 index 0649f36d48f05..0000000000000 --- a/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/CustomersOrderTotalReportEntityTest/test.csv +++ /dev/null @@ -1,4 +0,0 @@ -"orders";"report/report_from";"report/report_to";"report/report_period";"columns/orders";"columns/average";"columns/total";"constraint" -"default,virtual_product";"m/d/Y";"m/d/Y";"Day";"2";"285";"570";"assertCustomerOrderTotalReportResult" -"default,virtual_product";"m/d/Y";"m/d/Y";"Month";"2";"285";"570";"assertCustomerOrderTotalReportResult" -"default";"m/d/Y";"m/d/Y";"Year";"1";"560";"560";"assertCustomerOrderTotalReportResult" diff --git a/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/DownloadProductsReportEntityTest.php b/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/DownloadProductsReportEntityTest.php deleted file mode 100644 index ad5e499938fe6..0000000000000 --- a/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/DownloadProductsReportEntityTest.php +++ /dev/null @@ -1,116 +0,0 @@ - My Downloads and click download link. - * - * Steps: - * 1. Open Backend. - * 2. Go to Reports > Products > Downloads. - * 3. Perform all assertions. - * - * @group Reports_(MX) - * @ZephyrId MAGETWO-28823 - */ -class DownloadProductsReportEntityTest extends Injectable -{ - /** - * Browser Interface. - * - * @var Browser - */ - protected $browser; - - /** - * Customer Account index page. - * - * @var CustomerAccountIndex - */ - protected $customerAccount; - - /** - * Downloadable Customer Products page. - * - * @var DownloadableCustomerProducts - */ - protected $customerProducts; - - /** - * Inject pages. - * - * @param CustomerAccountIndex $customerAccount - * @param DownloadableCustomerProducts $customerProducts - * @param Browser $browser - * @return void - */ - public function __inject( - CustomerAccountIndex $customerAccount, - DownloadableCustomerProducts $customerProducts, - Browser $browser - ) { - $this->customerAccount = $customerAccount; - $this->customerProducts = $customerProducts; - $this->browser = $browser; - } - - /** - * Order downloadable product. - * - * @param OrderInjectable $order - * @param string $downloads - * @return void - */ - public function test(OrderInjectable $order, $downloads) - { - $this->markTestIncomplete('MAGETWO-30346'); - // Preconditions - $order->persist(); - $invoice = $this->objectManager->create('Magento\Sales\Test\TestStep\CreateInvoiceStep', ['order' => $order]); - $invoice->run(); - $this->openDownloadableLink($order, (int)$downloads); - } - - /** - * Open Downloadable Link. - * - * @param OrderInjectable $order - * @param int $downloads - * @return void - */ - protected function openDownloadableLink(OrderInjectable $order, $downloads) - { - $customerLogin = $this->objectManager->create( - 'Magento\Customer\Test\TestStep\LoginCustomerOnFrontendStep', - ['customer' => $order->getDataFieldConfig('customer_id')['source']->getCustomer()] - ); - $customerLogin->run(); - $this->customerAccount->getAccountMenuBlock()->openMenuItem('My Downloadable Products'); - foreach ($order->getEntityId()['products'] as $product) { - foreach ($product->getDownloadableLinks()['downloadable']['link'] as $link) { - for ($i = 0; $i < $downloads; $i++) { - $this->customerProducts->getMainBlock()->openLink($link['title']); - $this->browser->selectWindow(); - $this->browser->closeWindow(); - $this->browser->selectWindow(); - } - } - } - } -} diff --git a/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/DownloadProductsReportEntityTest/test.csv b/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/DownloadProductsReportEntityTest/test.csv deleted file mode 100644 index fcb06cbea2595..0000000000000 --- a/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/DownloadProductsReportEntityTest/test.csv +++ /dev/null @@ -1,4 +0,0 @@ -"order/dataSet";"downloads";"constraint" -"downloadable_product";"1";"assertDownloadsReportResult" -"two_downloadable_product";"2";"assertDownloadsReportResult" -"downloadable_product";"0";"assertDownloadsReportResult" diff --git a/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/OrderedProductsReportEntityTest.php b/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/OrderedProductsReportEntityTest.php deleted file mode 100644 index 1d74aec70bcbf..0000000000000 --- a/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/OrderedProductsReportEntityTest.php +++ /dev/null @@ -1,65 +0,0 @@ - Products > Ordered - * 3. Select time range and report period - * 4. Click "Refresh button" - * 5. Perform all assertions - * - * @group Reports_(MX) - * @ZephyrId MAGETWO-28200 - */ -class OrderedProductsReportEntityTest extends Injectable -{ - /** - * Ordered Products Report - * - * @var OrderedProductsReport - */ - protected $orderedProducts; - - /** - * Inject pages - * - * @param OrderedProductsReport $orderedProducts - * @return void - */ - public function __inject(OrderedProductsReport $orderedProducts) - { - $this->orderedProducts = $orderedProducts; - } - - /** - * Search order products report - * - * @param OrderInjectable $order - * @param array $customersReport - * @return void - */ - public function test(OrderInjectable $order, array $customersReport) - { - // Preconditions - $order->persist(); - - // Steps - $this->orderedProducts->open(); - $this->orderedProducts->getGridBlock()->searchAccounts($customersReport); - } -} diff --git a/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/OrderedProductsReportEntityTest/test.csv b/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/OrderedProductsReportEntityTest/test.csv deleted file mode 100644 index a19d4bc8b76b3..0000000000000 --- a/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/OrderedProductsReportEntityTest/test.csv +++ /dev/null @@ -1,4 +0,0 @@ -"order/dataSet";"customersReport/report_from";"customersReport/report_to";"customersReport/report_period";"constraint" -"default";"m/d/Y";"m/d/Y";"Year";"assertOrderedProductResult" -"default";"m/d/Y";"m/d/Y";"Month";"assertOrderedProductResult" -"virtual_product";"m/d/Y";"m/d/Y";"Day";"assertOrderedProductResult" diff --git a/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/SalesCouponReportEntityTest.php b/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/SalesCouponReportEntityTest.php deleted file mode 100644 index e36cef2c44d28..0000000000000 --- a/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/SalesCouponReportEntityTest.php +++ /dev/null @@ -1,126 +0,0 @@ - Sales > Coupons - * 3. Select time range, report period etc - * 4. Click "Show report" - * 5. Perform all assertions - * - * @group Reports_(MX) - * @ZephyrId MAGETWO-28190 - */ -class SalesCouponReportEntityTest extends Injectable -{ - /** - * Order index page - * - * @var OrderIndex - */ - protected $orderIndex; - - /** - * Order invoice new page - * - * @var OrderInvoiceNew - */ - protected $orderInvoiceNew; - - /** - * Sales coupon report view page - * - * @var SalesCouponReportView - */ - protected $salesCouponReportView; - - /** - * Order view page - * - * @var OrderView - */ - protected $orderView; - - /** - * Report statistic page - * - * @var Statistics - */ - protected $reportStatistic; - - /** - * Injection data - * - * @param OrderIndex $orderIndex - * @param OrderInvoiceNew $orderInvoiceNew - * @param SalesCouponReportView $salesCouponReportView - * @param OrderView $orderView - * @param Statistics $reportStatistic - * @return void - */ - public function __inject( - OrderIndex $orderIndex, - OrderInvoiceNew $orderInvoiceNew, - SalesCouponReportView $salesCouponReportView, - OrderView $orderView, - Statistics $reportStatistic - ) { - $this->orderIndex = $orderIndex; - $this->orderInvoiceNew = $orderInvoiceNew; - $this->salesCouponReportView = $salesCouponReportView; - $this->orderView = $orderView; - $this->reportStatistic = $reportStatistic; - } - - /** - * Sales coupon report - * - * @param OrderInjectable $order - * @param array $viewsReport - * @return void - */ - public function test(OrderInjectable $order, array $viewsReport) - { - // Precondition - $order->persist(); - $this->orderIndex->open(); - $this->orderIndex->getSalesOrderGrid()->searchAndOpen(['id' => $order->getId()]); - $this->orderView->getPageActions()->invoice(); - $this->orderInvoiceNew->getTotalsBlock()->submit(); - $this->reportStatistic->open(); - $this->reportStatistic->getGridBlock()->massaction( - [['report' => 'Coupons']], - 'Refresh Statistics for the Last Day', - true - ); - - // Steps - $this->salesCouponReportView->open(); - $ruleName = $order->getCouponCode()->getName(); - $viewsReport['rules_list'] = str_replace('%rule_name%', $ruleName, $viewsReport['rules_list']); - $this->salesCouponReportView->getFilterBlock()->viewsReport($viewsReport); - $this->salesCouponReportView->getActionBlock()->showReport(); - } -} diff --git a/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/SalesCouponReportEntityTest/test.csv b/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/SalesCouponReportEntityTest/test.csv deleted file mode 100644 index d3b91c6d306ef..0000000000000 --- a/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/SalesCouponReportEntityTest/test.csv +++ /dev/null @@ -1,5 +0,0 @@ -"order/dataSet";"viewsReport/report_type";"viewsReport/period_type";"viewsReport/from";"viewsReport/to";"viewsReport/show_order_statuses";"viewsReport/order_statuses";"viewsReport/show_empty_rows";"viewsReport/price_rule_type";"viewsReport/rules_list";"constraint";"issue" -"with_coupon";"Order Created Date";"Year";"m/d/Y";"m/d/Y";"Any";"-";"No";"Any";"-";"assertCouponReportResult";"" -"with_coupon";"Order Created Date";"Month";"m/d/Y";"m/d/Y";"Specified";"Processing";"No";"Any";"-";"assertCouponReportResult";"" -"with_coupon";"Order Updated Date";"Day";"m/d/Y";"m/d/Y";"Any";"-";"No";"Specified";"%rule_name%";"assertCouponReportResult";"Bug: MAGETWO-28201" -"with_coupon";"Order Updated Date";"Day";"m/d/Y 12:00 a-1 day";"m/d/Y 12:00 a+1 day";"Specified";"Processing";"Yes";"Specified";"%rule_name%";"assertCouponReportResult";"Bug: MAGETWO-28201" diff --git a/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/SalesInvoiceReportEntityTest.php b/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/SalesInvoiceReportEntityTest.php deleted file mode 100644 index 4de247b5d7201..0000000000000 --- a/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/SalesInvoiceReportEntityTest.php +++ /dev/null @@ -1,67 +0,0 @@ - Sales > Invoiced - * 3. Refresh statistic - * 4. Configure filter - * 5. Click "Show Report" - * 6. Save/remember report result - * 7. Create customer - * 8. Place order - * 9. Create Invoice - * 10. Refresh statistic - * - * Steps: - * 1. Open Backend - * 2. Go to Reports > Sales > Invoiced - * 3. Configure filter - * 4. Click "Show Report" - * 5. Perform all assertions - * - * @group Reports_(MX) - * @ZephyrId MAGETWO-29216 - */ -class SalesInvoiceReportEntityTest extends Injectable -{ - /** - * Sales invoice report - * - * @param SalesInvoiceReport $salesInvoiceReport - * @param OrderInjectable $order - * @param array $invoiceReport - * @return array - */ - public function test(SalesInvoiceReport $salesInvoiceReport, OrderInjectable $order, array $invoiceReport) - { - // Preconditions - $salesInvoiceReport->open(); - $salesInvoiceReport->getMessagesBlock()->clickLinkInMessages('notice', 'here'); - $salesInvoiceReport->getFilterForm()->viewsReport($invoiceReport); - $salesInvoiceReport->getActionBlock()->showReport(); - $initialInvoiceResult = $salesInvoiceReport->getGridBlock()->getLastResult(); - $initialInvoiceTotalResult = $salesInvoiceReport->getGridBlock()->getTotalResult(); - $order->persist(); - $invoice = $this->objectManager->create('Magento\Sales\Test\TestStep\CreateInvoiceStep', ['order' => $order]); - $invoice->run(); - - return [ - 'initialInvoiceResult' => $initialInvoiceResult, - 'initialInvoiceTotalResult' => $initialInvoiceTotalResult - ]; - } -} diff --git a/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/SalesInvoiceReportEntityTest/test.csv b/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/SalesInvoiceReportEntityTest/test.csv deleted file mode 100644 index 4f7347373f358..0000000000000 --- a/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/SalesInvoiceReportEntityTest/test.csv +++ /dev/null @@ -1,4 +0,0 @@ -"order/dataSet";"order/data/price/preset";"invoiceReport/report_type";"invoiceReport/period_type";"invoiceReport/from";"invoiceReport/to";"invoiceReport/show_order_statuses";"invoiceReport/data/order_statuses";"invoiceReport/show_empty_rows";"constraint";"issue" -"default";"full_invoice";"Order Created Date";"Year";"m/d/Y 12:00 a-2 days";"m/d/Y 12:00 a+2 days";"Any";"-";"Yes";"assertInvoiceReportIntervalResult, assertInvoiceReportTotalResult";"Bug: MAGETWO-29383" -"default";"full_invoice";"Order Created Date";"Month";"m/d/Y";"m/d/Y";"Any";"-";"No";"assertInvoiceReportIntervalResult, assertInvoiceReportTotalResult";"" -"default";"full_invoice";"Last Invoice Created Date";"Day";"m/d/Y";"m/d/Y";"Specified";"Processing";"No";"assertInvoiceReportIntervalResult, assertInvoiceReportTotalResult";"" diff --git a/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/SalesOrderReportEntityTest.php b/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/SalesOrderReportEntityTest.php deleted file mode 100644 index 5f0587265c170..0000000000000 --- a/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/SalesOrderReportEntityTest.php +++ /dev/null @@ -1,82 +0,0 @@ - Sales > Orders - * 3. Refresh statistic - * 4. Configure filter - * 5. Click "Show Report" - * 6. Save/remember report result - * 7. Create customer - * 8. Place order - * 9. Create Invoice - * 10. Refresh statistic - * - * Steps: - * 1. Open Backend - * 2. Go to Reports > Sales > Orders - * 3. Configure filter - * 4. Click "Show Report" - * 5. Perform all assertions - * - * @group Reports_(MX) - * @ZephyrId MAGETWO-29136 - */ -class SalesOrderReportEntityTest extends Injectable -{ - /** - * Sales Report page - * - * @var SalesReport - */ - protected $salesReport; - - /** - * Inject page - * - * @param SalesReport $salesReport - * @return void - */ - public function __inject(SalesReport $salesReport) - { - $this->salesReport = $salesReport; - } - - /** - * Sales order report - * - * @param OrderInjectable $order - * @param array $salesReport - * @return array - */ - public function test(OrderInjectable $order, array $salesReport) - { - // Preconditions - $this->salesReport->open(); - $this->salesReport->getMessagesBlock()->clickLinkInMessages('notice', 'here'); - $this->salesReport->getFilterBlock()->viewsReport($salesReport); - $this->salesReport->getActionBlock()->showReport(); - $initialSalesResult = $this->salesReport->getGridBlock()->getLastResult(); - $initialSalesTotalResult = $this->salesReport->getGridBlock()->getTotalResult(); - - $order->persist(); - $invoice = $this->objectManager->create('Magento\Sales\Test\TestStep\CreateInvoiceStep', ['order' => $order]); - $invoice->run(); - - return ['initialSalesResult' => $initialSalesResult, 'initialSalesTotalResult' => $initialSalesTotalResult]; - } -} diff --git a/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/SalesOrderReportEntityTest/test.csv b/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/SalesOrderReportEntityTest/test.csv deleted file mode 100644 index e5dab82b29e18..0000000000000 --- a/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/SalesOrderReportEntityTest/test.csv +++ /dev/null @@ -1,4 +0,0 @@ -"order/dataSet";"order/data/price/preset";"salesReport/report_type";"salesReport/period_type";"salesReport/from";"salesReport/to";"salesReport/show_order_statuses";"salesReport/order_statuses";"salesReport/show_empty_rows";"salesReport/show_actual_columns";"constraint";"issue" -"default";"full_invoice";"Order Created Date";"Year";"m/d/Y 12:00 a-2 days";"m/d/Y 12:00 a+2 days";"Any";"-";"Yes";"Yes";"assertSalesReportIntervalResult, assertSalesReportTotalResult";";"Bug: MAGETWO-29383" -"default";"full_invoice";"Order Created Date";"Month";"m/d/Y";"m/d/Y";"Any";"-";"No";"No";"assertSalesReportIntervalResult, assertSalesReportTotalResult";"" -"default";"full_invoice";"Order Updated Date";"Day";"m/d/Y";"m/d/Y";"Specified";"Processing";"No";"No";"assertSalesReportIntervalResult, assertSalesReportTotalResult";"" diff --git a/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/SalesRefundsReportEntityTest.php b/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/SalesRefundsReportEntityTest.php deleted file mode 100644 index 4bb950c1248d8..0000000000000 --- a/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/SalesRefundsReportEntityTest.php +++ /dev/null @@ -1,85 +0,0 @@ - Sales > Refunds - * 3. Refresh statistic - * 4. Configure filter - * 5. Click "Show Report" - * 6. Save/remember report result - * 7. Place order - * 8. Create Invoice - * 9. Refresh statistic - * - * Steps: - * 1. Go to backend - * 2. Go to Reports > Sales > Refunds - * 3. Fill data from dataSet - * 4. Click button Show Report - * 5. Perform Asserts - * - * @group Reports_(MX) - * @ZephyrId MAGETWO-29348 - */ -class SalesRefundsReportEntityTest extends Injectable -{ - /** - * Refunds report page - * - * @var RefundsReport - */ - protected $refundsReport; - - /** - * Inject pages - * - * @param RefundsReport $refundsReport - * @return void - */ - public function __inject(RefundsReport $refundsReport) - { - $this->refundsReport = $refundsReport; - } - - /** - * Refunds report - * - * @param OrderInjectable $order - * @param array $refundsReport - * @return array - */ - public function test(OrderInjectable $order, array $refundsReport) - { - // Preconditions - $this->refundsReport->open(); - $this->refundsReport->getMessagesBlock()->clickLinkInMessages('notice', 'here'); - $this->refundsReport->getFilterBlock()->viewsReport($refundsReport); - $this->refundsReport->getActionBlock()->showReport(); - $initialRefundsResult = $this->refundsReport->getGridBlock()->getLastResult(); - - $order->persist(); - $invoice = $this->objectManager->create('Magento\Sales\Test\TestStep\CreateInvoiceStep', ['order' => $order]); - $invoice->run(); - $creditMemo = $this->objectManager->create( - 'Magento\Sales\Test\TestStep\CreateCreditMemoStep', - ['order' => $order] - ); - $creditMemo->run(); - - return ['initialRefundsResult' => $initialRefundsResult]; - } -} diff --git a/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/SalesRefundsReportEntityTest/test.csv b/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/SalesRefundsReportEntityTest/test.csv deleted file mode 100644 index f25229d78431f..0000000000000 --- a/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/SalesRefundsReportEntityTest/test.csv +++ /dev/null @@ -1,4 +0,0 @@ -"description";"order/dataSet";"order/data/price/preset";"refundsReport/report_type";"refundsReport/period_type";"refundsReport/from";"refundsReport/to";"refundsReport/show_order_statuses";"refundsReport/show_empty_rows";"constraint";"issue" -"assert refunds year report";"default";"full_invoice";"Order Created Date";"Year";"m/d/Y 12:00 a-2 days";"m/d/Y 12:00 a+2 days";"Any";"Yes";"assertRefundReportIntervalResult";"MAGETWO-29383" -"assert refunds month report";"default";"full_invoice";"Order Created Date";"Month";"m/d/Y";"m/d/Y";"Any";"No";"assertRefundReportIntervalResult";"" -"assert refund Daily report";"default";"full_invoice";"Last Credit Memo Created Date";"Day";"m/d/Y";"m/d/Y";"Specified";"No";"assertRefundReportIntervalResult";"" diff --git a/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/SalesTaxReportEntityTest.php b/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/SalesTaxReportEntityTest.php deleted file mode 100644 index f022023a386ed..0000000000000 --- a/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/SalesTaxReportEntityTest.php +++ /dev/null @@ -1,193 +0,0 @@ - Sales > Tax. - * 3. Fill data from dataSet. - * 4. Click "Show report". - * 5. Perform all assertions. - * - * @group Reports_(MX) - * @ZephyrId MAGETWO-28515 - * - * @SuppressWarnings(PHPMD.CouplingBetweenObjects) - */ -class SalesTaxReportEntityTest extends Injectable -{ - /** - * Order index page. - * - * @var OrderIndex - */ - protected $orderIndex; - - /** - * Order invoice new page. - * - * @var OrderInvoiceNew - */ - protected $orderInvoiceNew; - - /** - * Sales tax report page. - * - * @var SalesTaxReport - */ - protected $salesTaxReport; - - /** - * Order view page. - * - * @var OrderView - */ - protected $orderView; - - /** - * Report statistic page. - * - * @var Statistics - */ - protected $reportStatistic; - - /** - * Tax Rule grid page. - * - * @var TaxRuleIndex - */ - protected $taxRuleIndexPage; - - /** - * Tax Rule new and edit page. - * - * @var TaxRuleNew - */ - protected $taxRuleNewPage; - - /** - * Tax Rule fixture. - * - * @var TaxRule - */ - protected $taxRule; - - /** - * Delete all tax rules. - * - * @return void - */ - public function __prepare() - { - $deleteTaxRule = $this->objectManager->create('Magento\Tax\Test\TestStep\DeleteAllTaxRulesStep'); - $deleteTaxRule->run(); - } - - /** - * Injection data. - * - * @param OrderIndex $orderIndex - * @param OrderInvoiceNew $orderInvoiceNew - * @param OrderView $orderView - * @param Statistics $reportStatistic - * @param SalesTaxReport $salesTaxReport - * @param TaxRuleIndex $taxRuleIndexPage - * @param TaxRuleNew $taxRuleNewPage - * @return void - */ - public function __inject( - OrderIndex $orderIndex, - OrderInvoiceNew $orderInvoiceNew, - OrderView $orderView, - Statistics $reportStatistic, - SalesTaxReport $salesTaxReport, - TaxRuleIndex $taxRuleIndexPage, - TaxRuleNew $taxRuleNewPage - ) { - $this->orderIndex = $orderIndex; - $this->orderInvoiceNew = $orderInvoiceNew; - $this->orderView = $orderView; - $this->reportStatistic = $reportStatistic; - $this->salesTaxReport = $salesTaxReport; - $this->taxRuleIndexPage = $taxRuleIndexPage; - $this->taxRuleNewPage = $taxRuleNewPage; - } - - /** - * Create tax report entity. - * - * @param OrderInjectable $order - * @param TaxRule $taxRule - * @param array $report - * @param string $orderStatus - * @param string $invoice - * @return void - */ - public function test( - OrderInjectable $order, - TaxRule $taxRule, - array $report, - $orderStatus, - $invoice - ) { - // Precondition - $taxRule->persist(); - $this->taxRule = $taxRule; - $order->persist(); - $this->orderIndex->open(); - $this->orderIndex->getSalesOrderGrid()->searchAndOpen(['id' => $order->getId()]); - if ($orderStatus !== 'Pending') { - $createInvoice = $this->objectManager->create( - 'Magento\Sales\Test\TestStep\CreateInvoiceStep', - ['order' => $order, 'data' => $invoice] - ); - $createInvoice->run(); - } - $this->reportStatistic->open(); - $this->reportStatistic->getGridBlock()->massaction( - [['report' => 'Tax']], - 'Refresh Statistics for the Last Day', - true - ); - - // Steps - $this->salesTaxReport->open(); - $this->salesTaxReport->getFilterBlock()->viewsReport($report); - $this->salesTaxReport->getActionBlock()->showReport(); - } - - /** - * Delete all tax rules after test. - * - * @return void - */ - public function tearDown() - { - $deleteTaxRule = $this->objectManager->create('Magento\Tax\Test\TestStep\DeleteAllTaxRulesStep'); - $deleteTaxRule->run(); - } -} diff --git a/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/SalesTaxReportEntityTest/test.csv b/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/SalesTaxReportEntityTest/test.csv deleted file mode 100644 index 733b7a871cd84..0000000000000 --- a/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/SalesTaxReportEntityTest/test.csv +++ /dev/null @@ -1,4 +0,0 @@ -"taxRule/dataSet";"order/dataSet";"orderStatus";"report/report_type";"report/period_type";"report/from";"report/to";"report/show_order_statuses";"report/order_statuses";"report/show_empty_rows";"invoice/do_shipment";"taxAmount";"constraint";"issue" -"custom_rule";"default";"Pending";"Order Created Date";"Day";"m/d/Y";"m/d/Y";"Any";"-";"-";"No";"$46.20";"assertTaxReportNotInGrid";"" -"custom_rule";"default";"Processing";"Order Created Date";"Month";"m/d/Y";"m/d/Y";"Specified";"Processing";"-";"No";"$46.20";"assertTaxReportInGrid";"" -"custom_rule";"default";"Complete";"Order Updated Date";"Year";"m/d/Y";"m/d/Y";"Specified";"Complete";"Yes";"Yes";"$46.20";"assertTaxReportInGrid";"Bug: MAGETWO-28611" diff --git a/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/ViewedProductsReportEntityTest.php b/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/ViewedProductsReportEntityTest.php index 77ab7cdba8d7f..d9e2df96f8ed1 100644 --- a/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/ViewedProductsReportEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/ViewedProductsReportEntityTest.php @@ -5,10 +5,11 @@ namespace Magento\Reports\Test\TestCase; -use Magento\Reports\Test\Page\Adminhtml\ProductReportView; use Mtf\Client\Browser; -use Mtf\Fixture\FixtureFactory; use Mtf\TestCase\Injectable; +use Mtf\Fixture\FixtureFactory; +use Magento\Reports\Test\Page\Adminhtml\ProductReportView; +use Magento\Catalog\Test\Page\Adminhtml\CatalogProductIndex; /** * Test Creation for ViewedProductsReportEntity @@ -52,6 +53,18 @@ class ViewedProductsReportEntityTest extends Injectable */ protected $browser; + /** + * Delete all products + * + * @param CatalogProductIndex $catalogProductIndexPage + * @return void + */ + public function __prepare(CatalogProductIndex $catalogProductIndexPage) + { + $catalogProductIndexPage->open(); + $catalogProductIndexPage->getProductGrid()->massaction([], 'Delete', true, 'Select All'); + } + /** * Inject pages * @@ -80,7 +93,6 @@ public function __inject( */ public function test($products, array $viewsReport, $total) { - $this->markTestIncomplete('MAGETWO-15707'); // Preconditions $productsList = $this->prepareProducts($products); $this->openProducts($productsList, $total); diff --git a/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/ViewedProductsReportEntityTest/test.csv b/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/ViewedProductsReportEntityTest/test.csv index 390345cb8208f..fd637ffda83b6 100644 --- a/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/ViewedProductsReportEntityTest/test.csv +++ b/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/ViewedProductsReportEntityTest/test.csv @@ -1,4 +1,4 @@ "description";"total";"products";"viewsReport/period_type";"viewsReport/from";"viewsReport/to";"viewsReport/show_empty_rows";"constraint" "view products on front and verify they all reflected in Year report";"2, 1";"catalogProductSimple::default, catalogProductVirtual::default";"Year";"m/d/Y -1 year";"m/d/Y";"No";"assertProductViewsReportTotalResult" -"view products on front and verify they all reflected in Month report";"1, 1";"downloadableProductInjectable::default, catalogProductBundle::bundle_dynamic_product";"Month";"m/d/Y";"m/d/Y";"No";"assertProductViewsReportTotalResult" -"view products on front and verify they all reflected in Day report";"1, 1";"configurableProductInjectable::default, catalogProductGrouped::default";"Day";"m/d/Y -1 day";"m/d/Y +1 day";"Yes";"assertProductViewsReportTotalResult" +"view products on front and verify they all reflected in Month report";"1, 1";"downloadableProductInjectable::default, bundleProduct::bundle_dynamic_product";"Month";"m/d/Y";"m/d/Y";"No";"assertProductViewsReportTotalResult" +"view products on front and verify they all reflected in Day report";"1, 1";"configurableProductInjectable::default, groupedProductInjectable::default";"Day";"m/d/Y -1 day";"m/d/Y +1 day";"Yes";"assertProductViewsReportTotalResult" diff --git a/dev/tests/functional/tests/app/Magento/Reports/Test/etc/constraint.xml b/dev/tests/functional/tests/app/Magento/Reports/Test/etc/constraint.xml index 12d41c877d45a..265b5217ffac2 100644 --- a/dev/tests/functional/tests/app/Magento/Reports/Test/etc/constraint.xml +++ b/dev/tests/functional/tests/app/Magento/Reports/Test/etc/constraint.xml @@ -6,78 +6,78 @@ --> - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low diff --git a/dev/tests/functional/tests/app/Magento/Review/Test/Block/Adminhtml/Edit/CustomerForm.xml b/dev/tests/functional/tests/app/Magento/Review/Test/Block/Adminhtml/Edit/CustomerForm.xml index c00979849ac9d..21db32b88fed9 100644 --- a/dev/tests/functional/tests/app/Magento/Review/Test/Block/Adminhtml/Edit/CustomerForm.xml +++ b/dev/tests/functional/tests/app/Magento/Review/Test/Block/Adminhtml/Edit/CustomerForm.xml @@ -7,7 +7,7 @@ \Magento\Review\Test\Block\Adminhtml\Customer\Edit\Tab\Reviews - #customer_info_tabs_reviews + #tab_reviews css selector diff --git a/dev/tests/functional/tests/app/Magento/Review/Test/Block/Adminhtml/ReviewsTab.php b/dev/tests/functional/tests/app/Magento/Review/Test/Block/Adminhtml/ReviewsTab.php index 8e2d9b1c2e920..c2983dbc7d95c 100644 --- a/dev/tests/functional/tests/app/Magento/Review/Test/Block/Adminhtml/ReviewsTab.php +++ b/dev/tests/functional/tests/app/Magento/Review/Test/Block/Adminhtml/ReviewsTab.php @@ -18,7 +18,7 @@ class ReviewsTab extends Tab * * @var string */ - protected $reviews = '#Product_Reviews'; + protected $reviews = '#reviwGrid'; /** * Returns product reviews grid diff --git a/dev/tests/functional/tests/app/Magento/Review/Test/Constraint/AssertProductRatingInGrid.php b/dev/tests/functional/tests/app/Magento/Review/Test/Constraint/AssertProductRatingInGrid.php index a4040a184462a..050c2d10f281e 100755 --- a/dev/tests/functional/tests/app/Magento/Review/Test/Constraint/AssertProductRatingInGrid.php +++ b/dev/tests/functional/tests/app/Magento/Review/Test/Constraint/AssertProductRatingInGrid.php @@ -14,12 +14,9 @@ */ class AssertProductRatingInGrid extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'middle'; + /* tags */ + const SEVERITY = 'middle'; + /* end tags */ /** * Assert product Rating availability in product Rating grid diff --git a/dev/tests/functional/tests/app/Magento/Review/Test/Constraint/AssertProductRatingInProductPage.php b/dev/tests/functional/tests/app/Magento/Review/Test/Constraint/AssertProductRatingInProductPage.php index a491693e25011..66b26ef9c4d13 100755 --- a/dev/tests/functional/tests/app/Magento/Review/Test/Constraint/AssertProductRatingInProductPage.php +++ b/dev/tests/functional/tests/app/Magento/Review/Test/Constraint/AssertProductRatingInProductPage.php @@ -18,12 +18,9 @@ */ class AssertProductRatingInProductPage extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'middle'; + /* tags */ + const SEVERITY = 'middle'; + /* end tags */ /** * Assert that product rating is displayed on product review(frontend) diff --git a/dev/tests/functional/tests/app/Magento/Review/Test/Constraint/AssertProductRatingNotInGrid.php b/dev/tests/functional/tests/app/Magento/Review/Test/Constraint/AssertProductRatingNotInGrid.php index cbbaf0b30502d..23cf3f3a88ae1 100755 --- a/dev/tests/functional/tests/app/Magento/Review/Test/Constraint/AssertProductRatingNotInGrid.php +++ b/dev/tests/functional/tests/app/Magento/Review/Test/Constraint/AssertProductRatingNotInGrid.php @@ -14,12 +14,9 @@ */ class AssertProductRatingNotInGrid extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'middle'; + /* tags */ + const SEVERITY = 'middle'; + /* end tags */ /** * Assert product Rating is absent on product Rating grid diff --git a/dev/tests/functional/tests/app/Magento/Review/Test/Constraint/AssertProductRatingNotInProductPage.php b/dev/tests/functional/tests/app/Magento/Review/Test/Constraint/AssertProductRatingNotInProductPage.php index 5bc7c81fa2838..43c3cf191fc62 100755 --- a/dev/tests/functional/tests/app/Magento/Review/Test/Constraint/AssertProductRatingNotInProductPage.php +++ b/dev/tests/functional/tests/app/Magento/Review/Test/Constraint/AssertProductRatingNotInProductPage.php @@ -16,12 +16,9 @@ */ class AssertProductRatingNotInProductPage extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'middle'; + /* tags */ + const SEVERITY = 'middle'; + /* end tags */ /** * Assert that product rating is not displayed on frontend on product review diff --git a/dev/tests/functional/tests/app/Magento/Review/Test/Constraint/AssertProductRatingOnReviewPage.php b/dev/tests/functional/tests/app/Magento/Review/Test/Constraint/AssertProductRatingOnReviewPage.php index a0e657f29f421..4f3e23a8338ea 100755 --- a/dev/tests/functional/tests/app/Magento/Review/Test/Constraint/AssertProductRatingOnReviewPage.php +++ b/dev/tests/functional/tests/app/Magento/Review/Test/Constraint/AssertProductRatingOnReviewPage.php @@ -15,12 +15,9 @@ */ class AssertProductRatingOnReviewPage extends AbstractAssertForm { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'middle'; + /* tags */ + const SEVERITY = 'middle'; + /* end tags */ /** * Assert that product rating is displayed on product review(backend) diff --git a/dev/tests/functional/tests/app/Magento/Review/Test/Constraint/AssertProductRatingSuccessDeleteMessage.php b/dev/tests/functional/tests/app/Magento/Review/Test/Constraint/AssertProductRatingSuccessDeleteMessage.php index a138f6038a5ae..62490decee02b 100755 --- a/dev/tests/functional/tests/app/Magento/Review/Test/Constraint/AssertProductRatingSuccessDeleteMessage.php +++ b/dev/tests/functional/tests/app/Magento/Review/Test/Constraint/AssertProductRatingSuccessDeleteMessage.php @@ -13,14 +13,11 @@ */ class AssertProductRatingSuccessDeleteMessage extends AbstractConstraint { - const SUCCESS_DELETE_MESSAGE = 'You deleted the rating.'; + /* tags */ + const SEVERITY = 'high'; + /* end tags */ - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'high'; + const SUCCESS_DELETE_MESSAGE = 'You deleted the rating.'; /** * Assert that success message is displayed after rating delete diff --git a/dev/tests/functional/tests/app/Magento/Review/Test/Constraint/AssertProductRatingSuccessSaveMessage.php b/dev/tests/functional/tests/app/Magento/Review/Test/Constraint/AssertProductRatingSuccessSaveMessage.php index b2be0173d951c..db1fb17ba36ae 100755 --- a/dev/tests/functional/tests/app/Magento/Review/Test/Constraint/AssertProductRatingSuccessSaveMessage.php +++ b/dev/tests/functional/tests/app/Magento/Review/Test/Constraint/AssertProductRatingSuccessSaveMessage.php @@ -13,14 +13,11 @@ */ class AssertProductRatingSuccessSaveMessage extends AbstractConstraint { - const SUCCESS_MESSAGE = 'You saved the rating.'; + /* tags */ + const SEVERITY = 'high'; + /* end tags */ - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'high'; + const SUCCESS_MESSAGE = 'You saved the rating.'; /** * Assert that success message is displayed after rating save diff --git a/dev/tests/functional/tests/app/Magento/Review/Test/Constraint/AssertProductReviewBackendSuccessSaveMessage.php b/dev/tests/functional/tests/app/Magento/Review/Test/Constraint/AssertProductReviewBackendSuccessSaveMessage.php index b7bfe5a5ebf6e..fad1e066f90dd 100644 --- a/dev/tests/functional/tests/app/Magento/Review/Test/Constraint/AssertProductReviewBackendSuccessSaveMessage.php +++ b/dev/tests/functional/tests/app/Magento/Review/Test/Constraint/AssertProductReviewBackendSuccessSaveMessage.php @@ -14,18 +14,15 @@ */ class AssertProductReviewBackendSuccessSaveMessage extends AbstractConstraint { + /* tags */ + const SEVERITY = 'middle'; + /* end tags */ + /** * Text of success message after review created */ const SUCCESS_MESSAGE = 'You saved the review.'; - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'middle'; - /** * Assert that success message is displayed after review created * diff --git a/dev/tests/functional/tests/app/Magento/Review/Test/Constraint/AssertProductReviewInGrid.php b/dev/tests/functional/tests/app/Magento/Review/Test/Constraint/AssertProductReviewInGrid.php index 32bbc3723eb44..b83eeecf9381f 100755 --- a/dev/tests/functional/tests/app/Magento/Review/Test/Constraint/AssertProductReviewInGrid.php +++ b/dev/tests/functional/tests/app/Magento/Review/Test/Constraint/AssertProductReviewInGrid.php @@ -16,12 +16,9 @@ */ class AssertProductReviewInGrid extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Filter params diff --git a/dev/tests/functional/tests/app/Magento/Review/Test/Constraint/AssertProductReviewInGridOnCustomerPage.php b/dev/tests/functional/tests/app/Magento/Review/Test/Constraint/AssertProductReviewInGridOnCustomerPage.php index a59b875ab0e77..f135712301a99 100644 --- a/dev/tests/functional/tests/app/Magento/Review/Test/Constraint/AssertProductReviewInGridOnCustomerPage.php +++ b/dev/tests/functional/tests/app/Magento/Review/Test/Constraint/AssertProductReviewInGridOnCustomerPage.php @@ -18,12 +18,9 @@ */ class AssertProductReviewInGridOnCustomerPage extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Asserts all Product Review variables in the reviews grid on customer page diff --git a/dev/tests/functional/tests/app/Magento/Review/Test/Constraint/AssertProductReviewMassActionSuccessDeleteMessage.php b/dev/tests/functional/tests/app/Magento/Review/Test/Constraint/AssertProductReviewMassActionSuccessDeleteMessage.php index df39cca65f837..811356bb59764 100644 --- a/dev/tests/functional/tests/app/Magento/Review/Test/Constraint/AssertProductReviewMassActionSuccessDeleteMessage.php +++ b/dev/tests/functional/tests/app/Magento/Review/Test/Constraint/AssertProductReviewMassActionSuccessDeleteMessage.php @@ -15,18 +15,15 @@ */ class AssertProductReviewMassActionSuccessDeleteMessage extends AbstractConstraint { + /* tags */ + const SEVERITY = 'high'; + /* end tags */ + /** * Message that appears after deletion via mass actions */ const SUCCESS_DELETE_MESSAGE = 'A total of %d record(s) have been deleted.'; - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'high'; - /** * Assert that success message is displayed after deletion via mass actions * diff --git a/dev/tests/functional/tests/app/Magento/Review/Test/Constraint/AssertProductReviewMassActionSuccessMessage.php b/dev/tests/functional/tests/app/Magento/Review/Test/Constraint/AssertProductReviewMassActionSuccessMessage.php index fab20856815fd..85dda0cdc5a16 100644 --- a/dev/tests/functional/tests/app/Magento/Review/Test/Constraint/AssertProductReviewMassActionSuccessMessage.php +++ b/dev/tests/functional/tests/app/Magento/Review/Test/Constraint/AssertProductReviewMassActionSuccessMessage.php @@ -15,18 +15,15 @@ */ class AssertProductReviewMassActionSuccessMessage extends AbstractConstraint { + /* tags */ + const SEVERITY = 'high'; + /* end tags */ + /** * Message that appears after updates via mass actions */ const SUCCESS_MESSAGE = 'A total of %d record(s) have been updated.'; - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'high'; - /** * Assert that success message is displayed after updated via mass actions * diff --git a/dev/tests/functional/tests/app/Magento/Review/Test/Constraint/AssertProductReviewNotInGrid.php b/dev/tests/functional/tests/app/Magento/Review/Test/Constraint/AssertProductReviewNotInGrid.php index aa96f23a1380c..d60bd2d1f823c 100644 --- a/dev/tests/functional/tests/app/Magento/Review/Test/Constraint/AssertProductReviewNotInGrid.php +++ b/dev/tests/functional/tests/app/Magento/Review/Test/Constraint/AssertProductReviewNotInGrid.php @@ -16,12 +16,9 @@ */ class AssertProductReviewNotInGrid extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Filter params diff --git a/dev/tests/functional/tests/app/Magento/Review/Test/Constraint/AssertProductReviewNotOnProductPage.php b/dev/tests/functional/tests/app/Magento/Review/Test/Constraint/AssertProductReviewNotOnProductPage.php index 7776da4c89cd7..e5a3ae3b556ec 100644 --- a/dev/tests/functional/tests/app/Magento/Review/Test/Constraint/AssertProductReviewNotOnProductPage.php +++ b/dev/tests/functional/tests/app/Magento/Review/Test/Constraint/AssertProductReviewNotOnProductPage.php @@ -17,12 +17,9 @@ */ class AssertProductReviewNotOnProductPage extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'middle'; + /* tags */ + const SEVERITY = 'middle'; + /* end tags */ /** * Assert that product review Not available on product page diff --git a/dev/tests/functional/tests/app/Magento/Review/Test/Constraint/AssertProductReviewOnProductPage.php b/dev/tests/functional/tests/app/Magento/Review/Test/Constraint/AssertProductReviewOnProductPage.php index 5bff591d0208d..7ff7a616b380b 100644 --- a/dev/tests/functional/tests/app/Magento/Review/Test/Constraint/AssertProductReviewOnProductPage.php +++ b/dev/tests/functional/tests/app/Magento/Review/Test/Constraint/AssertProductReviewOnProductPage.php @@ -18,12 +18,9 @@ */ class AssertProductReviewOnProductPage extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'middle'; + /* tags */ + const SEVERITY = 'middle'; + /* end tags */ /** * Assert that product review available on product page diff --git a/dev/tests/functional/tests/app/Magento/Review/Test/Constraint/AssertReviewCreationSuccessMessage.php b/dev/tests/functional/tests/app/Magento/Review/Test/Constraint/AssertReviewCreationSuccessMessage.php index 1093c4e23528e..c7fc83dedb5c5 100755 --- a/dev/tests/functional/tests/app/Magento/Review/Test/Constraint/AssertReviewCreationSuccessMessage.php +++ b/dev/tests/functional/tests/app/Magento/Review/Test/Constraint/AssertReviewCreationSuccessMessage.php @@ -13,18 +13,15 @@ */ class AssertReviewCreationSuccessMessage extends AbstractConstraint { + /* tags */ + const SEVERITY = 'high'; + /* end tags */ + /** * Text of success message after review created */ const SUCCESS_MESSAGE = 'Your review has been accepted for moderation.'; - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'high'; - /** * Assert that success message is displayed after review created * diff --git a/dev/tests/functional/tests/app/Magento/Review/Test/Constraint/AssertReviewSuccessSaveMessage.php b/dev/tests/functional/tests/app/Magento/Review/Test/Constraint/AssertReviewSuccessSaveMessage.php index 1316973c66562..1f65a344f5fb1 100755 --- a/dev/tests/functional/tests/app/Magento/Review/Test/Constraint/AssertReviewSuccessSaveMessage.php +++ b/dev/tests/functional/tests/app/Magento/Review/Test/Constraint/AssertReviewSuccessSaveMessage.php @@ -13,14 +13,11 @@ */ class AssertReviewSuccessSaveMessage extends AbstractConstraint { - const SUCCESS_MESSAGE = 'You saved the review.'; + /* tags */ + const SEVERITY = 'high'; + /* end tags */ - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'high'; + const SUCCESS_MESSAGE = 'You saved the review.'; /** * Assert that success message is displayed after review save diff --git a/dev/tests/functional/tests/app/Magento/Review/Test/etc/constraint.xml b/dev/tests/functional/tests/app/Magento/Review/Test/etc/constraint.xml index 5174b9ce6d7f3..fa4d771db01fb 100644 --- a/dev/tests/functional/tests/app/Magento/Review/Test/etc/constraint.xml +++ b/dev/tests/functional/tests/app/Magento/Review/Test/etc/constraint.xml @@ -6,63 +6,63 @@ --> - high + high - high + high - middle + middle - middle + middle - middle + middle - middle + middle - high + high - high + high - low + low - middle + middle - middle + middle - high + high - high + high - middle + middle - middle + middle - middle + middle - low + low - low + low \ No newline at end of file diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/CreditMemo/Grid.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/CreditMemo/Grid.php new file mode 100644 index 0000000000000..3943370397c5d --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/CreditMemo/Grid.php @@ -0,0 +1,33 @@ + [ + 'selector' => 'input[name="real_creditmemo_id"]', + ], + 'order_id' => [ + 'selector' => 'input[name="order_increment_id"]', + ], + 'grand_total_from' => [ + 'selector' => 'input[name="base_grand_total[from]"]', + ], + 'grand_total_to' => [ + 'selector' => 'input[name="base_grand_total[to]"]', + ], + ]; +} diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Invoice/Grid.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Invoice/Grid.php new file mode 100644 index 0000000000000..9d1a5796bca7d --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Invoice/Grid.php @@ -0,0 +1,33 @@ + [ + 'selector' => 'input[name="increment_id"]', + ], + 'order_id' => [ + 'selector' => 'input[name="order_increment_id"]', + ], + 'grand_total_from' => [ + 'selector' => 'input[name="grand_total[from]"]', + ], + 'grand_total_to' => [ + 'selector' => 'input[name="grand_total[to]"]', + ], + ]; +} diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/AbstractForm.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/AbstractForm.php new file mode 100644 index 0000000000000..355bdef0c473c --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/AbstractForm.php @@ -0,0 +1,107 @@ +prepareData($data); + if (isset($data['form_data'])) { + $data['form_data'] = $this->dataMapping($data['form_data']); + $this->_fill($data['form_data']); + } + if (isset($data['items_data']) && $products !== null) { + foreach ($products as $key => $product) { + $this->getItemsBlock()->getItemProductBlock($product)->fillProduct($data['items_data'][$key]); + } + } + } + + /** + * Click update qty's button + * + * @return void + */ + public function updateQty() + { + $this->getItemsBlock()->clickUpdateQty(); + } + + /** + * Get items block + * + * @return AbstractItemsNewBlock + */ + abstract protected function getItemsBlock(); + + /** + * Submit order + * + * @return void + */ + public function submit() + { + $browser = $this->browser; + $selector = $this->loader; + $browser->waitUntil( + function () use ($browser, $selector) { + $element = $browser->find($selector); + return $element->isVisible() == false ? true : null; + } + ); + $this->reinitRootElement(); + $this->_rootElement->find($this->send)->click(); + } + + /** + * Prepare data + * + * @param array $data + * @return array|null + */ + protected function prepareData(array $data) + { + $result = []; + foreach ($data as $key => $value) { + if (is_array($value)) { + $value = $this->prepareData($value); + } + if ($value !== '-' && $value !== null) { + $result[$key] = $value; + } + } + + return empty($result) ? null : $result; + } +} diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/AbstractForm/Product.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/AbstractForm/Product.php new file mode 100644 index 0000000000000..cae80b47c510a --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/AbstractForm/Product.php @@ -0,0 +1,27 @@ +dataMapping($data); + $this->_fill($data); + } +} diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/AbstractItems.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/AbstractItems.php new file mode 100644 index 0000000000000..01a9b4193ddf2 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/AbstractItems.php @@ -0,0 +1,124 @@ +_rootElement->find($this->rowItem)->getElements(); + $data = []; + + foreach ($items as $item) { + $itemData = []; + + $itemData += $this->parseProductName($item->find($this->product)->getText()); + $itemData['price'] = $this->escapePrice($item->find($this->price)->getText()); + $itemData['qty'] = $item->find($this->qty)->getText(); + $itemData['subtotal'] = $this->escapePrice($item->find($this->subtotal)->getText()); + $itemData['tax'] = $this->escapePrice($item->find($this->taxAmount)->getText()); + $itemData['discount'] = $this->escapePrice($item->find($this->discountAmount)->getText()); + $itemData['total'] = $this->escapePrice($item->find($this->rowTotal)->getText()); + + $data[] = $itemData; + } + + return $data; + } + + /** + * Parse product name to title and sku product + * + * @param string $product + * @return array + */ + protected function parseProductName($product) + { + $data = array_map('trim', explode('SKU:', $product)); + return [ + 'product' => $data[0], + 'sku' => isset($data[1]) ? $data[1] : '' + ]; + } + + /** + * Prepare price + * + * @var string $price + * @return string + */ + protected function escapePrice($price) + { + return preg_replace('[^0-9\.]', '', $price); + } +} diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/AbstractItemsNewBlock.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/AbstractItemsNewBlock.php new file mode 100644 index 0000000000000..7dffee326af1d --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/AbstractItemsNewBlock.php @@ -0,0 +1,49 @@ +_rootElement->find($this->updateQty)->click(); + } +} diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/Actions.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/Actions.php new file mode 100644 index 0000000000000..db1389a9782bb --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/Actions.php @@ -0,0 +1,257 @@ +_rootElement->find($this->ship)->click(); + } + + /** + * Invoice order + * + * @return void + */ + public function invoice() + { + $this->_rootElement->find($this->invoice)->click(); + } + + /** + * Reorder order + * + * @return void + */ + public function reorder() + { + $this->_rootElement->find($this->reorder)->click(); + } + + /** + * Go back + * + * @return void + */ + public function back() + { + $this->_rootElement->find($this->back)->click(); + } + + /** + * Edit order + * + * @return void + */ + public function edit() + { + $this->_rootElement->find($this->edit)->click(); + } + + /** + * Cancel order + * + * @return void + */ + public function cancel() + { + $this->_rootElement->find($this->cancel)->click(); + $this->_rootElement->acceptAlert(); + } + + /** + * Send email + * + * @return void + */ + public function sendEmail() + { + $this->_rootElement->find($this->sendEmail)->click(); + } + + /** + * Void order + * + * @return void + */ + public function void() + { + $this->_rootElement->find($this->void)->click(); + } + + /** + * Hold order + * + * @return void + */ + public function hold() + { + $this->_rootElement->find($this->hold)->click(); + } + + /** + * Order credit memo + * + * @return void + */ + public function orderCreditMemo() + { + $this->_rootElement->find($this->orderCreditMemo)->click(); + } + + /** + * Order invoice credit memo + * + * @return void + */ + public function orderInvoiceCreditMemo() + { + $this->_rootElement->find($this->orderInvoiceCreditMemo)->click(); + } + + /** + * Refund order + * + * @return void + */ + public function refund() + { + $this->_rootElement->find($this->refund, Locator::SELECTOR_CSS)->click(); + } + + /** + * Refund offline order + * + * @return void + */ + public function refundOffline() + { + $this->_rootElement->find($this->refundOffline, Locator::SELECTOR_CSS)->click(); + } + + /** + * Check if action button is visible + * + * @param string $buttonName + * @return bool + */ + public function isActionButtonVisible($buttonName) + { + $buttonName = str_replace(' ', '-', strtolower($buttonName)); + return $this->_rootElement->find(sprintf($this->button, $buttonName))->isVisible(); + } +} diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/Create.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/Create.php new file mode 100644 index 0000000000000..0c8c21a0b15e9 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/Create.php @@ -0,0 +1,291 @@ +getMagentoSalesAdminhtmlOrderCreateItems( + $this->_rootElement->find($this->itemsBlock, Locator::SELECTOR_CSS) + ); + } + + /** + * Get sales order create billing address block + * + * @return \Magento\Sales\Test\Block\Adminhtml\Order\Create\Billing\Address + */ + public function getBillingAddressBlock() + { + return Factory::getBlockFactory()->getMagentoSalesAdminhtmlOrderCreateBillingAddress( + $this->_rootElement->find($this->billingAddressBlock, Locator::SELECTOR_CSS) + ); + } + + /** + * Get sales order create billing address block + * + * @return \Magento\Sales\Test\Block\Adminhtml\Order\Create\Shipping\Address + */ + protected function getShippingAddressBlock() + { + return Factory::getBlockFactory()->getMagentoSalesAdminhtmlOrderCreateShippingAddress( + $this->_rootElement->find($this->shippingAddressBlock, Locator::SELECTOR_CSS) + ); + } + + /** + * Get sales order create payment method block + * + * @return \Magento\Sales\Test\Block\Adminhtml\Order\Create\Billing\Method + */ + protected function getBillingMethodBlock() + { + return Factory::getBlockFactory()->getMagentoSalesAdminhtmlOrderCreateBillingMethod( + $this->_rootElement->find($this->billingMethodBlock, Locator::SELECTOR_CSS) + ); + } + + /** + * Get sales order create shipping method block + * + * @return \Magento\Sales\Test\Block\Adminhtml\Order\Create\Shipping\Method + */ + protected function getShippingMethodBlock() + { + return Factory::getBlockFactory()->getMagentoSalesAdminhtmlOrderCreateShippingMethod( + $this->_rootElement->find($this->shippingMethodBlock, Locator::SELECTOR_CSS) + ); + } + + /** + * Get sales order create totals block + * + * @return \Magento\Sales\Test\Block\Adminhtml\Order\Create\Totals + */ + protected function getTotalsBlock() + { + return Factory::getBlockFactory()->getMagentoSalesAdminhtmlOrderCreateTotals( + $this->_rootElement->find($this->totalsBlock, Locator::SELECTOR_CSS) + ); + } + + /** + * Get backend abstract block + * + * @return \Magento\Backend\Test\Block\Template + */ + public function getTemplateBlock() + { + return Factory::getBlockFactory()->getMagentoBackendTemplate( + $this->_rootElement->find($this->templateBlock, Locator::SELECTOR_XPATH) + ); + } + + /** + * Get sales order create search products block + * + * @return \Magento\Sales\Test\Block\Adminhtml\Order\Create\Search\Grid + */ + public function getGridBlock() + { + return Factory::getBlockFactory()->getMagentoSalesAdminhtmlOrderCreateSearchGrid( + $this->_rootElement->find($this->gridBlock, Locator::SELECTOR_CSS) + ); + } + + /** + * Wait display order items grid + * + * @return void + */ + public function waitOrderItemsGrid() + { + $this->waitForElementVisible($this->orderItemsGrid); + } + + /** + * Update product data in sales + * + * @param array $products + * @return void + */ + public function updateProductsData(array $products) + { + /** @var \Magento\Sales\Test\Block\Adminhtml\Order\Create\Items $items */ + $items = $this->blockFactory->create( + 'Magento\Sales\Test\Block\Adminhtml\Order\Create\Items', + ['element' => $this->_rootElement->find($this->itemsBlock)] + ); + foreach ($products as $product) { + $items->getItemProductByName($product->getName()) + ->fill($product->getDataFieldConfig('checkout_data')['source']); + } + $this->updateItems(); + } + + /** + * Update product items. + * + * @return void + */ + public function updateItems() + { + $this->_rootElement->find($this->updateItems)->click(); + $this->getTemplateBlock()->waitLoader(); + } + + /** + * Fill addresses based on present data in customer and order fixtures + * + * @param FixtureInterface $address + * @return void + */ + public function fillAddresses(FixtureInterface $address) + { + $this->getShippingAddressBlock()->uncheckSameAsBillingShippingAddress(); + $this->getTemplateBlock()->waitLoader(); + $this->getBillingAddressBlock()->fill($address); + $this->getShippingAddressBlock()->setSameAsBillingShippingAddress(); + $this->getTemplateBlock()->waitLoader(); + } + + /** + * Select shipping method + * + * @param array $shippingMethod + * @return void + */ + public function selectShippingMethod(array $shippingMethod) + { + $this->getShippingMethodBlock()->selectShippingMethod($shippingMethod); + $this->getTemplateBlock()->waitLoader(); + } + + /** + * Select payment method + * + * @param array $paymentCode + * @return void + */ + public function selectPaymentMethod(array $paymentCode) + { + $this->getBillingMethodBlock()->selectPaymentMethod($paymentCode); + $this->getTemplateBlock()->waitLoader(); + } + + /** + * Submit order + * + * @return void + */ + public function submitOrder() + { + $this->getTotalsBlock()->submitOrder(); + } + + /** + * Click "Add Selected Product(s) to Order" button + * + * @return void + */ + public function addSelectedProductsToOrder() + { + $this->_rootElement->find($this->addSelectedProducts)->click(); + } +} diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/Create/Billing/Address.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/Create/Billing/Address.php new file mode 100644 index 0000000000000..4dc59b14faa45 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/Create/Billing/Address.php @@ -0,0 +1,34 @@ +reinitRootElement(); + return explode("\n", $this->_rootElement->find($this->existingAddressSelector)->getText()); + } +} diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/Create/Billing/Address.xml b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/Create/Billing/Address.xml new file mode 100644 index 0000000000000..abb7c3c77b191 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/Create/Billing/Address.xml @@ -0,0 +1,29 @@ + + + + order[billing_address] + + + + + + [name='order[billing_address][street][0]'] + + + + select + + + select + + + + + checkbox + + + diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/Create/Billing/Method.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/Create/Billing/Method.php new file mode 100644 index 0000000000000..759e75ca34c3a --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/Create/Billing/Method.php @@ -0,0 +1,47 @@ +_rootElement->click(); + $paymentInput = $this->_rootElement->find(sprintf($this->paymentMethod, $paymentCode['method'])); + if ($paymentInput->isVisible()) { + $paymentInput->click(); + } + if (isset($paymentCode['po_number']) && $paymentCode['po_number'] !== "-") { + $this->_rootElement->find($this->purchaseOrderNumber)->setValue($paymentCode['po_number']); + } + } +} diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/Create/Customer.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/Create/Customer.php new file mode 100644 index 0000000000000..472175a911a7b --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/Create/Customer.php @@ -0,0 +1,70 @@ + [ + 'selector' => '#sales_order_create_customer_grid_filter_email', + ], + ]; + + /** + * Select customer if it is present in fixture or click create new customer button + * + * @param FixtureInterface|null $fixture + * @return void + */ + public function selectCustomer($fixture) + { + if ($fixture === null) { + $this->_rootElement->find($this->createNewCustomer)->click(); + } else { + $this->searchAndOpen(['email' => $fixture->getEmail()]); + } + $this->getTemplateBlock()->waitLoader(); + } + + /** + * Search item and open it. + * + * @param array $filter + * @return void + */ + public function searchAndOpen(array $filter) + { + parent::searchAndOpen($filter); + $this->getTemplateBlock()->waitLoader(); + } +} diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/Create/CustomerActivities.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/Create/CustomerActivities.php new file mode 100644 index 0000000000000..058fde4a1e2e9 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/Create/CustomerActivities.php @@ -0,0 +1,184 @@ +blockFactory->create( + 'Magento\Sales\Test\Block\Adminhtml\Order\Create\CustomerActivities\Sidebar\LastOrderedItems', + ['element' => $this->_rootElement->find($this->reorderSidebar)] + ); + } + + /** + * Get viewed products block. + * + * @return RecentlyViewedItems + */ + public function getRecentlyViewedItemsBlock() + { + return $this->blockFactory->create( + 'Magento\Sales\Test\Block\Adminhtml\Order\Create\CustomerActivities\Sidebar\RecentlyViewedItems', + ['element' => $this->_rootElement->find($this->recentlyViewedSidebar)] + ); + } + + /** + * Get products in comparison block + * + * @return ProductsInComparison + */ + public function getProductsInComparisonBlock() + { + return $this->blockFactory->create( + 'Magento\Sales\Test\Block\Adminhtml\Order\Create\CustomerActivities\Sidebar\ProductsInComparison', + ['element' => $this->_rootElement->find($this->comparedSidebar)] + ); + } + + /** + * Get products in comparison block + * + * @return RecentlyComparedProducts + */ + public function getRecentlyComparedProductsBlock() + { + return $this->blockFactory->create( + 'Magento\Sales\Test\Block\Adminhtml\Order\Create\CustomerActivities\Sidebar\RecentlyComparedProducts', + ['element' => $this->_rootElement->find($this->recentlyComparedSidebar)] + ); + } + + /** + * Get products in view block + * + * @return RecentlyViewedProducts + */ + public function getRecentlyViewedProductsBlock() + { + return $this->blockFactory->create( + 'Magento\Sales\Test\Block\Adminhtml\Order\Create\CustomerActivities\Sidebar\RecentlyViewedProducts', + ['element' => $this->_rootElement->find($this->recentlyViewedSidebar)] + ); + } + + /** + * Get shopping Cart items block + * + * @return ShoppingCartItems + */ + public function getShoppingCartItemsBlock() + { + return $this->blockFactory->create( + 'Magento\Sales\Test\Block\Adminhtml\Order\Create\CustomerActivities\Sidebar\ShoppingCartItems', + ['element' => $this->_rootElement->find($this->shoppingCartSidebar)] + ); + } + + /** + * Get backend abstract block + * + * @return \Magento\Backend\Test\Block\Template + */ + public function getTemplateBlock() + { + return $this->blockFactory->create( + 'Magento\Backend\Test\Block\Template', + ['element' => $this->_rootElement->find($this->templateBlock, Locator::SELECTOR_XPATH)] + ); + } + + /** + * Click 'Update Changes' button + * + * @return void + */ + public function updateChanges() + { + $this->_rootElement->find($this->lastSidebar, Locator::SELECTOR_XPATH)->click(); + $this->_rootElement->find($this->updateChanges)->click(); + $this->getTemplateBlock()->waitLoader(); + } +} diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/Create/CustomerActivities/Sidebar.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/Create/CustomerActivities/Sidebar.php new file mode 100644 index 0000000000000..d7d83760d2074 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/Create/CustomerActivities/Sidebar.php @@ -0,0 +1,46 @@ +_rootElement->find(sprintf($this->addToOrderProductName, $name), Locator::SELECTOR_XPATH)->click(); + $this->_rootElement->click(); + $this->_rootElement->find(sprintf($this->addToOrder, $name), Locator::SELECTOR_XPATH, 'checkbox') + ->setValue('Yes'); + } + } +} diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/Create/CustomerActivities/Sidebar/LastOrderedItems.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/Create/CustomerActivities/Sidebar/LastOrderedItems.php new file mode 100644 index 0000000000000..d7c8091bc0c5f --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/Create/CustomerActivities/Sidebar/LastOrderedItems.php @@ -0,0 +1,17 @@ +_rootElement->find($this->recentlyViewedProducts, Locator::SELECTOR_XPATH) + ->getElements(); + foreach ($productNames as $productName) { + $products[] = $productName->getText(); + } + return $products; + } +} diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/Create/CustomerActivities/Sidebar/ShoppingCartItems.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/Create/CustomerActivities/Sidebar/ShoppingCartItems.php new file mode 100644 index 0000000000000..2d2429493d05f --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/Create/CustomerActivities/Sidebar/ShoppingCartItems.php @@ -0,0 +1,17 @@ +_rootElement; + $selector = $this->addProducts; + $this->_rootElement->waitUntil( + function () use ($element, $selector) { + $addProductsButton = $element->find($selector, Locator::SELECTOR_XPATH); + return $addProductsButton->isVisible() ? true : null; + } + ); + $this->_rootElement->find($this->addProducts, Locator::SELECTOR_XPATH)->click(); + } + + /** + * Get item product block + * + * @param string $name + * @return \Magento\Sales\Test\Block\Adminhtml\Order\Create\Items\ItemProduct + */ + public function getItemProductByName($name) + { + return $this->blockFactory->create( + 'Magento\Sales\Test\Block\Adminhtml\Order\Create\Items\ItemProduct', + ['element' => $this->_rootElement->find(sprintf($this->itemProduct, $name), Locator::SELECTOR_XPATH)] + ); + } + + /** + * Get products data by fields from items ordered grid. + * + * @param array $fields + * @return array + */ + public function getProductsDataByFields($fields) + { + $this->getTemplateBlock()->waitLoader(); + $this->_rootElement->click(); + $products = $this->_rootElement->find($this->productNames, Locator::SELECTOR_XPATH)->getElements(); + $pageData = []; + foreach ($products as $product) { + $pageData[] = $this->getItemProductByName($product->getText())->getCheckoutData($fields); + } + + return $pageData; + } + + /** + * Get template block. + * + * @return Template + */ + public function getTemplateBlock() + { + return $this->blockFactory->create( + 'Magento\Backend\Test\Block\Template', + ['element' => $this->_rootElement->find($this->template, Locator::SELECTOR_XPATH)] + ); + } +} diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/Create/Items/ItemProduct.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/Create/Items/ItemProduct.php new file mode 100644 index 0000000000000..744fb440f507d --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/Create/Items/ItemProduct.php @@ -0,0 +1,89 @@ + 'getText', + 'price' => 'getText', + 'qty' => 'getValue', + 'checkout_data' => 'getValue', + ]; + + /** + * Magento loader. + * + * @var string + */ + protected $loader = '//ancestor::body/div[@id="loading-mask"]'; + + /** + * Configure button locator. + * + * @var string + */ + protected $configureButton = 'button'; + + /** + * Order items block locator. + * + * @var string + */ + protected $orderItemsBlock = '#order-items .title'; + + /** + * Get data item products. + * + * @param array $fields + * @param string $currency [optional] + * @return array + */ + public function getCheckoutData(array $fields, $currency = '$') + { + $result = []; + $data = $this->dataMapping($fields); + foreach ($data as $key => $item) { + if (!isset($item['value'])) { + $result[$key] = $this->getCheckoutData($item); + continue; + } + $value = $this->_rootElement->find( + $item['selector'], + $item['strategy'], + $item['input'] + )->{$this->actions[$key]}(); + + $result[$key] = str_replace($currency, '', trim($value)); + } + + return $result; + } + + /** + * Click Configure button. + * + * @return void + */ + public function configure() + { + $this->browser->find($this->orderItemsBlock)->click(); + $this->_rootElement->find($this->configureButton)->click(); + $this->waitForElementNotVisible($this->loader, Locator::SELECTOR_XPATH); + } +} diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/Create/Items/ItemProduct.xml b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/Create/Items/ItemProduct.xml new file mode 100644 index 0000000000000..16679e2cca1d9 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/Create/Items/ItemProduct.xml @@ -0,0 +1,28 @@ + + + + + + .col-product span + + + .col-price span.price + + + .col-qty input + + + + .col-price input.item-price + + + .col-price input[type=checkbox] + checkbox + + + + diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/Create/Search/Grid.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/Create/Search/Grid.php new file mode 100644 index 0000000000000..d406409e7634f --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/Create/Search/Grid.php @@ -0,0 +1,31 @@ + [ + 'selector' => '#sales_order_create_search_grid_filter_sku', + ], + ]; +} diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/Create/Shipping/Address.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/Create/Shipping/Address.php new file mode 100644 index 0000000000000..faae41bd8ea46 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/Create/Shipping/Address.php @@ -0,0 +1,53 @@ +_rootElement->find($this->title)->click(); + $this->_rootElement->find($this->sameAsBilling, Locator::SELECTOR_CSS, 'checkbox')->setValue('Yes'); + } + + /** + * Uncheck the 'Same as billing address' checkbox in shipping address + * + * @return void + */ + public function uncheckSameAsBillingShippingAddress() + { + $this->_rootElement->find($this->title)->click(); + $this->_rootElement->find($this->sameAsBilling, Locator::SELECTOR_CSS, 'checkbox')->setValue('No'); + } +} diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/Create/Shipping/Method.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/Create/Shipping/Method.php new file mode 100644 index 0000000000000..bed696e489629 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/Create/Shipping/Method.php @@ -0,0 +1,48 @@ +_rootElement->click(); + $this->_rootElement->find($this->shippingMethodsLink)->click(); + $selector = sprintf( + $this->shippingMethod, + $shippingMethod['shipping_service'], + $shippingMethod['shipping_method'] + ); + $this->_rootElement->find($selector, Locator::SELECTOR_XPATH)->click(); + } +} diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/Create/Store.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/Create/Store.php new file mode 100644 index 0000000000000..b071383601c32 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/Create/Store.php @@ -0,0 +1,55 @@ +getMagentoBackendTemplate( + $this->_rootElement->find($this->templateBlock, Locator::SELECTOR_XPATH) + ); + } + + /** + * Select store view for order based on Order fixture + * + * @param StoreFixture|null $fixture + */ + public function selectStoreView(StoreFixture $fixture = null) + { + if (!$this->isVisible()) { + return; + } + $storeName = $fixture == null ? 'Default Store View' : $fixture->getName(); + $selector = '//label[text()="' . $storeName . '"]/preceding-sibling::*'; + $this->_rootElement->find($selector, Locator::SELECTOR_XPATH, 'checkbox')->setValue('Yes'); + $this->getTemplateBlock()->waitLoader(); + } +} diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/Create/Totals.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/Create/Totals.php new file mode 100644 index 0000000000000..96acb7435c330 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/Create/Totals.php @@ -0,0 +1,31 @@ +_rootElement->find($this->submitOrder)->click(); + } +} diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/Creditmemo/Grid.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/Creditmemo/Grid.php new file mode 100644 index 0000000000000..ce628c14123f0 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/Creditmemo/Grid.php @@ -0,0 +1,66 @@ + [ + 'selector' => '#order_creditmemos_filter_increment_id', + ], + ]; + + /** + * Amount refunded + * + * @var string + */ + protected $amountRefunded = 'td.col-refunded.col-base_grand_total'; + + /** + * Refund status + * + * @var string + */ + protected $refundStatus = 'td.col-status.col-state'; + + /** + * An element locator which allows to select entities in grid + * + * @var string + */ + protected $selectItem = 'tbody tr .col-increment_id'; + + /** + * Get first refund amount + * + * @return array|string + */ + public function getRefundAmount() + { + return $this->_rootElement->find($this->amountRefunded)->getText(); + } + + /** + * Get first status + * + * @return array|string + */ + public function getStatus() + { + return $this->_rootElement->find($this->refundStatus)->getText(); + } +} diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/Creditmemo/View/Items.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/Creditmemo/View/Items.php new file mode 100644 index 0000000000000..b2691c4566187 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/Creditmemo/View/Items.php @@ -0,0 +1,17 @@ + [ + 'selector' => 'input[name="real_order_id"]', + ], + 'status' => [ + 'selector' => 'select[name="status"]', + 'input' => 'select', + ], + ]; + + /** + * Start to create new order + */ + public function addNewOrder() + { + $this->_rootElement->find($this->addNewOrder, Locator::SELECTOR_XPATH)->click(); + } + + /** + * Get selected data from Purchase Point filter + * + * @return string + */ + public function getPurchasePointFilterText() + { + return $this->_rootElement->find($this->purchasePointFilter, Locator::SELECTOR_XPATH)->getText(); + } + + /** + * Assert the number of Purchase Point Filter option group elements by checking non-existing group + * + * @param $number + * @return bool + */ + public function assertNumberOfPurchasePointFilterOptionsGroup($number) + { + $selector = $this->purchasePointOptGroup . '[' . ($number + 1) . ']'; + return !$this->_rootElement->find($selector, Locator::SELECTOR_XPATH)->isVisible(); + } +} diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/History.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/History.php new file mode 100644 index 0000000000000..ae9f6ab845d70 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/History.php @@ -0,0 +1,76 @@ +waitCommentsHistory(); + return $this->_rootElement->find($this->commentHistory, Locator::SELECTOR_CSS)->getText(); + } + + /** + * Get the captured amount from the comments history + * + * @return string + */ + public function getCapturedAmount() + { + $this->waitCommentsHistory(); + return $this->_rootElement->find($this->capturedAmount, Locator::SELECTOR_XPATH)->getText(); + } + + /** + * Wait for comments history is visible + * + * @return void + */ + protected function waitCommentsHistory() + { + $element = $this->_rootElement; + $selector = $this->noteList; + $element->waitUntil( + function () use ($element, $selector) { + return $element->find($selector)->isVisible() ? true : null; + } + ); + } +} diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/Invoice/Form.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/Invoice/Form.php new file mode 100644 index 0000000000000..d7931b7c648c1 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/Invoice/Form.php @@ -0,0 +1,36 @@ +blockFactory->create( + 'Magento\Sales\Test\Block\Adminhtml\Order\Invoice\Form\Items', + ['element' => $this->_rootElement->find($this->items)] + ); + } +} diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/Invoice/Form.xml b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/Invoice/Form.xml new file mode 100644 index 0000000000000..d2c2e6bf07dfa --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/Invoice/Form.xml @@ -0,0 +1,15 @@ + + + + invoice + + + checkbox + + + + diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/Invoice/Form/Items.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/Invoice/Form/Items.php new file mode 100644 index 0000000000000..b15ef482eee16 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/Invoice/Form/Items.php @@ -0,0 +1,33 @@ +productItem, $product->getSku()); + return $this->blockFactory->create( + 'Magento\Sales\Test\Block\Adminhtml\Order\Invoice\Form\Items\Product', + ['element' => $this->_rootElement->find($selector, Locator::SELECTOR_XPATH)] + ); + } +} diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/Invoice/Form/Items/Product.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/Invoice/Form/Items/Product.php new file mode 100644 index 0000000000000..5fdf390077dc8 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/Invoice/Form/Items/Product.php @@ -0,0 +1,15 @@ + + + + + + input.qty-input + + + diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/Invoice/Grid.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/Invoice/Grid.php new file mode 100644 index 0000000000000..1ac56f896346a --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/Invoice/Grid.php @@ -0,0 +1,80 @@ + [ + 'selector' => '#order_invoices_filter_increment_id', + ], + ]; + + /** + * Invoice amount + * + * @var string + */ + protected $invoiceAmount = 'td.col-qty.col-base_grand_total'; + + /** + * An element locator which allows to select entities in grid + * + * @var string + */ + protected $selectItem = 'tbody tr .col-invoice-number'; + + /** + * Get first invoice amount + * + * @return array|string + */ + public function getInvoiceAmount() + { + $invoiceAmount = $this->getInvoiceAmountElement()->getText(); + return $this->escapeCurrency($invoiceAmount); + } + + /** + * Click the first invoice amount + * + * @return void + */ + public function clickInvoiceAmount() + { + $this->getInvoiceAmountElement()->click(); + } + + /** + * @return mixed|\Mtf\Client\Element + */ + private function getInvoiceAmountElement() + { + return $this->_rootElement->find($this->invoiceAmount); + } + + /** + * Method that escapes currency symbols + * + * @param string $price + * @return string|null + */ + protected function escapeCurrency($price) + { + preg_match("/^\\D*\\s*([\\d,\\.]+)\\s*\\D*$/", $price, $matches); + return (isset($matches[1])) ? $matches[1] : null; + } +} diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/Invoice/Totals.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/Invoice/Totals.php new file mode 100644 index 0000000000000..32f2d54254ca2 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/Invoice/Totals.php @@ -0,0 +1,62 @@ +_rootElement; + $selector = $this->submit . '.disabled'; + $strategy = Locator::SELECTOR_CSS; + $browser->waitUntil( + function () use ($browser, $selector, $strategy) { + $element = $browser->find($selector, $strategy); + return $element->isVisible() == false ? true : null; + } + ); + $this->reinitRootElement(); + $this->_rootElement->find($this->submit)->click(); + } + + /** + * Set Capture amount option: + * Capture Online|Capture Offline|Not Capture + * + * @param string $option + * @return void + */ + public function setCaptureOption($option) + { + $this->_rootElement->find($this->capture, Locator::SELECTOR_CSS, 'select')->setValue($option); + } +} diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/Invoice/View/Items.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/Invoice/View/Items.php new file mode 100644 index 0000000000000..5d551e67b76a8 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/Invoice/View/Items.php @@ -0,0 +1,17 @@ +_rootElement->find($this->submit)->click(); + } +} diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/Shipment/View/Items.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/Shipment/View/Items.php new file mode 100644 index 0000000000000..60ccef39c5fde --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/Shipment/View/Items.php @@ -0,0 +1,37 @@ +_rootElement->find($this->rowItem)->getElements(); + $data = []; + + foreach ($items as $item) { + $itemData = []; + + $itemData += $this->parseProductName($item->find($this->product)->getText()); + $itemData['qty'] = $item->find($this->qty)->getText(); + + $data[] = $itemData; + } + + return $data; + } +} diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/Status/Assign/AssignForm.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/Status/Assign/AssignForm.php new file mode 100644 index 0000000000000..395d31e733220 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/Status/Assign/AssignForm.php @@ -0,0 +1,17 @@ + + + + + + + select + + + checkbox + + + checkbox + + + diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/Status/GridPageActions.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/Status/GridPageActions.php new file mode 100644 index 0000000000000..a788d27f58f9b --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/Status/GridPageActions.php @@ -0,0 +1,30 @@ +_rootElement->find($this->assignButton)->click(); + } +} diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/StatusGrid.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/StatusGrid.php new file mode 100644 index 0000000000000..eb2e7d5667da8 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/StatusGrid.php @@ -0,0 +1,61 @@ + [ + 'selector' => '#sales_order_status_grid_filter_label', + ], + 'status' => [ + 'selector' => '#sales_order_status_grid_filter_status', + ], + 'state' => [ + 'selector' => '#sales_order_status_grid_filter_state', + ], + ]; + + /** + * Locator value for link in action column + * + * @var string + */ + protected $editLink = '[data-column="label"]'; + + /** + * Selector for unassign custom status link + * + * @var string + */ + protected $unassignLink = '[data-column="unassign"] a'; + + /** + * Search custom status and unassign it + * + * @param array $filter + * @throws \Exception + * @return void + */ + public function searchAndUnassign(array $filter) + { + $this->openFilterBlock(); + $this->search($filter); + $selectItem = $this->_rootElement->find($this->unassignLink); + if ($selectItem->isVisible()) { + $selectItem->click(); + } else { + throw new \Exception('Searched item was not found.'); + } + } +} diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/Totals.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/Totals.php new file mode 100644 index 0000000000000..cff130c94a37a --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/Totals.php @@ -0,0 +1,47 @@ +_rootElement->find($this->grandTotal, Locator::SELECTOR_XPATH)->getText(); + return $this->escapeCurrency($grandTotal); + } + + /** + * Method that escapes currency symbols + * + * @param string $price + * @return string|null + */ + protected function escapeCurrency($price) + { + preg_match("/^\\D*\\s*([\\d,\\.]+)\\s*\\D*$/", $price, $matches); + return (isset($matches[1])) ? $matches[1] : null; + } +} diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/Transactions/Grid.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/Transactions/Grid.php new file mode 100644 index 0000000000000..ed049df0e514d --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/Transactions/Grid.php @@ -0,0 +1,42 @@ + [ + 'selector' => '#order_transactions_filter_txn_id', + ], + ]; + + /** + * Transaction type + * + * @var string + */ + protected $transactionType = 'td.col-transaction-type.col-txn_type'; + + /** + * Get Transaction type + * + * @return array|string + */ + public function getTransactionType() + { + return $this->_rootElement->find($this->transactionType)->getText(); + } +} diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/View/Info.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/View/Info.php new file mode 100644 index 0000000000000..e8725e61a85bb --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/View/Info.php @@ -0,0 +1,50 @@ +_rootElement->find($this->email, Locator::SELECTOR_XPATH)->getText(); + } + + /** + * Get group from the data inside block + * + * @return string + */ + public function getCustomerGroup() + { + return $this->_rootElement->find($this->group, Locator::SELECTOR_XPATH)->getText(); + } +} diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/View/Items.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/View/Items.php new file mode 100644 index 0000000000000..d70210c7c11f3 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/View/Items.php @@ -0,0 +1,55 @@ +getName(); + + if ($product instanceof ConfigurableProduct) { + // Find the price for the specific configurable product that was purchased + $configurableAttributes = $product->getConfigurableAttributes(); + $productOptions = $product->getCheckoutData()['options']['configurable_options']; + $checkoutOption = reset($productOptions); + $attributeKey = $checkoutOption['title']; + $optionKey = $checkoutOption['value']; + $attributeValue = $configurableAttributes[$attributeKey]['label']['value']; + $optionValue = $configurableAttributes[$attributeKey][$optionKey]['option_label']['value']; + + $productDisplay = $productName . ' SKU: ' . $product->getVariationSku($checkoutOption); + $productDisplay .= ' ' . $attributeValue . ' ' . $optionValue; + } else { + $productDisplay = $productName . ' SKU: ' . $product->getSku(); + } + $selector = '//tr[normalize-space(td)="' . $productDisplay . '"]' . $this->priceSelector; + + return $this->_rootElement->find($selector, Locator::SELECTOR_XPATH)->getText(); + } +} diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/View/OrderForm.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/View/OrderForm.php new file mode 100644 index 0000000000000..a8ad955d37e7c --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/View/OrderForm.php @@ -0,0 +1,36 @@ +blockFactory->create( + 'Magento\Sales\Test\Block\Adminhtml\Order\View\Tab\Info', + ['element' => $this->_rootElement->find($this->orderInfoBlock)] + ); + } +} diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/View/OrderForm.xml b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/View/OrderForm.xml new file mode 100644 index 0000000000000..93baf96fc197d --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/View/OrderForm.xml @@ -0,0 +1,33 @@ + + + + + Magento\Sales\Test\Block\Adminhtml\Order\View\Tab\Invoices + #sales_order_view_tabs_order_invoices + css selector + + + Magento\Sales\Test\Block\Adminhtml\Order\View\Tab\Shipments + #sales_order_view_tabs_order_shipments + css selector + + + Magento\Sales\Test\Block\Adminhtml\Order\View\Tab\CreditMemos + #sales_order_view_tabs_order_creditmemos + css selector + + + \Magento\Backend\Test\Block\Widget\Tab + #sales_order_view_tabs_order_rma + css selector + + + \Magento\Backend\Test\Block\Widget\Tab + #sales_order_view_tabs_order_transactions + css selector + + diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/View/Tab/CreditMemos.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/View/Tab/CreditMemos.php new file mode 100644 index 0000000000000..14cd6c3ce326b --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/View/Tab/CreditMemos.php @@ -0,0 +1,36 @@ +blockFactory->create( + 'Magento\Sales\Test\Block\Adminhtml\Order\View\Tab\CreditMemos\Grid', + ['element' => $this->_rootElement->find($this->grid)] + ); + } +} diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/View/Tab/CreditMemos/Grid.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/View/Tab/CreditMemos/Grid.php new file mode 100644 index 0000000000000..e5d47c46f294a --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/View/Tab/CreditMemos/Grid.php @@ -0,0 +1,67 @@ + [ + 'selector' => 'input[name="increment_id"]', + ], + 'status' => [ + 'selector' => 'select[name="state"]', + 'input' => 'select', + ], + 'amount_from' => [ + 'selector' => '[name="base_grand_total[from]"]', + ], + 'amount_to' => [ + 'selector' => '[name="base_grand_total[to]"]', + ], + ]; + + /** + * Get credit memo id from grid + * + * @return array|string + */ + public function getCreditMemoId() + { + return $this->_rootElement->find($this->editLink)->getText(); + } + + /** + * Get credit memo ids + * + * @return array + */ + public function getIds() + { + $result = []; + $creditMemoIds = $this->_rootElement->find($this->editLink)->getElements(); + foreach ($creditMemoIds as $creditMemoId) { + $result[] = trim($creditMemoId->getText()); + } + + return $result; + } +} diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/View/Tab/Info.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/View/Tab/Info.php new file mode 100644 index 0000000000000..a5459ff0ce045 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/View/Tab/Info.php @@ -0,0 +1,85 @@ +_rootElement->find($this->_verificationResult, Locator::SELECTOR_XPATH)->getText(); + } + + /** + * Get 3D Secure Verification Result + * + * @return array|string + */ + public function getCardholderValidation() + { + return $this->_rootElement->find($this->_cardholderValidation, Locator::SELECTOR_XPATH)->getText(); + } + + /** + * Get 3D Secure Electronic Commerce Indicator + * + * @return array|string + */ + public function getEcommerceIndicator() + { + return $this->_rootElement->find($this->_eCommerceIndicator, Locator::SELECTOR_XPATH)->getText(); + } + + /** + * Get order status from info block + * + * @return array|string + */ + public function getOrderStatus() + { + return $this->_rootElement->find($this->orderStatus)->getText(); + } +} diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/View/Tab/Invoices.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/View/Tab/Invoices.php new file mode 100644 index 0000000000000..4476e5c4c3971 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/View/Tab/Invoices.php @@ -0,0 +1,36 @@ +blockFactory->create( + 'Magento\Sales\Test\Block\Adminhtml\Order\View\Tab\Invoices\Grid', + ['element' => $this->_rootElement->find($this->grid)] + ); + } +} diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/View/Tab/Invoices/Grid.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/View/Tab/Invoices/Grid.php new file mode 100644 index 0000000000000..7ee52474297ac --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/View/Tab/Invoices/Grid.php @@ -0,0 +1,64 @@ + [ + 'selector' => 'input[name="increment_id"]', + ], + 'status' => [ + 'selector' => 'select[name="state"]', + 'input' => 'select', + ], + 'amount_from' => [ + 'selector' => 'input[name="base_grand_total[from]"]', + ], + 'amount_to' => [ + 'selector' => 'input[name="base_grand_total[to]"]', + ], + ]; + + /** + * Get invoice ids + * + * @return array + */ + public function getIds() + { + $result = []; + $invoiceIds = $this->_rootElement->find($this->invoiceId)->getElements(); + foreach ($invoiceIds as $invoiceId) { + $result[] = trim($invoiceId->getText()); + } + + return $result; + } +} diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/View/Tab/Shipments.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/View/Tab/Shipments.php new file mode 100644 index 0000000000000..f068963a27e5b --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/View/Tab/Shipments.php @@ -0,0 +1,36 @@ +blockFactory->create( + 'Magento\Sales\Test\Block\Adminhtml\Order\View\Tab\Shipments\Grid', + ['element' => $this->_rootElement->find($this->grid)] + ); + } +} diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/View/Tab/Shipments/Grid.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/View/Tab/Shipments/Grid.php new file mode 100644 index 0000000000000..12bcde191e6b9 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/View/Tab/Shipments/Grid.php @@ -0,0 +1,60 @@ + [ + 'selector' => 'input[name="real_shipment_id"]', + ], + 'qty_from' => [ + 'selector' => '[name="total_qty[from]"]', + ], + 'qty_to' => [ + 'selector' => '[name="total_qty[to]"]', + ], + ]; + + /** + * Get shipment ids + * + * @return array + */ + public function getIds() + { + $result = []; + $shipmentIds = $this->_rootElement->find($this->shipmentId)->getElements(); + foreach ($shipmentIds as $shipmentId) { + $result[] = trim($shipmentId->getText()); + } + + return $result; + } +} diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Report/Filter/Form.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Report/Filter/Form.php new file mode 100644 index 0000000000000..a1a2a8f932046 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Report/Filter/Form.php @@ -0,0 +1,17 @@ + + + + + + datepicker + + + datepicker + + + select + + + select + + + select + + + select + + + [name="order_statuses[]"] + multiselect + + + select + + + diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Order/History.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Order/History.php new file mode 100644 index 0000000000000..76ffd9ad785e9 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Order/History.php @@ -0,0 +1,104 @@ +_rootElement->find( + sprintf($this->customerOrders, $order['id'], $order['status']), + Locator::SELECTOR_XPATH + )->isVisible(); + } + + /** + * Get order total + * + * @param string $id + * @return string + */ + public function getOrderTotalById($id) + { + return $this->escapeCurrency($this->searchOrderById($id)->find($this->total)->getText()); + } + + /** + * Get item order block + * + * @param string $id + * @return Element + */ + protected function searchOrderById($id) + { + return $this->_rootElement->find(sprintf($this->itemOrder, $id), Locator::SELECTOR_XPATH); + } + + /** + * Open item order + * + * @param string $id + * @return void + */ + public function openOrderById($id) + { + $this->searchOrderById($id)->find($this->viewButton)->click(); + } + + /** + * Method that escapes currency symbols + * + * @param string $price + * @return string|null + */ + protected function escapeCurrency($price) + { + preg_match("/^\\D*\\s*([\\d,\\.]+)\\s*\\D*$/", $price, $matches); + return (isset($matches[1])) ? $matches[1] : null; + } +} diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Order/Info.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Order/Info.php new file mode 100644 index 0000000000000..2f578aac400b5 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Order/Info.php @@ -0,0 +1,53 @@ +_rootElement->find( + sprintf($this->paymentMethodSelector, $paymentMethod), + Locator::SELECTOR_XPATH + )->isVisible(); + } + + /** + * Returns billing address. + * + * @return string + */ + public function getBillingAddress() + { + return $this->_rootElement->find($this->billingAddressSelector)->getText(); + } +} diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Order/Items.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Order/Items.php new file mode 100644 index 0000000000000..691b21979b8b8 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Order/Items.php @@ -0,0 +1,65 @@ +_rootElement->find( + sprintf($this->itemSelector, $product->getName()), + Locator::SELECTOR_XPATH + )->isVisible(); + } + + /** + * Get grand total price + * + * @return string|null + */ + public function getGrandTotal() + { + return $this->escapeCurrency($this->_rootElement->find($this->grandTotal)->getText()); + } + + /** + * Method that escapes currency symbols + * + * @param string $price + * @return string|null + */ + protected function escapeCurrency($price) + { + preg_match("/^\\D*\\s*([\\d,\\.]+)\\s*\\D*$/", $price, $matches); + return (isset($matches[1])) ? $matches[1] : null; + } +} diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Order/View.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Order/View.php new file mode 100644 index 0000000000000..cb7a16398d871 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Order/View.php @@ -0,0 +1,63 @@ +content : sprintf($this->itemBlock, $id) . $this->content; + return $this->blockFactory->create( + 'Magento\Sales\Test\Block\Order\Items', + ['element' => $this->_rootElement->find($selector, Locator::SELECTOR_XPATH)] + ); + } + + /** + * Open link by name + * + * @param string $name + * @return void + */ + public function openLinkByName($name) + { + $this->_rootElement->find(sprintf($this->link, $name), Locator::SELECTOR_XPATH)->click(); + } +} diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Order/View/ActionsToolbar.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Order/View/ActionsToolbar.php new file mode 100644 index 0000000000000..d1e49fb25fa47 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Order/View/ActionsToolbar.php @@ -0,0 +1,34 @@ +_rootElement->find(sprintf($this->linkSelector, $linkName), Locator::SELECTOR_XPATH); + if (!$link->isVisible()) { + throw new \Exception(sprintf('"%s" link is not visible', $linkName)); + } + $link->click(); + } +} diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AbstractAssertItems.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AbstractAssertItems.php new file mode 100644 index 0000000000000..1bd7ff553ccf7 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AbstractAssertItems.php @@ -0,0 +1,75 @@ +getEntityId()['products']; + $productsData = []; + + /** @var CatalogProductSimple $product */ + foreach ($products as $key => $product) { + $productsData[] = [ + 'product' => $product->getName(), + 'sku' => $product->getSku(), + 'qty' => (isset($data[$key]['qty']) && $data[$key]['qty'] != '-') + ? $data[$key]['qty'] + : $product->getCheckoutData()['qty'], + ]; + } + + return $this->sortDataByPath($productsData, $this->sortKey); + } + + /** + * Prepare invoice data + * + * @param array $itemsData + * @return array + */ + protected function preparePageItems(array $itemsData) + { + foreach ($itemsData as $key => $itemData) { + $itemsData[$key] = array_intersect_key($itemData, array_flip($this->compareFields)); + } + return $this->sortDataByPath($itemsData, $this->sortKey); + } +} diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AbstractAssertOrderOnFrontend.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AbstractAssertOrderOnFrontend.php new file mode 100644 index 0000000000000..9bd2932c77747 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AbstractAssertOrderOnFrontend.php @@ -0,0 +1,67 @@ +cmsIndex = $cmsIndex; + $this->customerAccountIndex = $customerAccountIndex; + } + + /** + * Login customer and open Order page + * + * @param CustomerInjectable $customer + * @return void + */ + protected function loginCustomerAndOpenOrderPage(CustomerInjectable $customer) + { + $this->cmsIndex->open(); + $loginCustomerOnFrontendStep = $this->objectManager->create( + 'Magento\Customer\Test\TestStep\LoginCustomerOnFrontendStep', + ['customer' => $customer] + ); + $loginCustomerOnFrontendStep->run(); + $this->cmsIndex->getLinksBlock()->openLink('My Account'); + $this->customerAccountIndex->getAccountMenuBlock()->openMenuItem('My Orders'); + } +} diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertCreditMemoButton.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertCreditMemoButton.php new file mode 100644 index 0000000000000..5fd4edeb0fce6 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertCreditMemoButton.php @@ -0,0 +1,50 @@ +open(); + $orderIndex->getSalesOrderGrid()->searchAndOpen(['id' => $order->getId()]); + \PHPUnit_Framework_Assert::assertTrue( + $orderView->getPageActions()->isActionButtonVisible('CreditMemo'), + 'Credit memo button is absent on order view page.' + ); + } + + /** + * Returns a string representation of the object + * + * @return string + */ + public function toString() + { + return 'Credit memo button is present on order view page.'; + } +} diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertCreditMemoItems.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertCreditMemoItems.php new file mode 100644 index 0000000000000..cc35b869a4321 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertCreditMemoItems.php @@ -0,0 +1,63 @@ +open(); + $orderId = $order->getId(); + $productsData = $this->prepareOrderProducts($order, $data['items_data']); + foreach ($ids['creditMemoIds'] as $creditMemoId) { + $filter = [ + 'order_id' => $orderId, + 'id' => $creditMemoId, + ]; + $creditMemoIndex->getCreditMemoGrid()->searchAndOpen($filter); + $itemsData = $this->preparePageItems($salesCreditMemoView->getItemsBlock()->getData()); + $error = $this->verifyData($productsData, $itemsData); + \PHPUnit_Framework_Assert::assertEmpty($error, $error); + } + } + + /** + * Returns a string representation of the object + * + * @return string + */ + public function toString() + { + return 'All credit memo products are present in credit memo view page.'; + } +} diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertInvoiceInInvoicesGrid.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertInvoiceInInvoicesGrid.php new file mode 100644 index 0000000000000..81d456687301c --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertInvoiceInInvoicesGrid.php @@ -0,0 +1,61 @@ +open(); + $amount = $order->getPrice(); + $orderId = $order->getId(); + foreach ($ids['invoiceIds'] as $key => $invoiceId) { + $filter = [ + 'id' => $invoiceId, + 'order_id' => $orderId, + 'grand_total_from' => $amount[$key]['grand_invoice_total'], + 'grand_total_to' => $amount[$key]['grand_invoice_total'], + ]; + $invoiceIndex->getInvoicesGrid()->search($filter); + $filter['grand_total_from'] = number_format($amount[$key]['grand_invoice_total'], 2); + $filter['grand_total_to'] = number_format($amount[$key]['grand_invoice_total'], 2); + \PHPUnit_Framework_Assert::assertTrue( + $invoiceIndex->getInvoicesGrid()->isRowVisible($filter, false, false), + 'Invoice is absent in invoices grid on invoice index page.' + ); + } + } + + /** + * Returns a string representation of the object + * + * @return string + */ + public function toString() + { + return 'Invoice is present in the invoices grid with corresponding amount on invoice index page.'; + } +} diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertInvoiceInInvoicesTab.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertInvoiceInInvoicesTab.php new file mode 100644 index 0000000000000..d4c5694227655 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertInvoiceInInvoicesTab.php @@ -0,0 +1,70 @@ +open(); + $orderIndex->getSalesOrderGrid()->searchAndOpen(['id' => $order->getId()]); + $orderView->getOrderForm()->openTab('invoices'); + /** @var Grid $grid */ + $grid = $orderView->getOrderForm()->getTabElement('invoices')->getGridBlock(); + $amount = $order->getPrice(); + foreach ($ids['invoiceIds'] as $key => $invoiceId) { + $filter = [ + 'id' => $invoiceId, + 'amount_from' => $amount[$key]['grand_invoice_total'], + 'amount_to' => $amount[$key]['grand_invoice_total'], + ]; + $grid->search($filter); + $filter['amount_from'] = number_format($amount[$key]['grand_invoice_total'], 2); + $filter['amount_to'] = number_format($amount[$key]['grand_invoice_total'], 2); + \PHPUnit_Framework_Assert::assertTrue( + $grid->isRowVisible($filter, false, false), + 'Invoice is absent on invoices tab.' + ); + } + } + + /** + * Returns a string representation of the object + * + * @return string + */ + public function toString() + { + return 'Invoice is present on invoices tab.'; + } +} diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertInvoiceItems.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertInvoiceItems.php new file mode 100644 index 0000000000000..c7fbe84aa3b37 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertInvoiceItems.php @@ -0,0 +1,63 @@ +open(); + $orderId = $order->getId(); + $productsData = $this->prepareOrderProducts($order, $data['items_data']); + foreach ($ids['invoiceIds'] as $invoiceId) { + $filter = [ + 'order_id' => $orderId, + 'id' => $invoiceId, + ]; + $invoiceIndex->getInvoicesGrid()->searchAndOpen($filter); + $itemsData = $this->preparePageItems($salesInvoiceView->getItemsBlock()->getData()); + $error = $this->verifyData($productsData, $itemsData); + \PHPUnit_Framework_Assert::assertEmpty($error, $error); + } + } + + /** + * Returns a string representation of the object + * + * @return string + */ + public function toString() + { + return 'All invoice products are present in invoice view page.'; + } +} diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertInvoiceSuccessCreateMessage.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertInvoiceSuccessCreateMessage.php new file mode 100644 index 0000000000000..8206e7eaae71d --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertInvoiceSuccessCreateMessage.php @@ -0,0 +1,49 @@ +getMessagesBlock()->getSuccessMessages() + ); + } + + /** + * Returns a string representation of the object + * + * @return string + */ + public function toString() + { + return 'Success invoice create message is present.'; + } +} diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertInvoiceWithShipmentSuccessMessage.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertInvoiceWithShipmentSuccessMessage.php new file mode 100644 index 0000000000000..cd449db40f2a0 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertInvoiceWithShipmentSuccessMessage.php @@ -0,0 +1,49 @@ +getMessagesBlock()->getSuccessMessages() + ); + } + + /** + * Returns a string representation of the object + * + * @return string + */ + public function toString() + { + return 'Success invoice and shipment create message is present.'; + } +} diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertInvoicedAmountOnFrontend.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertInvoicedAmountOnFrontend.php new file mode 100644 index 0000000000000..e3fb1df7948fb --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertInvoicedAmountOnFrontend.php @@ -0,0 +1,60 @@ +loginCustomerAndOpenOrderPage($order->getDataFieldConfig('customer_id')['source']->getCustomer()); + $orderHistory->getOrderHistoryBlock()->openOrderById($order->getId()); + $orderView->getOrderViewBlock()->openLinkByName('Invoices'); + foreach ($ids['invoiceIds'] as $key => $invoiceId) { + \PHPUnit_Framework_Assert::assertEquals( + number_format($order->getPrice()[$key]['grand_invoice_total'], 2), + $invoiceView->getInvoiceBlock()->getItemBlock($invoiceId)->getGrandTotal() + ); + } + } + + /** + * Returns a string representation of the object + * + * @return string + */ + public function toString() + { + return 'Invoiced Grand Total amount is equal to placed order Grand Total amount on invoice page.'; + } +} diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertNoCreditMemoButton.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertNoCreditMemoButton.php new file mode 100644 index 0000000000000..4ae5a4064758a --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertNoCreditMemoButton.php @@ -0,0 +1,50 @@ +open(); + $orderIndex->getSalesOrderGrid()->searchAndOpen(['id' => $order->getId()]); + \PHPUnit_Framework_Assert::assertFalse( + $orderView->getPageActions()->isActionButtonVisible('CreditMemo'), + 'Credit memo button is present on order view page.' + ); + } + + /** + * Returns a string representation of the object + * + * @return string + */ + public function toString() + { + return 'Credit memo button is absent on order view page.'; + } +} diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertNoInvoiceButton.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertNoInvoiceButton.php new file mode 100644 index 0000000000000..b1033dc4090a3 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertNoInvoiceButton.php @@ -0,0 +1,50 @@ +open(); + $orderIndex->getSalesOrderGrid()->searchAndOpen(['id' => $order->getId()]); + \PHPUnit_Framework_Assert::assertFalse( + $orderView->getPageActions()->isActionButtonVisible('Invoice'), + 'Invoice button is present on order view page.' + ); + } + + /** + * Returns a string representation of the object + * + * @return string + */ + public function toString() + { + return 'Invoice button is absent on order view page.'; + } +} diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrderButtonsAvailable.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrderButtonsAvailable.php new file mode 100644 index 0000000000000..8e869beca3967 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrderButtonsAvailable.php @@ -0,0 +1,56 @@ +getOrderActionsBlock(); + + foreach ($buttons as $button) { + $button = trim($button); + if (!$actionsBlock->isActionButtonVisible($button)) { + $absentButtons[] = $button; + } + } + + \PHPUnit_Framework_Assert::assertEmpty( + $absentButtons, + "Next buttons was not found on page: \n" . implode(";\n", $absentButtons) + ); + } + + /** + * Returns string representation of successful assertion + * + * @return string + */ + public function toString() + { + return "All buttons are available on order page."; + } +} diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrderButtonsUnavailable.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrderButtonsUnavailable.php new file mode 100644 index 0000000000000..0289645ddae1a --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrderButtonsUnavailable.php @@ -0,0 +1,63 @@ +open(); + $orderIndex->getSalesOrderGrid()->searchAndOpen(['id' => $order->getId()]); + $buttons = explode(',', $orderButtonsUnavailable); + $matches = []; + foreach ($buttons as $button) { + if ($orderView->getPageActions()->isActionButtonVisible(trim($button))) { + $matches[] = $button; + } + } + \PHPUnit_Framework_Assert::assertEmpty( + $matches, + 'Buttons are present on order page.' + . "\nLog:\n" . implode(";\n", $matches) + ); + } + + /** + * Returns a string representation of the object + * + * @return string + */ + public function toString() + { + return 'Buttons from dataSet are not present on order page.'; + } +} diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrderCancelMassActionFailMessage.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrderCancelMassActionFailMessage.php new file mode 100644 index 0000000000000..5f1f0b5d0da7c --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrderCancelMassActionFailMessage.php @@ -0,0 +1,49 @@ +getMessagesBlock()->getErrorMessages() + ); + } + + /** + * Returns a string representation of the object + * + * @return string + */ + public function toString() + { + return 'Cancel fail message is displayed on order index page.'; + } +} diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrderCancelMassActionSuccessMessage.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrderCancelMassActionSuccessMessage.php new file mode 100644 index 0000000000000..6000f81f90aee --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrderCancelMassActionSuccessMessage.php @@ -0,0 +1,50 @@ +getMessagesBlock()->getSuccessMessages() + ); + } + + /** + * Returns a string representation of the object + * + * @return string + */ + public function toString() + { + return 'Cancel success message is displayed on order index page.'; + } +} diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrderCancelSuccessMessage.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrderCancelSuccessMessage.php new file mode 100644 index 0000000000000..ccaccec1462c6 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrderCancelSuccessMessage.php @@ -0,0 +1,49 @@ +getMessagesBlock()->getSuccessMessages() + ); + } + + /** + * Returns a string representation of the object + * + * @return string + */ + public function toString() + { + return 'Sales order success cancel message is present.'; + } +} diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrderGrandTotal.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrderGrandTotal.php new file mode 100644 index 0000000000000..6c5fd44e89f17 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrderGrandTotal.php @@ -0,0 +1,46 @@ +getOrderTotalsBlock()->getGrandTotal(), + 'Grand Total price does not equal to price from data set.' + ); + } + + /** + * Returns a string representation of the object + * + * @return string + */ + public function toString() + { + return 'Grand Total price equals to price from data set.'; + } +} diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrderInOrdersGrid.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrderInOrdersGrid.php new file mode 100644 index 0000000000000..ba38d09c704e8 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrderInOrdersGrid.php @@ -0,0 +1,68 @@ + Orders Grid + * + * @param OrderInjectable $order + * @param OrderIndex $orderIndex + * @param string|null $status [optional] + * @param string $orderId [optional] + * @return void + */ + public function processAssert(OrderInjectable $order, OrderIndex $orderIndex, $status = null, $orderId = '') + { + $orderIndex->open(); + $this->assert($order, $orderIndex, $status, $orderId); + } + + /** + * Process assert + * + * @param OrderInjectable $order + * @param OrderIndex $orderIndex + * @param string $status + * @param string $orderId [optional] + * @return void + */ + protected function assert(OrderInjectable $order, OrderIndex $orderIndex, $status, $orderId = '') + { + $filter = [ + 'id' => $order->hasData('id') ? $order->getId() : $orderId, + 'status' => $status, + ]; + $errorMessage = implode(', ', $filter); + \PHPUnit_Framework_Assert::assertTrue( + $orderIndex->getSalesOrderGrid()->isRowVisible($filter), + 'Order with following data \'' . $errorMessage . '\' is absent in Orders grid.' + ); + } + + /** + * Returns a string representation of the object + * + * @return string + */ + public function toString() + { + return 'Sales order is present in sales orders grid.'; + } +} diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrderInOrdersGridOnFrontend.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrderInOrdersGridOnFrontend.php new file mode 100644 index 0000000000000..d306db2545dab --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrderInOrdersGridOnFrontend.php @@ -0,0 +1,74 @@ + $order->hasData('id') ? $order->getId() : $orderId, + 'status' => $statusToCheck === null ? $status : $statusToCheck, + ]; + $customerLogin = $objectManager->create( + 'Magento\Customer\Test\TestStep\LoginCustomerOnFrontendStep', + ['customer' => $customer] + ); + $customerLogin->run(); + $customerAccountIndex->getAccountMenuBlock()->openMenuItem('My Orders'); + $errorMessage = implode(', ', $filter); + \PHPUnit_Framework_Assert::assertTrue( + $orderHistory->getOrderHistoryBlock()->isOrderVisible($filter), + 'Order with following data \'' . $errorMessage . '\' is absent in Orders block on frontend.' + ); + } + + /** + * Returns a string representation of the object + * + * @return string + */ + public function toString() + { + return 'Sales order is present in orders on frontend.'; + } +} diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrderMassOnHoldSuccessMessage.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrderMassOnHoldSuccessMessage.php new file mode 100644 index 0000000000000..5067162e0e70a --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrderMassOnHoldSuccessMessage.php @@ -0,0 +1,50 @@ +getMessagesBlock()->getSuccessMessages() + ); + } + + /** + * Returns a string representation of the object + * + * @return string + */ + public function toString() + { + return 'On hold success message is displayed on order index page.'; + } +} diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrderNotInOrdersGrid.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrderNotInOrdersGrid.php new file mode 100644 index 0000000000000..eaa43a0698407 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrderNotInOrdersGrid.php @@ -0,0 +1,50 @@ +getData(); + $filter = ['id' => $data['id']]; + $orderIndex->open(); + $errorMessage = implode(', ', $filter); + \PHPUnit_Framework_Assert::assertFalse( + $orderIndex->getSalesOrderGrid()->isRowVisible($filter), + 'Order with following data \'' . $errorMessage . '\' is present in Orders grid.' + ); + } + + /** + * Returns a string representation of the object + * + * @return string + */ + public function toString() + { + return 'Order is absent in sales orders grid.'; + } +} diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrderNotVisibleOnMyAccount.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrderNotVisibleOnMyAccount.php new file mode 100644 index 0000000000000..c1ab57a2c3a83 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrderNotVisibleOnMyAccount.php @@ -0,0 +1,69 @@ + $order->getId(), + 'status' => $status, + ]; + $customerLogin = $objectManager->create( + 'Magento\Customer\Test\TestStep\LoginCustomerOnFrontendStep', + ['customer' => $customer] + ); + $customerLogin->run(); + $customerAccountIndex->getAccountMenuBlock()->openMenuItem('My Orders'); + \PHPUnit_Framework_Assert::assertFalse( + $orderHistory->getOrderHistoryBlock()->isOrderVisible($filter), + 'Order with following data \'' . implode(', ', $filter) . '\' is present in Orders block on frontend.' + ); + } + + /** + * Returns a string representation of the object + * + * @return string + */ + public function toString() + { + return 'Sales order absent in orders on frontend.'; + } +} diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrderOnHoldFailMessage.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrderOnHoldFailMessage.php new file mode 100644 index 0000000000000..50d3bb40e57f5 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrderOnHoldFailMessage.php @@ -0,0 +1,49 @@ +getMessagesBlock()->getErrorMessages() + ); + } + + /** + * Returns a string representation of the object + * + * @return string + */ + public function toString() + { + return 'On hold fail message is displayed on order index page.'; + } +} diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrderOnHoldSuccessMessage.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrderOnHoldSuccessMessage.php new file mode 100644 index 0000000000000..0506a299486d4 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrderOnHoldSuccessMessage.php @@ -0,0 +1,59 @@ + 1) + ? sprintf(self::MULTIPLE_SUCCESS_ON_HOLD_MESSAGE, $ordersCount) + : self::SINGLE_SUCCESS_ON_HOLD_MESSAGE; + + \PHPUnit_Framework_Assert::assertEquals( + $successOnHoldMessage, + $orderIndex->getMessagesBlock()->getSuccessMessages() + ); + } + + /** + * Returns a string representation of the object + * + * @return string + */ + public function toString() + { + return 'On hold success message is displayed on order view page.'; + } +} diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrderReleaseFailMessage.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrderReleaseFailMessage.php new file mode 100644 index 0000000000000..2809a61b59da9 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrderReleaseFailMessage.php @@ -0,0 +1,49 @@ +getMessagesBlock()->getErrorMessages() + ); + } + + /** + * Returns a string representation of the object + * + * @return string + */ + public function toString() + { + return 'Release fail message is displayed on order index page.'; + } +} diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrderReleaseSuccessMessage.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrderReleaseSuccessMessage.php new file mode 100644 index 0000000000000..36d5735b1d8ce --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrderReleaseSuccessMessage.php @@ -0,0 +1,50 @@ +getMessagesBlock()->getSuccessMessages() + ); + } + + /** + * Returns a string representation of the object + * + * @return string + */ + public function toString() + { + return 'Release success message is displayed on order index page.'; + } +} diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrderStatusDuplicateStatus.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrderStatusDuplicateStatus.php new file mode 100644 index 0000000000000..62dce1b4ebb4d --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrderStatusDuplicateStatus.php @@ -0,0 +1,50 @@ +getMessagesBlock()->getErrorMessages(); + \PHPUnit_Framework_Assert::assertEquals( + self::DUPLICATE_MESSAGE, + $actualMessage, + 'Wrong duplicate message is displayed.' + . "\nExpected: " . self::DUPLICATE_MESSAGE + . "\nActual: " . $actualMessage + ); + } + + /** + * Text of Duplicate Message assert. + * + * @return string + */ + public function toString() + { + return 'Order status duplicate message is present.'; + } +} diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrderStatusInGrid.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrderStatusInGrid.php new file mode 100644 index 0000000000000..5b8b9561c4ffe --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrderStatusInGrid.php @@ -0,0 +1,80 @@ + "new"]; + + /** + * Assert order status availability in Order Status grid + * + * @param OrderStatus $orderStatus + * @param OrderStatusIndex $orderStatusIndexPage + * @param string|null $defaultState + * @return void + */ + public function processAssert( + OrderStatus $orderStatus, + OrderStatusIndex $orderStatusIndexPage, + $defaultState = null + ) { + $orderStatusIndexPage->open(); + $orderStatusLabel = $orderStatus->getLabel(); + $filter = ['status' => $orderStatus->getStatus(), 'label' => $orderStatusLabel]; + if ($defaultState !== null) { + $state = $this->prepareState($orderStatus->getState()); + $filter = ['label' => $defaultState, 'state' => $state]; + } + + \PHPUnit_Framework_Assert::assertTrue( + $orderStatusIndexPage->getOrderStatusGrid()->isRowVisible($filter, true, false), + 'Order status \'' . $orderStatusLabel . '\' is absent in Order Status grid.' + ); + } + + /** + * Prepare state value for assert + * + * @param string $state + * @return string + */ + protected function prepareState($state) + { + if (isset($this->stateMapping[$state])) { + return $this->stateMapping[$state]; + } else { + return $state; + } + } + + /** + * Text of Order Status in grid assert + * + * @return string + */ + public function toString() + { + return 'Order status is present in grid'; + } +} diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrderStatusIsCorrect.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrderStatusIsCorrect.php new file mode 100644 index 0000000000000..5913e5fa97fad --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrderStatusIsCorrect.php @@ -0,0 +1,58 @@ +open(); + $salesOrder->getSalesOrderGrid()->searchAndOpen(['id' => $orderId]); + $orderStatus = $statusToCheck == null ? $status : $statusToCheck; + + \PHPUnit_Framework_Assert::assertEquals( + $salesOrderView->getOrderForm()->getOrderInfoBlock()->getOrderStatus(), + $orderStatus + ); + } + + /** + * Returns a string representation of the object + * + * @return string + */ + public function toString() + { + return 'Order status is correct.'; + } +} diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrderStatusNotAssigned.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrderStatusNotAssigned.php new file mode 100644 index 0000000000000..f80348df2b749 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrderStatusNotAssigned.php @@ -0,0 +1,49 @@ +getLabel(); + \PHPUnit_Framework_Assert::assertFalse( + $orderStatusIndex->open()->getOrderStatusGrid()->isRowVisible( + ['label' => $statusLabel, 'state' => $orderStatus->getState()] + ), + "Order status $statusLabel is assigned to state." + ); + } + + /** + * Return string representation of object + * + * @return string + */ + public function toString() + { + return 'Order status with status code from fixture have empty "State Code and Title" value.'; + } +} diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrderStatusSuccessAssignMessage.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrderStatusSuccessAssignMessage.php new file mode 100644 index 0000000000000..778acb060b5d7 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrderStatusSuccessAssignMessage.php @@ -0,0 +1,49 @@ +getMessagesBlock()->getSuccessMessages() + ); + } + + /** + * Returns a string representation of the object + * + * @return string + */ + public function toString() + { + return 'Order status success assign message is present.'; + } +} diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrderStatusSuccessCreateMessage.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrderStatusSuccessCreateMessage.php new file mode 100644 index 0000000000000..cf7628ebc0d5d --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrderStatusSuccessCreateMessage.php @@ -0,0 +1,50 @@ +getMessagesBlock()->getSuccessMessages(); + \PHPUnit_Framework_Assert::assertEquals( + self::SUCCESS_MESSAGE, + $actualMessage, + 'Wrong success message is displayed.' + . "\nExpected: " . self::SUCCESS_MESSAGE + . "\nActual: " . $actualMessage + ); + } + + /** + * Text of Created Custom Order Status Success Message assert. + * + * @return string + */ + public function toString() + { + return 'Order status success create message is present.'; + } +} diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrderStatusSuccessUnassignMessage.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrderStatusSuccessUnassignMessage.php new file mode 100644 index 0000000000000..d80fd40c80362 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrderStatusSuccessUnassignMessage.php @@ -0,0 +1,49 @@ +getMessagesBlock()->getSuccessMessages() + ); + } + + /** + * Returns a string representation of the object + * + * @return string + */ + public function toString() + { + return 'Order status success unassign message is present.'; + } +} diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrderSuccessCreateMessage.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrderSuccessCreateMessage.php new file mode 100644 index 0000000000000..cd3b2a7a99b68 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrderSuccessCreateMessage.php @@ -0,0 +1,50 @@ +getMessagesBlock()->getSuccessMessages(), + 'Wrong success message is displayed.' + ); + } + + /** + * Returns a string representation of the object + * + * @return string + */ + public function toString() + { + return 'Sales order success created message is present.'; + } +} diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrdersInOrdersGrid.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrdersInOrdersGrid.php new file mode 100644 index 0000000000000..8d1ffb4c4e9f4 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrdersInOrdersGrid.php @@ -0,0 +1,52 @@ + Orders Grid + * + * @param OrderInjectable[] $orders + * @param OrderIndex $orderIndex + * @param array $statuses + * @param AssertOrderInOrdersGrid $assertOrderInOrdersGrid + * @return void + */ + public function processAssert( + $orders, + OrderIndex $orderIndex, + array $statuses, + AssertOrderInOrdersGrid $assertOrderInOrdersGrid + ) { + $orderIndex->open(); + foreach ($orders as $key => $order) { + $assertOrderInOrdersGrid->assert($order, $orderIndex, $statuses[$key]); + } + } + + /** + * Returns a string representation of the object + * + * @return string + */ + public function toString() + { + return 'All orders are present in sales orders grid.'; + } +} diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertProductInItemsOrderedGrid.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertProductInItemsOrderedGrid.php new file mode 100644 index 0000000000000..5e7a3f884138e --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertProductInItemsOrderedGrid.php @@ -0,0 +1,130 @@ + '', 'price' => '', 'checkout_data' => ['qty' => '']]; + + /** + * Check configured products. + * + * @var bool + */ + protected $productsIsConfigured; + + /** + * Assert product was added to Items Ordered grid in customer account on Order creation page backend. + * + * @param OrderCreateIndex $orderCreateIndex + * @param array $products + * @param bool $productsIsConfigured + * @throws \Exception + * @return void + */ + public function processAssert(OrderCreateIndex $orderCreateIndex, array $products, $productsIsConfigured = true) + { + if (!$products) { + throw new \Exception("No products"); + } + $this->productsIsConfigured = $productsIsConfigured; + $data = $this->prepareData($products, $orderCreateIndex->getCreateBlock()->getItemsBlock()); + + \PHPUnit_Framework_Assert::assertEquals( + $data['fixtureData'], + $data['pageData'], + 'Product data on order create page not equals to passed from fixture.' + ); + } + + /** + * Prepare data. + * + * @param array $data + * @param Items $itemsBlock + * @return array + */ + protected function prepareData(array $data, Items $itemsBlock) + { + $fixtureData = []; + foreach ($data as $product) { + $checkoutData = $product->getCheckoutData(); + $fixtureData[] = [ + 'name' => $product->getName(), + 'price' => number_format($this->getProductPrice($product), 2), + 'checkout_data' => [ + 'qty' => $this->productsIsConfigured && isset($checkoutData['qty']) ? $checkoutData['qty'] : 1, + ], + ]; + } + $pageData = $itemsBlock->getProductsDataByFields($this->fields); + $preparePageData = $this->arraySort($fixtureData, $pageData); + + return ['fixtureData' => $fixtureData, 'pageData' => $preparePageData]; + } + + /** + * Sort of array. + * + * @param array $fixtureData + * @param array $pageData + * @return array + */ + protected function arraySort(array $fixtureData, array $pageData) + { + $result = []; + foreach ($fixtureData as $key => $value) { + foreach ($pageData as $pageDataKey => $pageDataValue) { + if ($value['name'] == $pageDataValue['name']) { + $result[$key] = $pageDataValue; + unset($pageData[$pageDataKey]); + break; + } + } + } + return array_merge($result, $pageData); + } + + /** + * Get product price. + * + * @param FixtureInterface $product + * @return int + */ + protected function getProductPrice(FixtureInterface $product) + { + return isset($product->getCheckoutData()['cartItem']['price']) + ? $product->getCheckoutData()['cartItem']['price'] + : $product->getPrice(); + } + + /** + * Returns a string representation of the object. + * + * @return string + */ + public function toString() + { + return 'Product is added to Items Ordered grid from "Last Ordered Items" section on Order creation page.'; + } +} diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertRefundInCreditMemoTab.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertRefundInCreditMemoTab.php new file mode 100644 index 0000000000000..1f78b2625efbe --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertRefundInCreditMemoTab.php @@ -0,0 +1,70 @@ +open(); + $orderIndex->getSalesOrderGrid()->searchAndOpen(['id' => $order->getId()]); + $orderView->getOrderForm()->openTab('creditmemos'); + /** @var Grid $grid */ + $grid = $orderView->getOrderForm()->getTabElement('creditmemos')->getGridBlock(); + $amount = $order->getPrice(); + foreach ($ids['creditMemoIds'] as $key => $creditMemoId) { + $filter = [ + 'id' => $creditMemoId, + 'amount_from' => $amount[$key]['grand_creditmemo_total'], + 'amount_to' => $amount[$key]['grand_creditmemo_total'], + ]; + $grid->search($filter); + $filter['amount_from'] = number_format($amount[$key]['grand_creditmemo_total'], 2); + $filter['amount_to'] = number_format($amount[$key]['grand_creditmemo_total'], 2); + \PHPUnit_Framework_Assert::assertTrue( + $grid->isRowVisible($filter, false, false), + 'Credit memo is absent on credit memos tab.' + ); + } + } + + /** + * Returns a string representation of the object + * + * @return string + */ + public function toString() + { + return 'Credit memo is present on credit memos tab.'; + } +} diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertRefundInRefundsGrid.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertRefundInRefundsGrid.php new file mode 100644 index 0000000000000..6b1501aad3f36 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertRefundInRefundsGrid.php @@ -0,0 +1,61 @@ +open(); + $amount = $order->getPrice(); + $orderId = $order->getId(); + foreach ($ids['creditMemoIds'] as $key => $creditMemoId) { + $filter = [ + 'id' => $creditMemoId, + 'order_id' => $orderId, + 'grand_total_from' => $amount[$key]['grand_creditmemo_total'], + 'grand_total_to' => $amount[$key]['grand_creditmemo_total'], + ]; + $creditMemoIndex->getCreditMemoGrid()->search($filter); + $filter['grand_total_from'] = number_format($amount[$key]['grand_creditmemo_total'], 2); + $filter['grand_total_to'] = number_format($amount[$key]['grand_creditmemo_total'], 2); + \PHPUnit_Framework_Assert::assertTrue( + $creditMemoIndex->getCreditMemoGrid()->isRowVisible($filter, false, false), + "Credit memo '#$creditMemoId' is absent in credit memos grid on credit memo index page." + ); + } + } + + /** + * Returns a string representation of the object + * + * @return string + */ + public function toString() + { + return 'Credit memo is present in credit memos grid on credit memo index page.'; + } +} diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertRefundSuccessCreateMessage.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertRefundSuccessCreateMessage.php new file mode 100644 index 0000000000000..5f23de1fe7e35 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertRefundSuccessCreateMessage.php @@ -0,0 +1,49 @@ +getMessagesBlock()->getSuccessMessages() + ); + } + + /** + * Returns a string representation of the object + * + * @return string + */ + public function toString() + { + return 'Success create credit memo message is present on order view page.'; + } +} diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertRefundedGrandTotalOnFrontend.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertRefundedGrandTotalOnFrontend.php new file mode 100644 index 0000000000000..bcba940b0356e --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertRefundedGrandTotalOnFrontend.php @@ -0,0 +1,60 @@ +loginCustomerAndOpenOrderPage($order->getDataFieldConfig('customer_id')['source']->getCustomer()); + $orderHistory->getOrderHistoryBlock()->openOrderById($order->getId()); + $orderView->getOrderViewBlock()->openLinkByName('Refunds'); + foreach ($ids['creditMemoIds'] as $key => $creditMemoId) { + \PHPUnit_Framework_Assert::assertEquals( + number_format($order->getPrice()[$key]['grand_creditmemo_total'], 2), + $creditMemoView->getCreditMemoBlock()->getItemBlock($creditMemoId)->getGrandTotal() + ); + } + } + + /** + * Returns a string representation of the object + * + * @return string + */ + public function toString() + { + return 'Credit memo Grand Total amount is equal to placed order Grand Total amount on credit memo page.'; + } +} diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertReorderStatusIsCorrect.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertReorderStatusIsCorrect.php new file mode 100644 index 0000000000000..354017f8ca150 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertReorderStatusIsCorrect.php @@ -0,0 +1,57 @@ +open(); + $salesOrder->getSalesOrderGrid()->searchAndOpen(['id' => $order->getId()]); + + \PHPUnit_Framework_Assert::assertEquals( + $salesOrderView->getOrderForm()->getOrderInfoBlock()->getOrderStatus(), + $previousOrderStatus, + 'Order status is incorrect on order page in backend.' + ); + } + + /** + * Returns a string representation of the object + * + * @return string + */ + public function toString() + { + return 'Order status is correct.'; + } +} diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertSalesPrintOrderBillingAddress.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertSalesPrintOrderBillingAddress.php new file mode 100644 index 0000000000000..952dce858e8c9 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertSalesPrintOrderBillingAddress.php @@ -0,0 +1,51 @@ +objectManager->create( + 'Magento\Customer\Test\Block\Address\Renderer', + ['address' => $billingAddress, 'type' => 'html'] + ); + $expectedBillingAddress = $addressRenderer->render(); + \PHPUnit_Framework_Assert::assertEquals( + $expectedBillingAddress, + $salesGuestPrint->getInfoBlock()->getBillingAddress(), + "Billing address was printed incorrectly." + ); + } + + /** + * Returns a string representation of successful assertion. + * + * @return string + */ + public function toString() + { + return "Billing address printed correctly."; + } +} diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertSalesPrintOrderGrandTotal.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertSalesPrintOrderGrandTotal.php new file mode 100644 index 0000000000000..4ad51c43c4f62 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertSalesPrintOrderGrandTotal.php @@ -0,0 +1,45 @@ +getViewBlock()->getItemBlock()->getGrandTotal(), + "Grand total was printed incorrectly." + ); + } + + /** + * Returns a string representation of successful assertion. + * + * @return string + */ + public function toString() + { + return "Grand total was printed correctly."; + } +} diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertSalesPrintOrderPaymentMethod.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertSalesPrintOrderPaymentMethod.php new file mode 100644 index 0000000000000..f465275381fda --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertSalesPrintOrderPaymentMethod.php @@ -0,0 +1,44 @@ +getInfoBlock()->isPaymentMethodVisible($paymentMethod), + "Payment method was printed incorrect on sales guest print page." + ); + } + + /** + * Returns a string representation of successful assertion. + * + * @return string + */ + public function toString() + { + return "Payment method was printed correctly."; + } +} diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertSalesPrintOrderProducts.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertSalesPrintOrderProducts.php new file mode 100644 index 0000000000000..34c30a4834b52 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertSalesPrintOrderProducts.php @@ -0,0 +1,54 @@ +getViewBlock()->getItemBlock()->isItemVisible($product)) { + $errors .= sprintf(self::ERROR_MESSAGE, $product->getName()); + } + } + + \PHPUnit_Framework_Assert::assertEmpty($errors, $errors); + } + + /** + * Returns a string representation of successful assertion. + * + * @return string + */ + public function toString() + { + return "Products were printed correctly."; + } +} diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertUnholdButton.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertUnholdButton.php new file mode 100644 index 0000000000000..af06e6388c521 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertUnholdButton.php @@ -0,0 +1,50 @@ +open(); + $orderIndex->getSalesOrderGrid()->searchAndOpen(['id' => $order->getId()]); + \PHPUnit_Framework_Assert::assertTrue( + $orderView->getPageActions()->isActionButtonVisible('Unhold'), + 'Button "Unhold" is absent on order page.' + ); + } + + /** + * Returns a string representation of the object + * + * @return string + */ + public function toString() + { + return 'Button "Unhold" is present on order page.'; + } +} diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Page/Adminhtml/CreditMemoIndex.xml b/dev/tests/functional/tests/app/Magento/Sales/Test/Page/Adminhtml/CreditMemoIndex.xml new file mode 100644 index 0000000000000..f31afe8bcb4a4 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Page/Adminhtml/CreditMemoIndex.xml @@ -0,0 +1,20 @@ + + + + + + Magento\Sales\Test\Block\Adminhtml\CreditMemo\Grid + [data-grid-id="sales_creditmemo_grid"] + css selector + + + Magento\Core\Test\Block\Messages + #messages + css selector + + + diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Page/Adminhtml/InvoiceIndex.xml b/dev/tests/functional/tests/app/Magento/Sales/Test/Page/Adminhtml/InvoiceIndex.xml new file mode 100644 index 0000000000000..92c6d1278ce7b --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Page/Adminhtml/InvoiceIndex.xml @@ -0,0 +1,20 @@ + + + + + + Magento\Sales\Test\Block\Adminhtml\Invoice\Grid + #sales_invoice_grid + css selector + + + Magento\Core\Test\Block\Messages + #messages + css selector + + + diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Page/Adminhtml/OrderCreateIndex.xml b/dev/tests/functional/tests/app/Magento/Sales/Test/Page/Adminhtml/OrderCreateIndex.xml new file mode 100644 index 0000000000000..89eaa8663a995 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Page/Adminhtml/OrderCreateIndex.xml @@ -0,0 +1,45 @@ + + + + + + Magento\Sales\Test\Block\Adminhtml\Order\Create\Customer + #order-customer-selector + css selector + + + Magento\Sales\Test\Block\Adminhtml\Order\Create\Store + #order-store-selector + css selector + + + Magento\Sales\Test\Block\Adminhtml\Order\Create + [id="page:main-container"] + css selector + + + Magento\Backend\Test\Block\GridPageActions + .page-main-actions + css selector + + + Magento\Sales\Test\Block\Adminhtml\Order\Create\Coupons + #order-coupons + css selector + + + Magento\Sales\Test\Block\Adminhtml\Order\Create\CustomerActivities + .customer-current-activity + css selector + + + Magento\Catalog\Test\Block\Adminhtml\Product\Composite\Configure + //*[@role="dialog" and ./*[@id="product_composite_configure"] and contains(@style,"display: block")] + xpath + + + \ No newline at end of file diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Page/Adminhtml/OrderCreditMemoNew.xml b/dev/tests/functional/tests/app/Magento/Sales/Test/Page/Adminhtml/OrderCreditMemoNew.xml new file mode 100644 index 0000000000000..4dc2f4dec9a99 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Page/Adminhtml/OrderCreditMemoNew.xml @@ -0,0 +1,20 @@ + + + + + + Magento\Sales\Test\Block\Adminhtml\Order\Actions + .order-totals-bottom .actions + css selector + + + Magento\Sales\Test\Block\Adminhtml\Order\Creditmemo\Form + #edit_form + css selector + + + diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Page/Adminhtml/OrderIndex.xml b/dev/tests/functional/tests/app/Magento/Sales/Test/Page/Adminhtml/OrderIndex.xml new file mode 100644 index 0000000000000..f14c91de187b2 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Page/Adminhtml/OrderIndex.xml @@ -0,0 +1,25 @@ + + + + + + Magento\Backend\Test\Block\GridPageActions + .page-main-actions + css selector + + + Magento\Sales\Test\Block\Adminhtml\Order\Grid + #sales_order_grid + css selector + + + Magento\Core\Test\Block\Messages + #messages + css selector + + + diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Page/Adminhtml/OrderInvoiceNew.xml b/dev/tests/functional/tests/app/Magento/Sales/Test/Page/Adminhtml/OrderInvoiceNew.xml new file mode 100644 index 0000000000000..3e9cc73846b53 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Page/Adminhtml/OrderInvoiceNew.xml @@ -0,0 +1,20 @@ + + + + + + Magento\Sales\Test\Block\Adminhtml\Order\Invoice\Form + #edit_form + css selector + + + Magento\Sales\Test\Block\Adminhtml\Order\Invoice\Totals + #invoice_totals + css selector + + + diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Page/Adminhtml/OrderInvoiceView.xml b/dev/tests/functional/tests/app/Magento/Sales/Test/Page/Adminhtml/OrderInvoiceView.xml new file mode 100644 index 0000000000000..e769e6459ddfa --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Page/Adminhtml/OrderInvoiceView.xml @@ -0,0 +1,25 @@ + + + + + + Magento\Theme\Test\Block\Html\Title + .page-title + css selector + + + Magento\Sales\Test\Block\Adminhtml\Order\Actions + .page-actions + css selector + + + Magento\Sales\Test\Block\Adminhtml\Order\Invoice\View\Items + //div[./div[@id="invoice_item_container"]] + xpath + + + diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Page/Adminhtml/OrderStatusAssign.xml b/dev/tests/functional/tests/app/Magento/Sales/Test/Page/Adminhtml/OrderStatusAssign.xml new file mode 100644 index 0000000000000..b491f6c692910 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Page/Adminhtml/OrderStatusAssign.xml @@ -0,0 +1,20 @@ + + + + + + Magento\Backend\Test\Block\FormPageActions + .page-main-actions + css selector + + + Magento\Sales\Test\Block\Adminhtml\Order\Status\Assign\AssignForm + #edit_form + css selector + + + diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Page/Adminhtml/OrderStatusEdit.xml b/dev/tests/functional/tests/app/Magento/Sales/Test/Page/Adminhtml/OrderStatusEdit.xml new file mode 100644 index 0000000000000..06d2f2768f141 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Page/Adminhtml/OrderStatusEdit.xml @@ -0,0 +1,25 @@ + + + + + + Magento\Backend\Test\Block\FormPageActions + .page-main-actions + css selector + + + Magento\Backend\Test\Block\Widget\Form + #edit_form + css selector + + + Magento\Core\Test\Block\Messages + #messages + css selector + + + diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Page/Adminhtml/OrderStatusIndex.xml b/dev/tests/functional/tests/app/Magento/Sales/Test/Page/Adminhtml/OrderStatusIndex.xml new file mode 100644 index 0000000000000..52340fdf6bedd --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Page/Adminhtml/OrderStatusIndex.xml @@ -0,0 +1,25 @@ + + + + + + Magento\Sales\Test\Block\Adminhtml\Order\StatusGrid + #sales_order_status_grid + css selector + + + Magento\Sales\Test\Block\Adminhtml\Order\Status\GridPageActions + .page-main-actions + css selector + + + Magento\Core\Test\Block\Messages + #messages + css selector + + + diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Page/Adminhtml/OrderStatusNew.xml b/dev/tests/functional/tests/app/Magento/Sales/Test/Page/Adminhtml/OrderStatusNew.xml new file mode 100644 index 0000000000000..8b2e01d220dbd --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Page/Adminhtml/OrderStatusNew.xml @@ -0,0 +1,25 @@ + + + + + + Magento\Backend\Test\Block\FormPageActions + .page-main-actions + css selector + + + Magento\Backend\Test\Block\Widget\Form + #edit_form + css selector + + + Magento\Core\Test\Block\Messages + #messages + css selector + + + diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Page/Adminhtml/OrderView.xml b/dev/tests/functional/tests/app/Magento/Sales/Test/Page/Adminhtml/OrderView.xml new file mode 100644 index 0000000000000..55a7859d422c3 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Page/Adminhtml/OrderView.xml @@ -0,0 +1,55 @@ + + + + + + Magento\Sales\Test\Block\Adminhtml\Order\Actions + .page-actions + css selector + + + Magento\Core\Test\Block\Messages + #messages + css selector + + + Magento\Sales\Test\Block\Adminhtml\Order\View\OrderForm + [id="page:main-container"] + css selector + + + Magento\Theme\Test\Block\Html\Title + .page-title + css selector + + + Magento\Sales\Test\Block\Adminhtml\Order\View\Items + #sales_order_view_tabs_order_info_content .grid + css selector + + + Magento\Sales\Test\Block\Adminhtml\Order\Totals + .order-totals + css selector + + + Magento\Sales\Test\Block\Adminhtml\Order\History + .order-comments-history + css selector + + + Magento\Sales\Test\Block\Adminhtml\Order\View\Info + .order-account-information + css selector + + + Magento\Sales\Test\Block\Adminhtml\Order\View\Tab\Info + [data-ui-id="sales-order-tabs-tab-content-order-info"] + css selector + + + diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Page/Adminhtml/SalesCreditMemoView.xml b/dev/tests/functional/tests/app/Magento/Sales/Test/Page/Adminhtml/SalesCreditMemoView.xml new file mode 100644 index 0000000000000..a93388c95ab4a --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Page/Adminhtml/SalesCreditMemoView.xml @@ -0,0 +1,15 @@ + + + + + + Magento\Sales\Test\Block\Adminhtml\Order\Creditmemo\View\Items + .grid + css selector + + + diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Page/Adminhtml/SalesInvoiceView.xml b/dev/tests/functional/tests/app/Magento/Sales/Test/Page/Adminhtml/SalesInvoiceView.xml new file mode 100644 index 0000000000000..09311236e9be8 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Page/Adminhtml/SalesInvoiceView.xml @@ -0,0 +1,15 @@ + + + + + + Magento\Sales\Test\Block\Adminhtml\Order\Invoice\View\Items + .grid + css selector + + + diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Page/CreditMemoView.xml b/dev/tests/functional/tests/app/Magento/Sales/Test/Page/CreditMemoView.xml new file mode 100644 index 0000000000000..b1f5a5d2c34d8 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Page/CreditMemoView.xml @@ -0,0 +1,15 @@ + + + + + + Magento\Sales\Test\Block\Order\View + .order-details-items + css selector + + + diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Page/InvoiceView.xml b/dev/tests/functional/tests/app/Magento/Sales/Test/Page/InvoiceView.xml new file mode 100644 index 0000000000000..5e3cddd01a012 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Page/InvoiceView.xml @@ -0,0 +1,15 @@ + + + + + + Magento\Sales\Test\Block\Order\View + .order-details-items + css selector + + + diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Page/OrderHistory.xml b/dev/tests/functional/tests/app/Magento/Sales/Test/Page/OrderHistory.xml new file mode 100644 index 0000000000000..7871df1f76ae5 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Page/OrderHistory.xml @@ -0,0 +1,15 @@ + + + + + + Magento\Sales\Test\Block\Order\History + #my-orders-table + css selector + + + diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Page/OrderView.xml b/dev/tests/functional/tests/app/Magento/Sales/Test/Page/OrderView.xml new file mode 100644 index 0000000000000..c563a47e1c9ea --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Page/OrderView.xml @@ -0,0 +1,20 @@ + + + + + + Magento\Sales\Test\Block\Order\View + .column.main + css selector + + + Magento\Sales\Test\Block\Adminhtml\Order\Actions + .page-actions + css selector + + + diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Page/SalesGuestForm.xml b/dev/tests/functional/tests/app/Magento/Sales/Test/Page/SalesGuestForm.xml new file mode 100644 index 0000000000000..40f4723be1f2f --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Page/SalesGuestForm.xml @@ -0,0 +1,15 @@ + + + + + + Magento\Sales\Test\Block\Widget\Guest\Form + #oar-widget-orders-and-returns-form + css selector + + + diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Page/SalesGuestPrint.xml b/dev/tests/functional/tests/app/Magento/Sales/Test/Page/SalesGuestPrint.xml new file mode 100644 index 0000000000000..0151474657282 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Page/SalesGuestPrint.xml @@ -0,0 +1,20 @@ + + + + + + Magento\Sales\Test\Block\Order\View + .order-details-items + css selector + + + Magento\Sales\Test\Block\Order\Info + .block-order-details-view + css selector + + + diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Page/SalesGuestView.xml b/dev/tests/functional/tests/app/Magento/Sales/Test/Page/SalesGuestView.xml new file mode 100644 index 0000000000000..93f0d1fc97b4e --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Page/SalesGuestView.xml @@ -0,0 +1,20 @@ + + + + + + Magento\Sales\Test\Block\Order\View\ActionsToolbar + .actions-toolbar + css selector + + + Magento\Sales\Test\Block\Order\View + .column.main + css selector + + + diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Page/SalesOrderShipmentNew.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Page/SalesOrderShipmentNew.php new file mode 100644 index 0000000000000..d47c284c7fbb7 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Page/SalesOrderShipmentNew.php @@ -0,0 +1,50 @@ +_url = $this->_url = $_ENV['app_backend_url'] . self::MCA; + } + + /** + * Get shipment totals + * + * @return \Magento\Sales\Test\Block\Adminhtml\Order\Shipment\Totals + */ + public function getTotalsBlock() + { + return Factory::getBlockFactory()->getMagentoSalesAdminhtmlOrderShipmentTotals( + $this->_browser->find($this->totalsBlock, Locator::SELECTOR_CSS) + ); + } +} diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/TestStep/AddProductsStep.php b/dev/tests/functional/tests/app/Magento/Sales/Test/TestStep/AddProductsStep.php new file mode 100644 index 0000000000000..964ab0bf0d180 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/TestStep/AddProductsStep.php @@ -0,0 +1,61 @@ +orderCreateIndex = $orderCreateIndex; + $this->products = $products; + } + + /** + * Add product to sales + * + * @return void + */ + public function run() + { + $createBlock = $this->orderCreateIndex->getCreateBlock(); + $createBlock->getItemsBlock()->clickAddProducts(); + foreach ($this->products as $product) { + $createBlock->getGridBlock()->searchAndSelect(['sku' => $product->getSku()]); + $createBlock->getTemplateBlock()->waitLoader(); + if ($this->orderCreateIndex->getConfigureProductBlock()->isVisible()) { + $this->orderCreateIndex->getConfigureProductBlock()->configProduct($product); + } + } + $createBlock->addSelectedProductsToOrder(); + $createBlock->getTemplateBlock()->waitLoader(); + } +} diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/TestStep/AddRecentlyViewedProductsToCartStep.php b/dev/tests/functional/tests/app/Magento/Sales/Test/TestStep/AddRecentlyViewedProductsToCartStep.php new file mode 100644 index 0000000000000..36ff04bc6962d --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/TestStep/AddRecentlyViewedProductsToCartStep.php @@ -0,0 +1,66 @@ +products = $products; + $this->orderCreateIndex = $orderCreateIndex; + } + + /** + * Add Recently Viewed Products to cart. + * + * @return void + */ + public function run() + { + $recentlyBlock = $this->orderCreateIndex->getCustomerActivitiesBlock(); + $recentlyBlock->getRecentlyViewedItemsBlock()->addToOrderByName($this->extractProductNames()); + $recentlyBlock->updateChanges(); + } + + /** + * Extract products name. + * + * @return array + */ + protected function extractProductNames() + { + $result = []; + foreach ($this->products as $product) { + $result[] = $product->getName(); + } + return $result; + } +} diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/TestStep/ConfigureProductsStep.php b/dev/tests/functional/tests/app/Magento/Sales/Test/TestStep/ConfigureProductsStep.php new file mode 100644 index 0000000000000..1fb88d72c8db2 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/TestStep/ConfigureProductsStep.php @@ -0,0 +1,55 @@ +products = $products; + $this->orderCreateIndex = $orderCreateIndex; + } + + /** + * Configure products options on backend order. + * + * @return void + */ + public function run() + { + $orderPage = $this->orderCreateIndex; + foreach ($this->products as $product) { + $orderPage->getCreateBlock()->getItemsBlock()->getItemProductByName($product->getName())->configure(); + $orderPage->getConfigureProductBlock()->configProduct($product); + } + $orderPage->getCreateBlock()->updateItems(); + } +} diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/TestStep/CreateNewOrderStep.php b/dev/tests/functional/tests/app/Magento/Sales/Test/TestStep/CreateNewOrderStep.php new file mode 100644 index 0000000000000..45575ef3a0b31 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/TestStep/CreateNewOrderStep.php @@ -0,0 +1,42 @@ +orderIndex = $orderIndex; + } + + /** + * Create new order + * + * @return void + */ + public function run() + { + $this->orderIndex->getGridPageActions()->addNew(); + } +} diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/TestStep/FillBillingAddressStep.php b/dev/tests/functional/tests/app/Magento/Sales/Test/TestStep/FillBillingAddressStep.php new file mode 100644 index 0000000000000..1aaddcc746f5d --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/TestStep/FillBillingAddressStep.php @@ -0,0 +1,53 @@ +orderCreateIndex = $orderCreateIndex; + $this->billingAddress = $billingAddress; + } + + /** + * Fill Sales Data. + * + * @return AddressInjectable + */ + public function run() + { + $this->orderCreateIndex->getCreateBlock()->fillAddresses($this->billingAddress); + + return ['billingAddress' => $this->billingAddress]; + } +} diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/TestStep/OpenSalesOrdersStep.php b/dev/tests/functional/tests/app/Magento/Sales/Test/TestStep/OpenSalesOrdersStep.php new file mode 100644 index 0000000000000..39b4c770b5660 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/TestStep/OpenSalesOrdersStep.php @@ -0,0 +1,42 @@ +orderIndex = $orderIndex; + } + + /** + * Open Sales order + * + * @return void + */ + public function run() + { + $this->orderIndex->open(); + } +} diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/TestStep/PrintOrderOnFrontendStep.php b/dev/tests/functional/tests/app/Magento/Sales/Test/TestStep/PrintOrderOnFrontendStep.php new file mode 100644 index 0000000000000..bb676a6c7fde4 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/TestStep/PrintOrderOnFrontendStep.php @@ -0,0 +1,52 @@ +salesGuestView = $salesGuestView; + $this->browser = $browser; + } + + /** + * Click on "Print Order" button. + * + * @return void + */ + public function run() + { + $this->salesGuestView->getActionsToolbar()->clickLink('Print Order'); + $this->browser->selectWindow(); + } +} diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/TestStep/ReorderStep.php b/dev/tests/functional/tests/app/Magento/Sales/Test/TestStep/ReorderStep.php new file mode 100644 index 0000000000000..ae31dcdf031a2 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/TestStep/ReorderStep.php @@ -0,0 +1,42 @@ +orderView = $orderView; + } + + /** + * Click reorder + * + * @return void + */ + public function run() + { + $this->orderView->getPageActions()->reorder(); + } +} diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/TestStep/SelectCustomerOrderStep.php b/dev/tests/functional/tests/app/Magento/Sales/Test/TestStep/SelectCustomerOrderStep.php new file mode 100644 index 0000000000000..31dc28811597f --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/TestStep/SelectCustomerOrderStep.php @@ -0,0 +1,52 @@ +orderCreateIndex = $orderCreateIndex; + $this->customer = $customer; + } + + /** + * Select Customer for Order + * + * @return void + */ + public function run() + { + $this->orderCreateIndex->getCustomerBlock()->selectCustomer($this->customer); + } +} diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/TestStep/SelectPaymentMethodForOrderStep.php b/dev/tests/functional/tests/app/Magento/Sales/Test/TestStep/SelectPaymentMethodForOrderStep.php new file mode 100644 index 0000000000000..6e2cd5e27339e --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/TestStep/SelectPaymentMethodForOrderStep.php @@ -0,0 +1,51 @@ +orderCreateIndex = $orderCreateIndex; + $this->payment = $payment; + } + + /** + * Fill Payment data + * + * @return void + */ + public function run() + { + $this->orderCreateIndex->getCreateBlock()->selectPaymentMethod($this->payment); + } +} diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/TestStep/SelectShippingMethodForOrderStep.php b/dev/tests/functional/tests/app/Magento/Sales/Test/TestStep/SelectShippingMethodForOrderStep.php new file mode 100644 index 0000000000000..085b1e62d7e15 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/TestStep/SelectShippingMethodForOrderStep.php @@ -0,0 +1,55 @@ +orderCreateIndex = $orderCreateIndex; + $this->shipping = $shipping; + } + + /** + * Fill Shipping Data + * + * @return array + */ + public function run() + { + if ($this->shipping['shipping_service'] != '-') { + $this->orderCreateIndex->getCreateBlock()->selectShippingMethod($this->shipping); + } + + return ['shipping' => $this->shipping]; + } +} diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/TestStep/SelectStoreStep.php b/dev/tests/functional/tests/app/Magento/Sales/Test/TestStep/SelectStoreStep.php new file mode 100644 index 0000000000000..2562445fc8c6a --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/TestStep/SelectStoreStep.php @@ -0,0 +1,56 @@ +store = $store; + $this->orderCreateIndex = $orderCreateIndex; + } + + /** + * Select store on order create page + * + * @return array + */ + public function run() + { + if ($this->orderCreateIndex->getStoreBlock()->isVisible()) { + $this->orderCreateIndex->getStoreBlock()->selectStoreView($this->store); + } + } +} diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/TestStep/SubmitOrderStep.php b/dev/tests/functional/tests/app/Magento/Sales/Test/TestStep/SubmitOrderStep.php new file mode 100644 index 0000000000000..17bb4d15b94b3 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/TestStep/SubmitOrderStep.php @@ -0,0 +1,90 @@ +orderCreateIndex = $orderCreateIndex; + $this->orderView = $orderView; + $this->fixtureFactory = $fixtureFactory; + $this->customer = $customer; + $this->billingAddress = $billingAddress; + $this->products = $products; + } + + /** + * Fill Sales Data. + * + * @return array + */ + public function run() + { + $this->orderCreateIndex->getCreateBlock()->submitOrder(); + $this->orderView->getMessagesBlock()->waitSuccessMessage(); + $orderId = trim($this->orderView->getTitleBlock()->getTitle(), '#'); + $order = $this->fixtureFactory->createByCode( + 'orderInjectable', + [ + 'data' => [ + 'id' => $orderId, + 'customer_id' => ['customer' => $this->customer], + 'entity_id' => ['products' => $this->products], + 'billing_address_id' => ['billingAddress' => $this->billingAddress], + ] + ] + ); + + return ['orderId' => $orderId, 'order' => $order]; + } +} diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/TestStep/UpdateProductsDataStep.php b/dev/tests/functional/tests/app/Magento/Sales/Test/TestStep/UpdateProductsDataStep.php new file mode 100644 index 0000000000000..59dd7a83188f5 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/TestStep/UpdateProductsDataStep.php @@ -0,0 +1,51 @@ +orderCreateIndex = $orderCreateIndex; + $this->products = $products; + } + + /** + * Fill product data + * + * @return void + */ + public function run() + { + $this->orderCreateIndex->getCreateBlock()->updateProductsData($this->products); + } +} diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/etc/constraint.xml b/dev/tests/functional/tests/app/Magento/Sales/Test/etc/constraint.xml new file mode 100644 index 0000000000000..44fb7864e363f --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/etc/constraint.xml @@ -0,0 +1,159 @@ + + + + + low + + + + + + high + + + + + + + high + + + high + + + + + + low + + + low + + + low + + + low + + + high + + + low + + + low + + + low + + + high + + + high + + + low + + + low + + + low + + + low + + + low + + + low + + + low + + + low + + + low + + + low + + + low + + + low + + + low + + + low + + + low + + + low + + + low + + + low + + + low + + + low + + + low + + + low + + + low + + + low + + + low + + + low + + + low + + + low + + + low + + + low + + + low + + + low + + + low + + diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/etc/curl/di.xml b/dev/tests/functional/tests/app/Magento/Sales/Test/etc/curl/di.xml new file mode 100644 index 0000000000000..7fb36b15ed5a1 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/etc/curl/di.xml @@ -0,0 +1,10 @@ + + + + + + diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/etc/fixture.xml b/dev/tests/functional/tests/app/Magento/Sales/Test/etc/fixture.xml new file mode 100644 index 0000000000000..e92d4c817df07 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/etc/fixture.xml @@ -0,0 +1,44 @@ + + + + + flat + sales_order + Magento\Sales\Model\Resource\Order\Collection + + + + id + virtual + + + + + + + flat + sales_order + Magento\Sales\Model\Resource\Order\Collection + + + + id + virtual + + + + + + + composite + + sales_order_status + sales_order_status_state + + Magento\Sales\Model\Resource\Order\Status\Collection + + diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/etc/page.xml b/dev/tests/functional/tests/app/Magento/Sales/Test/etc/page.xml new file mode 100644 index 0000000000000..a7392a7767b78 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/etc/page.xml @@ -0,0 +1,98 @@ + + + + + sales/order_status/index + adminhtml + Magento\Sales\Test\Page\Adminhtml\OrderStatusIndex + + + sales/order_status/new + adminhtml + Magento\Sales\Test\Page\Adminhtml\OrderStatusNew + + + sales/order_status/edit + adminhtml + Magento\Sales\Test\Page\Adminhtml\OrderStatusEdit + + + sales/order_status/assign + adminhtml + Magento\Sales\Test\Page\Adminhtml\Order\Status\Assign + + + sales/order/index + adminhtml + Magento\Sales\Test\Page\Adminhtml\OderIndex + + + sales/order/view/index + adminhtml + Magento\Sales\Test\Page\Adminhtml\OrderView + + + sales/order/history + Magento\Sales\Test\Page\OrderHistory + + + sales/order_invoice/new + adminhtml + Magento\Sales\Test\Page\Adminhtml\OrderInvoiceNew + + + sales/order_invoice/view + adminhtml + Magento\Sales\Test\Page\Adminhtml\OrderInvoiceView + + + sales/order/invoice + Magento\Sales\Test\Page\InvoicesView + + + sales/order/view + Magento\Sales\Test\Page\OrderView + + + sales/creditmemo/view + adminhtml + Magento\Sales\Test\Page\SalesCreditMemoView + + + sales/order_creditmemo/new + adminhtml + Magento\Sales\Test\Page\Adminhtml\OrderCreditMemoNew + + + sales/creditmemo + adminhtml + Magento\Sales\Test\Page\Adminhtml\CreditMemoIndex + + + sales/invoice + adminhtml + Magento\Sales\Test\Page\Adminhtml\InvoiceIndex + + + sales/invoice/view + adminhtml + Magento\Sales\Test\Page\Adminhtml\SalesInvoiceView + + + sales/guest/form + Magento\Sales\Test\Page\SalesGuestForm + + + sales/order_create/index + adminhtml + Magento\Sales\Test\Page\Adminhtml\OrderCreateIndex + + + sales/guest/print + Magento\Sales\Test\Page\SalesGuestPrint + + diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/etc/scenario.xml b/dev/tests/functional/tests/app/Magento/Sales/Test/etc/scenario.xml new file mode 100644 index 0000000000000..a4357d242b6d6 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/etc/scenario.xml @@ -0,0 +1,188 @@ + + + + + + + + setupConfiguration + + createOrder + + + openOrder + + + reorder + + + fillBillingAddress + + + selectPaymentMethodForOrder + + + selectShippingMethodForOrder + + + submitOrder + + + + + + + + + + + setupConfiguration + + createProducts + + + createCustomer + + + + + johndoe_with_addresses + + + openSalesOrders + + + createNewOrder + + + selectCustomerOrder + + + selectStore + + + addProducts + + + updateProductsData + + + fillBillingAddress + + + selectPaymentMethodForOrder + + + selectShippingMethodForOrder + + + submitOrder + + + + + + + + + + + createProducts + + createCustomer + + + + + default + + + loginCustomerOnFrontend + + + openProductsOnFrontend + + + openCustomerOnBackend + + + createOrderFromCustomerAccount + + + addRecentlyViewedProductsToCart + + + configureProducts + + + + + + + + + + + + createProducts + + createCustomer + + + + + johndoe_with_addresses + + + openSalesOrders + + + createNewOrder + + + selectCustomerOrder + + + selectStore + + + addProducts + + + fillBillingAddress + + + + + customer_US + + + selectPaymentMethodForOrder + + + + + checkmo + + + selectShippingMethodForOrder + + + submitOrder + + + openSalesOrderOnFrontendForGuest + + + printOrderOnFrontend + + + + + + + diff --git a/dev/tests/functional/tests/app/Magento/Shipping/Test/Block/Adminhtml/Order/Tracking.php b/dev/tests/functional/tests/app/Magento/Shipping/Test/Block/Adminhtml/Order/Tracking.php new file mode 100644 index 0000000000000..5aaa2682c375f --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Shipping/Test/Block/Adminhtml/Order/Tracking.php @@ -0,0 +1,61 @@ +blockFactory->create( + 'Magento\Shipping\Test\Block\Adminhtml\Order\Tracking\Item', + ['element' => $this->_rootElement->find(sprintf($this->itemTracking, $index), Locator::SELECTOR_XPATH)] + ); + } + + /** + * Fill tracking + * + * @param array $data + * @return void + */ + public function fill(array $data) + { + foreach ($data as $key => $value) { + if (!$this->getItemTrackingBlock(++$key)->isVisible()) { + $this->_rootElement->find($this->addTracking)->click(); + } + $this->getItemTrackingBlock($key)->fillRow($value); + } + } +} diff --git a/dev/tests/functional/tests/app/Magento/Shipping/Test/Block/Adminhtml/Order/Tracking/Item.php b/dev/tests/functional/tests/app/Magento/Shipping/Test/Block/Adminhtml/Order/Tracking/Item.php new file mode 100644 index 0000000000000..82394457a4630 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Shipping/Test/Block/Adminhtml/Order/Tracking/Item.php @@ -0,0 +1,27 @@ +dataMapping($fields); + $this->_fill($mapping); + } +} diff --git a/dev/tests/functional/tests/app/Magento/Shipping/Test/Block/Adminhtml/Order/Tracking/Item.xml b/dev/tests/functional/tests/app/Magento/Shipping/Test/Block/Adminhtml/Order/Tracking/Item.xml new file mode 100644 index 0000000000000..b6eb27cfcc3cb --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Shipping/Test/Block/Adminhtml/Order/Tracking/Item.xml @@ -0,0 +1,20 @@ + + + + + + [name$='[carrier_code]'] + select + + + <selector>[name$='[title]']</selector> + + + [name$='[number]'] + + + diff --git a/dev/tests/functional/tests/app/Magento/Shipping/Test/Block/Adminhtml/Shipment/Grid.php b/dev/tests/functional/tests/app/Magento/Shipping/Test/Block/Adminhtml/Shipment/Grid.php new file mode 100644 index 0000000000000..2a14ceb2f3756 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Shipping/Test/Block/Adminhtml/Shipment/Grid.php @@ -0,0 +1,35 @@ + [ + 'selector' => 'input[name="real_shipment_id"]', + ], + 'order_id' => [ + 'selector' => 'input[name="order_increment_id"]', + ], + 'total_qty_from' => [ + 'selector' => 'input[name="total_qty[from]"]', + ], + 'total_qty_to' => [ + 'selector' => 'input[name="total_qty[to]"]', + ], + ]; +} diff --git a/dev/tests/functional/tests/app/Magento/Shipping/Test/Block/Adminhtml/View/Items.php b/dev/tests/functional/tests/app/Magento/Shipping/Test/Block/Adminhtml/View/Items.php new file mode 100644 index 0000000000000..ad100d3a39133 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Shipping/Test/Block/Adminhtml/View/Items.php @@ -0,0 +1,22 @@ +_rootElement->find( + sprintf($this->shippingMethodSelector, $shippingMethod), + Locator::SELECTOR_XPATH + )->isVisible(); + } +} diff --git a/dev/tests/functional/tests/app/Magento/Shipping/Test/Block/Order/Shipment.php b/dev/tests/functional/tests/app/Magento/Shipping/Test/Block/Order/Shipment.php new file mode 100644 index 0000000000000..ac87a3c3b66bc --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Shipping/Test/Block/Order/Shipment.php @@ -0,0 +1,46 @@ +shipmentItemBlock, $id) . $this->shipmentContent; + return $this->blockFactory->create( + 'Magento\Shipping\Test\Block\Order\Shipment\Items', + ['element' => $this->_rootElement->find($selector, Locator::SELECTOR_XPATH)] + ); + } +} diff --git a/dev/tests/functional/tests/app/Magento/Shipping/Test/Block/Order/Shipment/Items.php b/dev/tests/functional/tests/app/Magento/Shipping/Test/Block/Order/Shipment/Items.php new file mode 100644 index 0000000000000..b533a6aea6056 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Shipping/Test/Block/Order/Shipment/Items.php @@ -0,0 +1,32 @@ +_rootElement->find($this->grandTotal)->getText()); + } +} diff --git a/dev/tests/functional/tests/app/Magento/Shipping/Test/Constraint/AssertNoShipButton.php b/dev/tests/functional/tests/app/Magento/Shipping/Test/Constraint/AssertNoShipButton.php new file mode 100644 index 0000000000000..f7167eff5402a --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Shipping/Test/Constraint/AssertNoShipButton.php @@ -0,0 +1,50 @@ +open(); + $orderIndex->getSalesOrderGrid()->searchAndOpen(['id' => $order->getId()]); + \PHPUnit_Framework_Assert::assertFalse( + $orderView->getPageActions()->isActionButtonVisible('Ship'), + 'Ship button is present on order view page.' + ); + } + + /** + * Returns a string representation of the object + * + * @return string + */ + public function toString() + { + return 'Ship button is absent on order view page.'; + } +} diff --git a/dev/tests/functional/tests/app/Magento/Shipping/Test/Constraint/AssertShipTotalQuantity.php b/dev/tests/functional/tests/app/Magento/Shipping/Test/Constraint/AssertShipTotalQuantity.php new file mode 100644 index 0000000000000..854bb88d1e3a4 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Shipping/Test/Constraint/AssertShipTotalQuantity.php @@ -0,0 +1,62 @@ +getTotalQtyOrdered(); + $this->loginCustomerAndOpenOrderPage($order->getDataFieldConfig('customer_id')['source']->getCustomer()); + $orderHistory->getOrderHistoryBlock()->openOrderById($order->getId()); + $orderView->getOrderViewBlock()->openLinkByName('Order Shipments'); + foreach ($ids['shipmentIds'] as $key => $shipmentIds) { + \PHPUnit_Framework_Assert::assertEquals( + $totalQty[$key], + $shipmentView->getShipmentBlock()->getItemShipmentBlock($shipmentIds)->getTotalQty() + ); + } + } + + /** + * Returns a string representation of the object + * + * @return string + */ + public function toString() + { + return 'Shipped items quantity is equal to data from fixture on My Account page.'; + } +} diff --git a/dev/tests/functional/tests/app/Magento/Shipping/Test/Constraint/AssertShipmentInShipmentsGrid.php b/dev/tests/functional/tests/app/Magento/Shipping/Test/Constraint/AssertShipmentInShipmentsGrid.php new file mode 100644 index 0000000000000..227bac515482e --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Shipping/Test/Constraint/AssertShipmentInShipmentsGrid.php @@ -0,0 +1,58 @@ +open(); + $orderId = $order->getId(); + $totalQty = $order->getTotalQtyOrdered(); + foreach ($ids['shipmentIds'] as $key => $shipmentIds) { + $filter = [ + 'id' => $shipmentIds, + 'order_id' => $orderId, + 'total_qty_from' => $totalQty[$key], + 'total_qty_to' => $totalQty[$key], + ]; + \PHPUnit_Framework_Assert::assertTrue( + $shipmentIndex->getShipmentsGrid()->isRowVisible($filter), + 'Shipment is absent in shipment grid on shipment index page.' + ); + } + } + + /** + * Returns a string representation of the object + * + * @return string + */ + public function toString() + { + return 'Shipment is present in the shipment grid with correct total qty on shipment index page.'; + } +} diff --git a/dev/tests/functional/tests/app/Magento/Shipping/Test/Constraint/AssertShipmentInShipmentsTab.php b/dev/tests/functional/tests/app/Magento/Shipping/Test/Constraint/AssertShipmentInShipmentsTab.php new file mode 100644 index 0000000000000..6ad8c71f09b35 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Shipping/Test/Constraint/AssertShipmentInShipmentsTab.php @@ -0,0 +1,66 @@ +open(); + $orderIndex->getSalesOrderGrid()->searchAndOpen(['id' => $order->getId()]); + $orderView->getOrderForm()->openTab('shipments'); + $totalQty = $order->getTotalQtyOrdered(); + $totalQty = is_array($totalQty) ? $totalQty : [$totalQty]; + + foreach ($ids['shipmentIds'] as $key => $shipmentId) { + $filter = [ + 'id' => $shipmentId, + 'qty_from' => $totalQty[$key], + 'qty_to' => $totalQty[$key], + ]; + \PHPUnit_Framework_Assert::assertTrue( + $orderView->getOrderForm()->getTabElement('shipments')->getGridBlock()->isRowVisible($filter), + 'Shipment is absent on shipments tab.' + ); + } + } + + /** + * Returns a string representation of the object + * + * @return string + */ + public function toString() + { + return 'Shipment is present on shipments tab.'; + } +} diff --git a/dev/tests/functional/tests/app/Magento/Shipping/Test/Constraint/AssertShipmentItems.php b/dev/tests/functional/tests/app/Magento/Shipping/Test/Constraint/AssertShipmentItems.php new file mode 100644 index 0000000000000..23c1e40e276b5 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Shipping/Test/Constraint/AssertShipmentItems.php @@ -0,0 +1,99 @@ +shipmentPage = $shipmentIndex; + } + + /** + * Assert shipped products are represented on shipment view page + * + * @param SalesShipmentView $orderShipmentView + * @param OrderInjectable $order + * @param array $ids + * @param array|null $data [optional] + * @return void + */ + public function processAssert( + SalesShipmentView $orderShipmentView, + OrderInjectable $order, + array $ids, + array $data = null + ) { + $this->shipmentPage->open(); + $this->assert($order, $ids, $orderShipmentView, $data); + } + + /** + * Process assert + * + * @param OrderInjectable $order + * @param array $ids + * @param SalesShipmentView $salesShipmentView + * @param array|null $data [optional] + * @return void + */ + protected function assert( + OrderInjectable $order, + array $ids, + SalesShipmentView $salesShipmentView, + array $data = null + ) { + $orderId = $order->getId(); + $productsData = $this->prepareOrderProducts($order, $data['items_data']); + foreach ($ids['shipmentIds'] as $shipmentId) { + $filter = [ + 'order_id' => $orderId, + 'id' => $shipmentId, + ]; + $this->shipmentPage->getShipmentsGrid()->searchAndOpen($filter); + $itemsData = $this->preparePageItems($salesShipmentView->getItemsBlock()->getData()); + $error = $this->verifyData($productsData, $itemsData); + \PHPUnit_Framework_Assert::assertEmpty($error, $error); + } + } + + /** + * Returns a string representation of the object + * + * @return string + */ + public function toString() + { + return 'All shipment products are present in shipment page.'; + } +} diff --git a/dev/tests/functional/tests/app/Magento/Shipping/Test/Constraint/AssertShipmentSuccessCreateMessage.php b/dev/tests/functional/tests/app/Magento/Shipping/Test/Constraint/AssertShipmentSuccessCreateMessage.php new file mode 100644 index 0000000000000..7d97f565ef579 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Shipping/Test/Constraint/AssertShipmentSuccessCreateMessage.php @@ -0,0 +1,49 @@ +getMessagesBlock()->getSuccessMessages() + ); + } + + /** + * Returns a string representation of the object + * + * @return string + */ + public function toString() + { + return 'Shipment success create message is present.'; + } +} diff --git a/dev/tests/functional/tests/app/Magento/Shipping/Test/Constraint/AssertShippingMethodOnPrintOrder.php b/dev/tests/functional/tests/app/Magento/Shipping/Test/Constraint/AssertShippingMethodOnPrintOrder.php new file mode 100644 index 0000000000000..c7bf8c6c929be --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Shipping/Test/Constraint/AssertShippingMethodOnPrintOrder.php @@ -0,0 +1,50 @@ +getInfoShipping()->isShippingMethodVisible($expected), + "Shipping method was printed incorrectly." + ); + } + + /** + * Returns a string representation of successful assertion. + * + * @return string + */ + public function toString() + { + return "Shipping method was printed correctly."; + } +} diff --git a/dev/tests/functional/tests/app/Magento/Shipping/Test/Fixture/Method.php b/dev/tests/functional/tests/app/Magento/Shipping/Test/Fixture/Method.php new file mode 100644 index 0000000000000..bede0753c366e --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Shipping/Test/Fixture/Method.php @@ -0,0 +1,29 @@ +_repository = Factory::getRepositoryFactory() + ->getMagentoShippingMethod($this->_dataConfig, $this->_data); + + //Default data set + $this->switchData('flat_rate'); + } +} diff --git a/dev/tests/functional/tests/app/Magento/Shipping/Test/Page/Adminhtml/OrderShipmentNew.xml b/dev/tests/functional/tests/app/Magento/Shipping/Test/Page/Adminhtml/OrderShipmentNew.xml new file mode 100644 index 0000000000000..4377be2c138f7 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Shipping/Test/Page/Adminhtml/OrderShipmentNew.xml @@ -0,0 +1,20 @@ + + + + + + Magento\Shipping\Test\Block\Adminhtml\Create\Items + #ship_items_container + css selector + + + Magento\Shipping\Test\Block\Adminhtml\Form + #edit_form + css selector + + + diff --git a/dev/tests/functional/tests/app/Magento/Shipping/Test/Page/Adminhtml/OrderShipmentView.xml b/dev/tests/functional/tests/app/Magento/Shipping/Test/Page/Adminhtml/OrderShipmentView.xml new file mode 100644 index 0000000000000..e5a236dc4f067 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Shipping/Test/Page/Adminhtml/OrderShipmentView.xml @@ -0,0 +1,20 @@ + + + + + + Magento\Theme\Test\Block\Html\Title + .page-title + css selector + + + Magento\Sales\Test\Block\Adminhtml\Order\Shipment\View\Items + .grid + css selector + + + diff --git a/dev/tests/functional/tests/app/Magento/Shipping/Test/Page/Adminhtml/SalesShipmentView.xml b/dev/tests/functional/tests/app/Magento/Shipping/Test/Page/Adminhtml/SalesShipmentView.xml new file mode 100644 index 0000000000000..29889c877fd2a --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Shipping/Test/Page/Adminhtml/SalesShipmentView.xml @@ -0,0 +1,20 @@ + + + + + + Magento\Theme\Test\Block\Html\Title + .page-title + css selector + + + Magento\Sales\Test\Block\Adminhtml\Order\Shipment\View\Items + .grid + css selector + + + diff --git a/dev/tests/functional/tests/app/Magento/Shipping/Test/Page/Adminhtml/ShipmentIndex.xml b/dev/tests/functional/tests/app/Magento/Shipping/Test/Page/Adminhtml/ShipmentIndex.xml new file mode 100644 index 0000000000000..38bbc7eb4d8d5 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Shipping/Test/Page/Adminhtml/ShipmentIndex.xml @@ -0,0 +1,20 @@ + + + + + + Magento\Shipping\Test\Block\Adminhtml\Shipment\Grid + [data-grid-id="sales_shipment_grid"] + css selector + + + Magento\Core\Test\Block\Messages + #messages + css selector + + + diff --git a/dev/tests/functional/tests/app/Magento/Shipping/Test/Page/SalesGuestPrint.xml b/dev/tests/functional/tests/app/Magento/Shipping/Test/Page/SalesGuestPrint.xml new file mode 100644 index 0000000000000..e0c12fb87d965 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Shipping/Test/Page/SalesGuestPrint.xml @@ -0,0 +1,15 @@ + + + + + + Magento\Shipping\Test\Block\Order\Info + .block-order-details-view + css selector + + + diff --git a/dev/tests/functional/tests/app/Magento/Shipping/Test/Page/ShipmentView.xml b/dev/tests/functional/tests/app/Magento/Shipping/Test/Page/ShipmentView.xml new file mode 100644 index 0000000000000..3465a87ac2f54 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Shipping/Test/Page/ShipmentView.xml @@ -0,0 +1,15 @@ + + + + + + Magento\Shipping\Test\Block\Order\Shipment + .order-details-items + css selector + + + diff --git a/dev/tests/functional/tests/app/Magento/Shipping/Test/Repository/Method.php b/dev/tests/functional/tests/app/Magento/Shipping/Test/Repository/Method.php new file mode 100644 index 0000000000000..32a5d8a95562e --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Shipping/Test/Repository/Method.php @@ -0,0 +1,120 @@ +_data['default'] = [ + 'config' => $defaultConfig, + 'data' => $defaultData, + ]; + + $this->_data['free_shipping'] = $this->_getFreeShipping(); + $this->_data['flat_rate'] = $this->_getFlatRate(); + // Shipping carriers + $this->_data['dhl_eu'] = $this->_getDhlEU(); + $this->_data['dhl_uk'] = $this->_getDhlUK(); + $this->_data['fedex'] = $this->_getFedex(); + $this->_data['ups'] = $this->_getUps(); + $this->_data['usps'] = $this->_getUsps(); + } + + protected function _getFreeShipping() + { + return [ + 'data' => [ + 'fields' => [ + 'shipping_service' => 'Free Shipping', + 'shipping_method' => 'Free', + ], + ] + ]; + } + + protected function _getFlatRate() + { + return [ + 'data' => [ + 'fields' => [ + 'shipping_service' => 'Flat Rate', + 'shipping_method' => 'Fixed', + ], + ] + ]; + } + + protected function _getDhlEU() + { + return [ + 'data' => [ + 'fields' => [ + 'shipping_service' => 'DHL', + 'shipping_method' => 'Express worldwide', + ], + ] + ]; + } + + protected function _getDhlUK() + { + return [ + 'data' => [ + 'fields' => [ + 'shipping_service' => 'DHL', + 'shipping_method' => 'Domestic express', + ], + ] + ]; + } + + protected function _getFedex() + { + return [ + 'data' => [ + 'fields' => [ + 'shipping_service' => 'Federal Express', + 'shipping_method' => 'Ground', + ], + ] + ]; + } + + protected function _getUps() + { + return [ + 'data' => [ + 'fields' => [ + 'shipping_service' => 'United Parcel Service', + 'shipping_method' => 'Ground', + ], + ] + ]; + } + + protected function _getUsps() + { + return [ + 'data' => [ + 'fields' => [ + 'shipping_service' => 'United States Postal Service', + 'shipping_method' => 'Mail', /** @todo change to 'Priority Mail' when usps config is updated */ + ], + ] + ]; + } +} diff --git a/dev/tests/functional/tests/app/Magento/Shipping/Test/etc/constraint.xml b/dev/tests/functional/tests/app/Magento/Shipping/Test/etc/constraint.xml new file mode 100644 index 0000000000000..d722318c8177a --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Shipping/Test/etc/constraint.xml @@ -0,0 +1,29 @@ + + + + + low + + + low + + + low + + + low + + + low + + + low + + + low + + diff --git a/dev/tests/functional/tests/app/Magento/Shipping/Test/etc/fixture.xml b/dev/tests/functional/tests/app/Magento/Shipping/Test/etc/fixture.xml new file mode 100644 index 0000000000000..e4a0481b57055 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Shipping/Test/etc/fixture.xml @@ -0,0 +1,25 @@ + + + + + virtual + shipping + + + + shipping_service + virtual + + + shipping_method + virtual + + + + + + diff --git a/dev/tests/functional/tests/app/Magento/Shipping/Test/etc/page.xml b/dev/tests/functional/tests/app/Magento/Shipping/Test/etc/page.xml new file mode 100644 index 0000000000000..a5f4400a6fda0 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Shipping/Test/etc/page.xml @@ -0,0 +1,23 @@ + + + + + admin/order_shipment/new + adminhtml + Magento\Sales\Test\Page\Adminhtml\OrderShipmentNew + + + sales/shipment + adminhtml + Magento\Shipping\Test\Page\Adminhtml\ShipmentIndex + + + order_shipment/view + adminhtml + Magento\Shipping\Test\Page\Adminhtml\OrderShipmentView + + diff --git a/dev/tests/functional/tests/app/Magento/Sitemap/Test/Constraint/AssertSitemapContent.php b/dev/tests/functional/tests/app/Magento/Sitemap/Test/Constraint/AssertSitemapContent.php index 5b6f43a081a09..108dea9ad159b 100644 --- a/dev/tests/functional/tests/app/Magento/Sitemap/Test/Constraint/AssertSitemapContent.php +++ b/dev/tests/functional/tests/app/Magento/Sitemap/Test/Constraint/AssertSitemapContent.php @@ -18,12 +18,9 @@ */ class AssertSitemapContent extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that sitemap.xml file contains correct content according to dataset: diff --git a/dev/tests/functional/tests/app/Magento/Sitemap/Test/Constraint/AssertSitemapFailFolderSaveMessage.php b/dev/tests/functional/tests/app/Magento/Sitemap/Test/Constraint/AssertSitemapFailFolderSaveMessage.php index 7ee7996c9ca0d..b9e3669f34ab0 100644 --- a/dev/tests/functional/tests/app/Magento/Sitemap/Test/Constraint/AssertSitemapFailFolderSaveMessage.php +++ b/dev/tests/functional/tests/app/Magento/Sitemap/Test/Constraint/AssertSitemapFailFolderSaveMessage.php @@ -14,14 +14,11 @@ */ class AssertSitemapFailFolderSaveMessage extends AbstractConstraint { - const FAIL_FOLDER_MESSAGE = 'Please create the specified folder "%s" before saving the sitemap.'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + const FAIL_FOLDER_MESSAGE = 'Please create the specified folder "%s" before saving the sitemap.'; /** * Assert that error message is displayed after creating sitemap with wrong folder diff --git a/dev/tests/functional/tests/app/Magento/Sitemap/Test/Constraint/AssertSitemapFailPathSaveMessage.php b/dev/tests/functional/tests/app/Magento/Sitemap/Test/Constraint/AssertSitemapFailPathSaveMessage.php index e282eb331fbd6..3c6e69eeaf06f 100644 --- a/dev/tests/functional/tests/app/Magento/Sitemap/Test/Constraint/AssertSitemapFailPathSaveMessage.php +++ b/dev/tests/functional/tests/app/Magento/Sitemap/Test/Constraint/AssertSitemapFailPathSaveMessage.php @@ -14,14 +14,11 @@ */ class AssertSitemapFailPathSaveMessage extends AbstractConstraint { - const FAIL_PATH_MESSAGE = 'Path "/%s" is not available and cannot be used.'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + const FAIL_PATH_MESSAGE = 'Path "/%s" is not available and cannot be used.'; /** * Assert that error message is displayed after creating sitemap with wrong path diff --git a/dev/tests/functional/tests/app/Magento/Sitemap/Test/Constraint/AssertSitemapInGrid.php b/dev/tests/functional/tests/app/Magento/Sitemap/Test/Constraint/AssertSitemapInGrid.php index a0b778a44a81e..6e272f806148b 100644 --- a/dev/tests/functional/tests/app/Magento/Sitemap/Test/Constraint/AssertSitemapInGrid.php +++ b/dev/tests/functional/tests/app/Magento/Sitemap/Test/Constraint/AssertSitemapInGrid.php @@ -14,12 +14,9 @@ */ class AssertSitemapInGrid extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that sitemap availability in sitemap grid diff --git a/dev/tests/functional/tests/app/Magento/Sitemap/Test/Constraint/AssertSitemapNotInGrid.php b/dev/tests/functional/tests/app/Magento/Sitemap/Test/Constraint/AssertSitemapNotInGrid.php index 69f1896267b81..13d0a9d87b7c3 100644 --- a/dev/tests/functional/tests/app/Magento/Sitemap/Test/Constraint/AssertSitemapNotInGrid.php +++ b/dev/tests/functional/tests/app/Magento/Sitemap/Test/Constraint/AssertSitemapNotInGrid.php @@ -14,12 +14,9 @@ */ class AssertSitemapNotInGrid extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that sitemap not availability in sitemap grid diff --git a/dev/tests/functional/tests/app/Magento/Sitemap/Test/Constraint/AssertSitemapSuccessDeleteMessage.php b/dev/tests/functional/tests/app/Magento/Sitemap/Test/Constraint/AssertSitemapSuccessDeleteMessage.php index 2eefb99295dc5..63303aa1a56d3 100644 --- a/dev/tests/functional/tests/app/Magento/Sitemap/Test/Constraint/AssertSitemapSuccessDeleteMessage.php +++ b/dev/tests/functional/tests/app/Magento/Sitemap/Test/Constraint/AssertSitemapSuccessDeleteMessage.php @@ -13,14 +13,11 @@ */ class AssertSitemapSuccessDeleteMessage extends AbstractConstraint { - const SUCCESS_DELETE_MESSAGE = 'The sitemap has been deleted.'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + const SUCCESS_DELETE_MESSAGE = 'The sitemap has been deleted.'; /** * Assert that success message is displayed after sitemap delete diff --git a/dev/tests/functional/tests/app/Magento/Sitemap/Test/Constraint/AssertSitemapSuccessGenerateMessage.php b/dev/tests/functional/tests/app/Magento/Sitemap/Test/Constraint/AssertSitemapSuccessGenerateMessage.php index 4e17c680ee6a2..b60dd94793718 100644 --- a/dev/tests/functional/tests/app/Magento/Sitemap/Test/Constraint/AssertSitemapSuccessGenerateMessage.php +++ b/dev/tests/functional/tests/app/Magento/Sitemap/Test/Constraint/AssertSitemapSuccessGenerateMessage.php @@ -14,14 +14,11 @@ */ class AssertSitemapSuccessGenerateMessage extends AbstractConstraint { - const SUCCESS_GENERATE_MESSAGE = 'The sitemap "%s" has been generated.'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + const SUCCESS_GENERATE_MESSAGE = 'The sitemap "%s" has been generated.'; /** * Assert that success message is displayed after sitemap generate diff --git a/dev/tests/functional/tests/app/Magento/Sitemap/Test/Constraint/AssertSitemapSuccessSaveAndGenerateMessages.php b/dev/tests/functional/tests/app/Magento/Sitemap/Test/Constraint/AssertSitemapSuccessSaveAndGenerateMessages.php index 2c6aa227d2c80..1da3573347087 100644 --- a/dev/tests/functional/tests/app/Magento/Sitemap/Test/Constraint/AssertSitemapSuccessSaveAndGenerateMessages.php +++ b/dev/tests/functional/tests/app/Magento/Sitemap/Test/Constraint/AssertSitemapSuccessSaveAndGenerateMessages.php @@ -14,17 +14,14 @@ */ class AssertSitemapSuccessSaveAndGenerateMessages extends AbstractConstraint { + /* tags */ + const SEVERITY = 'low'; + /* end tags */ + const SUCCESS_GENERATE_MESSAGE = 'The sitemap "%s" has been generated.'; const SUCCESS_SAVE_MESSAGE = 'The sitemap has been saved.'; - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; - /** * Assert that success messages is displayed after sitemap generate * diff --git a/dev/tests/functional/tests/app/Magento/Sitemap/Test/Constraint/AssertSitemapSuccessSaveMessage.php b/dev/tests/functional/tests/app/Magento/Sitemap/Test/Constraint/AssertSitemapSuccessSaveMessage.php index 559021d499df5..ea7fc78a0262a 100644 --- a/dev/tests/functional/tests/app/Magento/Sitemap/Test/Constraint/AssertSitemapSuccessSaveMessage.php +++ b/dev/tests/functional/tests/app/Magento/Sitemap/Test/Constraint/AssertSitemapSuccessSaveMessage.php @@ -13,14 +13,11 @@ */ class AssertSitemapSuccessSaveMessage extends AbstractConstraint { - const SUCCESS_MESSAGE = 'The sitemap has been saved.'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + const SUCCESS_MESSAGE = 'The sitemap has been saved.'; /** * Assert that success message is displayed after sitemap save diff --git a/dev/tests/functional/tests/app/Magento/Sitemap/Test/TestCase/GenerateSitemapEntityTest.php b/dev/tests/functional/tests/app/Magento/Sitemap/Test/TestCase/GenerateSitemapEntityTest.php deleted file mode 100644 index 4c4dc5d06abf9..0000000000000 --- a/dev/tests/functional/tests/app/Magento/Sitemap/Test/TestCase/GenerateSitemapEntityTest.php +++ /dev/null @@ -1,92 +0,0 @@ - SEO and Search > Site Map. - * 3. Click "Add Sitemap" button. - * 4. Fill out all data according to data set. - * 5. Click "Save" button. - * 6. Perform all assertions. - * - * @group XML_Sitemap_(MX) - * @ZephyrId MAGETWO-25124 - */ -class GenerateSitemapEntityTest extends Injectable -{ - /** - * Sitemap grid page - * - * @var SitemapIndex - */ - protected $sitemapIndex; - - /** - * Sitemap new page - * - * @var SitemapNew - */ - protected $sitemapNew; - - /** - * Inject data - * - * @param SitemapIndex $sitemapIndex - * @param SitemapNew $sitemapNew - * @return void - */ - public function __inject( - SitemapIndex $sitemapIndex, - SitemapNew $sitemapNew - ) { - $this->sitemapIndex = $sitemapIndex; - $this->sitemapNew = $sitemapNew; - } - - /** - * Generate Sitemap Entity - * - * @param Sitemap $sitemap - * @param CatalogProductSimple $product - * @param CatalogCategory $catalog - * @param CmsPage $cmsPage - * @return void - */ - public function testGenerateSitemap( - Sitemap $sitemap, - CatalogProductSimple $product, - CatalogCategory $catalog, - CmsPage $cmsPage - ) { - // Preconditions - $product->persist(); - $catalog->persist(); - $cmsPage->persist(); - - // Steps - $this->sitemapIndex->open(); - $this->sitemapIndex->getGridPageActions()->addNew(); - $this->sitemapNew->getSitemapForm()->fill($sitemap); - $this->sitemapNew->getSitemapPageActions()->saveAndGenerate(); - } -} diff --git a/dev/tests/functional/tests/app/Magento/Sitemap/Test/TestCase/GenerateSitemapEntityTest/testGenerateSitemap.csv b/dev/tests/functional/tests/app/Magento/Sitemap/Test/TestCase/GenerateSitemapEntityTest/testGenerateSitemap.csv deleted file mode 100644 index 8a3137d9e6e79..0000000000000 --- a/dev/tests/functional/tests/app/Magento/Sitemap/Test/TestCase/GenerateSitemapEntityTest/testGenerateSitemap.csv +++ /dev/null @@ -1,2 +0,0 @@ -"catalog/dataSet";"product/dataSet";"cmsPage/dataSet";"sitemap/data/sitemap_filename";"sitemap/data/sitemap_path";"constraint" -"default_subcategory";"default";"default";"sitemap.xml";"/";"assertSitemapSuccessSaveAndGenerateMessages, assertSitemapContent, assertSitemapInGrid" \ No newline at end of file diff --git a/dev/tests/functional/tests/app/Magento/Sitemap/Test/TestCase/UpdateSitemapEntityTest.php b/dev/tests/functional/tests/app/Magento/Sitemap/Test/TestCase/UpdateSitemapEntityTest.php deleted file mode 100644 index 5240ddf5aa5c1..0000000000000 --- a/dev/tests/functional/tests/app/Magento/Sitemap/Test/TestCase/UpdateSitemapEntityTest.php +++ /dev/null @@ -1,83 +0,0 @@ - SEO & Search: Site Map - * 3. Click 'Generate' In the grid for sitemap from preconditions - * 4. Perform all assertions - * - * @group XML_Sitemap_(PS) - * @ZephyrId MAGETWO-25362 - */ -class UpdateSitemapEntityTest extends Injectable -{ - /** - * Sitemap grid page - * - * @var SitemapIndex - */ - protected $sitemapIndex; - - /** - * Inject data - * - * @param SitemapIndex $sitemapIndex - * @return void - */ - public function __inject(SitemapIndex $sitemapIndex) - { - $this->sitemapIndex = $sitemapIndex; - } - - /** - * Update Sitemap Entity - * - * @param Sitemap $sitemap - * @param CatalogProductSimple $product - * @param CatalogCategory $catalog - * @param CmsPage $cmsPage - * @return void - */ - public function testUpdateSitemap( - Sitemap $sitemap, - CatalogProductSimple $product, - CatalogCategory $catalog, - CmsPage $cmsPage - ) { - // Preconditions - $sitemap->persist(); - $product->persist(); - $catalog->persist(); - $cmsPage->persist(); - $filter = [ - 'sitemap_filename' => $sitemap->getSitemapFilename(), - 'sitemap_path' => $sitemap->getSitemapPath(), - 'sitemap_id' => $sitemap->getSitemapId(), - ]; - - // Steps - $this->sitemapIndex->open()->getSitemapGrid()->search($filter); - $this->sitemapIndex->getSitemapGrid()->generate(); - } -} diff --git a/dev/tests/functional/tests/app/Magento/Sitemap/Test/TestCase/UpdateSitemapEntityTest/testUpdateSitemap.csv b/dev/tests/functional/tests/app/Magento/Sitemap/Test/TestCase/UpdateSitemapEntityTest/testUpdateSitemap.csv deleted file mode 100644 index e7967ddf2af6a..0000000000000 --- a/dev/tests/functional/tests/app/Magento/Sitemap/Test/TestCase/UpdateSitemapEntityTest/testUpdateSitemap.csv +++ /dev/null @@ -1,2 +0,0 @@ -"catalog/dataSet";"product/dataSet";"cmsPage/dataSet";"sitemap/dataSet";"constraint" -"default_subcategory";"default";"default";"default";"assertSitemapSuccessGenerateMessage, assertSitemapContent" diff --git a/dev/tests/functional/tests/app/Magento/Sitemap/Test/etc/constraint.xml b/dev/tests/functional/tests/app/Magento/Sitemap/Test/etc/constraint.xml index 6cd73616a8347..c9f2f772e613b 100644 --- a/dev/tests/functional/tests/app/Magento/Sitemap/Test/etc/constraint.xml +++ b/dev/tests/functional/tests/app/Magento/Sitemap/Test/etc/constraint.xml @@ -6,30 +6,30 @@ --> - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low diff --git a/dev/tests/functional/tests/app/Magento/Store/Test/Constraint/AssertStoreBackend.php b/dev/tests/functional/tests/app/Magento/Store/Test/Constraint/AssertStoreBackend.php index d6658afe5c669..02aed4f08755b 100644 --- a/dev/tests/functional/tests/app/Magento/Store/Test/Constraint/AssertStoreBackend.php +++ b/dev/tests/functional/tests/app/Magento/Store/Test/Constraint/AssertStoreBackend.php @@ -15,12 +15,9 @@ */ class AssertStoreBackend extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that created store view displays in backend configuration (Stores > Configuration > "Scope" dropdown) diff --git a/dev/tests/functional/tests/app/Magento/Store/Test/Constraint/AssertStoreForm.php b/dev/tests/functional/tests/app/Magento/Store/Test/Constraint/AssertStoreForm.php index 2557fe928caf7..6bb5a4f315a3c 100644 --- a/dev/tests/functional/tests/app/Magento/Store/Test/Constraint/AssertStoreForm.php +++ b/dev/tests/functional/tests/app/Magento/Store/Test/Constraint/AssertStoreForm.php @@ -16,12 +16,9 @@ */ class AssertStoreForm extends AbstractAssertForm { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that displayed Store View data on edit page equals passed from fixture diff --git a/dev/tests/functional/tests/app/Magento/Store/Test/Constraint/AssertStoreFrontend.php b/dev/tests/functional/tests/app/Magento/Store/Test/Constraint/AssertStoreFrontend.php index 5a378b26cfb9b..882579dc9e77d 100644 --- a/dev/tests/functional/tests/app/Magento/Store/Test/Constraint/AssertStoreFrontend.php +++ b/dev/tests/functional/tests/app/Magento/Store/Test/Constraint/AssertStoreFrontend.php @@ -15,12 +15,9 @@ */ class AssertStoreFrontend extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that created store view available on frontend (store view selector on page top) diff --git a/dev/tests/functional/tests/app/Magento/Store/Test/Constraint/AssertStoreGroupForm.php b/dev/tests/functional/tests/app/Magento/Store/Test/Constraint/AssertStoreGroupForm.php index 955a9e605f433..eb4c8dbcc0a68 100644 --- a/dev/tests/functional/tests/app/Magento/Store/Test/Constraint/AssertStoreGroupForm.php +++ b/dev/tests/functional/tests/app/Magento/Store/Test/Constraint/AssertStoreGroupForm.php @@ -16,12 +16,9 @@ */ class AssertStoreGroupForm extends AbstractAssertForm { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Skipped fields for verify data diff --git a/dev/tests/functional/tests/app/Magento/Store/Test/Constraint/AssertStoreGroupInGrid.php b/dev/tests/functional/tests/app/Magento/Store/Test/Constraint/AssertStoreGroupInGrid.php index 2bd403cf3ea2c..c6a9051484e1f 100644 --- a/dev/tests/functional/tests/app/Magento/Store/Test/Constraint/AssertStoreGroupInGrid.php +++ b/dev/tests/functional/tests/app/Magento/Store/Test/Constraint/AssertStoreGroupInGrid.php @@ -15,12 +15,9 @@ */ class AssertStoreGroupInGrid extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that created Store Group can be found in Stores grid by name diff --git a/dev/tests/functional/tests/app/Magento/Store/Test/Constraint/AssertStoreGroupNotInGrid.php b/dev/tests/functional/tests/app/Magento/Store/Test/Constraint/AssertStoreGroupNotInGrid.php index 1ba55fbb0d337..fda67c4c40da0 100644 --- a/dev/tests/functional/tests/app/Magento/Store/Test/Constraint/AssertStoreGroupNotInGrid.php +++ b/dev/tests/functional/tests/app/Magento/Store/Test/Constraint/AssertStoreGroupNotInGrid.php @@ -15,12 +15,9 @@ */ class AssertStoreGroupNotInGrid extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that created Store Group can not be found in Stores grid by name diff --git a/dev/tests/functional/tests/app/Magento/Store/Test/Constraint/AssertStoreGroupOnStoreViewForm.php b/dev/tests/functional/tests/app/Magento/Store/Test/Constraint/AssertStoreGroupOnStoreViewForm.php index 80b3ac7260950..a5994564c4ab9 100644 --- a/dev/tests/functional/tests/app/Magento/Store/Test/Constraint/AssertStoreGroupOnStoreViewForm.php +++ b/dev/tests/functional/tests/app/Magento/Store/Test/Constraint/AssertStoreGroupOnStoreViewForm.php @@ -16,12 +16,9 @@ */ class AssertStoreGroupOnStoreViewForm extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that New Store Group visible on StoreView Form in Store dropdown diff --git a/dev/tests/functional/tests/app/Magento/Store/Test/Constraint/AssertStoreGroupSuccessDeleteAndBackupMessages.php b/dev/tests/functional/tests/app/Magento/Store/Test/Constraint/AssertStoreGroupSuccessDeleteAndBackupMessages.php index 21cfb5150ff02..d43aab2aeb6fc 100644 --- a/dev/tests/functional/tests/app/Magento/Store/Test/Constraint/AssertStoreGroupSuccessDeleteAndBackupMessages.php +++ b/dev/tests/functional/tests/app/Magento/Store/Test/Constraint/AssertStoreGroupSuccessDeleteAndBackupMessages.php @@ -14,6 +14,10 @@ */ class AssertStoreGroupSuccessDeleteAndBackupMessages extends AbstractConstraint { + /* tags */ + const SEVERITY = 'low'; + /* end tags */ + /** * Success backup message */ @@ -24,13 +28,6 @@ class AssertStoreGroupSuccessDeleteAndBackupMessages extends AbstractConstraint */ const SUCCESS_DELETE_MESSAGE = 'The store has been deleted.'; - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; - /** * Assert that success messages is displayed after deleting store group * diff --git a/dev/tests/functional/tests/app/Magento/Store/Test/Constraint/AssertStoreGroupSuccessDeleteMessage.php b/dev/tests/functional/tests/app/Magento/Store/Test/Constraint/AssertStoreGroupSuccessDeleteMessage.php index 79319bc2e0057..0ac251b637021 100644 --- a/dev/tests/functional/tests/app/Magento/Store/Test/Constraint/AssertStoreGroupSuccessDeleteMessage.php +++ b/dev/tests/functional/tests/app/Magento/Store/Test/Constraint/AssertStoreGroupSuccessDeleteMessage.php @@ -14,18 +14,15 @@ */ class AssertStoreGroupSuccessDeleteMessage extends AbstractConstraint { + /* tags */ + const SEVERITY = 'low'; + /* end tags */ + /** * Success store group delete message */ const SUCCESS_DELETE_MESSAGE = 'The store has been deleted.'; - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; - /** * Assert that success message is displayed after deleting store group * diff --git a/dev/tests/functional/tests/app/Magento/Store/Test/Constraint/AssertStoreGroupSuccessSaveMessage.php b/dev/tests/functional/tests/app/Magento/Store/Test/Constraint/AssertStoreGroupSuccessSaveMessage.php index a67c56fca06a7..91ac06a03f11b 100644 --- a/dev/tests/functional/tests/app/Magento/Store/Test/Constraint/AssertStoreGroupSuccessSaveMessage.php +++ b/dev/tests/functional/tests/app/Magento/Store/Test/Constraint/AssertStoreGroupSuccessSaveMessage.php @@ -14,18 +14,15 @@ */ class AssertStoreGroupSuccessSaveMessage extends AbstractConstraint { + /* tags */ + const SEVERITY = 'low'; + /* end tags */ + /** * Success store create message */ const SUCCESS_MESSAGE = 'The store has been saved.'; - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; - /** * Assert that success message is displayed after Store Group has been created * diff --git a/dev/tests/functional/tests/app/Magento/Store/Test/Constraint/AssertStoreInGrid.php b/dev/tests/functional/tests/app/Magento/Store/Test/Constraint/AssertStoreInGrid.php index 6ceb4738a515b..800a512f99543 100644 --- a/dev/tests/functional/tests/app/Magento/Store/Test/Constraint/AssertStoreInGrid.php +++ b/dev/tests/functional/tests/app/Magento/Store/Test/Constraint/AssertStoreInGrid.php @@ -15,12 +15,9 @@ */ class AssertStoreInGrid extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that created Store View can be found in Stores grid by name diff --git a/dev/tests/functional/tests/app/Magento/Store/Test/Constraint/AssertStoreNotInGrid.php b/dev/tests/functional/tests/app/Magento/Store/Test/Constraint/AssertStoreNotInGrid.php index 77654a35ae9d5..5ba7ce2a1e759 100644 --- a/dev/tests/functional/tests/app/Magento/Store/Test/Constraint/AssertStoreNotInGrid.php +++ b/dev/tests/functional/tests/app/Magento/Store/Test/Constraint/AssertStoreNotInGrid.php @@ -15,12 +15,9 @@ */ class AssertStoreNotInGrid extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that created Store can not be found in Stores grid by name diff --git a/dev/tests/functional/tests/app/Magento/Store/Test/Constraint/AssertStoreNotOnFrontend.php b/dev/tests/functional/tests/app/Magento/Store/Test/Constraint/AssertStoreNotOnFrontend.php index a8de5157cdbf2..cd60d922e6b1e 100644 --- a/dev/tests/functional/tests/app/Magento/Store/Test/Constraint/AssertStoreNotOnFrontend.php +++ b/dev/tests/functional/tests/app/Magento/Store/Test/Constraint/AssertStoreNotOnFrontend.php @@ -15,12 +15,9 @@ */ class AssertStoreNotOnFrontend extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that created store view is not available on frontend (store view selector on page top) diff --git a/dev/tests/functional/tests/app/Magento/Store/Test/Constraint/AssertStoreSuccessDeleteAndBackupMessages.php b/dev/tests/functional/tests/app/Magento/Store/Test/Constraint/AssertStoreSuccessDeleteAndBackupMessages.php index 21d6841aa8c0c..4789b621301bb 100644 --- a/dev/tests/functional/tests/app/Magento/Store/Test/Constraint/AssertStoreSuccessDeleteAndBackupMessages.php +++ b/dev/tests/functional/tests/app/Magento/Store/Test/Constraint/AssertStoreSuccessDeleteAndBackupMessages.php @@ -14,6 +14,10 @@ */ class AssertStoreSuccessDeleteAndBackupMessages extends AbstractConstraint { + /* tags */ + const SEVERITY = 'low'; + /* end tags */ + /** * Success backup message */ @@ -24,13 +28,6 @@ class AssertStoreSuccessDeleteAndBackupMessages extends AbstractConstraint */ const SUCCESS_DELETE_MESSAGE = 'The store view has been deleted.'; - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; - /** * Assert that store success delete and backup messages are present * diff --git a/dev/tests/functional/tests/app/Magento/Store/Test/Constraint/AssertStoreSuccessDeleteMessage.php b/dev/tests/functional/tests/app/Magento/Store/Test/Constraint/AssertStoreSuccessDeleteMessage.php index 45bc94d23a00b..39c153045062c 100644 --- a/dev/tests/functional/tests/app/Magento/Store/Test/Constraint/AssertStoreSuccessDeleteMessage.php +++ b/dev/tests/functional/tests/app/Magento/Store/Test/Constraint/AssertStoreSuccessDeleteMessage.php @@ -14,18 +14,15 @@ */ class AssertStoreSuccessDeleteMessage extends AbstractConstraint { + /* tags */ + const SEVERITY = 'low'; + /* end tags */ + /** * Success store delete message */ const SUCCESS_DELETE_MESSAGE = 'The store view has been deleted.'; - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; - /** * Assert that after store delete successful message appears * diff --git a/dev/tests/functional/tests/app/Magento/Store/Test/Constraint/AssertStoreSuccessSaveMessage.php b/dev/tests/functional/tests/app/Magento/Store/Test/Constraint/AssertStoreSuccessSaveMessage.php index ac5208b027162..4772b8a5789de 100644 --- a/dev/tests/functional/tests/app/Magento/Store/Test/Constraint/AssertStoreSuccessSaveMessage.php +++ b/dev/tests/functional/tests/app/Magento/Store/Test/Constraint/AssertStoreSuccessSaveMessage.php @@ -14,18 +14,15 @@ */ class AssertStoreSuccessSaveMessage extends AbstractConstraint { + /* tags */ + const SEVERITY = 'low'; + /* end tags */ + /** * Success store view create message */ const SUCCESS_MESSAGE = 'The store view has been saved'; - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; - /** * Assert that success message is displayed after Store View has been created * diff --git a/dev/tests/functional/tests/app/Magento/Store/Test/Constraint/AssertWebsiteForm.php b/dev/tests/functional/tests/app/Magento/Store/Test/Constraint/AssertWebsiteForm.php index aafa658db9608..768810a991a6e 100644 --- a/dev/tests/functional/tests/app/Magento/Store/Test/Constraint/AssertWebsiteForm.php +++ b/dev/tests/functional/tests/app/Magento/Store/Test/Constraint/AssertWebsiteForm.php @@ -16,12 +16,9 @@ */ class AssertWebsiteForm extends AbstractAssertForm { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Skipped fields for verify data diff --git a/dev/tests/functional/tests/app/Magento/Store/Test/Constraint/AssertWebsiteInGrid.php b/dev/tests/functional/tests/app/Magento/Store/Test/Constraint/AssertWebsiteInGrid.php index b96fc41b0ece9..f783137d79026 100644 --- a/dev/tests/functional/tests/app/Magento/Store/Test/Constraint/AssertWebsiteInGrid.php +++ b/dev/tests/functional/tests/app/Magento/Store/Test/Constraint/AssertWebsiteInGrid.php @@ -15,12 +15,9 @@ */ class AssertWebsiteInGrid extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that created Website can be found in Stores grid by name diff --git a/dev/tests/functional/tests/app/Magento/Store/Test/Constraint/AssertWebsiteNotInGrid.php b/dev/tests/functional/tests/app/Magento/Store/Test/Constraint/AssertWebsiteNotInGrid.php index 026cd7ca95e06..3bc71b517f23f 100644 --- a/dev/tests/functional/tests/app/Magento/Store/Test/Constraint/AssertWebsiteNotInGrid.php +++ b/dev/tests/functional/tests/app/Magento/Store/Test/Constraint/AssertWebsiteNotInGrid.php @@ -15,12 +15,9 @@ */ class AssertWebsiteNotInGrid extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that created Website can't be found in grid by name diff --git a/dev/tests/functional/tests/app/Magento/Store/Test/Constraint/AssertWebsiteOnStoreForm.php b/dev/tests/functional/tests/app/Magento/Store/Test/Constraint/AssertWebsiteOnStoreForm.php index 919b1c51f185c..d5283ec4c60f7 100644 --- a/dev/tests/functional/tests/app/Magento/Store/Test/Constraint/AssertWebsiteOnStoreForm.php +++ b/dev/tests/functional/tests/app/Magento/Store/Test/Constraint/AssertWebsiteOnStoreForm.php @@ -16,12 +16,9 @@ */ class AssertWebsiteOnStoreForm extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that Website visible on Store Group Form in Website dropdown diff --git a/dev/tests/functional/tests/app/Magento/Store/Test/Constraint/AssertWebsiteSuccessDeleteAndBackupMessages.php b/dev/tests/functional/tests/app/Magento/Store/Test/Constraint/AssertWebsiteSuccessDeleteAndBackupMessages.php index 7d1abde864aa2..e532649816079 100644 --- a/dev/tests/functional/tests/app/Magento/Store/Test/Constraint/AssertWebsiteSuccessDeleteAndBackupMessages.php +++ b/dev/tests/functional/tests/app/Magento/Store/Test/Constraint/AssertWebsiteSuccessDeleteAndBackupMessages.php @@ -14,6 +14,10 @@ */ class AssertWebsiteSuccessDeleteAndBackupMessages extends AbstractConstraint { + /* tags */ + const SEVERITY = 'low'; + /* end tags */ + /** * Success backup message */ @@ -24,13 +28,6 @@ class AssertWebsiteSuccessDeleteAndBackupMessages extends AbstractConstraint */ const SUCCESS_DELETE_MESSAGE = 'The website has been deleted.'; - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; - /** * Assert that success messages is displayed after deleting website * diff --git a/dev/tests/functional/tests/app/Magento/Store/Test/Constraint/AssertWebsiteSuccessDeleteMessage.php b/dev/tests/functional/tests/app/Magento/Store/Test/Constraint/AssertWebsiteSuccessDeleteMessage.php index 7a8b5821ecd9d..761553eab506e 100644 --- a/dev/tests/functional/tests/app/Magento/Store/Test/Constraint/AssertWebsiteSuccessDeleteMessage.php +++ b/dev/tests/functional/tests/app/Magento/Store/Test/Constraint/AssertWebsiteSuccessDeleteMessage.php @@ -14,18 +14,15 @@ */ class AssertWebsiteSuccessDeleteMessage extends AbstractConstraint { + /* tags */ + const SEVERITY = 'low'; + /* end tags */ + /** * Success website delete message */ const SUCCESS_DELETE_MESSAGE = 'The website has been deleted.'; - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; - /** * Assert that success message is displayed after deleting website * diff --git a/dev/tests/functional/tests/app/Magento/Store/Test/Constraint/AssertWebsiteSuccessSaveMessage.php b/dev/tests/functional/tests/app/Magento/Store/Test/Constraint/AssertWebsiteSuccessSaveMessage.php index 0b1c5e4a77ff4..1e64f22bc3168 100644 --- a/dev/tests/functional/tests/app/Magento/Store/Test/Constraint/AssertWebsiteSuccessSaveMessage.php +++ b/dev/tests/functional/tests/app/Magento/Store/Test/Constraint/AssertWebsiteSuccessSaveMessage.php @@ -14,18 +14,15 @@ */ class AssertWebsiteSuccessSaveMessage extends AbstractConstraint { + /* tags */ + const SEVERITY = 'low'; + /* end tags */ + /** * Success website create message */ const SUCCESS_MESSAGE = 'The website has been saved.'; - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; - /** * Assert that success message is displayed after Website has been created * diff --git a/dev/tests/functional/tests/app/Magento/Store/Test/TestCase/DeleteStoreEntityTest.php b/dev/tests/functional/tests/app/Magento/Store/Test/TestCase/DeleteStoreEntityTest.php index 74ff7199808e2..9d48de56e37bd 100644 --- a/dev/tests/functional/tests/app/Magento/Store/Test/TestCase/DeleteStoreEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/Store/Test/TestCase/DeleteStoreEntityTest.php @@ -100,6 +100,6 @@ public function test(Store $store, $createBackup) $this->storeIndex->getStoreGrid()->searchAndOpenStore($store); $this->editStore->getFormPageActions()->delete(); $this->storeDelete->getStoreForm()->fillForm(['create_backup' => $createBackup]); - $this->storeDelete->getFormPageFooterActions()->delete(); + $this->storeDelete->getFormPageActions()->delete(); } } diff --git a/dev/tests/functional/tests/app/Magento/Store/Test/TestCase/DeleteStoreGroupEntityTest.php b/dev/tests/functional/tests/app/Magento/Store/Test/TestCase/DeleteStoreGroupEntityTest.php index 1a5817d2d0ac2..3227833d67e76 100644 --- a/dev/tests/functional/tests/app/Magento/Store/Test/TestCase/DeleteStoreGroupEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/Store/Test/TestCase/DeleteStoreGroupEntityTest.php @@ -102,6 +102,6 @@ public function test(StoreGroup $storeGroup, $createBackup) $this->storeIndex->getStoreGrid()->searchAndOpenStoreGroup($storeGroup); $this->editGroup->getFormPageActions()->delete(); $this->deleteGroup->getDeleteGroupForm()->fillForm(['create_backup' => $createBackup]); - $this->deleteGroup->getFormPageFooterActions()->delete(); + $this->deleteGroup->getFormPageActions()->delete(); } } diff --git a/dev/tests/functional/tests/app/Magento/Store/Test/TestCase/DeleteWebsiteEntityTest.php b/dev/tests/functional/tests/app/Magento/Store/Test/TestCase/DeleteWebsiteEntityTest.php index 1bdd06c91fc37..66f06e8fbe61e 100644 --- a/dev/tests/functional/tests/app/Magento/Store/Test/TestCase/DeleteWebsiteEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/Store/Test/TestCase/DeleteWebsiteEntityTest.php @@ -102,6 +102,6 @@ public function test(Website $website, $createBackup) $this->storeIndex->getStoreGrid()->searchAndOpenWebsite($website); $this->editWebsite->getFormPageActions()->delete(); $this->deleteWebsite->getDeleteWebsiteForm()->fillForm(['create_backup' => $createBackup]); - $this->deleteWebsite->getFormPageFooterActions()->delete(); + $this->deleteWebsite->getFormPageActions()->delete(); } } diff --git a/dev/tests/functional/tests/app/Magento/Store/Test/etc/constraint.xml b/dev/tests/functional/tests/app/Magento/Store/Test/etc/constraint.xml index 4c64f9b0ecd9c..da43ec969ced1 100644 --- a/dev/tests/functional/tests/app/Magento/Store/Test/etc/constraint.xml +++ b/dev/tests/functional/tests/app/Magento/Store/Test/etc/constraint.xml @@ -6,78 +6,78 @@ --> - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low diff --git a/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertTaxRateForm.php b/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertTaxRateForm.php index fdec5c70f0bff..a09c55df53cc2 100644 --- a/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertTaxRateForm.php +++ b/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertTaxRateForm.php @@ -15,12 +15,9 @@ */ class AssertTaxRateForm extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'high'; + /* tags */ + const SEVERITY = 'high'; + /* end tags */ /** * Assert that tax rate form filled correctly @@ -69,6 +66,7 @@ protected function prepareData(array $data) } else { unset($data['zip_from'], $data['zip_to']); } + $data['rate'] = number_format($data['rate'], 4); return $data; } diff --git a/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertTaxRateInGrid.php b/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertTaxRateInGrid.php index 65b5da52bb96a..fb270ab259ce1 100644 --- a/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertTaxRateInGrid.php +++ b/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertTaxRateInGrid.php @@ -14,12 +14,9 @@ */ class AssertTaxRateInGrid extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'high'; + /* tags */ + const SEVERITY = 'high'; + /* end tags */ /** * Assert tax rule availability in Tax Rate grid diff --git a/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertTaxRateInTaxRule.php b/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertTaxRateInTaxRule.php index a54589348c8f5..efed34b3f6e6e 100644 --- a/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertTaxRateInTaxRule.php +++ b/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertTaxRateInTaxRule.php @@ -12,12 +12,9 @@ */ class AssertTaxRateInTaxRule extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * @return void diff --git a/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertTaxRateIsInCorrectRange.php b/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertTaxRateIsInCorrectRange.php index 51236eea84069..691a3fda7cb20 100644 --- a/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertTaxRateIsInCorrectRange.php +++ b/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertTaxRateIsInCorrectRange.php @@ -12,12 +12,9 @@ */ class AssertTaxRateIsInCorrectRange extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * @return void diff --git a/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertTaxRateNotInGrid.php b/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertTaxRateNotInGrid.php index b331009964523..cb89722285ef3 100644 --- a/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertTaxRateNotInGrid.php +++ b/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertTaxRateNotInGrid.php @@ -14,12 +14,9 @@ */ class AssertTaxRateNotInGrid extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'high'; + /* tags */ + const SEVERITY = 'high'; + /* end tags */ /** * Assert that tax rate not available in Tax Rate grid diff --git a/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertTaxRateNotInTaxRule.php b/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertTaxRateNotInTaxRule.php index 979175de60f22..b6015c3e57b4b 100644 --- a/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertTaxRateNotInTaxRule.php +++ b/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertTaxRateNotInTaxRule.php @@ -14,12 +14,9 @@ */ class AssertTaxRateNotInTaxRule extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'high'; + /* tags */ + const SEVERITY = 'high'; + /* end tags */ /** * Assert that tax rate is absent in tax rule form diff --git a/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertTaxRateSuccessDeleteMessage.php b/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertTaxRateSuccessDeleteMessage.php index 80ce8e1582ff3..793c1d32c7efb 100644 --- a/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertTaxRateSuccessDeleteMessage.php +++ b/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertTaxRateSuccessDeleteMessage.php @@ -13,14 +13,11 @@ */ class AssertTaxRateSuccessDeleteMessage extends AbstractConstraint { - const SUCCESS_DELETE_MESSAGE = 'The tax rate has been deleted.'; + /* tags */ + const SEVERITY = 'high'; + /* end tags */ - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'high'; + const SUCCESS_DELETE_MESSAGE = 'The tax rate has been deleted.'; /** * Assert that success delete message is displayed after tax rate deleted diff --git a/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertTaxRateSuccessSaveMessage.php b/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertTaxRateSuccessSaveMessage.php index 0e49736f61315..ee423b128ad03 100644 --- a/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertTaxRateSuccessSaveMessage.php +++ b/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertTaxRateSuccessSaveMessage.php @@ -13,14 +13,11 @@ */ class AssertTaxRateSuccessSaveMessage extends AbstractConstraint { - const SUCCESS_MESSAGE = 'The tax rate has been saved.'; + /* tags */ + const SEVERITY = 'high'; + /* end tags */ - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'high'; + const SUCCESS_MESSAGE = 'The tax rate has been saved.'; /** * Assert that success message is displayed after tax rate saved diff --git a/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertTaxRuleForm.php b/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertTaxRuleForm.php index dc08945f555e2..2da55c6b88294 100644 --- a/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertTaxRuleForm.php +++ b/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertTaxRuleForm.php @@ -15,12 +15,9 @@ */ class AssertTaxRuleForm extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'high'; + /* tags */ + const SEVERITY = 'high'; + /* end tags */ /** * Assert that tax rule form filled right diff --git a/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertTaxRuleInGrid.php b/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertTaxRuleInGrid.php index 85c8d5e0da535..61263b8e73140 100644 --- a/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertTaxRuleInGrid.php +++ b/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertTaxRuleInGrid.php @@ -14,12 +14,9 @@ */ class AssertTaxRuleInGrid extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'high'; + /* tags */ + const SEVERITY = 'high'; + /* end tags */ /** * Assert tax rule availability in Tax Rule grid diff --git a/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertTaxRuleIsApplied.php b/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertTaxRuleIsApplied.php index 9ca882c846d1b..a8525b09c479e 100644 --- a/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertTaxRuleIsApplied.php +++ b/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertTaxRuleIsApplied.php @@ -10,12 +10,9 @@ */ class AssertTaxRuleIsApplied extends AssertTaxRuleApplying { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'high'; + /* tags */ + const SEVERITY = 'high'; + /* end tags */ /** * Assert that tax rule is applied on product in shopping cart. diff --git a/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertTaxRuleIsAppliedToAllPrices.php b/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertTaxRuleIsAppliedToAllPrices.php index 73cfcca5f4c7a..ac4a53f3f3131 100644 --- a/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertTaxRuleIsAppliedToAllPrices.php +++ b/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertTaxRuleIsAppliedToAllPrices.php @@ -20,6 +20,10 @@ */ class AssertTaxRuleIsAppliedToAllPrices extends AbstractConstraint { + /* tags */ + const SEVERITY = 'high'; + /* end tags */ + /** * Cms index page * @@ -48,13 +52,6 @@ class AssertTaxRuleIsAppliedToAllPrices extends AbstractConstraint */ protected $checkoutCart; - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'high'; - /** * Assert that specified prices are actual on category, product and cart pages * @@ -162,14 +159,14 @@ public function getProductPagePrices($actualPrices) */ public function getCartPrices(CatalogProductSimple $product, $actualPrices) { - $actualPrices['cart_item_price_excl_tax'] = - $this->checkoutCart->getCartBlock()->getCartItem($product)->getPrice(); - $actualPrices['cart_item_price_incl_tax'] = - $this->checkoutCart->getCartBlock()->getCartItem($product)->getPriceInclTax(); $actualPrices['cart_item_subtotal_excl_tax'] = $this->checkoutCart->getCartBlock()->getCartItem($product)->getSubtotalPrice(); $actualPrices['cart_item_subtotal_incl_tax'] = $this->checkoutCart->getCartBlock()->getCartItem($product)->getSubtotalPriceInclTax(); + $actualPrices['cart_item_price_excl_tax'] = + $this->checkoutCart->getCartBlock()->getCartItem($product)->getPrice(); + $actualPrices['cart_item_price_incl_tax'] = + $this->checkoutCart->getCartBlock()->getCartItem($product)->getPriceInclTax(); return $actualPrices; } diff --git a/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertTaxRuleIsNotApplied.php b/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertTaxRuleIsNotApplied.php index c99ef7989e517..d3df0e46cbc4f 100644 --- a/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertTaxRuleIsNotApplied.php +++ b/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertTaxRuleIsNotApplied.php @@ -10,12 +10,9 @@ */ class AssertTaxRuleIsNotApplied extends AssertTaxRuleApplying { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'high'; + /* tags */ + const SEVERITY = 'high'; + /* end tags */ /** * Assert that tax rule is not applied on product in shopping cart. diff --git a/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertTaxRuleNotInGrid.php b/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertTaxRuleNotInGrid.php index a424b1e11a165..01b38ea99c3f4 100644 --- a/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertTaxRuleNotInGrid.php +++ b/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertTaxRuleNotInGrid.php @@ -14,12 +14,9 @@ */ class AssertTaxRuleNotInGrid extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'high'; + /* tags */ + const SEVERITY = 'high'; + /* end tags */ /** * Assert that tax rule not available in Tax Rule grid diff --git a/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertTaxRuleSuccessDeleteMessage.php b/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertTaxRuleSuccessDeleteMessage.php index 6595fccbaedb1..721c52e935252 100644 --- a/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertTaxRuleSuccessDeleteMessage.php +++ b/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertTaxRuleSuccessDeleteMessage.php @@ -13,14 +13,11 @@ */ class AssertTaxRuleSuccessDeleteMessage extends AbstractConstraint { - const SUCCESS_DELETE_MESSAGE = 'The tax rule has been deleted.'; + /* tags */ + const SEVERITY = 'high'; + /* end tags */ - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'high'; + const SUCCESS_DELETE_MESSAGE = 'The tax rule has been deleted.'; /** * Assert that success delete message is displayed after tax rule deleted diff --git a/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertTaxRuleSuccessSaveMessage.php b/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertTaxRuleSuccessSaveMessage.php index e176957e2965e..39db50df2b042 100644 --- a/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertTaxRuleSuccessSaveMessage.php +++ b/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertTaxRuleSuccessSaveMessage.php @@ -13,14 +13,11 @@ */ class AssertTaxRuleSuccessSaveMessage extends AbstractConstraint { - const SUCCESS_MESSAGE = 'The tax rule has been saved.'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + const SUCCESS_MESSAGE = 'The tax rule has been saved.'; /** * Assert that success message is displayed after tax rule saved diff --git a/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertTaxWithCrossBorderApplied.php b/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertTaxWithCrossBorderApplied.php index 52021d7192e13..17478d3afc0ff 100644 --- a/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertTaxWithCrossBorderApplied.php +++ b/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertTaxWithCrossBorderApplied.php @@ -11,12 +11,9 @@ */ class AssertTaxWithCrossBorderApplied extends AbstractAssertTaxWithCrossBorderApplying { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert prices on category, product and cart pages are equal for both customers diff --git a/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertTaxWithCrossBorderNotApplied.php b/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertTaxWithCrossBorderNotApplied.php index 390eb15183fdd..b64b3663a6baf 100644 --- a/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertTaxWithCrossBorderNotApplied.php +++ b/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertTaxWithCrossBorderNotApplied.php @@ -11,12 +11,9 @@ */ class AssertTaxWithCrossBorderNotApplied extends AbstractAssertTaxWithCrossBorderApplying { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert prices on category, product and cart pages are different for each customer diff --git a/dev/tests/functional/tests/app/Magento/Tax/Test/TestCase/TaxCalculationTest.php b/dev/tests/functional/tests/app/Magento/Tax/Test/TestCase/TaxCalculationTest.php deleted file mode 100644 index 68d001c6c4f6b..0000000000000 --- a/dev/tests/functional/tests/app/Magento/Tax/Test/TestCase/TaxCalculationTest.php +++ /dev/null @@ -1,223 +0,0 @@ - Taxes > Tax Rules. - * 3. Click 'Add New Tax Rule' button. - * 4. Assign default rates to rule. - * 5. Save Tax Rate. - * 6. Go to Products > Catalog. - * 7. Add new product. - * 8. Fill data according to dataset. - * 9. Save product. - * 10. Go to Stores > Configuration. - * 11. Fill Tax configuration according to data set. - * 12. Save tax configuration. - * 13. Perform all assertions. - * - * @group Tax_(CS) - * @ZephyrId MAGETWO-27809 - */ -class TaxCalculationTest extends Injectable -{ - /** - * Catalog product page. - * - * @var CheckoutCart - */ - protected $checkoutCart; - - /** - * Cms index page. - * - * @var CmsIndex - */ - protected $cmsIndex; - - /** - * Customer login page. - * - * @var CustomerAccountLogin - */ - protected $customerAccountLogin; - - /** - * Fixture factory. - * - * @var FixtureFactory - */ - protected $fixtureFactory; - - /** - * Fixture customer. - * - * @var CustomerInjectable - */ - protected $customer; - - /** - * Fixture SalesRule. - * - * @var SalesRuleInjectable - */ - protected $salesRule; - - /** - * Sales Rule Id. - * - * @var array - */ - public static $salesRuleName; - - /** - * Tax Rule Id. - * - * @var array - */ - public static $taxRuleCode; - - /** - * Skip failed tests. - * - * @return void - */ - public static function setUpBeforeClass() - { - self::markTestIncomplete("MAGETWO-28454"); - } - - /** - * Prepare data. - * - * @param FixtureFactory $fixtureFactory - * @param SalesRuleInjectable $salesRule - * @return void - */ - public function __prepare( - FixtureFactory $fixtureFactory, - SalesRuleInjectable $salesRule - ) { - $this->fixtureFactory = $fixtureFactory; - $customer = $fixtureFactory->createByCode('customerInjectable', ['dataSet' => 'johndoe_unique']); - $customer->persist(); - $this->customer = $customer; - $salesRule->persist(); - $this->salesRule = $salesRule; - self::$salesRuleName = $salesRule->getName(); - } - - /** - * Injection data. - * - * @param CmsIndex $cmsIndex - * @param CheckoutCart $checkoutCart - * @param CustomerAccountLogin $customerAccountLogin - * @return void - */ - public function __inject( - CmsIndex $cmsIndex, - CheckoutCart $checkoutCart, - CustomerAccountLogin $customerAccountLogin - ) { - $this->cmsIndex = $cmsIndex; - $this->checkoutCart = $checkoutCart; - $this->customerAccountLogin = $customerAccountLogin; - } - - /** - * Login customer. - * - * @return void - */ - protected function loginCustomer() - { - if (!$this->cmsIndex->getLinksBlock()->isLinkVisible('Log Out')) { - $this->cmsIndex->getLinksBlock()->openLink("Log In"); - $this->customerAccountLogin->getLoginBlock()->login($this->customer); - } - } - - /** - * Clear shopping cart. - * - * @return void - */ - protected function clearShoppingCart() - { - $this->checkoutCart->open(); - $this->checkoutCart->getCartBlock()->clearShoppingCart(); - } - - /** - * Test product prices with tax. - * - * @param CatalogProductSimple $product - * @param TaxRule $taxRule - * @param ConfigData $config - * @return array - */ - public function test(CatalogProductSimple $product, TaxRule $taxRule, ConfigData $config) - { - //Preconditions - $config->persist(); - $product->persist(); - $taxRule->persist(); - self::$taxRuleCode = $taxRule->getData()['code']; - //Steps - $this->cmsIndex->open(); - $this->loginCustomer($this->customer); - $this->clearShoppingCart(); - } - - /** - * Tear down after each test. - * - * @return void - */ - public function tearDown() - { - $taxRuleIndex = ObjectManager::getInstance()->create('\Magento\Tax\Test\Page\Adminhtml\TaxRuleIndex'); - $taxRuleIndex->open(); - $taxRuleIndex->getTaxRuleGrid()->searchAndOpen(['code' => self::$taxRuleCode]); - $taxRuleNewPage = ObjectManager::getInstance()->create('Magento\Tax\Test\Page\Adminhtml\TaxRuleNew'); - $taxRuleNewPage->getFormPageActions()->delete(); - } - - /** - * Tear down after tests. - * - * @return void - */ - public static function tearDownAfterClass() - { - $promoQuoteIndex = ObjectManager::getInstance() - ->create('Magento\SalesRule\Test\Page\Adminhtml\PromoQuoteIndex'); - $promoQuoteIndex->open(); - $promoQuoteIndex->getPromoQuoteGrid()->searchAndOpen(['name' => self::$salesRuleName]); - $promoQuoteEdit = ObjectManager::getInstance() - ->create('Magento\SalesRule\Test\Page\Adminhtml\PromoQuoteEdit'); - $promoQuoteEdit->getFormPageActions()->delete(); - $fixtureFactory = ObjectManager::getInstance()->create('Mtf\Fixture\FixtureFactory'); - $config = $fixtureFactory->createByCode('configData', ['dataSet' => 'default_tax_configuration']); - $config->persist(); - } -} diff --git a/dev/tests/functional/tests/app/Magento/Tax/Test/TestCase/TaxCalculationTest/test.csv b/dev/tests/functional/tests/app/Magento/Tax/Test/TestCase/TaxCalculationTest/test.csv deleted file mode 100644 index 3c6255166eea2..0000000000000 --- a/dev/tests/functional/tests/app/Magento/Tax/Test/TestCase/TaxCalculationTest/test.csv +++ /dev/null @@ -1,11 +0,0 @@ -"config/dataSet";"product/dataSet";"taxRule/dataSet";"prices/category_price_excl_tax";"prices/category_price_incl_tax";"prices/product_view_price_excl_tax";"prices/product_view_price_incl_tax";"prices/cart_item_subtotal_excl_tax";"prices/cart_item_subtotal_incl_tax";"prices/cart_item_price_excl_tax";"prices/cart_item_price_incl_tax";"prices/subtotal_excl_tax";"prices/subtotal_incl_tax";"prices/discount";"prices/shipping_excl_tax";"prices/shipping_incl_tax";"prices/tax";"prices/grand_total_excl_tax";"prices/grand_total_incl_tax";"constraint" -"row_cat_incl_ship_excl_after_disc_on_excl";"simple_with_tier_price_and_category";"customer_equals_store_rate";"277.14";"300.00";"277.14";"300.00";"41.57";"45.00";"13.86";"15.00";"41.57";"45.00";"20.79";"15.00";"16.24";"3.09";"37.36";"40.45";"assertTaxRuleIsAppliedToAllPrices" -"row_cat_excl_ship_incl_before_disc_on_incl";"simple_with_group_price_and_category";"customer_greater_store_rate";"90.99";"98.61";"90.99";"98.61";"272.97";"295.83";"90.99";"98.61";"272.97";"295.83";"147.92";"13.86";"15.02";"24.02";"138.91";"162.93";"assertTaxRuleIsAppliedToAllPrices" -"total_cat_excl_ship_incl_after_disc_on_excl";"simple_with_group_price_and_category";"customer_less_store_rate";"90.99";"98.50";"90.99";"98.50";"272.97";"295.49";"90.99";"98.50";"272.97";"295.49";"136.49";"13.84";"14.98";"12.40";"150.32";"162.72";"assertTaxRuleIsAppliedToAllPrices" -"row_cat_incl_ship_excl_before_disc_on_incl";"product_with_special_price_and_category";"customer_less_store_rate";"83.05";"89.90";"83.05";"89.90";"249.15";"269.70";"83.05";"89.90";"249.15";"269.70";"134.85";"15.00";"16.24";"21.79";"129.30";"151.09";"assertTaxRuleIsAppliedToAllPrices" -"unit_cat_incl_ship_incl_before_disc_on_incl";"simple_with_tier_price_and_category";"customer_less_store_rate";"276.81";"299.65";"276.81";"299.65";"41.52";"44.94";"13.84";"14.98";"41.52";"44.94";"22.47";"13.84";"14.98";"4.56";"32.89";"37.45";"assertTaxRuleIsAppliedToAllPrices" -"total_cat_excl_ship_incl_before_disc_on_incl";"product_with_special_price_and_category";"customer_equals_store_rate";"90.00";"97.43";"90.00";"97.43";"270.00";"292.28";"90.00";"97.43";"270.00";"292.28";"146.15";"13.86";"15.00";"23.42";"137.71";"161.13";"assertTaxRuleIsAppliedToAllPrices" -"unit_cat_excl_ship_excl_after_disc_on_excl";"simple_with_group_price_and_category";"customer_equals_store_rate";"90.99";"98.50";"90.99";"98.50";"272.97";"295.50";"90.99";"98.50";"272.97";"295.50";"136.49";"15.00";"16.24";"12.49";"151.48";"163.97";"assertTaxRuleIsAppliedToAllPrices" -"total_cat_incl_ship_excl_before_disc_on_excl";"simple_with_group_price_and_category";"customer_greater_store_rate";"84.06";"91.10";"84.06";"91.10";"252.18";"273.30";"84.06";"91.10";"252.18";"273.30";"126.09";"15.00";"16.26";"22.38";"141.09";"163.47";"assertTaxRuleIsAppliedToAllPrices" -"total_cat_excl_ship_incl_after_disc_on_incl";"simple_with_tier_price_and_category";"customer_greater_store_rate";"300.00";"325.13";"300.00";"325.13";"45.00";"48.77";"15.00";"16.26";"45.00";"48.77";"24.39";"13.86";"15.02";"2.89";"34.47";"37.36";"assertTaxRuleIsAppliedToAllPrices" -"unit_cat_excl_ship_incl_after_disc_on_excl";"product_with_special_price_and_category";"customer_greater_store_rate";"90.00";"97.54";"90.00";"97.54";"270.00";"292.62";"90.00";"97.54";"270.00";"292.62";"135.00";"13.86";"15.02";"12.47";"148.86";"161.33";"assertTaxRuleIsAppliedToAllPrices" diff --git a/dev/tests/functional/tests/app/Magento/Tax/Test/TestCase/TaxWithCrossBorderTest.php b/dev/tests/functional/tests/app/Magento/Tax/Test/TestCase/TaxWithCrossBorderTest.php deleted file mode 100644 index 16dd676f91517..0000000000000 --- a/dev/tests/functional/tests/app/Magento/Tax/Test/TestCase/TaxWithCrossBorderTest.php +++ /dev/null @@ -1,210 +0,0 @@ - Taxes > Tax Rules. - * 3. Click 'Add New Tax Rule' button. - * 4. Assign 3 different rates for different addresses - * 5. Save Tax Rate. - * 6. Go to Products > Catalog. - * 7. Add new product. - * 8. Fill data according to dataset. - * 9. Save product. - * 10. Go to Stores > Configuration. - * 11. Fill Tax configuration according to data set. - * 12. Save tax configuration. - * 13. Register two customers on front end that will match two different rates - * 14. Login with each customer and verify prices - * - * @group Tax_(CS) - * @ZephyrId MAGETWO-29052 - * @SuppressWarnings(PHPMD.CouplingBetweenObjects) - */ -class TaxWithCrossBorderTest extends Injectable -{ - /** - * Fixture SalesRule - * - * @var SalesRuleInjectable - */ - protected $salesRule; - - /** - * Fixture SalesRule - * - * @var CatalogRule - */ - protected $catalogRule; - - /** - * Fixture factory - * - * @var FixtureFactory - */ - protected $fixtureFactory; - - /** - * PromoQuoteIndex - * - * @var PromoQuoteIndex - */ - protected $promoQuoteIndex; - - /** - * PromoQuoteEdit - * - * @var PromoQuoteEdit - */ - protected $promoQuoteEdit; - - /** - * CatalogRuleIndex - * - * @var CatalogRuleIndex - */ - protected $catalogRuleIndex; - - /** - * CatalogRuleNew - * - * @var CatalogRuleNew - */ - protected $catalogRuleNew; - - /** - * Prepare data - * - * @param FixtureFactory $fixtureFactory - * @return array - */ - public function __prepare(FixtureFactory $fixtureFactory) - { - $this->fixtureFactory = $fixtureFactory; - $taxRule = $fixtureFactory->createByCode('taxRule', ['dataSet' => 'cross_border_tax_rule']); - $taxRule->persist(); - return ['customers' => $this->createCustomers()]; - } - - /** - * Injection data - * - * @param PromoQuoteIndex $promoQuoteIndex - * @param PromoQuoteEdit $promoQuoteEdit - * @param CatalogRuleIndex $catalogRuleIndex - * @param CatalogRuleNew $catalogRuleNew - * @return void - */ - public function __inject( - PromoQuoteIndex $promoQuoteIndex, - PromoQuoteEdit $promoQuoteEdit, - CatalogRuleIndex $catalogRuleIndex, - CatalogRuleNew $catalogRuleNew - ) { - $this->promoQuoteIndex = $promoQuoteIndex; - $this->promoQuoteEdit = $promoQuoteEdit; - $this->catalogRuleIndex = $catalogRuleIndex; - $this->catalogRuleNew = $catalogRuleNew; - } - - /** - * Create customers - * - * @return array $customers - */ - protected function createCustomers() - { - $customersData = ['johndoe_unique_TX', 'johndoe_unique']; - $customers = []; - foreach ($customersData as $customerData) { - $customer = $this->fixtureFactory->createByCode('customerInjectable', ['dataSet' => $customerData]); - $customer->persist(); - $customers[] = $customer; - } - return $customers; - } - - /** - * Test product prices with tax - * - * @param CatalogProductSimple $product - * @param ConfigData $config - * @param SalesRuleInjectable $salesRule - * @param CatalogRule $catalogRule - * @return void - */ - public function test( - CatalogProductSimple $product, - ConfigData $config, - SalesRuleInjectable $salesRule, - CatalogRule $catalogRule - ) { - //Preconditions - if ($this->currentVariation['arguments']['salesRule']['dataSet'] !== "-") { - $salesRule->persist(); - $this->salesRule = $salesRule; - } - if ($this->currentVariation['arguments']['catalogRule']['dataSet'] !== "-") { - $catalogRule->persist(); - $this->catalogRule = $catalogRule; - } - $config->persist(); - $product->persist(); - } - - /** - * Tear down after test - * - * @return void - */ - public function tearDown() - { - if (isset($this->salesRule)) { - $this->promoQuoteIndex->open(); - $this->promoQuoteIndex->getPromoQuoteGrid()->searchAndOpen(['name' => $this->salesRule->getName()]); - $this->promoQuoteEdit->getFormPageActions()->delete(); - $this->salesRule = null; - } - if (isset($this->catalogRule)) { - $this->catalogRuleIndex->open(); - $this->catalogRuleIndex->getCatalogRuleGrid()->searchAndOpen(['name' => $this->catalogRule->getName()]); - $this->catalogRuleNew->getFormPageActions()->delete(); - $this->catalogRule = null; - } - } - - /** - * Tear down after tests - * - * @return void - */ - public static function tearDownAfterClass() - { - ObjectManager::getInstance()->create('\Magento\Tax\Test\TestStep\DeleteAllTaxRulesStep')->run(); - ObjectManager::getInstance()->create( - 'Magento\Core\Test\TestStep\SetupConfigurationStep', - ['configData' => 'default_tax_configuration'] - )->run(); - } -} diff --git a/dev/tests/functional/tests/app/Magento/Tax/Test/TestCase/TaxWithCrossBorderTest/test.csv b/dev/tests/functional/tests/app/Magento/Tax/Test/TestCase/TaxWithCrossBorderTest/test.csv deleted file mode 100644 index 225adeebd03d0..0000000000000 --- a/dev/tests/functional/tests/app/Magento/Tax/Test/TestCase/TaxWithCrossBorderTest/test.csv +++ /dev/null @@ -1,6 +0,0 @@ -"product/dataSet";"catalogRule/dataSet";"salesRule/dataSet";"config/dataSet";"constraint" -"with_one_custom_option_and_category";"-";"-";"cross_border_enabled_price_incl_tax";"assertTaxWithCrossBorderApplied" -"product_with_category";"-";"cart_rule";"cross_border_enabled_price_incl_tax";"assertTaxWithCrossBorderApplied" -"product_with_category";"catalog_price_rule_priority_0";"-";"cross_border_enabled_price_incl_tax";"assertTaxWithCrossBorderApplied" -"product_with_special_price_and_category";"-";"-";"cross_border_enabled_price_incl_tax";"assertTaxWithCrossBorderApplied" -"product_with_category";"-";"-";"cross_border_enabled_price_excl_tax";"assertTaxWithCrossBorderNotApplied" diff --git a/dev/tests/functional/tests/app/Magento/Tax/Test/etc/constraint.xml b/dev/tests/functional/tests/app/Magento/Tax/Test/etc/constraint.xml index 535fba0e8e1ec..f61aa496c071a 100644 --- a/dev/tests/functional/tests/app/Magento/Tax/Test/etc/constraint.xml +++ b/dev/tests/functional/tests/app/Magento/Tax/Test/etc/constraint.xml @@ -6,20 +6,20 @@ --> - low + low - high + high - high + high @@ -27,20 +27,20 @@ - high + high - high + high - high + high @@ -48,54 +48,54 @@ - low + low - low + low - high + high - high + high - high + high - high + high - high + high - high + high - high + high - high + high - high + high - high + high diff --git a/dev/tests/functional/tests/app/Magento/Theme/Test/Block/Html/Footer.php b/dev/tests/functional/tests/app/Magento/Theme/Test/Block/Html/Footer.php index 0bc7e229d21d1..fc56ae562a33a 100644 --- a/dev/tests/functional/tests/app/Magento/Theme/Test/Block/Html/Footer.php +++ b/dev/tests/functional/tests/app/Magento/Theme/Test/Block/Html/Footer.php @@ -28,7 +28,7 @@ class Footer extends Block * * @var string */ - protected $variableSelector = './/div[contains(@class, "links")]/*[text()="%s"]'; + protected $variableSelector = './/ul[contains(@class, "links")]/*[text()="%s"]'; /** * Store group dropdown selector diff --git a/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/Block/Adminhtml/Catalog/Category/Tree.php b/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/Block/Adminhtml/Catalog/Category/Tree.php index 010e87641c305..a5b6b384f4a03 100644 --- a/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/Block/Adminhtml/Catalog/Category/Tree.php +++ b/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/Block/Adminhtml/Catalog/Category/Tree.php @@ -16,11 +16,11 @@ class Tree extends Block { /** - * Locator value for skip category button + * Locator value for skip category button * * @var string */ - protected $skipCategoryButton = '[data-ui-id="catalog-product-edit-skip-categories"]'; + protected $skipCategoryButton = '[data-ui-id$="skip-categories"]'; /** * Select category by its name diff --git a/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/Constraint/AssertPageByUrlRewriteIsNotFound.php b/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/Constraint/AssertPageByUrlRewriteIsNotFound.php index 588aa7d42f74b..69b9f49957a2d 100644 --- a/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/Constraint/AssertPageByUrlRewriteIsNotFound.php +++ b/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/Constraint/AssertPageByUrlRewriteIsNotFound.php @@ -16,18 +16,15 @@ */ class AssertPageByUrlRewriteIsNotFound extends AbstractConstraint { + /* tags */ + const SEVERITY = 'low'; + /* end tags */ + /** * Message on the product page 404 */ const NOT_FOUND_MESSAGE = 'Whoops, our bad...'; - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; - /** * Checking the server response 404 page on frontend * diff --git a/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/Constraint/AssertUrlRewriteCategoryInGrid.php b/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/Constraint/AssertUrlRewriteCategoryInGrid.php index 5315fc2c09c26..28575a379d660 100644 --- a/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/Constraint/AssertUrlRewriteCategoryInGrid.php +++ b/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/Constraint/AssertUrlRewriteCategoryInGrid.php @@ -15,12 +15,9 @@ */ class AssertUrlRewriteCategoryInGrid extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that url rewrite category in grid diff --git a/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/Constraint/AssertUrlRewriteCategoryNotInGrid.php b/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/Constraint/AssertUrlRewriteCategoryNotInGrid.php index 6fe8eba8ef494..04f485d06c3bd 100644 --- a/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/Constraint/AssertUrlRewriteCategoryNotInGrid.php +++ b/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/Constraint/AssertUrlRewriteCategoryNotInGrid.php @@ -15,12 +15,9 @@ */ class AssertUrlRewriteCategoryNotInGrid extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that category url rewrite not in grid diff --git a/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/Constraint/AssertUrlRewriteCategoryRedirect.php b/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/Constraint/AssertUrlRewriteCategoryRedirect.php index 5209cc0abd783..6c728817a9e71 100644 --- a/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/Constraint/AssertUrlRewriteCategoryRedirect.php +++ b/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/Constraint/AssertUrlRewriteCategoryRedirect.php @@ -16,12 +16,9 @@ */ class AssertUrlRewriteCategoryRedirect extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert check URL rewrite category redirect diff --git a/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/Constraint/AssertUrlRewriteCustomRedirect.php b/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/Constraint/AssertUrlRewriteCustomRedirect.php index da77f1fad6851..77667006006f5 100644 --- a/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/Constraint/AssertUrlRewriteCustomRedirect.php +++ b/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/Constraint/AssertUrlRewriteCustomRedirect.php @@ -16,12 +16,9 @@ */ class AssertUrlRewriteCustomRedirect extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert check URL rewrite custom redirect diff --git a/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/Constraint/AssertUrlRewriteCustomSearchRedirect.php b/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/Constraint/AssertUrlRewriteCustomSearchRedirect.php index 02b3197d5cc6f..6f5fdaf774d78 100644 --- a/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/Constraint/AssertUrlRewriteCustomSearchRedirect.php +++ b/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/Constraint/AssertUrlRewriteCustomSearchRedirect.php @@ -16,12 +16,9 @@ */ class AssertUrlRewriteCustomSearchRedirect extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that created entity was found on search page diff --git a/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/Constraint/AssertUrlRewriteDeletedMessage.php b/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/Constraint/AssertUrlRewriteDeletedMessage.php index 27c430d7cf97d..eb2a6d4cb5d17 100644 --- a/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/Constraint/AssertUrlRewriteDeletedMessage.php +++ b/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/Constraint/AssertUrlRewriteDeletedMessage.php @@ -14,18 +14,15 @@ */ class AssertUrlRewriteDeletedMessage extends AbstractConstraint { + /* tags */ + const SEVERITY = 'low'; + /* end tags */ + /** * Message that displayed after delete url rewrite */ const SUCCESS_DELETE_MESSAGE = 'The URL Rewrite has been deleted.'; - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; - /** * Assert that delete message is displayed * diff --git a/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/Constraint/AssertUrlRewriteInGrid.php b/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/Constraint/AssertUrlRewriteInGrid.php index 7358327177ee1..766b25cf3ec5c 100644 --- a/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/Constraint/AssertUrlRewriteInGrid.php +++ b/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/Constraint/AssertUrlRewriteInGrid.php @@ -15,12 +15,9 @@ */ class AssertUrlRewriteInGrid extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that url rewrite category in grid diff --git a/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/Constraint/AssertUrlRewriteNotInGrid.php b/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/Constraint/AssertUrlRewriteNotInGrid.php index e180fdba27234..d85a146e49b62 100644 --- a/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/Constraint/AssertUrlRewriteNotInGrid.php +++ b/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/Constraint/AssertUrlRewriteNotInGrid.php @@ -15,12 +15,9 @@ */ class AssertUrlRewriteNotInGrid extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that url rewrite not in grid diff --git a/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/Constraint/AssertUrlRewriteProductRedirect.php b/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/Constraint/AssertUrlRewriteProductRedirect.php index b4983ca54ce68..51ca53f93fa77 100644 --- a/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/Constraint/AssertUrlRewriteProductRedirect.php +++ b/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/Constraint/AssertUrlRewriteProductRedirect.php @@ -17,12 +17,9 @@ */ class AssertUrlRewriteProductRedirect extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Check that product available by new URL on the front diff --git a/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/Constraint/AssertUrlRewriteSaveMessage.php b/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/Constraint/AssertUrlRewriteSaveMessage.php index a9bd5a53a4f33..eb2a8bfcdf1a9 100644 --- a/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/Constraint/AssertUrlRewriteSaveMessage.php +++ b/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/Constraint/AssertUrlRewriteSaveMessage.php @@ -14,14 +14,11 @@ */ class AssertUrlRewriteSaveMessage extends AbstractConstraint { - const SUCCESS_MESSAGE = 'The URL Rewrite has been saved.'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + const SUCCESS_MESSAGE = 'The URL Rewrite has been saved.'; /** * Assert that url rewrite success message is displayed diff --git a/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/Constraint/AssertUrlRewriteSuccessOutsideRedirect.php b/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/Constraint/AssertUrlRewriteSuccessOutsideRedirect.php index 4126a4bf76f40..a8189399e2ac1 100644 --- a/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/Constraint/AssertUrlRewriteSuccessOutsideRedirect.php +++ b/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/Constraint/AssertUrlRewriteSuccessOutsideRedirect.php @@ -15,12 +15,9 @@ */ class AssertUrlRewriteSuccessOutsideRedirect extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that outside redirect was success diff --git a/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/Constraint/AssertUrlRewriteUpdatedProductInGrid.php b/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/Constraint/AssertUrlRewriteUpdatedProductInGrid.php index c70641f561501..ac6a36156941b 100644 --- a/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/Constraint/AssertUrlRewriteUpdatedProductInGrid.php +++ b/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/Constraint/AssertUrlRewriteUpdatedProductInGrid.php @@ -15,12 +15,9 @@ */ class AssertUrlRewriteUpdatedProductInGrid extends AbstractConstraint { - /** - * Constraint severeness. - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that product url in url rewrite grid. diff --git a/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/TestCase/CreateCustomUrlRewriteEntityTest.php b/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/TestCase/CreateCustomUrlRewriteEntityTest.php deleted file mode 100644 index ab90fa5ade49f..0000000000000 --- a/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/TestCase/CreateCustomUrlRewriteEntityTest.php +++ /dev/null @@ -1,77 +0,0 @@ - SEO & Search->URL Rewrites - * 3. Click "Add Url Rewrite" button - * 4. Select "Custom" in Create URL Rewrite dropdown - * 5. Fill data according to data set - * 6. Save Rewrite - * 7. Perform all assertions - * - * @group URL_Rewrites_(MX) - * @ZephyrId MAGETWO-25474 - */ -class CreateCustomUrlRewriteEntityTest extends Injectable -{ - /** - * Url rewrite index page - * - * @var UrlRewriteIndex - */ - protected $urlRewriteIndex; - - /** - * Url rewrite edit page - * - * @var UrlRewriteEdit - */ - protected $urlRewriteEdit; - - /** - * Inject pages - * - * @param UrlRewriteIndex $urlRewriteIndex - * @param UrlRewriteEdit $urlRewriteEdit - * @return void - */ - public function __inject(UrlRewriteIndex $urlRewriteIndex, UrlRewriteEdit $urlRewriteEdit) - { - $this->urlRewriteIndex = $urlRewriteIndex; - $this->urlRewriteEdit = $urlRewriteEdit; - } - - /** - * Create custom URL Rewrite - * - * @param UrlRewrite $urlRewrite - * @return void - */ - public function test(UrlRewrite $urlRewrite) - { - $this->urlRewriteIndex->open(); - $this->urlRewriteIndex->getPageActionsBlock()->addNew(); - $this->urlRewriteEdit->getFormBlock()->fill($urlRewrite); - $this->urlRewriteEdit->getPageMainActions()->save(); - } -} diff --git a/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/TestCase/CreateCustomUrlRewriteEntityTest/test.csv b/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/TestCase/CreateCustomUrlRewriteEntityTest/test.csv deleted file mode 100644 index 680e08b0defce..0000000000000 --- a/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/TestCase/CreateCustomUrlRewriteEntityTest/test.csv +++ /dev/null @@ -1,5 +0,0 @@ -"urlRewrite/data/entity_type";"urlRewrite/data/store_id";"urlRewrite/data/target_path/entity";"urlRewrite/data/request_path";"urlRewrite/data/redirect_type";"urlRewrite/data/description";"constraint" -"Custom";"Main Website/Main Website Store/Default Store View";"catalog/category/view/id/%catalogCategory::default_subcategory%";"category_request_path%isolation%";"Permanent (301)";"test_description_relative path";"assertUrlRewriteSaveMessage, assertUrlRewriteInGrid, assertUrlRewriteCustomRedirect" -"Custom";"Main Website/Main Website Store/Default Store View";"catalog/product/view/id/%catalogProductSimple::default%";"product_request_path%isolation%";"Temporary (302)";"test_description_relative path";"assertUrlRewriteSaveMessage, assertUrlRewriteInGrid, assertUrlRewriteCustomRedirect" -"Custom";"Main Website/Main Website Store/Default Store View";"cms/page/view/page_id/%cmsPage::cms-page-test%";"cms_page_request_path%isolation%";"No";"test description_full path";"assertUrlRewriteSaveMessage, assertUrlRewriteInGrid, assertUrlRewriteCustomRedirect" -"Custom";"Main Website/Main Website Store/Default Store View";"cms/page/view/page_id/%cmsPage::cms-page-test%";"cms_page_request_path%isolation%";"Temporary (302)";"test description_full path";"assertUrlRewriteSaveMessage, assertUrlRewriteInGrid, assertUrlRewriteCustomRedirect" diff --git a/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/TestCase/UpdateCustomUrlRewriteEntityTest/test.csv b/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/TestCase/UpdateCustomUrlRewriteEntityTest/test.csv index cb82ccd2b4643..dc82f30d3e7d8 100644 --- a/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/TestCase/UpdateCustomUrlRewriteEntityTest/test.csv +++ b/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/TestCase/UpdateCustomUrlRewriteEntityTest/test.csv @@ -1,3 +1,3 @@ -"initialRewrite/dataSet";"urlRewrite/data/store_id";"urlRewrite/data/request_path";"urlRewrite/data/target_path/entity";"urlRewrite/data/redirect_type";"urlRewrite/data/description";"constraint";"issue" -"default";"Main Website/Main Website Store/Default Store View";"wishlist/%isolation%";"http://www.magentocommerce.com/magento-connect/";"Permanent (301)";"test_description_relative path";"assertUrlRewriteSaveMessage, assertUrlRewriteInGrid, assertUrlRewriteSuccessOutsideRedirect";"MAGETWO-29618" -"custom_rewrite_wishlist";"Main Website/Main Website Store/Default Store View";"wishlist/%isolation%";"catalogsearch/result/?q=$%catalogProductSimple::defaul%sku$";"Temporary (302)";"test_description_relative path";"assertUrlRewriteSaveMessage, assertUrlRewriteInGrid, assertUrlRewriteCustomSearchRedirect";"" +"initialRewrite/dataSet";"urlRewrite/data/store_id";"urlRewrite/data/request_path";"urlRewrite/data/target_path/entity";"urlRewrite/data/redirect_type";"urlRewrite/data/description";"constraint" +"default";"Main Website/Main Website Store/Default Store View";"wishlist/%isolation%";"http://www.magentocommerce.com/magento-connect/";"Permanent (301)";"test_description_relative path";"assertUrlRewriteSaveMessage, assertUrlRewriteInGrid, assertUrlRewriteSuccessOutsideRedirect" +"custom_rewrite_wishlist";"Main Website/Main Website Store/Default Store View";"wishlist/%isolation%";"catalogsearch/result/?q=$%catalogProductSimple::defaul%sku$";"Temporary (302)";"test_description_relative path";"assertUrlRewriteSaveMessage, assertUrlRewriteInGrid, assertUrlRewriteCustomSearchRedirect" diff --git a/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/etc/constraint.xml b/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/etc/constraint.xml index 069d8b9a9756a..26dc285fc65c2 100644 --- a/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/etc/constraint.xml +++ b/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/etc/constraint.xml @@ -6,20 +6,20 @@ --> - low + low - low + low - low + low - low + low @@ -28,20 +28,20 @@ - low + low - low + low - low + low @@ -49,17 +49,17 @@ - low + low - low + low - low + low @@ -67,12 +67,12 @@ - low + low - low + low - low + low diff --git a/dev/tests/functional/tests/app/Magento/User/Test/Constraint/AssertAccessTokensErrorRevokeMessage.php b/dev/tests/functional/tests/app/Magento/User/Test/Constraint/AssertAccessTokensErrorRevokeMessage.php index cc9d7e29e3e74..e064d2e4e7557 100644 --- a/dev/tests/functional/tests/app/Magento/User/Test/Constraint/AssertAccessTokensErrorRevokeMessage.php +++ b/dev/tests/functional/tests/app/Magento/User/Test/Constraint/AssertAccessTokensErrorRevokeMessage.php @@ -14,18 +14,15 @@ */ class AssertAccessTokensErrorRevokeMessage extends AbstractConstraint { + /* tags */ + const SEVERITY = 'low'; + /* end tags */ + /** * User revoke tokens error message. */ const ERROR_MESSAGE = 'This user has no tokens.'; - /** - * Constraint severeness. - * - * @var string - */ - protected $severeness = 'low'; - /** * Assert that error message appears after click on 'Force Sing-In' button for user without tokens. * diff --git a/dev/tests/functional/tests/app/Magento/User/Test/Constraint/AssertImpossibleDeleteYourOwnAccount.php b/dev/tests/functional/tests/app/Magento/User/Test/Constraint/AssertImpossibleDeleteYourOwnAccount.php index fac61dc3f854d..902dcbd20afea 100644 --- a/dev/tests/functional/tests/app/Magento/User/Test/Constraint/AssertImpossibleDeleteYourOwnAccount.php +++ b/dev/tests/functional/tests/app/Magento/User/Test/Constraint/AssertImpossibleDeleteYourOwnAccount.php @@ -13,14 +13,11 @@ */ class AssertImpossibleDeleteYourOwnAccount extends AbstractConstraint { - const ERROR_MESSAGE = 'You cannot delete your own account.'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + const ERROR_MESSAGE = 'You cannot delete your own account.'; /** * Asserts that error message equals to expected message. diff --git a/dev/tests/functional/tests/app/Magento/User/Test/Constraint/AssertImpossibleDeleteYourOwnRole.php b/dev/tests/functional/tests/app/Magento/User/Test/Constraint/AssertImpossibleDeleteYourOwnRole.php index 29ccbe89b9e40..711fac9363133 100644 --- a/dev/tests/functional/tests/app/Magento/User/Test/Constraint/AssertImpossibleDeleteYourOwnRole.php +++ b/dev/tests/functional/tests/app/Magento/User/Test/Constraint/AssertImpossibleDeleteYourOwnRole.php @@ -13,14 +13,11 @@ */ class AssertImpossibleDeleteYourOwnRole extends AbstractConstraint { - const ERROR_MESSAGE = 'You cannot delete self-assigned roles.'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + const ERROR_MESSAGE = 'You cannot delete self-assigned roles.'; /** * Asserts that error message equals to expected message. diff --git a/dev/tests/functional/tests/app/Magento/User/Test/Constraint/AssertRoleInGrid.php b/dev/tests/functional/tests/app/Magento/User/Test/Constraint/AssertRoleInGrid.php index 217f1334e0ba8..2be0b58aad647 100644 --- a/dev/tests/functional/tests/app/Magento/User/Test/Constraint/AssertRoleInGrid.php +++ b/dev/tests/functional/tests/app/Magento/User/Test/Constraint/AssertRoleInGrid.php @@ -14,12 +14,9 @@ */ class AssertRoleInGrid extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Asserts that saved role is present in Role Grid. diff --git a/dev/tests/functional/tests/app/Magento/User/Test/Constraint/AssertRoleNotInGrid.php b/dev/tests/functional/tests/app/Magento/User/Test/Constraint/AssertRoleNotInGrid.php index 0c6c2fb70ab59..675cec9ce181b 100644 --- a/dev/tests/functional/tests/app/Magento/User/Test/Constraint/AssertRoleNotInGrid.php +++ b/dev/tests/functional/tests/app/Magento/User/Test/Constraint/AssertRoleNotInGrid.php @@ -14,12 +14,9 @@ */ class AssertRoleNotInGrid extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Asserts that role is not present in Role Grid. diff --git a/dev/tests/functional/tests/app/Magento/User/Test/Constraint/AssertRoleSuccessDeleteMessage.php b/dev/tests/functional/tests/app/Magento/User/Test/Constraint/AssertRoleSuccessDeleteMessage.php index d51f5ad4c946b..2f86757392e41 100644 --- a/dev/tests/functional/tests/app/Magento/User/Test/Constraint/AssertRoleSuccessDeleteMessage.php +++ b/dev/tests/functional/tests/app/Magento/User/Test/Constraint/AssertRoleSuccessDeleteMessage.php @@ -13,14 +13,11 @@ */ class AssertRoleSuccessDeleteMessage extends AbstractConstraint { - const SUCCESS_DELETE_MESSAGE = 'You deleted the role.'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + const SUCCESS_DELETE_MESSAGE = 'You deleted the role.'; /** * Asserts that success delete message equals to expected message. diff --git a/dev/tests/functional/tests/app/Magento/User/Test/Constraint/AssertRoleSuccessSaveMessage.php b/dev/tests/functional/tests/app/Magento/User/Test/Constraint/AssertRoleSuccessSaveMessage.php index 4be018c21e315..faccbb2519cec 100644 --- a/dev/tests/functional/tests/app/Magento/User/Test/Constraint/AssertRoleSuccessSaveMessage.php +++ b/dev/tests/functional/tests/app/Magento/User/Test/Constraint/AssertRoleSuccessSaveMessage.php @@ -13,14 +13,11 @@ */ class AssertRoleSuccessSaveMessage extends AbstractConstraint { - const SUCCESS_MESSAGE = 'You saved the role.'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + const SUCCESS_MESSAGE = 'You saved the role.'; /** * Asserts that success message equals to expected message. diff --git a/dev/tests/functional/tests/app/Magento/User/Test/Constraint/AssertUserDuplicateMessage.php b/dev/tests/functional/tests/app/Magento/User/Test/Constraint/AssertUserDuplicateMessage.php index 1172cc335ee8f..bd0b3d36171c0 100644 --- a/dev/tests/functional/tests/app/Magento/User/Test/Constraint/AssertUserDuplicateMessage.php +++ b/dev/tests/functional/tests/app/Magento/User/Test/Constraint/AssertUserDuplicateMessage.php @@ -13,14 +13,11 @@ */ class AssertUserDuplicateMessage extends AbstractConstraint { - const ERROR_MESSAGE = 'A user with the same user name or email already exists.'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + const ERROR_MESSAGE = 'A user with the same user name or email already exists.'; /** * Asserts that error message equals to expected message. diff --git a/dev/tests/functional/tests/app/Magento/User/Test/Constraint/AssertUserInGrid.php b/dev/tests/functional/tests/app/Magento/User/Test/Constraint/AssertUserInGrid.php index c6751758ca15c..048570ff16cc9 100644 --- a/dev/tests/functional/tests/app/Magento/User/Test/Constraint/AssertUserInGrid.php +++ b/dev/tests/functional/tests/app/Magento/User/Test/Constraint/AssertUserInGrid.php @@ -14,12 +14,9 @@ */ class AssertUserInGrid extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Asserts that user is present in User Grid. diff --git a/dev/tests/functional/tests/app/Magento/User/Test/Constraint/AssertUserInvalidEmailMessage.php b/dev/tests/functional/tests/app/Magento/User/Test/Constraint/AssertUserInvalidEmailMessage.php index 77885af492af0..19dedcba36908 100644 --- a/dev/tests/functional/tests/app/Magento/User/Test/Constraint/AssertUserInvalidEmailMessage.php +++ b/dev/tests/functional/tests/app/Magento/User/Test/Constraint/AssertUserInvalidEmailMessage.php @@ -14,14 +14,11 @@ */ class AssertUserInvalidEmailMessage extends AbstractConstraint { - const ERROR_MESSAGE = 'Please correct this email address: "%s".'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + const ERROR_MESSAGE = 'Please correct this email address: "%s".'; /** * Asserts that error message equals to expected message. diff --git a/dev/tests/functional/tests/app/Magento/User/Test/Constraint/AssertUserNotInGrid.php b/dev/tests/functional/tests/app/Magento/User/Test/Constraint/AssertUserNotInGrid.php index fecddb7e20019..7eeed200a5d32 100644 --- a/dev/tests/functional/tests/app/Magento/User/Test/Constraint/AssertUserNotInGrid.php +++ b/dev/tests/functional/tests/app/Magento/User/Test/Constraint/AssertUserNotInGrid.php @@ -14,12 +14,9 @@ */ class AssertUserNotInGrid extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Asserts that User is not present in User Grid. diff --git a/dev/tests/functional/tests/app/Magento/User/Test/Constraint/AssertUserRoleSalesRestrictedAccess.php b/dev/tests/functional/tests/app/Magento/User/Test/Constraint/AssertUserRoleSalesRestrictedAccess.php index c07bc23bf1ef4..fe26eca385eaf 100644 --- a/dev/tests/functional/tests/app/Magento/User/Test/Constraint/AssertUserRoleSalesRestrictedAccess.php +++ b/dev/tests/functional/tests/app/Magento/User/Test/Constraint/AssertUserRoleSalesRestrictedAccess.php @@ -14,16 +14,13 @@ */ class AssertUserRoleSalesRestrictedAccess extends AbstractConstraint { + /* tags */ + const SEVERITY = 'low'; + /* end tags */ + const ROLE_RESOURCE = 'sales'; const DENIED_ACCESS = 'Access denied'; - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; - /** * Asserts that user has only Sales-related permissions * diff --git a/dev/tests/functional/tests/app/Magento/User/Test/Constraint/AssertUserSuccessDeleteMessage.php b/dev/tests/functional/tests/app/Magento/User/Test/Constraint/AssertUserSuccessDeleteMessage.php index 15ef99d460be0..5584f1b681f0d 100644 --- a/dev/tests/functional/tests/app/Magento/User/Test/Constraint/AssertUserSuccessDeleteMessage.php +++ b/dev/tests/functional/tests/app/Magento/User/Test/Constraint/AssertUserSuccessDeleteMessage.php @@ -13,14 +13,11 @@ */ class AssertUserSuccessDeleteMessage extends AbstractConstraint { - const SUCCESS_MESSAGE = 'You deleted the user.'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + const SUCCESS_MESSAGE = 'You deleted the user.'; /** * Asserts that success delete message equals to expected message. diff --git a/dev/tests/functional/tests/app/Magento/User/Test/Constraint/AssertUserSuccessLogOut.php b/dev/tests/functional/tests/app/Magento/User/Test/Constraint/AssertUserSuccessLogOut.php index 65bcde1d0180a..c69e891a1a27f 100644 --- a/dev/tests/functional/tests/app/Magento/User/Test/Constraint/AssertUserSuccessLogOut.php +++ b/dev/tests/functional/tests/app/Magento/User/Test/Constraint/AssertUserSuccessLogOut.php @@ -14,12 +14,9 @@ */ class AssertUserSuccessLogOut extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Asserts that 'You have logged out.' message is present on page diff --git a/dev/tests/functional/tests/app/Magento/User/Test/Constraint/AssertUserSuccessLogin.php b/dev/tests/functional/tests/app/Magento/User/Test/Constraint/AssertUserSuccessLogin.php index b2a2d7f3b4b4e..c23d34ce4e94f 100644 --- a/dev/tests/functional/tests/app/Magento/User/Test/Constraint/AssertUserSuccessLogin.php +++ b/dev/tests/functional/tests/app/Magento/User/Test/Constraint/AssertUserSuccessLogin.php @@ -15,12 +15,9 @@ */ class AssertUserSuccessLogin extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Verify whether customer has logged in to the Backend @@ -38,6 +35,7 @@ public function processAssert( Dashboard $dashboard, User $customAdmin = null ) { + $adminAuth->open(); $adminUser = $customAdmin === null ? $user : $customAdmin; if ($dashboard->getAdminPanelHeader()->isVisible()) { $dashboard->getAdminPanelHeader()->logOut(); diff --git a/dev/tests/functional/tests/app/Magento/User/Test/Constraint/AssertUserSuccessSaveMessage.php b/dev/tests/functional/tests/app/Magento/User/Test/Constraint/AssertUserSuccessSaveMessage.php index 7aa97dc66a9fc..2ac8c562eead8 100644 --- a/dev/tests/functional/tests/app/Magento/User/Test/Constraint/AssertUserSuccessSaveMessage.php +++ b/dev/tests/functional/tests/app/Magento/User/Test/Constraint/AssertUserSuccessSaveMessage.php @@ -13,14 +13,11 @@ */ class AssertUserSuccessSaveMessage extends AbstractConstraint { - const SUCCESS_MESSAGE = 'You saved the user.'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + const SUCCESS_MESSAGE = 'You saved the user.'; /** * Asserts that success message equals to expected message. diff --git a/dev/tests/functional/tests/app/Magento/User/Test/Constraint/AssertUserWrongCredentialsMessage.php b/dev/tests/functional/tests/app/Magento/User/Test/Constraint/AssertUserWrongCredentialsMessage.php index 1711fcb0abed9..51afc85ef97c2 100644 --- a/dev/tests/functional/tests/app/Magento/User/Test/Constraint/AssertUserWrongCredentialsMessage.php +++ b/dev/tests/functional/tests/app/Magento/User/Test/Constraint/AssertUserWrongCredentialsMessage.php @@ -14,14 +14,11 @@ */ class AssertUserWrongCredentialsMessage extends AbstractConstraint { - const INVALID_CREDENTIALS_MESSAGE = 'Please correct the user name or password.'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + const INVALID_CREDENTIALS_MESSAGE = 'Please correct the user name or password.'; /** * Verify incorrect credentials message while login to admin diff --git a/dev/tests/functional/tests/app/Magento/User/Test/Handler/User/Curl.php b/dev/tests/functional/tests/app/Magento/User/Test/Handler/User/Curl.php index ac4bd263bcebb..c21b6c0aa4ae7 100644 --- a/dev/tests/functional/tests/app/Magento/User/Test/Handler/User/Curl.php +++ b/dev/tests/functional/tests/app/Magento/User/Test/Handler/User/Curl.php @@ -33,7 +33,7 @@ public function persist(FixtureInterface $fixture = null) if ($fixture->hasData('role_id')) { $data['roles[]'] = $fixture->getDataFieldConfig('role_id')['source']->getRole()->getRoleId(); } - $data['is_active'] = (isset($data['is_active']) && ($data['is_active'] === 'Active')) ? 1 : 0; + $data['is_active'] = (isset($data['is_active']) && ($data['is_active'] === 'Inactive')) ? 0 : 1; $url = $_ENV['app_backend_url'] . 'admin/user/save/active_tab/main_section/'; $curl = new BackendDecorator(new CurlTransport(), new Config()); $curl->addOption(CURLOPT_HEADER, 1); diff --git a/dev/tests/functional/tests/app/Magento/User/Test/TestCase/CreateAdminUserEntityTest/test.csv b/dev/tests/functional/tests/app/Magento/User/Test/TestCase/CreateAdminUserEntityTest/test.csv index 7872c32a2612c..178ac7b96f4ca 100644 --- a/dev/tests/functional/tests/app/Magento/User/Test/TestCase/CreateAdminUserEntityTest/test.csv +++ b/dev/tests/functional/tests/app/Magento/User/Test/TestCase/CreateAdminUserEntityTest/test.csv @@ -1,7 +1,7 @@ -"user/data/username";"user/data/firstname";"user/data/lastname";"user/data/email";"user/data/password";"user/data/password_confirmation";"user/data/is_active";"user/data/role_id/dataSet";"isDuplicated";"constraint";"user/data/current_password";"issue" -"AdminUser%isolation%";"FirstName%isolation%";"LastName%isolation%";"email%isolation%@example.com";"123123q";"123123q";"Active";"Administrators";"-";"assertUserSuccessSaveMessage, assertUserInGrid, assertUserSuccessLogOut, assertUserSuccessLogin"; "123123q";"" -"AdminUser%isolation%";"FirstName%isolation%";"LastName%isolation%";"email%isolation%@example.com";"123123q";"123123q";"Inactive";"Administrators";"-";"assertUserSuccessSaveMessage, assertUserInGrid, assertUserSuccessLogOut, assertUserWrongCredentialsMessage"; "123123q";"" -"-";"FirstName%isolation%";"LastName%isolation%";"email%isolation%@example.com";"123123q";"123123q";"Active";"Administrators";"username";"assertUserDuplicateMessage"; "123123q";"" -"AdminUser%isolation%";"FirstName%isolation%";"LastName%isolation%";"-";"123123q";"123123q";"Active";"Administrators";"email";"assertUserDuplicateMessage"; "123123q";"" -"AdminUser%isolation%";"FirstName%isolation%";"LastName%isolation%";"email%isolation%@example.com";"123123q";"123123q";"Active";"-";"-";"assertUserSuccessSaveMessage, assertUserInGrid, assertUserSuccessLogOut, assertUserWrongCredentialsMessage"; "123123q";"" -"AdminUser%isolation%";"FirstName%isolation%";"LastName%isolation%";"email%isolation%@example.cim";"123123q";"123123q";"Active";"-";"-";"assertUserInvalidEmailMessage"; "123123q";"Bug: MAGETWO-28875" +"user/data/username";"user/data/firstname";"user/data/lastname";"user/data/email";"user/data/password";"user/data/password_confirmation";"user/data/is_active";"user/data/role_id/dataSet";"isDuplicated";"constraint";"user/data/current_password" +"AdminUser%isolation%";"FirstName%isolation%";"LastName%isolation%";"email%isolation%@example.com";"123123q";"123123q";"Active";"Administrators";"-";"assertUserSuccessSaveMessage, assertUserInGrid, assertUserSuccessLogOut, assertUserSuccessLogin"; "123123q" +"AdminUser%isolation%";"FirstName%isolation%";"LastName%isolation%";"email%isolation%@example.com";"123123q";"123123q";"Inactive";"Administrators";"-";"assertUserSuccessSaveMessage, assertUserInGrid, assertUserSuccessLogOut, assertUserWrongCredentialsMessage"; "123123q" +"-";"FirstName%isolation%";"LastName%isolation%";"email%isolation%@example.com";"123123q";"123123q";"Active";"Administrators";"username";"assertUserDuplicateMessage"; "123123q" +"AdminUser%isolation%";"FirstName%isolation%";"LastName%isolation%";"-";"123123q";"123123q";"Active";"Administrators";"email";"assertUserDuplicateMessage"; "123123q" +"AdminUser%isolation%";"FirstName%isolation%";"LastName%isolation%";"email%isolation%@example.com";"123123q";"123123q";"Active";"-";"-";"assertUserSuccessSaveMessage, assertUserInGrid, assertUserSuccessLogOut, assertUserWrongCredentialsMessage"; "123123q" +"AdminUser%isolation%";"FirstName%isolation%";"LastName%isolation%";"email%isolation%@example.cim";"123123q";"123123q";"Active";"-";"-";"assertUserInvalidEmailMessage"; "123123q" diff --git a/dev/tests/functional/tests/app/Magento/User/Test/TestCase/UpdateAdminUserRoleEntityTest/testUpdateAdminUserRolesEntity.csv b/dev/tests/functional/tests/app/Magento/User/Test/TestCase/UpdateAdminUserRoleEntityTest/testUpdateAdminUserRolesEntity.csv index 40e2c721a2b66..a90ad495b8a14 100644 --- a/dev/tests/functional/tests/app/Magento/User/Test/TestCase/UpdateAdminUserRoleEntityTest/testUpdateAdminUserRolesEntity.csv +++ b/dev/tests/functional/tests/app/Magento/User/Test/TestCase/UpdateAdminUserRoleEntityTest/testUpdateAdminUserRolesEntity.csv @@ -1,3 +1,3 @@ -"user/dataSet";"role/data/rolename";"role/data/resource_access";"role/data/roles_resources";"role/data/in_role_users/dataSet";"constraint";"issue" -"custom_admin_with_default_role";"NewAdminRole%isolation%";"-";"-";"-";"assertRoleSuccessSaveMessage, assertRoleInGrid, assertUserSuccessLogOut, assertUserSuccessLogin";"" -"default";"-";"Custom";"Sales";"custom_admin";"assertRoleSuccessSaveMessage, assertRoleInGrid, assertUserSuccessLogOut, assertUserSuccessLogin, assertUserRoleSalesRestrictedAccess";"Bug: MAGETWO-28587" +"user/dataSet";"role/data/rolename";"role/data/resource_access";"role/data/roles_resources";"role/data/in_role_users/dataSet";"constraint" +"custom_admin_with_default_role";"NewAdminRole%isolation%";"-";"-";"-";"assertRoleSuccessSaveMessage, assertRoleInGrid, assertUserSuccessLogOut, assertUserSuccessLogin" +"default";"-";"Custom";"Sales";"custom_admin";"assertRoleSuccessSaveMessage, assertRoleInGrid, assertUserSuccessLogOut, assertUserSuccessLogin, assertUserRoleSalesRestrictedAccess" diff --git a/dev/tests/functional/tests/app/Magento/User/Test/etc/constraint.xml b/dev/tests/functional/tests/app/Magento/User/Test/etc/constraint.xml index 5ed3437f673f2..972e9665d4b15 100644 --- a/dev/tests/functional/tests/app/Magento/User/Test/etc/constraint.xml +++ b/dev/tests/functional/tests/app/Magento/User/Test/etc/constraint.xml @@ -6,7 +6,7 @@ --> - low + low @@ -15,102 +15,102 @@ - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low diff --git a/dev/tests/functional/tests/app/Magento/Weee/Test/Block/Cart.php b/dev/tests/functional/tests/app/Magento/Weee/Test/Block/Cart.php deleted file mode 100644 index e0887ec82e603..0000000000000 --- a/dev/tests/functional/tests/app/Magento/Weee/Test/Block/Cart.php +++ /dev/null @@ -1,44 +0,0 @@ -getDataConfig(); - $typeId = isset($dataConfig['type_id']) ? $dataConfig['type_id'] : null; - $cartItem = null; - - if ($this->hasRender($typeId)) { - $cartItem = $this->callRender($typeId, 'getCartItem', ['product' => $product]); - } else { - $cartItemBlock = $this->_rootElement->find( - sprintf($this->cartItemByProductName, $product->getName()), - Locator::SELECTOR_XPATH - ); - $cartItem = $this->blockFactory->create( - 'Magento\Weee\Test\Block\Cart\CartItem', - ['element' => $cartItemBlock] - ); - } - - return $cartItem; - } -} diff --git a/dev/tests/functional/tests/app/Magento/Weee/Test/Block/Cart/CartItem.php b/dev/tests/functional/tests/app/Magento/Weee/Test/Block/Cart/CartItem.php deleted file mode 100644 index 29dacf85df721..0000000000000 --- a/dev/tests/functional/tests/app/Magento/Weee/Test/Block/Cart/CartItem.php +++ /dev/null @@ -1,55 +0,0 @@ -blockFactory->create( - 'Magento\Weee\Test\Block\Cart\CartItem\Fpt', - ['element' => $this->_rootElement->find($this->priceFptBlock, Locator::SELECTOR_XPATH)] - ); - } - - /** - * Get block subtotal fpt - * - * @return \Magento\Weee\Test\Block\Cart\CartItem\Fpt - */ - public function getSubtotalFptBlock() - { - return $this->blockFactory->create( - 'Magento\Weee\Test\Block\Cart\CartItem\Fpt', - ['element' => $this->_rootElement->find($this->subtotalFptBlock, Locator::SELECTOR_XPATH)] - ); - } -} diff --git a/dev/tests/functional/tests/app/Magento/Weee/Test/Block/Cart/CartItem/Fpt.php b/dev/tests/functional/tests/app/Magento/Weee/Test/Block/Cart/CartItem/Fpt.php deleted file mode 100644 index 1346102e43e84..0000000000000 --- a/dev/tests/functional/tests/app/Magento/Weee/Test/Block/Cart/CartItem/Fpt.php +++ /dev/null @@ -1,74 +0,0 @@ -_rootElement->find($this->fpt, Locator::SELECTOR_XPATH); - if (!$cartProductFpt->isVisible()) { - $this->_rootElement->find($this->price, Locator::SELECTOR_XPATH)->click(); - } - return str_replace(',', '', $this->escapeCurrency($cartProductFpt->getText())); - } - - /** - * Get product fpt total - * - * @return string - */ - public function getFptTotal() - { - $cartProductFptTotal = $this->_rootElement->find($this->fptTotal, Locator::SELECTOR_XPATH); - $cartProductFptTotalText = $cartProductFptTotal->isVisible() ? $cartProductFptTotal->getText() : ''; - return str_replace(',', '', $this->escapeCurrency($cartProductFptTotalText)); - } - - /** - * Escape currency in price - * - * @param string $price - * @return string|null - */ - protected function escapeCurrency($price) - { - preg_match("/^\\D*\\s*([\\d,\\.]+)\\s*\\D*$/", $price, $matches); - return (isset($matches[1])) ? $matches[1] : null; - } -} diff --git a/dev/tests/functional/tests/app/Magento/Weee/Test/Block/Cart/Totals.php b/dev/tests/functional/tests/app/Magento/Weee/Test/Block/Cart/Totals.php deleted file mode 100644 index 0321f29538d26..0000000000000 --- a/dev/tests/functional/tests/app/Magento/Weee/Test/Block/Cart/Totals.php +++ /dev/null @@ -1,34 +0,0 @@ -blockFactory->create( - 'Magento\Weee\Test\Block\Cart\Totals\Fpt', - ['element' => $this->_rootElement->find($this->fptBlock, Locator::SELECTOR_XPATH)] - ); - } -} diff --git a/dev/tests/functional/tests/app/Magento/Weee/Test/Block/Cart/Totals/Fpt.php b/dev/tests/functional/tests/app/Magento/Weee/Test/Block/Cart/Totals/Fpt.php deleted file mode 100644 index 62d282ee69e19..0000000000000 --- a/dev/tests/functional/tests/app/Magento/Weee/Test/Block/Cart/Totals/Fpt.php +++ /dev/null @@ -1,45 +0,0 @@ -_rootElement->find($this->totalFpt, Locator::SELECTOR_CSS)->getText(); - return $this->escapeCurrency($grandTotal); - } - - /** - * Escape currency in price - * - * @param string $price - * @return string|null - */ - protected function escapeCurrency($price) - { - preg_match("/^\\D*\\s*([\\d,\\.]+)\\s*\\D*$/", $price, $matches); - return (isset($matches[1])) ? $matches[1] : null; - } -} diff --git a/dev/tests/functional/tests/app/Magento/Weee/Test/Block/Product/Fpt.php b/dev/tests/functional/tests/app/Magento/Weee/Test/Block/Product/Fpt.php deleted file mode 100644 index e7b69582c6220..0000000000000 --- a/dev/tests/functional/tests/app/Magento/Weee/Test/Block/Product/Fpt.php +++ /dev/null @@ -1,49 +0,0 @@ - [ - 'selector' => '[class="weee"] .price', - ], - 'weee_total' => [ - 'selector' => '[class="weee"] [data-label="Total"] .price', - ], - ]; - - /** - * Get fpt - * - * @param string $currency - * @return string - */ - public function getFpt($currency = '$') - { - return $this->getTypePrice('weee', $currency); - } - - /** - * Get fpt total - * - * @param string $currency - * @return string - */ - public function getFptTotal($currency = '$') - { - return $this->getTypePrice('weee_total', $currency); - } -} diff --git a/dev/tests/functional/tests/app/Magento/Weee/Test/Block/Product/ListProduct.php b/dev/tests/functional/tests/app/Magento/Weee/Test/Block/Product/ListProduct.php deleted file mode 100644 index ce3f3ba4718f4..0000000000000 --- a/dev/tests/functional/tests/app/Magento/Weee/Test/Block/Product/ListProduct.php +++ /dev/null @@ -1,38 +0,0 @@ -getProductDetailsElement($productName) - ->find(sprintf($this->fptBlockClass, $fptLabel), Locator::SELECTOR_CSS); - return $this->blockFactory->create( - 'Magento\Weee\Test\Block\Product\Fpt', - ['element' => $element] - ); - } -} diff --git a/dev/tests/functional/tests/app/Magento/Weee/Test/Block/Product/View.php b/dev/tests/functional/tests/app/Magento/Weee/Test/Block/Product/View.php deleted file mode 100644 index 02ca9a56ee9d9..0000000000000 --- a/dev/tests/functional/tests/app/Magento/Weee/Test/Block/Product/View.php +++ /dev/null @@ -1,35 +0,0 @@ -blockFactory->create( - 'Magento\Weee\Test\Block\Product\Fpt', - ['element' => $this->_rootElement->find(sprintf($this->fptBlock, $fptLabel), Locator::SELECTOR_CSS)] - ); - } -} diff --git a/dev/tests/functional/tests/app/Magento/Weee/Test/Constraint/AssertFptApplied.php b/dev/tests/functional/tests/app/Magento/Weee/Test/Constraint/AssertFptApplied.php deleted file mode 100644 index 960dcf8132e94..0000000000000 --- a/dev/tests/functional/tests/app/Magento/Weee/Test/Constraint/AssertFptApplied.php +++ /dev/null @@ -1,196 +0,0 @@ -cmsIndex = $cmsIndex; - $this->catalogCategoryView = $catalogCategoryView; - $this->catalogProductView = $catalogProductView; - $this->checkoutCart = $checkoutCart; - $this->fptLabel = $product->getDataFieldConfig('attribute_set_id')['source'] - ->getAttributeSet()->getDataFieldConfig('assigned_attributes')['source'] - ->getAttributes()[0]->getFrontendLabel(); - $this->clearShoppingCart(); - $actualPrices = $this->getPrices($product); - //Prices verification - \PHPUnit_Framework_Assert::assertEquals( - $prices, - $actualPrices, - 'Prices on front should be equal to defined in dataset' - ); - } - - /** - * Clear shopping cart - * - * @return void - */ - protected function clearShoppingCart() - { - $this->checkoutCart->open(); - $this->checkoutCart->getCartBlock()->clearShoppingCart(); - } - - /** - * Get prices with fpt on category, product and cart pages - * - * @param CatalogProductSimple $product - * @return array - */ - protected function getPrices(CatalogProductSimple $product) - { - $actualPrices = []; - $productName = $product->getName(); - // Get prices with fpt on category page - $this->cmsIndex->open(); - $this->cmsIndex->getTopmenu()->selectCategoryByName($product->getCategoryIds()[0]); - $actualPrices = $this->getCategoryPrice($productName, $actualPrices); - // Get prices with fpt on product page - $this->catalogCategoryView->getListProductBlock()->openProductViewPage($productName); - $actualPrices = $this->addToCart($product, $actualPrices); - // Get prices with fpt on cart page - $actualPrices = $this->getCartPrice($product, $actualPrices); - - return $actualPrices; - } - - /** - * Get prices on category page - * - * @param string $productName - * @param array $actualPrices - * @return array - */ - protected function getCategoryPrice($productName, $actualPrices) - { - $productBlock = $this->catalogCategoryView->getListProductBlock(); - $actualPrices['category_price'] = $productBlock->getProductPriceBlock($productName)->getEffectivePrice(); - $productWeeeBlock = $this->catalogCategoryView->getWeeeListProductBlock(); - $actualPrices['fpt_category'] = $productWeeeBlock->getProductFptBlock($productName, $this->fptLabel)->getFpt(); - $actualPrices['fpt_total_category'] = $productWeeeBlock->getProductFptBlock($productName, $this->fptLabel) - ->getFptTotal(); - - return $actualPrices; - } - - /** - * Fill options get price and add to cart - * - * @param CatalogProductSimple $product - * @param array $actualPrices - * @return array - */ - protected function addToCart(CatalogProductSimple $product, array $actualPrices) - { - $viewBlock = $this->catalogProductView->getViewBlock(); - $viewBlock->fillOptions($product); - $actualPrices['product_page_price'] = $viewBlock->getPriceBlock()->getEffectivePrice(); - $viewWeeeBlock = $this->catalogProductView->getWeeeViewBlock(); - $actualPrices['product_page_fpt'] = $viewWeeeBlock->getFptBlock($this->fptLabel)->getFpt(); - $actualPrices['product_page_fpt_total'] = $viewWeeeBlock->getFptBlock($this->fptLabel)->getFptTotal(); - $viewBlock->clickAddToCart(); - - return $actualPrices; - } - - /** - * Get cart prices - * - * @param CatalogProductSimple $product - * @param array $actualPrices - * @return array - */ - protected function getCartPrice(CatalogProductSimple $product, array $actualPrices) - { - $productItem = $this->checkoutCart->getCartBlock()->getCartItem($product); - $productWeeeItem = $this->checkoutCart->getWeeeCartBlock()->getCartItem($product); - $actualPrices['cart_item_price'] = $productItem->getPrice(); - $actualPrices['cart_item_fpt'] = $productWeeeItem->getPriceFptBlock()->getFpt(); - $actualPrices['cart_item_fpt_total'] = $productWeeeItem->getPriceFptBlock()->getFptTotal(); - $actualPrices['cart_item_subtotal'] = $productItem->getSubtotalPrice(); - $actualPrices['cart_item_subtotal_fpt'] = $productWeeeItem->getSubtotalFptBlock()->getFpt(); - $actualPrices['cart_item_subtotal_fpt_total'] = $productWeeeItem->getSubtotalFptBlock()->getFptTotal(); - $actualPrices['grand_total'] = $this->checkoutCart->getTotalsBlock()->getGrandTotal(); - $actualPrices['total_fpt'] = $this->checkoutCart->getWeeeTotalsBlock()->getFptBlock()->getTotalFpt(); - - return $actualPrices; - } - - /** - * Text of FPT is applied - * - * @return string - */ - public function toString() - { - return 'FPT is applied to product.'; - } -} diff --git a/dev/tests/functional/tests/app/Magento/Weee/Test/Page/Category/CatalogCategoryView.xml b/dev/tests/functional/tests/app/Magento/Weee/Test/Page/Category/CatalogCategoryView.xml deleted file mode 100644 index da7a0087d6277..0000000000000 --- a/dev/tests/functional/tests/app/Magento/Weee/Test/Page/Category/CatalogCategoryView.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - Magento\Weee\Test\Block\Product\ListProduct - .products.wrapper.grid - css selector - - - diff --git a/dev/tests/functional/tests/app/Magento/Weee/Test/Page/CheckoutCart.xml b/dev/tests/functional/tests/app/Magento/Weee/Test/Page/CheckoutCart.xml deleted file mode 100644 index bbd0b3669f31f..0000000000000 --- a/dev/tests/functional/tests/app/Magento/Weee/Test/Page/CheckoutCart.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - Magento\Weee\Test\Block\Cart - //div[contains(@class, "column main")] - xpath - - - Magento\Weee\Test\Block\Cart\Totals - #shopping-cart-totals-table - css selector - - - diff --git a/dev/tests/functional/tests/app/Magento/Weee/Test/Page/Product/CatalogProductView.xml b/dev/tests/functional/tests/app/Magento/Weee/Test/Page/Product/CatalogProductView.xml deleted file mode 100644 index 8830078965652..0000000000000 --- a/dev/tests/functional/tests/app/Magento/Weee/Test/Page/Product/CatalogProductView.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - Magento\Weee\Test\Block\Product\View - #maincontent - css selector - - - diff --git a/dev/tests/functional/tests/app/Magento/Weee/Test/TestCase/CreateTaxWithFptTest.php b/dev/tests/functional/tests/app/Magento/Weee/Test/TestCase/CreateTaxWithFptTest.php deleted file mode 100644 index 37c4631795e71..0000000000000 --- a/dev/tests/functional/tests/app/Magento/Weee/Test/TestCase/CreateTaxWithFptTest.php +++ /dev/null @@ -1,135 +0,0 @@ - Taxes > Tax Rules. - * 4. Click 'Add New Tax Rule' button. - * 5. Assign default rates to rule. - * 6. Save Tax Rule. - * 7. Go to Stores > Attributes > Product and add new attribute. - * 8. Select Fixed Product Tax type and fill attribute label. - * 9. Save attribute. - * 10. Go to Stores > Attributes > Product Template. - * 11. Add new product template based on default. - * 12. Add created FPT attribute to Product Details group and fill set name. - * 13. Save attribute set. - * - * Steps: - * 1. Go to Products > Catalog. - * 2. Add new product. - * 3. Select created product template. - * 4. Fill data according to dataset. - * 5. Save product. - * 6. Go to Stores > Configuration. - * 7. Fill FPT and Tax configuration according to data set. - * 8. Save tax configuration. - * 9. Go to frontend and login with customer - * 10. Perform all assertions. - * - * @group Tax_(CS) - * @ZephyrId MAGETWO-29551 - */ -class CreateTaxWithFptTest extends Injectable -{ - /** - * Fixture factory - * - * @var FixtureFactory - */ - protected $fixtureFactory; - - /** - * Prepare data - * - * @param FixtureFactory $fixtureFactory - * @return array - */ - public function __prepare( - FixtureFactory $fixtureFactory - ) { - $this->fixtureFactory = $fixtureFactory; - $customer = $fixtureFactory->createByCode('customerInjectable', ['dataSet' => 'johndoe_with_addresses']); - $customer->persist(); - $taxRule = $fixtureFactory->createByCode('taxRule', ['dataSet' => 'tax_rule_default']); - $taxRule->persist(); - $productTemplate = $this->fixtureFactory - ->createByCode('catalogAttributeSet', ['dataSet' => 'custom_attribute_set_with_fpt']); - $productTemplate->persist(); - return [ - 'customer' => $customer, - 'productTemplate' => $productTemplate - ]; - } - - /** - * Login customer - * - * @param CustomerInjectable $customer - * @return void - */ - protected function loginCustomer(CustomerInjectable $customer) - { - $this->objectManager->create( - '\Magento\Customer\Test\TestStep\LoginCustomerOnFrontendStep', - ['customer' => $customer] - )->run(); - } - - /** - * Test product prices with tax - * - * @param ConfigData $config - * @param CustomerInjectable $customer - * @param CatalogAttributeSet $productTemplate - * @param array $productData - * @return array - */ - public function test( - $productData, - ConfigData $config, - CustomerInjectable $customer, - CatalogAttributeSet $productTemplate - ) { - $product = $this->fixtureFactory->createByCode( - 'catalogProductSimple', - ['dataSet' => $productData, 'data' => ['attribute_set_id' => ['attribute_set' => $productTemplate]]] - ); - $product->persist(); - $config->persist(); - $this->loginCustomer($customer); - return ['product' => $product]; - } - - /** - * Tear down after tests - * - * @return void - */ - public static function tearDownAfterClass() - { - ObjectManager::getInstance()->create('\Magento\Tax\Test\TestStep\DeleteAllTaxRulesStep')->run(); - ObjectManager::getInstance()->create( - 'Magento\Core\Test\TestStep\SetupConfigurationStep', - ['configData' => 'default_tax_configuration'] - )->run(); - } -} diff --git a/dev/tests/functional/tests/app/Magento/Weee/Test/TestCase/CreateTaxWithFptTest/test.csv b/dev/tests/functional/tests/app/Magento/Weee/Test/TestCase/CreateTaxWithFptTest/test.csv deleted file mode 100644 index 3d36f615ecbc4..0000000000000 --- a/dev/tests/functional/tests/app/Magento/Weee/Test/TestCase/CreateTaxWithFptTest/test.csv +++ /dev/null @@ -1,12 +0,0 @@ -"description";"config/dataSet";"productData";"prices/category_price";"prices/fpt_category";"prices/fpt_total_category";"prices/product_page_price";"prices/product_page_fpt";"prices/product_page_fpt_total";"prices/cart_item_price";"prices/cart_item_fpt";"prices/cart_item_fpt_total";"prices/cart_item_subtotal";"prices/cart_item_subtotal_fpt";"prices/cart_item_subtotal_fpt_total";"prices/grand_total";"prices/total_fpt";"constraint";"issue" -"Check not taxed FPT display set to Excluding, Description and Including FPT on product with custom option catalog price Excluding Tax";"tax_with_fpt_cat_excl_disp_excl";"with_custom_option_and_fpt";"70.00";"10.00";"80.00";"100.00";"10.00";"110.00";"100.00";"10.00";"110.00";"100.00";"10.00";"110.00";"118.25";"10.00";"assertFptApplied";"MAGETWO-29617" -"Check not taxed FPT display set to Including FPT and Description on product with custom option catalog price Excluding Tax";"tax_with_fpt_cat_excl_disp_incl";"with_custom_option_and_fpt";"80.00";"10.00";"";"100.00";"10.00";"";"110.00";"10.00";"";"110.00";"10.00";"";"118.25";"10.00";"assertFptApplied";"" -"Check not taxed FPT display set to Excluding, Description and Including FPT on product with special price catalog price Excluding Tax";"tax_with_fpt_cat_excl_disp_incl";"with_special_price_and_fpt";"110.00";"10.00";"";"110.00";"10.00";"";"110.00";"10.00";"";"110.00";"10.00";"";"118.25";"10.00";"assertFptApplied";"" -"Check not taxed FPT display set to Including FPT and Description on product with special price catalog price Excluding Tax";"tax_with_fpt_cat_excl_disp_excl";"with_special_price_and_fpt";"100.00";"10.00";"110.00";"100.00";"10.00";"110.00";"100.00";"10.00";"110.00";"100.00";"10.00";"110.00";"118.25";"10.00";"assertFptApplied";"MAGETWO-29617" -"Check taxed FPT display set to Excluding, Description and Including FPT on product with with custom option catalog price Excluding Tax";"tax_with_fpt_taxed_cat_excl_disp_excl";"with_custom_option_and_fpt";"70.00";"10.00";"80.00";"100.00";"10.00";"110.00";"100.00";"10.00";"110.00";"100.00";"10.00";"110.00";"119.08";"10.00";"assertFptApplied";"MAGETWO-29617" -"Check taxed FPT display set to Including FPT and Description on product with with custom option catalog price Excluding Tax";"tax_with_fpt_taxed_cat_excl_disp_incl";"with_custom_option_and_fpt";"80.00";"10.00";"";"100.00";"10.00";"";"110.00";"10.00";"";"110.00";"10.00";"";"119.08";"10.00";"assertFptApplied";"" -"Check taxed FPT display set to Excluding, Description and Including FPT on product with special price catalog price Excluding Tax";"tax_with_fpt_taxed_cat_excl_disp_incl";"with_special_price_and_fpt";"110.00";"10.00";"";"110.00";"10.00";"";"110.00";"10.00";"";"110.00";"10.00";"";"119.08";"10.00";"assertFptApplied";"" -"Check taxed FPT display set to Including FPT and Description on product with special price catalog price Excluding Tax";"tax_with_fpt_taxed_cat_excl_disp_excl";"with_special_price_and_fpt";"100.00";"10.00";"110.00";"100.00";"10.00";"110.00";"100.00";"10.00";"110.00";"100.00";"10.00";"110.00";"119.08";"10.00";"assertFptApplied";"MAGETWO-29617" -"Check taxed FPT display set to Excluding, Description and Including FPT on product with with special price and catalog price Including Tax";"tax_with_fpt_taxed_cat_incl_disp_excl";"with_special_price_and_fpt";"82.38";"10.00";"92.38";"82.38";"10.00";"92.38";"92.38";"9.24";"101.62";"92.38";"9.24";"101.62";"110.00";"10.00";"assertFptApplied";"MAGETWO-29617" -"Check taxed FPT display set to Including FPT and Description on product with with special price and catalog price Including Tax";"tax_with_fpt_taxed_cat_incl_disp_incl";"with_special_price_and_fpt";"92.38";"10.00";"";"92.38";"10.00";"";"101.62";"9.24";"";"101.62";"9.24";"";"110.00";"10.00";"assertFptApplied";"" -"Check taxed FPT display set to Excluding, Description and Including FPT on product with with custom option and catalog price Including Tax";"tax_with_fpt_taxed_cat_incl_disp_excl";"with_custom_option_and_fpt";"54.67";"10.00";"64.67";"82.38";"10.00";"92.38";"92.38";"9.24";"101.62";"92.38";"9.24";"101.62";"110.00";"10.00";"assertFptApplied";"MAGETWO-29617" diff --git a/dev/tests/functional/tests/app/Magento/Weee/Test/etc/constraint.xml b/dev/tests/functional/tests/app/Magento/Weee/Test/etc/constraint.xml deleted file mode 100644 index 2d842994ffe22..0000000000000 --- a/dev/tests/functional/tests/app/Magento/Weee/Test/etc/constraint.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - high - - diff --git a/dev/tests/functional/tests/app/Magento/Wishlist/Test/Block/Adminhtml/Customer/Edit/Tab/Wishlist/Grid.php b/dev/tests/functional/tests/app/Magento/Wishlist/Test/Block/Adminhtml/Customer/Edit/Tab/Wishlist/Grid.php index 274d23169e349..c2374e20b52ae 100644 --- a/dev/tests/functional/tests/app/Magento/Wishlist/Test/Block/Adminhtml/Customer/Edit/Tab/Wishlist/Grid.php +++ b/dev/tests/functional/tests/app/Magento/Wishlist/Test/Block/Adminhtml/Customer/Edit/Tab/Wishlist/Grid.php @@ -105,9 +105,6 @@ protected function getRow(array $filter, $isSearchable = true, $isStrict = true) } $location = '//div[@class="grid"]//tr['; $rowTemplate = 'td[contains(.,normalize-space("%s"))]'; - if ($isStrict) { - $rowTemplate = 'td[text()[normalize-space()="%s"]]'; - } $rows = []; foreach ($filter as $value) { $rows[] = sprintf($rowTemplate, $value); diff --git a/dev/tests/functional/tests/app/Magento/Wishlist/Test/Block/Adminhtml/Edit/CustomerForm.xml b/dev/tests/functional/tests/app/Magento/Wishlist/Test/Block/Adminhtml/Edit/CustomerForm.xml index 6bf8bbb220023..3bca952aecf22 100644 --- a/dev/tests/functional/tests/app/Magento/Wishlist/Test/Block/Adminhtml/Edit/CustomerForm.xml +++ b/dev/tests/functional/tests/app/Magento/Wishlist/Test/Block/Adminhtml/Edit/CustomerForm.xml @@ -7,7 +7,7 @@ \Magento\Wishlist\Test\Block\Adminhtml\Customer\Edit\Tab\Wishlist - #customer_info_tabs_wishlist + #tab_wishlist css selector diff --git a/dev/tests/functional/tests/app/Magento/Wishlist/Test/Constraint/AssertAddProductToWishlistSuccessMessage.php b/dev/tests/functional/tests/app/Magento/Wishlist/Test/Constraint/AssertAddProductToWishlistSuccessMessage.php index 077ab523f5f9a..2d0905f33ddbb 100644 --- a/dev/tests/functional/tests/app/Magento/Wishlist/Test/Constraint/AssertAddProductToWishlistSuccessMessage.php +++ b/dev/tests/functional/tests/app/Magento/Wishlist/Test/Constraint/AssertAddProductToWishlistSuccessMessage.php @@ -15,18 +15,15 @@ */ class AssertAddProductToWishlistSuccessMessage extends AbstractConstraint { + /* tags */ + const SEVERITY = 'low'; + /* end tags */ + /** * Success add message */ const SUCCESS_MESSAGE = "%s has been added to your wishlist. Click here to continue shopping."; - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; - /** * Assert that success message appears on My Wish List page after adding product to wishlist. * diff --git a/dev/tests/functional/tests/app/Magento/Wishlist/Test/Constraint/AssertMoveProductToWishlistSuccessMessage.php b/dev/tests/functional/tests/app/Magento/Wishlist/Test/Constraint/AssertMoveProductToWishlistSuccessMessage.php index a7b13e8bffb64..cc28d74f53f43 100644 --- a/dev/tests/functional/tests/app/Magento/Wishlist/Test/Constraint/AssertMoveProductToWishlistSuccessMessage.php +++ b/dev/tests/functional/tests/app/Magento/Wishlist/Test/Constraint/AssertMoveProductToWishlistSuccessMessage.php @@ -15,18 +15,15 @@ */ class AssertMoveProductToWishlistSuccessMessage extends AbstractConstraint { + /* tags */ + const SEVERITY = 'low'; + /* end tags */ + /** * Success add message */ const SUCCESS_MESSAGE = "%s has been moved to wish list Wish List"; - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; - /** * Assert that success message appears on My Wish List page after moving product to wishlist. * diff --git a/dev/tests/functional/tests/app/Magento/Wishlist/Test/Constraint/AssertProductDetailsInWishlist.php b/dev/tests/functional/tests/app/Magento/Wishlist/Test/Constraint/AssertProductDetailsInWishlist.php index 64881ef289947..23765d99f718e 100644 --- a/dev/tests/functional/tests/app/Magento/Wishlist/Test/Constraint/AssertProductDetailsInWishlist.php +++ b/dev/tests/functional/tests/app/Magento/Wishlist/Test/Constraint/AssertProductDetailsInWishlist.php @@ -17,12 +17,9 @@ */ class AssertProductDetailsInWishlist extends AbstractAssertForm { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that the correct option details are displayed on the "View Details" tool tip @@ -44,7 +41,10 @@ public function processAssert( $cartFixture = $fixtureFactory->createByCode('cart', ['data' => ['items' => ['products' => [$product]]]]); $expectedOptions = $cartFixture->getItems()[0]->getData()['options']; - $errors = $this->verifyData($expectedOptions, $actualOptions); + $errors = $this->verifyData( + $this->sortDataByPath($expectedOptions, '::title'), + $this->sortDataByPath($actualOptions, '::title') + ); \PHPUnit_Framework_Assert::assertEmpty($errors, $errors); } diff --git a/dev/tests/functional/tests/app/Magento/Wishlist/Test/Constraint/AssertProductInCustomerWishlistOnBackendGrid.php b/dev/tests/functional/tests/app/Magento/Wishlist/Test/Constraint/AssertProductInCustomerWishlistOnBackendGrid.php index a210f017074e1..aec67bef8064c 100644 --- a/dev/tests/functional/tests/app/Magento/Wishlist/Test/Constraint/AssertProductInCustomerWishlistOnBackendGrid.php +++ b/dev/tests/functional/tests/app/Magento/Wishlist/Test/Constraint/AssertProductInCustomerWishlistOnBackendGrid.php @@ -16,12 +16,9 @@ */ class AssertProductInCustomerWishlistOnBackendGrid extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that product is present in grid on customer's wish list tab with configure option and qty diff --git a/dev/tests/functional/tests/app/Magento/Wishlist/Test/Constraint/AssertProductIsPresentInCustomerBackendWishlist.php b/dev/tests/functional/tests/app/Magento/Wishlist/Test/Constraint/AssertProductIsPresentInCustomerBackendWishlist.php index 711732e33f1c8..c664bfbbc42e2 100644 --- a/dev/tests/functional/tests/app/Magento/Wishlist/Test/Constraint/AssertProductIsPresentInCustomerBackendWishlist.php +++ b/dev/tests/functional/tests/app/Magento/Wishlist/Test/Constraint/AssertProductIsPresentInCustomerBackendWishlist.php @@ -18,12 +18,9 @@ */ class AssertProductIsPresentInCustomerBackendWishlist extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that products added to wishlist are present on Customers account on backend. @@ -47,7 +44,7 @@ public function processAssert( $wishlistGrid = $customerIndexEdit->getCustomerForm()->getTabElement('wishlist')->getSearchGridBlock(); \PHPUnit_Framework_Assert::assertTrue( - $wishlistGrid->isRowVisible(['product_name' => $product->getName()]), + $wishlistGrid->isRowVisible(['product_name' => $product->getName()], true, false), $product->getName() . " is not visible in customer wishlist on backend." ); } diff --git a/dev/tests/functional/tests/app/Magento/Wishlist/Test/Constraint/AssertProductIsPresentInWishlist.php b/dev/tests/functional/tests/app/Magento/Wishlist/Test/Constraint/AssertProductIsPresentInWishlist.php index d4c007777e994..d6c6854ac8604 100644 --- a/dev/tests/functional/tests/app/Magento/Wishlist/Test/Constraint/AssertProductIsPresentInWishlist.php +++ b/dev/tests/functional/tests/app/Magento/Wishlist/Test/Constraint/AssertProductIsPresentInWishlist.php @@ -17,12 +17,9 @@ */ class AssertProductIsPresentInWishlist extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that product is present in default wishlist diff --git a/dev/tests/functional/tests/app/Magento/Wishlist/Test/Constraint/AssertProductsIsAbsentInWishlist.php b/dev/tests/functional/tests/app/Magento/Wishlist/Test/Constraint/AssertProductsIsAbsentInWishlist.php index cf330dc751a05..b5df2c1b8ef75 100644 --- a/dev/tests/functional/tests/app/Magento/Wishlist/Test/Constraint/AssertProductsIsAbsentInWishlist.php +++ b/dev/tests/functional/tests/app/Magento/Wishlist/Test/Constraint/AssertProductsIsAbsentInWishlist.php @@ -20,12 +20,9 @@ */ class AssertProductsIsAbsentInWishlist extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that product is not present in Wishlist on Frontend diff --git a/dev/tests/functional/tests/app/Magento/Wishlist/Test/Constraint/AssertWishlistIsEmpty.php b/dev/tests/functional/tests/app/Magento/Wishlist/Test/Constraint/AssertWishlistIsEmpty.php index 5ae0070689bb9..ef833626c2015 100644 --- a/dev/tests/functional/tests/app/Magento/Wishlist/Test/Constraint/AssertWishlistIsEmpty.php +++ b/dev/tests/functional/tests/app/Magento/Wishlist/Test/Constraint/AssertWishlistIsEmpty.php @@ -15,12 +15,9 @@ */ class AssertWishlistIsEmpty extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert wish list is empty diff --git a/dev/tests/functional/tests/app/Magento/Wishlist/Test/Constraint/AssertWishlistShareMessage.php b/dev/tests/functional/tests/app/Magento/Wishlist/Test/Constraint/AssertWishlistShareMessage.php index 7bf0348b1c77d..a66a7b74c8dad 100644 --- a/dev/tests/functional/tests/app/Magento/Wishlist/Test/Constraint/AssertWishlistShareMessage.php +++ b/dev/tests/functional/tests/app/Magento/Wishlist/Test/Constraint/AssertWishlistShareMessage.php @@ -14,18 +14,15 @@ */ class AssertWishlistShareMessage extends AbstractConstraint { + /* tags */ + const SEVERITY = 'low'; + /* end tags */ + /** * Success wishlist share message */ const SUCCESS_MESSAGE = 'Your wish list has been shared.'; - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; - /** * Assert that success message is displayed after wishlist has been shared * diff --git a/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/AddProductToWishlistEntityTest.php b/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/AddProductToWishlistEntityTest.php deleted file mode 100644 index cd11872300b69..0000000000000 --- a/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/AddProductToWishlistEntityTest.php +++ /dev/null @@ -1,61 +0,0 @@ -persist(); - - return ['customer' => $customer]; - } - - /** - * Run Add Product To Wishlist test - * - * @param CustomerInjectable $customer - * @param string $product - * @return array - */ - public function test(CustomerInjectable $customer, $product) - { - $this->markTestIncomplete('Bug: MAGETWO-27949'); - $product = $this->createProducts($product)[0]; - - // Steps: - $this->loginCustomer($customer); - $this->addToWishlist([$product], true); - - return ['product' => $product]; - } -} diff --git a/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/AddProductToWishlistEntityTest/test.csv b/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/AddProductToWishlistEntityTest/test.csv deleted file mode 100644 index 92def772d1f25..0000000000000 --- a/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/AddProductToWishlistEntityTest/test.csv +++ /dev/null @@ -1,8 +0,0 @@ -"product";"constraint" -"catalogProductSimple::default";"assertAddProductToWishlistSuccessMessage, assertProductIsPresentInWishlist, assertProductIsPresentInCustomerBackendWishlist" -"catalogProductVirtual::default";"assertAddProductToWishlistSuccessMessage, assertProductIsPresentInWishlist, assertProductIsPresentInCustomerBackendWishlist" -"downloadableProductInjectable::with_two_separately_links";"assertAddProductToWishlistSuccessMessage, assertProductIsPresentInWishlist, assertProductIsPresentInCustomerBackendWishlist" -"groupedProductInjectable::three_simple_products";"assertAddProductToWishlistSuccessMessage, assertProductIsPresentInWishlist, assertProductIsPresentInCustomerBackendWishlist" -"configurableProductInjectable::default";"assertAddProductToWishlistSuccessMessage, assertProductIsPresentInWishlist, assertProductIsPresentInCustomerBackendWishlist" -"bundleProduct::bundle_dynamic_product";"assertAddProductToWishlistSuccessMessage, assertProductDetailsInWishlist, assertProductIsPresentInCustomerBackendWishlist" -"bundleProduct::bundle_fixed_product";"assertAddProductToWishlistSuccessMessage, assertProductDetailsInWishlist, assertProductIsPresentInCustomerBackendWishlist" \ No newline at end of file diff --git a/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/AddProductsToCartFromCustomerWishlistOnFrontendTest.php b/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/AddProductsToCartFromCustomerWishlistOnFrontendTest.php deleted file mode 100644 index 2b20ff511881b..0000000000000 --- a/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/AddProductsToCartFromCustomerWishlistOnFrontendTest.php +++ /dev/null @@ -1,100 +0,0 @@ - My Wishlist - * 2. Fill qty and update wish list - * 3. Click "Add to Cart" - * 4. Perform asserts - * - * @group Wishlist_(CS) - * @ZephyrId MAGETWO-25268 - */ -class AddProductsToCartFromCustomerWishlistOnFrontendTest extends AbstractWishlistTest -{ - /** - * Browser - * - * @var Browser - */ - protected $browser; - - /** - * Run suggest searching result test - * - * @param CustomerInjectable $customer - * @param string $products - * @param int $qty - * @param Browser $browser - * @return array - */ - public function test(CustomerInjectable $customer, $products, $qty, Browser $browser) - { - $this->markTestIncomplete("Bug: MAGETWO-30097"); - // Preconditions - $this->browser = $browser; - $customer->persist(); - $this->loginCustomer($customer); - $products = $this->createProducts($products); - $this->addToWishlist($products); - - // Steps - $this->addToCart($products, $qty); - - // Prepare data for asserts - $cart = $this->createCart($products); - - return ['products' => $products, 'customer' => $customer, 'cart' => $cart]; - } - - /** - * Add products from wish list to cart - * - * @param array $products - * @param int $qty - * @return void - */ - protected function addToCart(array $products, $qty) - { - foreach ($products as $product) { - $this->cmsIndex->getLinksBlock()->openLink("My Wish List"); - if ($qty != '-') { - $this->wishlistIndex->getItemsBlock()->getItemProduct($product)->fillProduct(['qty' => $qty]); - $this->wishlistIndex->getWishlistBlock()->clickUpdateWishlist(); - } - $this->wishlistIndex->getItemsBlock()->getItemProduct($product)->clickAddToCart(); - if (strpos($this->browser->getUrl(), 'checkout/cart/') === false) { - $this->catalogProductView->getViewBlock()->addToCart($product); - } - } - } - - /** - * Create cart fixture - * - * @param array $products - * @return Cart - */ - protected function createCart(array $products) - { - return $this->fixtureFactory->createByCode('cart', ['data' => ['items' => ['products' => $products]]]); - } -} diff --git a/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/AddProductsToCartFromCustomerWishlistOnFrontendTest/test.csv b/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/AddProductsToCartFromCustomerWishlistOnFrontendTest/test.csv deleted file mode 100644 index 471cd7123f1cf..0000000000000 --- a/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/AddProductsToCartFromCustomerWishlistOnFrontendTest/test.csv +++ /dev/null @@ -1,9 +0,0 @@ -"products";"qty";"constraint" -"catalogProductSimple::100_dollar_product";"2";"assertProductQtyInShoppingCart, assertProductsIsAbsentInWishlist" -"catalogProductVirtual::50_dollar_product";"1";"assertProductQtyInShoppingCart, assertProductsIsAbsentInWishlist" -"catalogProductSimple::default,catalogProductVirtual::50_dollar_product,catalogProductSimple::default,catalogProductVirtual::50_dollar_product";"-";"assertProductQtyInShoppingCart, assertWishlistIsEmpty" -"groupedProductInjectable::three_simple_products";"-";"assertProductQtyInShoppingCart, assertProductsIsAbsentInWishlist" -"downloadableProductInjectable::with_two_separately_links";"-";"assertProductQtyInShoppingCart, assertProductsIsAbsentInWishlist" -"configurableProductInjectable::default";"3";"assertProductQtyInShoppingCart, assertProductsIsAbsentInWishlist" -"bundleProduct::bundle_dynamic_product";"2";"assertProductQtyInShoppingCart, assertProductsIsAbsentInWishlist" -"bundleProduct::bundle_fixed_product";"2";"assertProductQtyInShoppingCart, assertProductsIsAbsentInWishlist" diff --git a/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/ConfigureProductInCustomerWishlistOnBackendTest.php b/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/ConfigureProductInCustomerWishlistOnBackendTest.php deleted file mode 100644 index a7d702343d290..0000000000000 --- a/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/ConfigureProductInCustomerWishlistOnBackendTest.php +++ /dev/null @@ -1,82 +0,0 @@ - All Customers - * 3. Open the customer - * 4. Open wishlist tab - * 5. Click 'Configure' for the product - * 6. Fill in data - * 7. Click Ok - * 8. Perform assertions - * - * @group Wishlist_(CS) - * @ZephyrId MAGETWO-29257 - */ -class ConfigureProductInCustomerWishlistOnBackendTest extends AbstractWishlistTest -{ - /** - * Prepare data - * - * @param CustomerInjectable $customer - * @return array - */ - public function __prepare(CustomerInjectable $customer) - { - $customer->persist(); - - return ['customer' => $customer]; - } - - /** - * Configure customer wish list on backend - * - * @param CustomerInjectable $customer - * @param string $product - * @param CustomerIndex $customerIndex - * @param CustomerIndexEdit $customerIndexEdit - * @return array - */ - public function test( - CustomerInjectable $customer, - $product, - CustomerIndex $customerIndex, - CustomerIndexEdit $customerIndexEdit - ) { - // Preconditions - $product = $this->createProducts($product)[0]; - $this->loginCustomer($customer); - $this->addToWishlist([$product]); - // Steps - $customerIndex->open(); - $customerIndex->getCustomerGridBlock()->searchAndOpen(['email' => $customer->getEmail()]); - $customerForm = $customerIndexEdit->getCustomerForm(); - $customerForm->openTab('wishlist'); - $customerForm->getTabElement('wishlist')->getSearchGridBlock()->searchAndAction( - ['product_name' => $product->getName()], - 'Configure' - ); - $customerIndexEdit->getConfigureProductBlock()->configProduct($product); - - return['product' => $product]; - } -} diff --git a/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/ConfigureProductInCustomerWishlistOnBackendTest/test.csv b/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/ConfigureProductInCustomerWishlistOnBackendTest/test.csv deleted file mode 100644 index 740881766b87f..0000000000000 --- a/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/ConfigureProductInCustomerWishlistOnBackendTest/test.csv +++ /dev/null @@ -1,6 +0,0 @@ -"product";"constraint" -"catalogProductSimple::with_two_custom_option";"assertProductInCustomerWishlistOnBackendGrid" -"configurableProductInjectable::default";"assertConfigurableProductInCustomerWishlistOnBackendGrid" -"bundleProduct::bundle_dynamic_product";"assertBundleProductInCustomerWishlistOnBackendGrid" -"downloadableProductInjectable::with_two_separately_links";"assertDownloadableProductInCustomerWishlistOnBackendGrid" -"groupedProductInjectable::three_simple_products";"assertGroupedProductInCustomerWishlistOnBackendGrid" diff --git a/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/ConfigureProductInCustomerWishlistOnFrontendTest.php b/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/ConfigureProductInCustomerWishlistOnFrontendTest.php deleted file mode 100644 index 1fc45be9613fc..0000000000000 --- a/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/ConfigureProductInCustomerWishlistOnFrontendTest.php +++ /dev/null @@ -1,68 +0,0 @@ -persist(); - - return ['customer' => $customer]; - } - - /** - * Configure customer wish list on frontend - * - * @param CustomerInjectable $customer - * @param string $product - * @return array - */ - public function test(CustomerInjectable $customer, $product) - { - $this->markTestIncomplete("Bug: MAGETWO-30097"); - // Preconditions - $product = $this->createProducts($product)[0]; - $this->loginCustomer($customer); - $this->addToWishlist([$product]); - - // Steps - $this->cmsIndex->getLinksBlock()->openLink('My Wish List'); - $this->wishlistIndex->getItemsBlock()->getItemProduct($product)->clickEdit(); - $this->catalogProductView->getViewBlock()->addToWishlist($product); - - return ['product' => $product]; - } -} diff --git a/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/ConfigureProductInCustomerWishlistOnFrontendTest/test.csv b/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/ConfigureProductInCustomerWishlistOnFrontendTest/test.csv deleted file mode 100644 index 7b192fe4280b0..0000000000000 --- a/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/ConfigureProductInCustomerWishlistOnFrontendTest/test.csv +++ /dev/null @@ -1,6 +0,0 @@ -"product";"constraint" -"catalogProductSimple::with_two_custom_option";"assertProductIsPresentInWishlist, assertProductDetailsInWishlist" -"configurableProductInjectable::default";"assertProductIsPresentInWishlist, assertProductDetailsInWishlist" -"bundleProduct::bundle_dynamic_product";"assertProductIsPresentInWishlist, assertProductDetailsInWishlist" -"downloadableProductInjectable::with_two_separately_links";"assertProductIsPresentInWishlist, assertProductDetailsInWishlist" -"groupedProductInjectable::three_simple_products";"assertProductIsPresentInWishlist, assertProductDetailsInWishlist" diff --git a/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/DeleteProductFromCustomerWishlistOnBackendTest.php b/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/DeleteProductFromCustomerWishlistOnBackendTest.php deleted file mode 100644 index 9eeef2b4ef674..0000000000000 --- a/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/DeleteProductFromCustomerWishlistOnBackendTest.php +++ /dev/null @@ -1,80 +0,0 @@ - All Customers - * 3. Open the customer - * 4. Open wishlist tab - * 5. Click 'Delete' - * 6. Perform assertions - * - * @group Wishlist_(CS) - * @ZephyrId MAGETWO-27813 - */ -class DeleteProductFromCustomerWishlistOnBackendTest extends AbstractWishlistTest -{ - /** - * Prepare data - * - * @param CustomerInjectable $customer - * @return array - */ - public function __prepare(CustomerInjectable $customer) - { - $customer->persist(); - - return ['customer' => $customer]; - } - - /** - * Delete product from customer wishlist on backend - * - * @param CustomerInjectable $customer - * @param string $product - * @param CustomerIndex $customerIndex - * @param CustomerIndexEdit $customerIndexEdit - * @return array - */ - public function test( - CustomerInjectable $customer, - $product, - CustomerIndex $customerIndex, - CustomerIndexEdit $customerIndexEdit - ) { - $this->markTestIncomplete('MAGETWO-27949'); - //Preconditions - $product = $this->createProducts($product)[0]; - $this->loginCustomer($customer); - $this->addToWishlist([$product]); - - //Steps - $customerIndex->open(); - $customerIndex->getCustomerGridBlock()->searchAndOpen(['email' => $customer->getEmail()]); - $customerForm = $customerIndexEdit->getCustomerForm(); - $customerForm->openTab('wishlist'); - $filter = ['product_name' => $product->getName()]; - $customerForm->getTabElement('wishlist')->getSearchGridBlock()->searchAndAction($filter, 'Delete'); - - return ['products' => [$product]]; - } -} diff --git a/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/DeleteProductFromCustomerWishlistOnBackendTest/test.csv b/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/DeleteProductFromCustomerWishlistOnBackendTest/test.csv deleted file mode 100644 index de3b53115610c..0000000000000 --- a/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/DeleteProductFromCustomerWishlistOnBackendTest/test.csv +++ /dev/null @@ -1,3 +0,0 @@ -"product";"constraint" -"configurableProductInjectable::default";"assertProductsIsAbsentInWishlist" -"catalogProductSimple::simple_for_composite_products";"assertProductsIsAbsentInWishlist" diff --git a/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/DeleteProductsFromWishlistOnFrontendTest.php b/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/DeleteProductsFromWishlistOnFrontendTest.php deleted file mode 100644 index 99ac8c5e2bc37..0000000000000 --- a/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/DeleteProductsFromWishlistOnFrontendTest.php +++ /dev/null @@ -1,77 +0,0 @@ - My Wishlist - * 4. Click "Remove item" - * 5. Perform all assertions - * - * @group Wishlist_(CS) - * @ZephyrId MAGETWO-28874 - */ -class DeleteProductsFromWishlistOnFrontendTest extends AbstractWishlistTest -{ - /** - * Delete products form default wish list - * - * @param CustomerInjectable $customer - * @param string $products - * @param string $removedProductsIndex [optional] - * @return array - */ - public function test(CustomerInjectable $customer, $products, $removedProductsIndex = null) - { - // Preconditions - $customer->persist(); - $this->loginCustomer($customer); - $products = $this->createProducts($products); - $this->addToWishlist($products); - - // Steps - $this->cmsIndex->getLinksBlock()->openLink("My Wish List"); - $removeProducts = $this->removeProducts($products, $removedProductsIndex); - - return ['products' => $removeProducts, 'customer' => $customer]; - } - - /** - * Remove products from wish list - * - * @param array $products - * @param string $removedProductsIndex - * @return array - */ - protected function removeProducts(array $products, $removedProductsIndex) - { - $removeProducts = []; - if ($removedProductsIndex) { - $removedProductsIndex = explode(',', $removedProductsIndex); - foreach ($removedProductsIndex as $index) { - $this->wishlistIndex->getItemsBlock()->getItemProduct($products[--$index])->remove(); - $removeProducts[] = $products[$index]; - } - } else { - $this->wishlistIndex->getItemsBlock()->removeAllProducts(); - $removeProducts = $products; - } - - return $removeProducts; - } -} diff --git a/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/DeleteProductsFromWishlistOnFrontendTest/test.csv b/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/DeleteProductsFromWishlistOnFrontendTest/test.csv deleted file mode 100644 index a07c9bb3ae23d..0000000000000 --- a/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/DeleteProductsFromWishlistOnFrontendTest/test.csv +++ /dev/null @@ -1,9 +0,0 @@ -"products";"removedProductsIndex";"constraint" -"catalogProductSimple::100_dollar_product,catalogProductVirtual::50_dollar_product";"1";"assertProductsIsAbsentInWishlist" -"catalogProductVirtual::50_dollar_product";"1";"assertWishlistIsEmpty" -"catalogProductSimple::default,catalogProductVirtual::50_dollar_product,catalogProductSimple::default,catalogProductVirtual::50_dollar_product";"";"assertWishlistIsEmpty" -"bundleProduct::bundle_dynamic_product";"1";"assertWishlistIsEmpty" -"bundleProduct::bundle_fixed_product";"1";"assertWishlistIsEmpty" -"configurableProductInjectable::default";"1";"assertWishlistIsEmpty" -"downloadableProductInjectable::with_two_separately_links";"1";"assertWishlistIsEmpty" -"groupedProductInjectable::three_simple_products";"1";"assertWishlistIsEmpty" diff --git a/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/MoveProductFromShoppingCartToWishlistTest.php b/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/MoveProductFromShoppingCartToWishlistTest.php deleted file mode 100644 index e1e891b4cbc53..0000000000000 --- a/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/MoveProductFromShoppingCartToWishlistTest.php +++ /dev/null @@ -1,86 +0,0 @@ -persist(); - - return ['customer' => $customer]; - } - - /** - * Run Move from ShoppingCard to Wishlist test - * - * @param CustomerInjectable $customer - * @param string $product - * @param AssertAddedProductToCartSuccessMessage $assertAddedProductToCartSuccessMessage - * @param CheckoutCart $checkoutCart - * @return array - */ - public function test( - CustomerInjectable $customer, - $product, - AssertAddedProductToCartSuccessMessage $assertAddedProductToCartSuccessMessage, - CheckoutCart $checkoutCart - ) { - // Preconditions: - $product = $this->createProducts($product)[0]; - $this->loginCustomer($customer); - - // Steps: - $this->addToCart($product); - $assertAddedProductToCartSuccessMessage->processAssert($checkoutCart, $product); - $checkoutCart->getCartBlock()->getCartItem($product)->moveToWishlist(); - - return ['product' => $product]; - } - - /** - * Add product to cart - * - * @param FixtureInterface $product - * @return void - */ - protected function addToCart(FixtureInterface $product) - { - $addProductsToTheCartStep = $this->objectManager->create( - 'Magento\Checkout\Test\TestStep\AddProductsToTheCartStep', - ['products' => [$product]] - ); - $addProductsToTheCartStep->run(); - } -} diff --git a/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/MoveProductFromShoppingCartToWishlistTest/test.csv b/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/MoveProductFromShoppingCartToWishlistTest/test.csv deleted file mode 100644 index d330b2779a670..0000000000000 --- a/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/MoveProductFromShoppingCartToWishlistTest/test.csv +++ /dev/null @@ -1,7 +0,0 @@ -"product";"constraint" -"catalogProductSimple::default";"assertMoveProductToWishlistSuccessMessage, assertProductIsPresentInWishlist, assertCartIsEmpty" -"catalogProductVirtual::default";"assertMoveProductToWishlistSuccessMessage, assertProductIsPresentInWishlist, assertCartIsEmpty" -"downloadableProductInjectable::with_two_separately_links";"assertMoveProductToWishlistSuccessMessage, assertProductIsPresentInWishlist, assertCartIsEmpty, assertProductDetailsInWishlist" -"configurableProductInjectable::default";"assertMoveProductToWishlistSuccessMessage, assertProductIsPresentInWishlist, assertCartIsEmpty, assertProductDetailsInWishlist" -"bundleProduct::bundle_dynamic_product";"assertMoveProductToWishlistSuccessMessage, assertProductIsPresentInWishlist, assertCartIsEmpty, assertProductDetailsInWishlist" -"bundleProduct::bundle_fixed_product";"assertMoveProductToWishlistSuccessMessage, assertProductIsPresentInWishlist, assertCartIsEmpty, assertProductDetailsInWishlist" \ No newline at end of file diff --git a/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/ShareWishlistEntityTest.php b/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/ShareWishlistEntityTest.php index b4a26725034cf..8c83fe2fff1b8 100644 --- a/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/ShareWishlistEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/ShareWishlistEntityTest.php @@ -155,7 +155,6 @@ public function test( CatalogProductSimple $product, array $sharingInfo ) { - $this->markTestIncomplete("Bug: MAGETWO-30105"); //Steps $this->loginCustomer($customer); $browser->open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html'); diff --git a/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/ViewProductInCustomerWishlistOnBackendTest.php b/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/ViewProductInCustomerWishlistOnBackendTest.php deleted file mode 100644 index 21feb4148be38..0000000000000 --- a/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/ViewProductInCustomerWishlistOnBackendTest.php +++ /dev/null @@ -1,76 +0,0 @@ - All Customers. - * 3. Search and open customer. - * 4. Open wish list tab. - * 5. Perform assertions. - * - * @group Wishlist_(CS) - * @ZephyrId MAGETWO-29616 - */ -class ViewProductInCustomerWishlistOnBackendTest extends AbstractWishlistTest -{ - /** - * Prepare customer for test. - * - * @param CustomerInjectable $customer - * @return array - */ - public function __prepare(CustomerInjectable $customer) - { - $customer->persist(); - - return ['customer' => $customer]; - } - - /** - * Configure customer wish list on backend. - * - * @param CustomerInjectable $customer - * @param string $product - * @param CustomerIndex $customerIndex - * @param CustomerIndexEdit $customerIndexEdit - * @return array - */ - public function test( - CustomerInjectable $customer, - $product, - CustomerIndex $customerIndex, - CustomerIndexEdit $customerIndexEdit - ) { - $this->markTestIncomplete('Bug: MAGETWO-27949'); - - // Preconditions - $product = $this->createProducts($product)[0]; - $this->loginCustomer($customer); - $this->addToWishlist([$product], true); - - // Steps - $customerIndex->open(); - $customerIndex->getCustomerGridBlock()->searchAndOpen(['email' => $customer->getEmail()]); - $customerIndexEdit->getCustomerForm()->openTab('wishlist'); - - return['product' => $product]; - } -} diff --git a/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/ViewProductInCustomerWishlistOnBackendTest/test.csv b/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/ViewProductInCustomerWishlistOnBackendTest/test.csv deleted file mode 100644 index 740881766b87f..0000000000000 --- a/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/ViewProductInCustomerWishlistOnBackendTest/test.csv +++ /dev/null @@ -1,6 +0,0 @@ -"product";"constraint" -"catalogProductSimple::with_two_custom_option";"assertProductInCustomerWishlistOnBackendGrid" -"configurableProductInjectable::default";"assertConfigurableProductInCustomerWishlistOnBackendGrid" -"bundleProduct::bundle_dynamic_product";"assertBundleProductInCustomerWishlistOnBackendGrid" -"downloadableProductInjectable::with_two_separately_links";"assertDownloadableProductInCustomerWishlistOnBackendGrid" -"groupedProductInjectable::three_simple_products";"assertGroupedProductInCustomerWishlistOnBackendGrid" diff --git a/dev/tests/functional/tests/app/Magento/Wishlist/Test/etc/constraint.xml b/dev/tests/functional/tests/app/Magento/Wishlist/Test/etc/constraint.xml index 0cf6e50c1a28b..b2437571725eb 100644 --- a/dev/tests/functional/tests/app/Magento/Wishlist/Test/etc/constraint.xml +++ b/dev/tests/functional/tests/app/Magento/Wishlist/Test/etc/constraint.xml @@ -6,30 +6,30 @@ --> - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low diff --git a/dev/tests/functional/testsuites/Mtf/TestSuite/BatCETests.php b/dev/tests/functional/testsuites/Mtf/TestSuite/BatCETests.php new file mode 100644 index 0000000000000..d5d16fc2cb8e3 --- /dev/null +++ b/dev/tests/functional/testsuites/Mtf/TestSuite/BatCETests.php @@ -0,0 +1,31 @@ +addTestSuite('Magento\Bundle\Test\TestCase\BundleFixedTest'); + $suite->addTestSuite('Magento\Catalog\Test\TestCase\Product\CreateTest'); + $suite->addTestSuite('Magento\ConfigurableProduct\Test\TestCase\CreateConfigurableTest'); + $suite->addTestSuite('Magento\ConfigurableProduct\Test\TestCase\CreateWithAttributeTest'); + $suite->addTestSuite('Magento\Catalog\Test\TestCase\Product\CreateSimpleWithCustomOptionsAndCategoryTest'); + + // Category + $suite->addTestSuite('Magento\Catalog\Test\TestCase\Category\CreateTest'); + + // Stores + $suite->addTestSuite('Magento\Store\Test\TestCase\StoreTest'); + + return $suite; + } +} diff --git a/dev/tests/functional/testsuites/Mtf/TestSuite/EndToEndCETests.php b/dev/tests/functional/testsuites/Mtf/TestSuite/EndToEndCETests.php new file mode 100755 index 0000000000000..a02b42d41eaf6 --- /dev/null +++ b/dev/tests/functional/testsuites/Mtf/TestSuite/EndToEndCETests.php @@ -0,0 +1,60 @@ +addTestSuite('Magento\Catalog\Test\TestCase\Product\CreateProductTest'); + $suite->addTestSuite('Magento\Catalog\Test\TestCase\Product\EditSimpleProductTest'); + $suite->addTestSuite('Magento\Catalog\Test\TestCase\Product\CreateSimpleWithCategoryTest'); + $suite->addTestSuite('Magento\Catalog\Test\TestCase\Product\UnassignCategoryTest'); + // Grouped + $suite->addTestSuite('Magento\GroupedProduct\Test\TestCase\CreateGroupedTest'); + // Virtual + $suite->addTestSuite('Magento\Catalog\Test\TestCase\Product\CreateVirtualTest'); + // Configurable + $suite->addTestSuite('Magento\ConfigurableProduct\Test\TestCase\EditConfigurableTest'); + // Downloadable + $suite->addTestSuite('Magento\Downloadable\Test\TestCase\Create\LinksPurchasedSeparatelyTest'); + // Bundle + $suite->addTestSuite('Magento\Bundle\Test\TestCase\BundleDynamicTest'); + $suite->addTestSuite('Magento\Bundle\Test\TestCase\EditBundleTest'); + + $suite->addTestSuite('Magento\Catalog\Test\TestCase\Product\UpsellTest'); + $suite->addTestSuite('Magento\Catalog\Test\TestCase\Product\CrosssellTest'); + $suite->addTestSuite('Magento\Catalog\Test\TestCase\Product\RelatedProductTest'); + + // Product search + $suite->addTestSuite('Magento\CatalogSearch\Test\TestCase\AdvancedSearchTest'); + + // Url rewrites + $suite->addTestSuite('Magento\Urlrewrite\Test\TestCase\ProductTest'); + $suite->addTestSuite('Magento\Urlrewrite\Test\TestCase\CategoryTest'); + + // Customer + $suite->addTestSuite('Magento\Customer\Test\TestCase\BackendCustomerCreateTest'); + $suite->addTestSuite('Magento\Customer\Test\TestCase\CreateOnFrontendTest'); + + // Review + $suite->addTestSuite('Magento\Review\Test\TestCase\ReviewTest'); + + // Tax + $suite->addTestSuite('Magento\Tax\Test\TestCase\TaxRuleTest'); + + // Assign products to a category + $suite->addTestSuite('Magento\Catalog\Test\TestCase\Category\AssignProductTest'); + + return $suite; + } +} diff --git a/dev/tests/functional/testsuites/Mtf/TestSuite/GithubPublicationTests.php b/dev/tests/functional/testsuites/Mtf/TestSuite/GithubPublicationTests.php new file mode 100644 index 0000000000000..7eee6cacd69c6 --- /dev/null +++ b/dev/tests/functional/testsuites/Mtf/TestSuite/GithubPublicationTests.php @@ -0,0 +1,70 @@ +addTestSuite('Magento\Customer\Test\TestCase\BackendCustomerCreateTest'); + + // Using USPS/UPS/FedEx/DHL(EU)/DHL(US) online shipping carrier on checkout as a registered customer + // (MAGETWO-12444, MAGETWO-12848, MAGETWO-12849, MAGETWO-12850, MAGETWO-12851) + $suite->addTestSuite('Magento\Checkout\Test\TestCase\ShippingCarrierTest'); + + // Adding temporary redirect for product (MAGETWO-12409) + $suite->addTestSuite('Magento\UrlRewrite\Test\TestCase\ProductTest'); + + // Creating offline order for registered/new customer in admin (MAGETWO-12395, MAGETWO-12520) + $suite->addTestSuite('Magento\Sales\Test\TestCase\CreateOrderTest'); + + // Creating customer account (MAGETWO-12394) + $suite->addTestSuite('Magento\Customer\Test\TestCase\CreateOnFrontendTest'); + + // Creating Grouped product and assign it to the category (MAGETWO-13610) + $suite->addTestSuite('Magento\GroupedProduct\Test\TestCase\CreateGroupedTest'); + + // Creating Virtual product with required fields only and assign it to the category (MAGETWO-13593) + $suite->addTestSuite('Magento\Catalog\Test\TestCase\Product\CreateVirtualTest'); + + // Creating Downloadable product with required fields only and assign it to the category (MAGETWO-13595) + $suite->addTestSuite('Magento\Downloadable\Test\TestCase\Create\LinksPurchasedSeparatelyTest'); + + // Using ACL Role with full GWS Scope (without using Secret Key to URLs) (MAGETWO-12375, MAGETWO-12385) + $suite->addTestSuite('Magento\User\Test\TestCase\UserWithRestrictedRoleTest'); + + // Creating simple product with creating new category (required fields only) (MAGETWO-13345) + $suite->addTestSuite('Magento\Catalog\Test\TestCase\Product\CreateSimpleWithCategoryTest'); + + // Checkout products with special prices (MAGETWO-12429) + $suite->addTestSuite('Magento\Checkout\Test\TestCase\ProductAdvancedPricingTest'); + + // Using layered navigation to filter product list (MAGETWO-12419) + $suite->addTestSuite('Magento\Catalog\Test\TestCase\Layer\FilterProductListTest'); + + // Using quick search to find the product (MAGETWO-12420) + $suite->addTestSuite('Magento\CatalogSearch\Test\TestCase\SearchTest'); + + // Product Up-selling (MAGETWO-12391) + $suite->addTestSuite('Magento\Catalog\Test\TestCase\Product\UpsellTest'); + + // Product Cross-selling (MAGETWO-12390) + $suite->addTestSuite('Magento\Catalog\Test\TestCase\Product\CrosssellTest'); + + return $suite; + } +} diff --git a/dev/tests/functional/testsuites/Mtf/TestSuite/InjectableTests.php b/dev/tests/functional/testsuites/Mtf/TestSuite/InjectableTests.php index 37512122ab9de..b9b75cf577c2f 100644 --- a/dev/tests/functional/testsuites/Mtf/TestSuite/InjectableTests.php +++ b/dev/tests/functional/testsuites/Mtf/TestSuite/InjectableTests.php @@ -96,12 +96,12 @@ private function initObjectManager() ? $_ENV['configuration:Mtf/TestSuite/InjectableTests'] : 'basic'; $confFilePath = __DIR__ . '/InjectableTests/' . $configurationFileName . '.xml'; - $testRunnerConfiguration = new Configuration(); + /** @var \Mtf\TestRunner\Configuration $testRunnerConfiguration */ + $testRunnerConfiguration = $objectManagerFactory->getObjectManager()->get('\Mtf\TestRunner\Configuration'); $testRunnerConfiguration->load($confFilePath); + $testRunnerConfiguration->loadEnvConfig(); - $shared = [ - 'Mtf\TestRunner\Configuration' => $testRunnerConfiguration, - ]; + $shared = ['Mtf\TestRunner\Configuration' => $testRunnerConfiguration]; $this->objectManager = $objectManagerFactory->create($shared); } } diff --git a/dev/tests/functional/testsuites/Mtf/TestSuite/InjectableTests/basic.xml b/dev/tests/functional/testsuites/Mtf/TestSuite/InjectableTests/basic.xml index 32fb471707c2d..045bf10e7ef22 100644 --- a/dev/tests/functional/testsuites/Mtf/TestSuite/InjectableTests/basic.xml +++ b/dev/tests/functional/testsuites/Mtf/TestSuite/InjectableTests/basic.xml @@ -6,10 +6,10 @@ --> - + - Magento - injectable + + - + diff --git a/dev/tests/functional/testsuites/Mtf/TestSuite/InjectableTests/installation.xml b/dev/tests/functional/testsuites/Mtf/TestSuite/InjectableTests/installation.xml new file mode 100644 index 0000000000000..e4d2fbca97b05 --- /dev/null +++ b/dev/tests/functional/testsuites/Mtf/TestSuite/InjectableTests/installation.xml @@ -0,0 +1,14 @@ + + + + + + + + + diff --git a/dev/tests/integration/framework/Magento/TestFramework/Annotation/ConfigFixture.php b/dev/tests/integration/framework/Magento/TestFramework/Annotation/ConfigFixture.php index d1cf52c0ad8b6..f5bb55aa9639f 100644 --- a/dev/tests/integration/framework/Magento/TestFramework/Annotation/ConfigFixture.php +++ b/dev/tests/integration/framework/Magento/TestFramework/Annotation/ConfigFixture.php @@ -102,7 +102,8 @@ protected function _assignConfigData(\PHPUnit_Framework_TestCase $test) if (preg_match('/^.+?(?=_store\s)/', $configPathAndValue, $matches)) { /* Store-scoped config value */ $storeCode = $matches[0] != 'current' ? $matches[0] : null; - list(, $configPath, $requiredValue) = preg_split('/\s+/', $configPathAndValue, 3); + $parts = preg_split('/\s+/', $configPathAndValue, 3); + list(, $configPath, $requiredValue) = $parts + ['', '', '']; $originalValue = $this->_getConfigValue($configPath, $storeCode); $this->_storeConfigValues[$storeCode][$configPath] = $originalValue; $this->_setConfigValue($configPath, $requiredValue, $storeCode); diff --git a/dev/tests/integration/framework/Magento/TestFramework/Listener/ExtededTestdox.php b/dev/tests/integration/framework/Magento/TestFramework/Listener/ExtededTestdox.php index 235601f391c82..a38db0245b70a 100644 --- a/dev/tests/integration/framework/Magento/TestFramework/Listener/ExtededTestdox.php +++ b/dev/tests/integration/framework/Magento/TestFramework/Listener/ExtededTestdox.php @@ -46,6 +46,11 @@ class ExtededTestdox extends \PHPUnit_Util_Printer implements \PHPUnit_Framework */ protected $incomplete = 0; + /** + * @var integer + */ + protected $risky = 0; + /** * @var string */ @@ -89,8 +94,8 @@ public function flush() /** * An error occurred. * - * @param PHPUnit_Framework_Test $test - * @param Exception $e + * @param \PHPUnit_Framework_Test $test + * @param \Exception $e * @param float $time * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ @@ -105,12 +110,12 @@ public function addError(\PHPUnit_Framework_Test $test, \Exception $e, $time) /** * A failure occurred. * - * @param PHPUnit_Framework_Test $test - * @param PHPUnit_Framework_AssertionFailedError $e + * @param \PHPUnit_Framework_Test $test + * @param \PHPUnit_Framework_AssertionFailedError $e * @param float $time * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ - public function addFailure(\PHPUnit_Framework_Test $test, PHPUnit_Framework_AssertionFailedError $e, $time) + public function addFailure(\PHPUnit_Framework_Test $test, \PHPUnit_Framework_AssertionFailedError $e, $time) { if ($test instanceof $this->testTypeOfInterest) { $this->testStatus = \PHPUnit_Runner_BaseTestRunner::STATUS_FAILURE; @@ -121,8 +126,8 @@ public function addFailure(\PHPUnit_Framework_Test $test, PHPUnit_Framework_Asse /** * Incomplete test. * - * @param PHPUnit_Framework_Test $test - * @param Exception $e + * @param \PHPUnit_Framework_Test $test + * @param \Exception $e * @param float $time * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ @@ -137,8 +142,8 @@ public function addIncompleteTest(\PHPUnit_Framework_Test $test, \Exception $e, /** * Skipped test. * - * @param PHPUnit_Framework_Test $test - * @param Exception $e + * @param \PHPUnit_Framework_Test $test + * @param \Exception $e * @param float $time * @since Method available since Release 3.0.0 * @SuppressWarnings(PHPMD.UnusedFormalParameter) @@ -151,10 +156,27 @@ public function addSkippedTest(\PHPUnit_Framework_Test $test, \Exception $e, $ti } } + /** + * Risky test. + * + * @param \PHPUnit_Framework_Test $test + * @param \Exception $e + * @param float $time + * @since Method available since Release 4.0.0 + * @SuppressWarnings(PHPMD.UnusedFormalParameter) + */ + public function addRiskyTest(\PHPUnit_Framework_Test $test, \Exception $e, $time) + { + if ($test instanceof $this->testTypeOfInterest) { + $this->testStatus = \PHPUnit_Runner_BaseTestRunner::STATUS_RISKY; + $this->risky++; + } + } + /** * A testsuite started. * - * @param PHPUnit_Framework_TestSuite $suite + * @param \PHPUnit_Framework_TestSuite $suite * @since Method available since Release 2.2.0 * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ @@ -165,7 +187,7 @@ public function startTestSuite(\PHPUnit_Framework_TestSuite $suite) /** * A testsuite ended. * - * @param PHPUnit_Framework_TestSuite $suite + * @param \PHPUnit_Framework_TestSuite $suite * @since Method available since Release 2.2.0 * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ @@ -176,7 +198,7 @@ public function endTestSuite(\PHPUnit_Framework_TestSuite $suite) /** * A test started. * - * @param PHPUnit_Framework_Test $test + * @param \PHPUnit_Framework_Test $test */ public function startTest(\PHPUnit_Framework_Test $test) { @@ -204,7 +226,7 @@ public function startTest(\PHPUnit_Framework_Test $test) /** * A test ended. * - * @param PHPUnit_Framework_Test $test + * @param \PHPUnit_Framework_Test $test * @param float $time */ public function endTest(\PHPUnit_Framework_Test $test, $time) diff --git a/dev/tests/integration/framework/Magento/TestFramework/Mail/Template/TransportBuilderMock.php b/dev/tests/integration/framework/Magento/TestFramework/Mail/Template/TransportBuilderMock.php index 2d91bf268269f..cc8a08612d22d 100644 --- a/dev/tests/integration/framework/Magento/TestFramework/Mail/Template/TransportBuilderMock.php +++ b/dev/tests/integration/framework/Magento/TestFramework/Mail/Template/TransportBuilderMock.php @@ -24,7 +24,7 @@ protected function reset() } /** - * Returns message object with prepared data + * Return message object with prepared data * * @return \Magento\Framework\Mail\Message|null */ @@ -32,4 +32,16 @@ public function getSentMessage() { return $this->_sentMessage; } + + /** + * Return transport mock. + * + * @return \Magento\TestFramework\Mail\TransportInterfaceMock + */ + public function getTransport() + { + $this->prepareMessage(); + $this->reset(); + return new \Magento\TestFramework\Mail\TransportInterfaceMock(); + } } diff --git a/dev/tests/integration/framework/Magento/TestFramework/ObjectManager/Config.php b/dev/tests/integration/framework/Magento/TestFramework/ObjectManager/Config.php index fc1518c6e12ba..8660b2fa13202 100644 --- a/dev/tests/integration/framework/Magento/TestFramework/ObjectManager/Config.php +++ b/dev/tests/integration/framework/Magento/TestFramework/ObjectManager/Config.php @@ -4,14 +4,17 @@ */ namespace Magento\TestFramework\ObjectManager; -class Config extends \Magento\Framework\Interception\ObjectManager\Config +class Config extends \Magento\Framework\Interception\ObjectManager\Config\Developer { /** - * Clean configuration by recreating subject for proxy config + * Clean configuration */ public function clean() { - $className = get_class($this->subjectConfig); - $this->subjectConfig = new $className(); + $this->_preferences = []; + $this->_virtualTypes = []; + $this->_arguments = []; + $this->_nonShared = []; + $this->_mergedArguments = []; } } diff --git a/dev/tests/integration/framework/Magento/TestFramework/ObjectManager/Environment/Developer.php b/dev/tests/integration/framework/Magento/TestFramework/ObjectManager/Environment/Developer.php index 553e00bb87fc4..829515a373cca 100644 --- a/dev/tests/integration/framework/Magento/TestFramework/ObjectManager/Environment/Developer.php +++ b/dev/tests/integration/framework/Magento/TestFramework/ObjectManager/Environment/Developer.php @@ -10,10 +10,8 @@ public function getDiConfig() { if (!$this->config) { $this->config = new \Magento\TestFramework\ObjectManager\Config( - new \Magento\Framework\ObjectManager\Config\Config( - $this->envFactory->getRelations(), - $this->envFactory->getDefinitions() - ) + $this->envFactory->getRelations(), + $this->envFactory->getDefinitions() ); } diff --git a/dev/tests/integration/framework/Magento/TestFramework/Workaround/Cleanup/StaticProperties.php b/dev/tests/integration/framework/Magento/TestFramework/Workaround/Cleanup/StaticProperties.php index e0e3654c36931..3a4d0cd0eef4e 100644 --- a/dev/tests/integration/framework/Magento/TestFramework/Workaround/Cleanup/StaticProperties.php +++ b/dev/tests/integration/framework/Magento/TestFramework/Workaround/Cleanup/StaticProperties.php @@ -15,7 +15,9 @@ class StaticProperties * * @var array */ - protected static $_cleanableFolders = ['/app/code/', '/dev/tests/', '/lib/internal/']; + protected static $_cleanableFolders = ['/app/code/', '/dev/tests/integration/framework', '/lib/internal/']; + + protected static $backupStaticVariables = []; /** * Classes to exclude from static variables cleaning @@ -29,6 +31,7 @@ class StaticProperties 'Magento\TestFramework\Event\Magento', 'Magento\TestFramework\Event\PhpUnit', 'Magento\TestFramework\Annotation\AppIsolation', + 'Magento\TestFramework\Workaround\Cleanup\StaticProperties', 'Magento\Framework\Phrase', ]; @@ -40,12 +43,7 @@ class StaticProperties */ protected static function _isClassCleanable(\ReflectionClass $reflectionClass) { - // 1. do not process php internal classes - if ($reflectionClass->isInternal()) { - return false; - } - - // 2. do not process blacklisted classes from integration framework + // do not process blacklisted classes from integration framework foreach (self::$_classesToSkip as $notCleanableClass) { if ($reflectionClass->getName() == $notCleanableClass || is_subclass_of( $reflectionClass->getName(), @@ -55,45 +53,97 @@ protected static function _isClassCleanable(\ReflectionClass $reflectionClass) return false; } } + return true; + } - // 3. process only files from specific folders - $fileName = $reflectionClass->getFileName(); - - if ($fileName) { - $fileName = str_replace('\\', '/', $fileName); - foreach (self::$_cleanableFolders as $directory) { - if (stripos($fileName, $directory) !== false) { - return true; - } + /** + * Check if class has to be backed up + * + * @param string $classFile + * @return bool + */ + protected static function _isClassInCleanableFolders($classFile) + { + $classFile = str_replace('\\', '/', $classFile); + foreach (self::$_cleanableFolders as $directory) { + if (stripos($classFile, $directory) !== false) { + return true; } } return false; } + /** - * Clear static variables (after running controller test case) + * Restore static variables (after running controller test case) * @TODO: refactor all code where objects are stored to static variables to use object manager instead */ - public static function clearStaticVariables() + public static function restoreStaticVariables() + { + foreach (array_keys(self::$backupStaticVariables) as $class) { + $reflectionClass = new \ReflectionClass($class); + $staticProperties = $reflectionClass->getProperties(\ReflectionProperty::IS_STATIC); + foreach ($staticProperties as $staticProperty) { + $staticProperty->setAccessible(true); + $staticProperty->setValue(self::$backupStaticVariables[$class][$staticProperty->getName()]); + } + } + } + + /** + * Backup static variables + * + */ + public static function backupStaticVariables() { - $classes = get_declared_classes(); + $classFiles = \Magento\Framework\Test\Utility\Files::init()->getClassFiles(true, true, false, true, false); + $namespacePattern = '/namespace [a-zA-Z0-9\\\\]+;/'; + $classPattern = '/\nclass [a-zA-Z0-9_]+/'; + foreach ($classFiles as $classFile) { + if (self::_isClassInCleanableFolders($classFile)) { + $file = @fopen($classFile, 'r'); + $code = fread($file, 4096); + preg_match($namespacePattern, $code, $namespace); + preg_match($classPattern, $code, $class); + if (!isset($namespace[0]) || !isset($class[0])) { + fclose($file); + continue; + } + // trim namespace and class name + $namespace = substr($namespace[0], 10, strlen($namespace[0]) - 11); + $class = substr($class[0], 7, strlen($class[0]) - 7); + $className = $namespace . '\\' . $class; - foreach ($classes as $class) { - $reflectionCLass = new \ReflectionClass($class); - if (self::_isClassCleanable($reflectionCLass)) { - $staticProperties = $reflectionCLass->getProperties(\ReflectionProperty::IS_STATIC); - foreach ($staticProperties as $staticProperty) { - $staticProperty->setAccessible(true); - $value = $staticProperty->getValue(); - if (is_object($value) || is_array($value) && is_object(current($value))) { - $staticProperty->setValue(null); + try { + $reflectionClass = new \ReflectionClass($className); + } catch (\Exception $e) { + fclose($file); + continue; + } + if (self::_isClassCleanable($reflectionClass)) { + $staticProperties = $reflectionClass->getProperties(\ReflectionProperty::IS_STATIC); + foreach ($staticProperties as $staticProperty) { + $staticProperty->setAccessible(true); + $value = $staticProperty->getValue(); + self::$backupStaticVariables[$className][$staticProperty->getName()] = $value; } - unset($value); } + fclose($file); } } } + /** + * Handler for 'startTestSuite' event + * + */ + public function startTestSuite() + { + if (empty(self::$backupStaticVariables)) { + self::backupStaticVariables(); + } + } + /** * Handler for 'endTestSuite' event * @@ -109,7 +159,7 @@ public function endTestSuite(\PHPUnit_Framework_TestSuite $suite) } } if ($clearStatics) { - self::clearStaticVariables(); + self::restoreStaticVariables(); } } } diff --git a/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/RequestTest.php b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/RequestTest.php index 19d772d34ccfd..2d60675519cf4 100644 --- a/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/RequestTest.php +++ b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/RequestTest.php @@ -17,7 +17,7 @@ protected function setUp() $this->getMock('Magento\Framework\App\Route\ConfigInterface\Proxy', [], [], '', false), $this->getMock('Magento\Framework\App\Request\PathInfoProcessorInterface', [], [], '', false), $this->getMock('Magento\Framework\Stdlib\Cookie\CookieReaderInterface'), - $this->getMock('Magento\Framework\App\Config\ReinitableConfigInterface') + $this->getMock('Magento\Framework\ObjectManagerInterface') ); } diff --git a/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/TestCase/ControllerAbstractTest.php b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/TestCase/ControllerAbstractTest.php index 145ce5f3e62ed..cf46839d580dc 100644 --- a/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/TestCase/ControllerAbstractTest.php +++ b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/TestCase/ControllerAbstractTest.php @@ -21,7 +21,7 @@ protected function setUp() $this->getMock('Magento\Framework\App\Route\ConfigInterface\Proxy', [], [], '', false), $this->getMock('Magento\Framework\App\Request\PathInfoProcessorInterface', [], [], '', false), $this->getMock('Magento\Framework\Stdlib\Cookie\CookieReaderInterface'), - $this->getMock('Magento\Framework\App\Config\ReinitableConfigInterface') + $this->getMock('Magento\Framework\ObjectManagerInterface') ); $response = new \Magento\TestFramework\Response( $this->getMock('Magento\Framework\Stdlib\CookieManagerInterface'), diff --git a/dev/tests/integration/testsuite/Magento/Authorizenet/Block/Directpost/IframeTest.php b/dev/tests/integration/testsuite/Magento/Authorizenet/Block/Directpost/IframeTest.php deleted file mode 100644 index e47468dfd3fee..0000000000000 --- a/dev/tests/integration/testsuite/Magento/Authorizenet/Block/Directpost/IframeTest.php +++ /dev/null @@ -1,28 +0,0 @@ -'; - /** @var $block \Magento\Authorizenet\Block\Directpost\Iframe */ - $block = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get( - 'Magento\Framework\View\LayoutInterface' - )->createBlock( - 'Magento\Authorizenet\Block\Directpost\Iframe' - ); - $block->setTemplate('directpost/iframe.phtml'); - $block->setParams(['redirect' => $xssString, 'redirect_parent' => $xssString, 'error_msg' => $xssString]); - $content = $block->toHtml(); - $this->assertNotContains($xssString, $content, 'Params mast be escaped'); - $this->assertContains(htmlspecialchars($xssString), $content, 'Content must present'); - } -} diff --git a/dev/tests/integration/testsuite/Magento/Authorizenet/Controller/Directpost/PaymentTest.php b/dev/tests/integration/testsuite/Magento/Authorizenet/Controller/Directpost/PaymentTest.php deleted file mode 100644 index 361fdaaea8606..0000000000000 --- a/dev/tests/integration/testsuite/Magento/Authorizenet/Controller/Directpost/PaymentTest.php +++ /dev/null @@ -1,28 +0,0 @@ -getRequest()->setPost('controller_action_name', 'onepage'); - $this->dispatch('authorizenet/directpost_payment/response'); - // @codingStandardsIgnoreStart - $this->assertContains( - 'authorizenet/directpost_payment/redirect/success/0/error_msg/The transaction was declined because the response hash validation failed.', - // @codingStandardsIgnoreEnd - $this->getResponse()->getBody() - ); - } - - public function testRedirectActionErrorMessage() - { - $this->getRequest()->setParam('success', '0'); - $this->getRequest()->setParam('error_msg', 'Error message'); - $this->dispatch('authorizenet/directpost_payment/redirect'); - $this->assertContains('alert("Error message");', $this->getResponse()->getBody()); - } -} diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Controller/Adminhtml/ProductTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Controller/Adminhtml/ProductTest.php index 98b5b34643626..639cfb4c99ab8 100644 --- a/dev/tests/integration/testsuite/Magento/Catalog/Controller/Adminhtml/ProductTest.php +++ b/dev/tests/integration/testsuite/Magento/Catalog/Controller/Adminhtml/ProductTest.php @@ -17,7 +17,7 @@ public function testSaveActionWithDangerRequest() $this->equalTo(['Unable to save product']), \Magento\Framework\Message\MessageInterface::TYPE_ERROR ); - $this->assertRedirect($this->stringContains('/backend/catalog/product/edit')); + $this->assertRedirect($this->stringContains('/backend/catalog/product/new')); } /** diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Model/Layer/Filter/Price/_files/products_advanced.php b/dev/tests/integration/testsuite/Magento/Catalog/Model/Layer/Filter/Price/_files/products_advanced.php index 8463339eb7888..bd7d853d702b9 100644 --- a/dev/tests/integration/testsuite/Magento/Catalog/Model/Layer/Filter/Price/_files/products_advanced.php +++ b/dev/tests/integration/testsuite/Magento/Catalog/Model/Layer/Filter/Price/_files/products_advanced.php @@ -19,6 +19,7 @@ */ /** @var $category \Magento\Catalog\Model\Category */ $category = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create('Magento\Catalog\Model\Category'); +$category->isObjectNew(true); $category->setId( 3 )->setName( @@ -40,6 +41,7 @@ )->save(); $category = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create('Magento\Catalog\Model\Category'); +$category->isObjectNew(true); $category->setId( 4 )->setName( diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Model/Layer/Filter/Price/_files/products_base.php b/dev/tests/integration/testsuite/Magento/Catalog/Model/Layer/Filter/Price/_files/products_base.php index 54aa171480af2..0ff18b75b49e3 100644 --- a/dev/tests/integration/testsuite/Magento/Catalog/Model/Layer/Filter/Price/_files/products_base.php +++ b/dev/tests/integration/testsuite/Magento/Catalog/Model/Layer/Filter/Price/_files/products_base.php @@ -19,6 +19,7 @@ */ /** @var $category \Magento\Catalog\Model\Category */ $category = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create('Magento\Catalog\Model\Category'); +$category->isObjectNew(true); $category->setId( 3 )->setName( @@ -44,6 +45,7 @@ $category = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create('Magento\Catalog\Model\Category'); $position = $index + 1; $categoryId = $index + 4; + $category->isObjectNew(true); $category->setId( $categoryId )->setName( diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Model/Resource/_files/url_rewrites.php b/dev/tests/integration/testsuite/Magento/Catalog/Model/Resource/_files/url_rewrites.php index 45c11ef2434ac..2984cc1d65711 100644 --- a/dev/tests/integration/testsuite/Magento/Catalog/Model/Resource/_files/url_rewrites.php +++ b/dev/tests/integration/testsuite/Magento/Catalog/Model/Resource/_files/url_rewrites.php @@ -5,6 +5,7 @@ \Magento\TestFramework\Helper\Bootstrap::getInstance()->loadArea('adminhtml'); /** @var $category \Magento\Catalog\Model\Category */ $category = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create('Magento\Catalog\Model\Category'); +$category->isObjectNew(true); $category->setId( 3 )->setName( diff --git a/dev/tests/integration/testsuite/Magento/Catalog/_files/categories.php b/dev/tests/integration/testsuite/Magento/Catalog/_files/categories.php index a8bcc36d09581..c86f9939948b0 100644 --- a/dev/tests/integration/testsuite/Magento/Catalog/_files/categories.php +++ b/dev/tests/integration/testsuite/Magento/Catalog/_files/categories.php @@ -12,6 +12,7 @@ */ /** @var $category \Magento\Catalog\Model\Category */ $category = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create('Magento\Catalog\Model\Category'); +$category->isObjectNew(true); $category->setId(3) ->setName('Category 1') ->setParentId(2) @@ -24,6 +25,7 @@ ->save(); $category = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create('Magento\Catalog\Model\Category'); +$category->isObjectNew(true); $category->setId(4) ->setName('Category 1.1') ->setParentId(3) @@ -37,6 +39,7 @@ ->save(); $category = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create('Magento\Catalog\Model\Category'); +$category->isObjectNew(true); $category->setId(5) ->setName('Category 1.1.1') ->setParentId(4) @@ -51,6 +54,7 @@ ->save(); $category = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create('Magento\Catalog\Model\Category'); +$category->isObjectNew(true); $category->setId(6) ->setName('Category 2') ->setParentId(2) @@ -63,6 +67,7 @@ ->save(); $category = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create('Magento\Catalog\Model\Category'); +$category->isObjectNew(true); $category->setId(7) ->setName('Movable') ->setParentId(2) @@ -75,6 +80,7 @@ ->save(); $category = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create('Magento\Catalog\Model\Category'); +$category->isObjectNew(true); $category->setId(8) ->setName('Inactive') ->setParentId(2) @@ -86,6 +92,7 @@ ->save(); $category = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create('Magento\Catalog\Model\Category'); +$category->isObjectNew(true); $category->setId(9) ->setName('Movable Position 1') ->setParentId(2) @@ -98,6 +105,7 @@ ->save(); $category = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create('Magento\Catalog\Model\Category'); +$category->isObjectNew(true); $category->setId(10) ->setName('Movable Position 2') ->setParentId(2) @@ -110,6 +118,7 @@ ->save(); $category = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create('Magento\Catalog\Model\Category'); +$category->isObjectNew(true); $category->setId(11) ->setName('Movable Position 3') ->setParentId(2) @@ -122,6 +131,7 @@ ->save(); $category = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create('Magento\Catalog\Model\Category'); +$category->isObjectNew(true); $category->setId(12) ->setName('Category 12') ->setParentId(2) diff --git a/dev/tests/integration/testsuite/Magento/Catalog/_files/category.php b/dev/tests/integration/testsuite/Magento/Catalog/_files/category.php index a515e63e540ba..39010e85abfa5 100644 --- a/dev/tests/integration/testsuite/Magento/Catalog/_files/category.php +++ b/dev/tests/integration/testsuite/Magento/Catalog/_files/category.php @@ -4,6 +4,7 @@ */ $category = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create('Magento\Catalog\Model\Category'); +$category->isObjectNew(true); $category->setId( 333 )->setCreatedAt( diff --git a/dev/tests/integration/testsuite/Magento/Catalog/_files/category_product.php b/dev/tests/integration/testsuite/Magento/Catalog/_files/category_product.php index bfe8b33356236..3998c24d3fa03 100644 --- a/dev/tests/integration/testsuite/Magento/Catalog/_files/category_product.php +++ b/dev/tests/integration/testsuite/Magento/Catalog/_files/category_product.php @@ -4,6 +4,7 @@ */ $category = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create('Magento\Catalog\Model\Category'); +$category->isObjectNew(true); $category->setId( 333 )->setCreatedAt( diff --git a/dev/tests/integration/testsuite/Magento/Catalog/_files/category_tree.php b/dev/tests/integration/testsuite/Magento/Catalog/_files/category_tree.php index e9f6f32a611e8..f1c072788f353 100644 --- a/dev/tests/integration/testsuite/Magento/Catalog/_files/category_tree.php +++ b/dev/tests/integration/testsuite/Magento/Catalog/_files/category_tree.php @@ -44,6 +44,7 @@ ]; foreach ($categories as $data) { $model = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create('Magento\Catalog\Model\Category'); + $model->isObjectNew(true); $model->setId($data['id']) ->setName($data['name']) ->setParentId($data['parent_id']) diff --git a/dev/tests/integration/testsuite/Magento/Catalog/_files/price_row_fixture.php b/dev/tests/integration/testsuite/Magento/Catalog/_files/price_row_fixture.php index a1974d80192e1..13a6903922015 100644 --- a/dev/tests/integration/testsuite/Magento/Catalog/_files/price_row_fixture.php +++ b/dev/tests/integration/testsuite/Magento/Catalog/_files/price_row_fixture.php @@ -12,6 +12,7 @@ */ /** @var $category \Magento\Catalog\Model\Category */ $category = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create('Magento\Catalog\Model\Category'); +$category->isObjectNew(true); $category->setId( 9 )->setName( diff --git a/dev/tests/integration/testsuite/Magento/Catalog/_files/products_in_category.php b/dev/tests/integration/testsuite/Magento/Catalog/_files/products_in_category.php index 9f285a2dae78c..20926113150e0 100644 --- a/dev/tests/integration/testsuite/Magento/Catalog/_files/products_in_category.php +++ b/dev/tests/integration/testsuite/Magento/Catalog/_files/products_in_category.php @@ -52,6 +52,7 @@ /** @var \Magento\Catalog\Model\Category $category */ $category = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create('Magento\Catalog\Model\Category'); +$category->isObjectNew(true); $category->setId( 333 )->setCreatedAt( diff --git a/dev/tests/integration/testsuite/Magento/Catalog/_files/row_fixture.php b/dev/tests/integration/testsuite/Magento/Catalog/_files/row_fixture.php index 64c496c07c9ea..69d9775cda772 100644 --- a/dev/tests/integration/testsuite/Magento/Catalog/_files/row_fixture.php +++ b/dev/tests/integration/testsuite/Magento/Catalog/_files/row_fixture.php @@ -12,6 +12,7 @@ */ /** @var $category \Magento\Catalog\Model\Category */ $category = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create('Magento\Catalog\Model\Category'); +$category->isObjectNew(true); $category->setId( 9 )->setName( diff --git a/dev/tests/integration/testsuite/Magento/Catalog/_files/url_rewrites.php b/dev/tests/integration/testsuite/Magento/Catalog/_files/url_rewrites.php index 2e9dcfc41ee82..49f4f5622d325 100644 --- a/dev/tests/integration/testsuite/Magento/Catalog/_files/url_rewrites.php +++ b/dev/tests/integration/testsuite/Magento/Catalog/_files/url_rewrites.php @@ -7,6 +7,7 @@ /** @var $category \Magento\Catalog\Model\Category */ $category = $objectManager->create('Magento\Catalog\Model\Category'); +$category->isObjectNew(true); $category->setId( 3 )->setName( @@ -51,6 +52,7 @@ )->save(); $category = $objectManager->create('Magento\Catalog\Model\Category'); +$category->isObjectNew(true); $category->setId( 4 )->setName( @@ -72,6 +74,7 @@ )->save(); $category = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create('Magento\Catalog\Model\Category'); +$category->isObjectNew(true); $category->setId( 5 )->setName( diff --git a/dev/tests/integration/testsuite/Magento/CatalogUrlRewrite/Model/CategoryUrlRewriteGeneratorTest.php b/dev/tests/integration/testsuite/Magento/CatalogUrlRewrite/Model/CategoryUrlRewriteGeneratorTest.php new file mode 100644 index 0000000000000..315a9832467fc --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/CatalogUrlRewrite/Model/CategoryUrlRewriteGeneratorTest.php @@ -0,0 +1,118 @@ +objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); + } + + /** + * @magentoDataFixture Magento/CatalogUrlRewrite/_files/categories.php + * @magentoDbIsolation enabled + */ + public function testGenerateUrlRewritesWithoutSaveHistory() + { + /** @var \Magento\Catalog\Model\Category $category */ + $category = $this->objectManager->create('Magento\Catalog\Model\Category'); + $category->load(3); + $category->setData('save_rewrites_history', false); + $category->setUrlKey('new-url'); + $category->save(); + + $categoryFilter = [ + UrlRewrite::ENTITY_TYPE => CategoryUrlRewriteGenerator::ENTITY_TYPE, + UrlRewrite::ENTITY_ID => [3, 4, 5] + ]; + $actualResults = $this->getActualResults($categoryFilter); + $categoryExpectedResult = [ + ['new-url.html', 'catalog/category/view/id/3', 1, 0], + ['new-url/category-1-1.html', 'catalog/category/view/id/4', 1, 0], + ['new-url/category-1-1/category-1-1-1.html', 'catalog/category/view/id/5', 1, 0], + ]; + + $this->assertResults($categoryExpectedResult, $actualResults); + } + + /** + * @magentoDataFixture Magento/CatalogUrlRewrite/_files/categories.php + * @magentoDbIsolation enabled + * + */ + public function testGenerateUrlRewritesWithSaveHistory() + { + /** @var \Magento\Catalog\Model\Category $category */ + $category = $this->objectManager->create('Magento\Catalog\Model\Category'); + $category->load(3); + $category->setData('save_rewrites_history', true); + $category->setUrlKey('new-url'); + $category->save(); + + $categoryFilter = [ + UrlRewrite::ENTITY_TYPE => CategoryUrlRewriteGenerator::ENTITY_TYPE, + UrlRewrite::ENTITY_ID => [3, 4, 5] + ]; + $actualResults = $this->getActualResults($categoryFilter); + $categoryExpectedResult = [ + ['new-url.html', 'catalog/category/view/id/3', 1, 0], + ['new-url/category-1-1.html', 'catalog/category/view/id/4', 1, 0], + ['new-url/category-1-1/category-1-1-1.html', 'catalog/category/view/id/5', 1, 0], + ['category-1.html', 'new-url.html', 0, OptionProvider::PERMANENT], + ['category-1/category-1-1.html', 'new-url/category-1-1.html', 0, OptionProvider::PERMANENT], + [ + 'category-1/category-1-1/category-1-1-1.html', + 'new-url/category-1-1/category-1-1-1.html', + 0, + OptionProvider::PERMANENT + ], + ]; + + $this->assertResults($categoryExpectedResult, $actualResults); + } + + /** + * @param array $filter + * @return array + */ + protected function getActualResults(array $filter) + { + /** @var \Magento\UrlRewrite\Model\UrlFinderInterface $urlFinder */ + $urlFinder = $this->objectManager->get('\Magento\UrlRewrite\Model\UrlFinderInterface'); + $actualResults = []; + foreach ($urlFinder->findAllByData($filter) as $url) { + $actualResults[] = [ + $url->getRequestPath(), + $url->getTargetPath(), + $url->getIsAutogenerated(), + $url->getRedirectType() + ]; + } + return $actualResults; + } + + /** + * @param array $expected + * @param array $actual + */ + protected function assertResults($expected, $actual) + { + foreach ($actual as $row) { + $this->assertContains($row, $expected, implode(', ', $row)); + } + + } +} diff --git a/dev/tests/integration/testsuite/Magento/CatalogUrlRewrite/_files/categories.php b/dev/tests/integration/testsuite/Magento/CatalogUrlRewrite/_files/categories.php index 119916c697b23..bf6ebab9cabee 100644 --- a/dev/tests/integration/testsuite/Magento/CatalogUrlRewrite/_files/categories.php +++ b/dev/tests/integration/testsuite/Magento/CatalogUrlRewrite/_files/categories.php @@ -15,6 +15,7 @@ */ /** @var $category \Magento\Catalog\Model\Category */ $category = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create('Magento\Catalog\Model\Category'); +$category->isObjectNew(true); $category->setId(3) ->setName('Category 1') ->setParentId(2) @@ -27,6 +28,7 @@ ->save(); $category = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create('Magento\Catalog\Model\Category'); +$category->isObjectNew(true); $category->setId(4) ->setName('Category 1.1') ->setParentId(3) @@ -40,6 +42,7 @@ ->save(); $category = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create('Magento\Catalog\Model\Category'); +$category->isObjectNew(true); $category->setId(5) ->setName('Category 1.1.1') ->setParentId(4) @@ -54,6 +57,7 @@ ->save(); $category = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create('Magento\Catalog\Model\Category'); +$category->isObjectNew(true); $category->setId(6) ->setName('Category 2') ->setParentId(2) diff --git a/dev/tests/integration/testsuite/Magento/Centinel/CreateOrderTest.php b/dev/tests/integration/testsuite/Magento/Centinel/CreateOrderTest.php deleted file mode 100644 index dab36b3f35561..0000000000000 --- a/dev/tests/integration/testsuite/Magento/Centinel/CreateOrderTest.php +++ /dev/null @@ -1,49 +0,0 @@ -_objectManager->get('Magento\Sales\Model\AdminOrder\Create'); - $quote = $order->addProducts([1 => ['qty' => 1]])->getQuote(); - - /** @var \Magento\Customer\Api\CustomerRepositoryInterface $customerRepository */ - $customerRepository = $this->_objectManager->create('Magento\Customer\Api\CustomerRepositoryInterface'); - $customer = $customerRepository->getById(1); - $quote->setCustomer($customer); - - $defaultStore = $this->_objectManager->get('Magento\Store\Model\StoreManagerInterface'); - $defaultStoreId = $defaultStore->getStore('default')->getId(); - $quote->setStoreId($defaultStoreId); - - $quote->getPayment()->addData([ - 'cc_owner' => 'Test User', - 'cc_type' => 'visa', - 'cc_number' => '400000000000002', - 'cc_exp_month' => '1', - 'cc_exp_year' => '2016', - 'cc_cid' => '123', - 'method' => 'authorizenet' - ]); - - $this->dispatch('backend/sales/order_create/index'); - - $this->assertContains('
', $this->getResponse()->getBody()); - } -} diff --git a/dev/tests/integration/testsuite/Magento/Cms/Controller/PageTest.php b/dev/tests/integration/testsuite/Magento/Cms/Controller/PageTest.php index f72544f76c94a..8ff3169659bb9 100644 --- a/dev/tests/integration/testsuite/Magento/Cms/Controller/PageTest.php +++ b/dev/tests/integration/testsuite/Magento/Cms/Controller/PageTest.php @@ -28,4 +28,27 @@ public function testAddBreadcrumbs() $breadcrumbsBlock = $layout->getBlock('breadcrumbs'); $this->assertContains($breadcrumbsBlock->toHtml(), $this->getResponse()->getBody()); } + + /** + * @magentoDataFixture cmsPageWithSystemRouteFixture + */ + public function testCreatePageWithSameModuleName() + { + $this->dispatch('/shipping/'); + $content = $this->getResponse()->getBody(); + $this->assertContains('Shipping Test Page', $content); + } + + public static function cmsPageWithSystemRouteFixture() + { + /** @var $page \Magento\Cms\Model\Page */ + $page = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create('Magento\Cms\Model\Page'); + $page->setTitle('Test title') + ->setIdentifier('shipping') + ->setStores([0]) + ->setIsActive(1) + ->setContent('

Shipping Test Page

') + ->setPageLayout('1column') + ->save(); + } } diff --git a/dev/tests/integration/testsuite/Magento/Framework/Interception/GeneralTest.php b/dev/tests/integration/testsuite/Magento/Framework/Interception/GeneralTest.php index 4a64ef68421b4..bd54fecae3c2f 100644 --- a/dev/tests/integration/testsuite/Magento/Framework/Interception/GeneralTest.php +++ b/dev/tests/integration/testsuite/Magento/Framework/Interception/GeneralTest.php @@ -25,7 +25,7 @@ class GeneralTest extends \PHPUnit_Framework_TestCase public function setUp() { - $config = new \Magento\Framework\Interception\ObjectManager\Config(new ObjectManagerConfig()); + $config = new \Magento\Framework\Interception\ObjectManager\Config\Developer(); $factory = new \Magento\Framework\ObjectManager\Factory\Dynamic\Developer($config, null); $this->_configReader = $this->getMock('Magento\Framework\Config\ReaderInterface'); @@ -81,7 +81,7 @@ public function setUp() 'Magento\Framework\Config\ReaderInterface' => $this->_configReader, 'Magento\Framework\ObjectManager\RelationsInterface' => $relations, 'Magento\Framework\ObjectManager\ConfigInterface' => $config, - 'Magento\Framework\Interception\ObjectManager\Config' => $config, + 'Magento\Framework\Interception\ObjectManager\ConfigInterface' => $config, 'Magento\Framework\ObjectManager\DefinitionInterface' => $definitions, 'Magento\Framework\Interception\DefinitionInterface' => $interceptionDefinitions ] diff --git a/dev/tests/integration/testsuite/Magento/Framework/Module/Plugin/DbStatusValidatorTest.php b/dev/tests/integration/testsuite/Magento/Framework/Module/Plugin/DbStatusValidatorTest.php index 434ad3113c740..c4fad76c42d8e 100644 --- a/dev/tests/integration/testsuite/Magento/Framework/Module/Plugin/DbStatusValidatorTest.php +++ b/dev/tests/integration/testsuite/Magento/Framework/Module/Plugin/DbStatusValidatorTest.php @@ -11,41 +11,40 @@ public function testValidationUpToDateDb() $this->dispatch('index/index'); } + /** + * @magentoDbIsolation enabled + * @expectedException \Magento\Framework\Module\Exception + * @expectedExceptionMessage Please update your database + */ public function testValidationOutdatedDb() { - $resourceName = 'adminnotification_setup'; - /*reset versions*/ - /** @var \Magento\Framework\Module\ResourceInterface $resource */ - $resource = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( - 'Magento\Framework\Module\ResourceInterface' - ); - $dbVersion = $resource->getDbVersion($resourceName); - $dbDataVersion = $resource->getDataVersion($resourceName); - try { - $resource->setDbVersion($resourceName, '0.1'); - $resource->setDataVersion($resourceName, '0.1'); - /** @var \Magento\Framework\Cache\FrontendInterface $cache */ - $cache = $this->_objectManager->get('Magento\Framework\App\Cache\Type\Config'); - $cache->clean(); - - try { - /* This triggers plugin to be executed */ - $this->dispatch('index/index'); - } catch (\Magento\Framework\Module\Exception $e) { - if ($e->getMessage() != 'Looks like database is outdated. Please, use setup tool to perform update') { - $failureMessage = "DB status validation doesn't work properly. Caught exception message is '" - . $e->getMessage() . "'"; - } + $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); + + /** @var \Magento\Framework\Module\ModuleListInterface $moduleList */ + $moduleList = $objectManager->get('Magento\Framework\Module\ModuleListInterface'); + + /** @var \Magento\Framework\Module\ResourceResolverInterface $resourceResolver */ + $resourceResolver = $objectManager->get('\Magento\Framework\Module\ResourceResolverInterface'); + + // get first resource, we don't care which one it is. + foreach ($moduleList->getNames() as $moduleName) { + if ($resourceList = $resourceResolver->getResourceList($moduleName)) { + $resourceName = $resourceList[0]; + break; } - } catch (\Exception $e) { - $failureMessage = "Impossible to continue other tests, because database is broken: {$e}"; } - $resource->setDbVersion($resourceName, $dbVersion); - $resource->setDataVersion($resourceName, $dbDataVersion); + // Prepend '0.' to DB Version, to cause it to be an older version + /** @var \Magento\Framework\Module\ResourceInterface $resource */ + $resource = $objectManager->create('Magento\Framework\Module\ResourceInterface'); + $currentDbVersion = $resource->getDbVersion($resourceName); + $resource->setDbVersion($resourceName, '0.' . $currentDbVersion); - if (isset($failureMessage)) { - $this->fail($failureMessage); - } + /** @var \Magento\Framework\Cache\FrontendInterface $cache */ + $cache = $this->_objectManager->get('Magento\Framework\App\Cache\Type\Config'); + $cache->clean(); + + /* This triggers plugin to be executed */ + $this->dispatch('index/index'); } } diff --git a/dev/tests/integration/testsuite/Magento/Paypal/Adminhtml/Paypal/ReportsTest.php b/dev/tests/integration/testsuite/Magento/Paypal/Adminhtml/Paypal/ReportsTest.php deleted file mode 100644 index a9c744caf2333..0000000000000 --- a/dev/tests/integration/testsuite/Magento/Paypal/Adminhtml/Paypal/ReportsTest.php +++ /dev/null @@ -1,29 +0,0 @@ -dispatch('backend/paypal/paypal_reports/fetch'); - $this->assertSessionMessages( - $this->equalTo(["We couldn't fetch reports from 'login@127.0.0.1'."]), - \Magento\Framework\Message\MessageInterface::TYPE_ERROR - ); - } -} diff --git a/dev/tests/integration/testsuite/Magento/Paypal/Block/Adminhtml/Billing/Agreement/View/Tab/InfoTest.php b/dev/tests/integration/testsuite/Magento/Paypal/Block/Adminhtml/Billing/Agreement/View/Tab/InfoTest.php deleted file mode 100644 index 99290ce58c62f..0000000000000 --- a/dev/tests/integration/testsuite/Magento/Paypal/Block/Adminhtml/Billing/Agreement/View/Tab/InfoTest.php +++ /dev/null @@ -1,37 +0,0 @@ -create( - 'Magento\Paypal\Model\Resource\Billing\Agreement\Collection' - )->load(); - $agreementId = $billingAgreementCollection->getFirstItem()->getId(); - $this->dispatch('backend/paypal/billing_agreement/view/agreement/' . $agreementId); - - $this->assertSelectCount( - 'a[name="billing_agreement_info"]', - 1, - $this->getResponse()->getBody(), - 'Response for billing agreement info doesn\'t contain billing agreement info tab' - ); - - $this->assertSelectRegExp( - 'a', - '/customer\@example.com/', - 1, - $this->getResponse()->getBody(), - 'Response for billing agreement info doesn\'t contain Customer info' - ); - } -} diff --git a/dev/tests/integration/testsuite/Magento/Paypal/Block/Billing/Agreement/ViewTest.php b/dev/tests/integration/testsuite/Magento/Paypal/Block/Billing/Agreement/ViewTest.php deleted file mode 100644 index 0d2ac4c3111c7..0000000000000 --- a/dev/tests/integration/testsuite/Magento/Paypal/Block/Billing/Agreement/ViewTest.php +++ /dev/null @@ -1,81 +0,0 @@ -_block = Bootstrap::getObjectManager()->create('Magento\Paypal\Block\Billing\Agreement\View'); - parent::setUp(); - } - - /** - * Test getting orders associated with specified billing agreement. - * - * Create two identical orders, associate one of them with billing agreement and invoke testGetRelatedOrders() - * - * @magentoDataFixture Magento/Customer/_files/customer.php - * @magentoDataFixture Magento/Paypal/_files/billing_agreement.php - * @magentoDataFixture Magento/Sales/_files/order.php - * @magentoDbIsolation enabled - * @magentoAppIsolation enabled - */ - public function testGetRelatedOrders() - { - /** Customer ID declared in the fixture */ - $customerId = 1; - /** Assign first order to the active customer */ - /** @var \Magento\Sales\Model\Order $orderA */ - $orderA = Bootstrap::getObjectManager()->create('Magento\Sales\Model\Order'); - $orderA->loadByIncrementId('100000001'); - $orderA->setCustomerIsGuest(false)->setCustomerId($customerId)->save(); - /** @var \Magento\Customer\Model\Session $customerSession */ - $customerSession = Bootstrap::getObjectManager()->create('Magento\Customer\Model\Session'); - $customerSession->setCustomerId($customerId); - - /** Assign second order to the active customer */ - $orderB = clone $orderA; - $orderB->setId( - null - )->setIncrementId( - '100000002' - )->setCustomerIsGuest( - false - )->setCustomerId( - $customerId - )->save(); - - /** @var \Magento\Customer\Model\Session $customerSession */ - $customerSession = Bootstrap::getObjectManager()->create('Magento\Customer\Model\Session'); - $customerSession->setCustomerId($customerId); - - /** @var \Magento\Paypal\Model\Resource\Billing\Agreement\Collection $billingAgreementCollection */ - $billingAgreementCollection = Bootstrap::getObjectManager()->create( - 'Magento\Paypal\Model\Resource\Billing\Agreement\Collection' - ); - /** @var \Magento\Paypal\Model\Billing\Agreement $billingAgreement */ - $billingAgreement = $billingAgreementCollection->getFirstItem(); - $billingAgreement->addOrderRelation($orderA->getId())->save(); - - $registry = Bootstrap::getObjectManager()->get('Magento\Framework\Registry'); - $registry->register('current_billing_agreement', $billingAgreement); - - $relatedOrders = $this->_block->getRelatedOrders(); - $this->assertEquals(1, $relatedOrders->count(), "Only one order must be returned."); - $this->assertEquals( - $orderA->getId(), - $relatedOrders->getFirstItem()->getId(), - "Invalid order returned as associated with billing agreement." - ); - } -} diff --git a/dev/tests/integration/testsuite/Magento/Paypal/Block/Bml/BannersTest.php b/dev/tests/integration/testsuite/Magento/Paypal/Block/Bml/BannersTest.php deleted file mode 100644 index 833eb25b6a784..0000000000000 --- a/dev/tests/integration/testsuite/Magento/Paypal/Block/Bml/BannersTest.php +++ /dev/null @@ -1,61 +0,0 @@ -getMock('Magento\Paypal\Model\Config', [], [], '', false); - $paypalConfig->expects($this->any())->method('getBmlPublisherId')->will($this->returnValue($publisherId)); - $paypalConfig->expects($this->any())->method('getBmlDisplay')->will($this->returnValue($display)); - $paypalConfig->expects($this->any())->method('getBmlPosition')->will($this->returnValue($configPosition)); - - /** @var \Magento\Framework\View\LayoutInterface $layout */ - $layout = Bootstrap::getObjectManager()->get('Magento\Framework\View\LayoutInterface'); - $block = $layout->createBlock( - 'Magento\Paypal\Block\Bml\Banners', - '', - [ - 'paypalConfig' => $paypalConfig, - 'data' => ['position' => $position] - ] - ); - $block->setTemplate('bml.phtml'); - $html = $block->toHtml(); - - if ($isEmptyHtml) { - $this->assertEmpty($html); - } else { - $this->assertContains('data-pp-pubid="' . $block->getPublisherId() . '"', $html); - $this->assertContains('data-pp-placementtype="' . $block->getSize() . '"', $html); - } - } - - /** - * @return array - */ - public function testToHtmlDataProvider() - { - return [ - [1, 1, 100, 100, false], - [0, 1, 100, 100, true], - [1, 0, 100, 100, true], - [1, 0, 10, 100, true] - ]; - } -} diff --git a/dev/tests/integration/testsuite/Magento/Paypal/Block/Express/ReviewTest.php b/dev/tests/integration/testsuite/Magento/Paypal/Block/Express/ReviewTest.php deleted file mode 100644 index db56b0b62f5e5..0000000000000 --- a/dev/tests/integration/testsuite/Magento/Paypal/Block/Express/ReviewTest.php +++ /dev/null @@ -1,35 +0,0 @@ -create('Magento\Sales\Model\Quote'); - $quote->load('test01', 'reserved_order_id'); - - $block = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get( - 'Magento\Framework\View\LayoutInterface' - )->createBlock( - 'Magento\Paypal\Block\Express\Review' - ); - $addressData = include __DIR__ . '/../../../Sales/_files/address_data.php'; - $address = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( - 'Magento\Sales\Model\Quote\Address', - ['data' => $addressData] - ); - $address->setAddressType('billing'); - $address->setQuote($quote); - $this->assertContains('Los Angeles', $block->renderAddress($address)); - } -} diff --git a/dev/tests/integration/testsuite/Magento/Paypal/Block/Payment/Form/Billing/AgreementTest.php b/dev/tests/integration/testsuite/Magento/Paypal/Block/Payment/Form/Billing/AgreementTest.php deleted file mode 100644 index 361bc71713fee..0000000000000 --- a/dev/tests/integration/testsuite/Magento/Paypal/Block/Payment/Form/Billing/AgreementTest.php +++ /dev/null @@ -1,48 +0,0 @@ -create( - 'Magento\Sales\Model\Resource\Quote\Collection' - )->getFirstItem(); - /** @var \Magento\Framework\View\LayoutInterface $layout */ - $layout = $this->getMockBuilder('Magento\Framework\View\LayoutInterface') - ->disableOriginalConstructor() - ->getMock(); - $layout->expects( - $this->once() - )->method( - 'getBlock' - )->will( - $this->returnValue(new \Magento\Framework\Object(['quote' => $quote])) - ); - $layout->expects($this->once())->method('getParentName')->will($this->returnValue('billing_agreement_form')); - - $this->_block = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( - 'Magento\Paypal\Block\Payment\Form\Billing\Agreement' - ); - $this->_block->setLayout($layout); - } - - /** - * @magentoDataFixture Magento/Sales/_files/quote_with_customer.php - * @magentoDataFixture Magento/Paypal/_files/billing_agreement.php - */ - public function testGetBillingAgreements() - { - $billingAgreements = $this->_block->getBillingAgreements(); - $this->assertEquals(1, count($billingAgreements)); - $this->assertEquals('REF-ID-TEST-678', array_shift($billingAgreements)); - } -} diff --git a/dev/tests/integration/testsuite/Magento/Paypal/Controller/Adminhtml/Billing/AgreementTest.php b/dev/tests/integration/testsuite/Magento/Paypal/Controller/Adminhtml/Billing/AgreementTest.php deleted file mode 100644 index 7b3fa1670cbf1..0000000000000 --- a/dev/tests/integration/testsuite/Magento/Paypal/Controller/Adminhtml/Billing/AgreementTest.php +++ /dev/null @@ -1,93 +0,0 @@ -create('Magento\Backend\Model\Session'); - - $this->dispatch('backend/paypal/billing_agreement/grid'); - $response = $this->getResponse(); - - $this->assertSelectCount( - 'button[type="button"][title="Reset Filter"]', - 1, - $response->getBody(), - "Response for billing agreement grid doesn't contain 'Reset Filter' button" - ); - - $this->assertSelectCount( - '[id="billing_agreements"]', - 1, - $response->getBody(), - "Response for billing agreement grid doesn't contain grid" - ); - } - - /** - * @magentoDataFixture Magento/Customer/_files/customer.php - * @magentoDataFixture Magento/Paypal/_files/billing_agreement.php - */ - public function testCustomerInfoTabs() - { - /** @var \Magento\Paypal\Model\Resource\Billing\Agreement\Collection $billingAgreementCollection */ - $billingAgreementCollection = Bootstrap::getObjectManager()->create( - 'Magento\Paypal\Model\Resource\Billing\Agreement\Collection' - ); - $agreementId = $billingAgreementCollection->getFirstItem()->getId(); - $this->dispatch('backend/paypal/billing_agreement/view/agreement/' . $agreementId); - - $this->assertSelectCount( - 'a[name="billing_agreement_info"]', - 1, - $this->getResponse()->getBody(), - "Response for billing agreement info doesn't contain billing agreement info tab" - ); - - $this->assertSelectRegExp( - 'a', - '/customer\@example.com/', - 1, - $this->getResponse()->getBody(), - "Response for billing agreement info doesn't contain Customer info" - ); - } - - /** - * @magentoDataFixture Magento/Customer/_files/customer.php - * @magentoDataFixture Magento/Paypal/_files/billing_agreement.php - */ - public function testCustomerGrid() - { - $this->dispatch('backend/paypal/billing_agreement/customergrid/id/1'); - $this->assertSelectCount( - 'td[class="col-reference_id"]', - 1, - $this->getResponse()->getBody(), - "Response for billing agreement orders doesn't contain billing agreement customers grid" - ); - $this->assertSelectRegExp( - 'td', - '/REF-ID-TEST-678/', - 1, - $this->getResponse()->getBody(), - "Response for billing agreement info doesn't contain reference ID" - ); - } -} diff --git a/dev/tests/integration/testsuite/Magento/Paypal/Controller/Billing/AgreementTest.php b/dev/tests/integration/testsuite/Magento/Paypal/Controller/Billing/AgreementTest.php deleted file mode 100644 index 91143d6532583..0000000000000 --- a/dev/tests/integration/testsuite/Magento/Paypal/Controller/Billing/AgreementTest.php +++ /dev/null @@ -1,121 +0,0 @@ -getMockForAbstractClass('Magento\Framework\App\RequestInterface', [], '', false); - $requestMock - ->expects($this->any()) - ->method('getParam') - ->will( - $this->returnValueMap( - [ - ['payment_method', null, $paymentMethod], - ['token', null, $token], - ] - ) - ); - - /** - * Disable billing agreement placement using calls to remote system - * in \Magento\Paypal\Model\Billing\Agreement::place() - */ - $objectManagerMock = $this->getMock('Magento\Framework\ObjectManagerInterface'); - $paymentMethodMock = $this->getMock( - 'Magento\Paypal\Model\Express', - ['getTitle', 'setStore', 'placeBillingAgreement'], - [], - '', - false - ); - $paymentMethodMock->expects($this->any())->method('placeBillingAgreement')->will($this->returnSelf()); - $paymentMethodMock->expects($this->any())->method('getTitle')->will($this->returnValue($paymentMethod)); - - $paymentHelperMock = $this->getMock('Magento\Payment\Helper\Data', ['getMethodInstance'], [], '', false); - $paymentHelperMock - ->expects($this->any()) - ->method('getMethodInstance') - ->will($this->returnValue($paymentMethodMock)); - $billingAgreement = $objectManager->create( - 'Magento\Paypal\Model\Billing\Agreement', - ['paymentData' => $paymentHelperMock] - ); - /** Reference ID is normally set by placeBillingAgreement() and is an agreement ID in the external system. */ - $billingAgreement->setBillingAgreementId($referenceId); - $objectManagerMock - ->expects($this->once()) - ->method('create') - ->with('Magento\Paypal\Model\Billing\Agreement', []) - ->will($this->returnValue($billingAgreement)); - $storeManager = $objectManager->get('Magento\Store\Model\StoreManager'); - $customerSession = $objectManager->get('Magento\Customer\Model\Session'); - $objectManagerMock - ->expects($this->any()) - ->method('get') - ->will( - $this->returnValueMap( - [ - ['Magento\Store\Model\StoreManager', $storeManager], - ['Magento\Customer\Model\Session', $customerSession], - ] - ) - ); - $contextMock = $objectManager->create( - 'Magento\Framework\App\Action\Context', - [ - 'objectManager' => $objectManagerMock, - 'request' => $requestMock - ] - ); - /** @var \Magento\Paypal\Controller\Billing\Agreement $billingAgreementController */ - $billingAgreementController = $objectManager->create( - 'Magento\Paypal\Controller\Billing\Agreement\ReturnWizard', - ['context' => $contextMock] - ); - - /** Initialize current customer */ - /** @var \Magento\Customer\Model\Session $customerSession */ - $customerSession = $objectManager->get('Magento\Customer\Model\Session'); - $fixtureCustomerId = 1; - $customerSession->setCustomerId($fixtureCustomerId); - - /** Execute SUT */ - $billingAgreementController->execute(); - - /** Ensure that billing agreement record was created in the DB */ - /** @var \Magento\Paypal\Model\Resource\Billing\Agreement\Collection $billingAgreementCollection */ - $billingAgreementCollection = $objectManager->create( - 'Magento\Paypal\Model\Resource\Billing\Agreement\Collection' - ); - /** @var \Magento\Paypal\Model\Billing\Agreement $createdBillingAgreement */ - $createdBillingAgreement = $billingAgreementCollection->getLastItem(); - $this->assertEquals($fixtureCustomerId, $createdBillingAgreement->getCustomerId(), "Customer ID is invalid."); - $this->assertEquals($referenceId, $createdBillingAgreement->getReferenceId(), "Reference ID is invalid."); - $this->assertEquals($paymentMethod, $createdBillingAgreement->getMethodCode(), "Method code is invalid."); - } -} diff --git a/dev/tests/integration/testsuite/Magento/Paypal/Controller/ExpressTest.php b/dev/tests/integration/testsuite/Magento/Paypal/Controller/ExpressTest.php deleted file mode 100644 index 65bd6755617e4..0000000000000 --- a/dev/tests/integration/testsuite/Magento/Paypal/Controller/ExpressTest.php +++ /dev/null @@ -1,124 +0,0 @@ -create('Magento\Sales\Model\Quote'); - $quote->load('test01', 'reserved_order_id'); - \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get( - 'Magento\Checkout\Model\Session' - )->setQuoteId( - $quote->getId() - ); - - $this->dispatch('paypal/express/review'); - - $html = $this->getResponse()->getBody(); - $this->assertContains('Simple Product', $html); - $this->assertContains('Review', $html); - $this->assertContains('/paypal/express/placeOrder/', $html); - } - - /** - * @magentoDataFixture Magento/Paypal/_files/quote_payment_express.php - * @magentoConfigFixture current_store paypal/general/business_account merchant_2012050718_biz@example.com - */ - public function testCancelAction() - { - $quote = $this->_objectManager->create('Magento\Sales\Model\Quote'); - $quote->load('test02', 'reserved_order_id'); - $order = $this->_objectManager->create('Magento\Sales\Model\Order'); - $order->load('100000002', 'increment_id'); - $session = $this->_objectManager->get('Magento\Checkout\Model\Session'); - $session->setLastRealOrderId( - $order->getRealOrderId() - )->setLastOrderId( - $order->getId() - )->setLastQuoteId( - $order->getQuoteId() - )->setQuoteId( - $order->getQuoteId() - ); - /** @var $paypalSession \Magento\Framework\Session\Generic */ - $paypalSession = $this->_objectManager->get('Magento\Framework\Session\Generic'); - $paypalSession->setExpressCheckoutToken('token'); - - $this->dispatch('paypal/express/cancel'); - - $order->load('100000002', 'increment_id'); - $this->assertEquals('canceled', $order->getState()); - $this->assertEquals($session->getQuote()->getGrandTotal(), $quote->getGrandTotal()); - $this->assertEquals($session->getQuote()->getItemsCount(), $quote->getItemsCount()); - } - - /** - * Test ensures only that customer data was copied to quote correctly. - * - * Note that test does not verify communication during remote calls to PayPal. - * - * @magentoDataFixture Magento/Sales/_files/quote.php - * @magentoDataFixture Magento/Customer/_files/customer.php - */ - public function testStartActionCustomerToQuote() - { - $fixtureCustomerId = 1; - $fixtureCustomerEmail = 'customer@example.com'; - $fixtureCustomerFirstname = 'John'; - $fixtureQuoteReserveId = 'test01'; - - /** Preconditions */ - /** @var \Magento\Customer\Model\Session $customerSession */ - $customerSession = $this->_objectManager->get('Magento\Customer\Model\Session'); - /** @var \Magento\Customer\Api\CustomerRepositoryInterface $customerRepository */ - $customerRepository = $this->_objectManager->get('Magento\Customer\Api\CustomerRepositoryInterface'); - $customerData = $customerRepository->getById($fixtureCustomerId); - $customerSession->setCustomerDataObject($customerData); - - /** @var \Magento\Sales\Model\Quote $quote */ - $quote = $this->_objectManager->create('Magento\Sales\Model\Quote'); - $quote->load($fixtureQuoteReserveId, 'reserved_order_id'); - - /** @var \Magento\Checkout\Model\Session $checkoutSession */ - $checkoutSession = $this->_objectManager->get('Magento\Checkout\Model\Session'); - $checkoutSession->setQuoteId($quote->getId()); - - /** Preconditions check */ - $this->assertNotEquals( - $fixtureCustomerEmail, - $quote->getCustomerEmail(), - "Precondition failed: customer email in quote is invalid." - ); - $this->assertNotEquals( - $fixtureCustomerFirstname, - $quote->getCustomerFirstname(), - "Precondition failed: customer first name in quote is invalid." - ); - - /** Execute SUT */ - $this->dispatch('paypal/express/start'); - - /** Check if customer data was copied to quote correctly */ - /** @var \Magento\Sales\Model\Quote $updatedQuote */ - $updatedQuote = $this->_objectManager->create('Magento\Sales\Model\Quote'); - $updatedQuote->load($fixtureQuoteReserveId, 'reserved_order_id'); - $this->assertEquals( - $fixtureCustomerEmail, - $updatedQuote->getCustomer()->getEmail(), - "Customer email in quote is invalid." - ); - $this->assertEquals( - $fixtureCustomerFirstname, - $updatedQuote->getCustomer()->getFirstname(), - "Customer first name in quote is invalid." - ); - } -} diff --git a/dev/tests/integration/testsuite/Magento/Paypal/Controller/HostedproTest.php b/dev/tests/integration/testsuite/Magento/Paypal/Controller/HostedproTest.php deleted file mode 100644 index 44b3856b7e7a5..0000000000000 --- a/dev/tests/integration/testsuite/Magento/Paypal/Controller/HostedproTest.php +++ /dev/null @@ -1,60 +0,0 @@ -create('Magento\Sales\Model\Order'); - $order->load('100000001', 'increment_id'); - $order->getPayment()->setMethod(\Magento\Paypal\Model\Config::METHOD_HOSTEDPRO); - - $quote = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( - 'Magento\Sales\Model\Quote' - )->setStoreId( - $order->getStoreId() - )->save(); - - $order->setQuoteId($quote->getId()); - $order->save(); - - $session = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\Checkout\Model\Session'); - $session->setLastRealOrderId($order->getRealOrderId())->setLastQuoteId($order->getQuoteId()); - - $this->dispatch('paypal/hostedpro/cancel'); - $this->assertContains( - "parent.jQuery('#checkoutSteps').trigger('gotoSection', 'payment');", - $this->getResponse()->getBody() - ); - $this->assertContains("parent.jQuery('#checkout-review-submit').show();", $this->getResponse()->getBody()); - $this->assertContains("parent.jQuery('#iframe-warning').hide();", $this->getResponse()->getBody()); - } - - /** - * @magentoDataFixture Magento/Paypal/_files/quote_payment_express.php - * @magentoConfigFixture current_store payment/paypal_hostedpro/active 1 - * @magentoConfigFixture current_store paypal/general/business_account merchant_2012050718_biz@example.com - */ - public function testCancelAction() - { - $order = $this->_objectManager->create('Magento\Sales\Model\Order'); - $session = $this->_objectManager->get('Magento\Checkout\Model\Session'); - - $quote = $this->_objectManager->create('Magento\Sales\Model\Quote'); - $quote->load('test02', 'reserved_order_id'); - $session->setQuoteId($quote->getId()); - $session->setPaypalStandardQuoteId($quote->getId())->setLastRealOrderId('100000002'); - $this->dispatch('paypal/hostedpro/cancel'); - - $order->load('100000002', 'increment_id'); - $this->assertEquals('canceled', $order->getState()); - $this->assertEquals($session->getQuote()->getGrandTotal(), $quote->getGrandTotal()); - $this->assertEquals($session->getQuote()->getItemsCount(), $quote->getItemsCount()); - } -} diff --git a/dev/tests/integration/testsuite/Magento/Paypal/Controller/PayflowTest.php b/dev/tests/integration/testsuite/Magento/Paypal/Controller/PayflowTest.php deleted file mode 100644 index 828cd5193021d..0000000000000 --- a/dev/tests/integration/testsuite/Magento/Paypal/Controller/PayflowTest.php +++ /dev/null @@ -1,93 +0,0 @@ -create('Magento\Sales\Model\Order'); - $order->load('100000001', 'increment_id'); - $order->getPayment()->setMethod(\Magento\Paypal\Model\Config::METHOD_PAYFLOWLINK); - - $quote = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( - 'Magento\Sales\Model\Quote' - )->setStoreId( - $order->getStoreId() - )->save(); - - $order->setQuoteId($quote->getId()); - $order->save(); - - $session = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\Checkout\Model\Session'); - $session->setLastRealOrderId($order->getRealOrderId())->setLastQuoteId($order->getQuoteId()); - } - - public function testCancelPaymentActionIsContentGenerated() - { - $this->dispatch('paypal/payflow/cancelpayment'); - $this->assertContains( - "parent.jQuery('#checkoutSteps').trigger('gotoSection', 'payment');", - $this->getResponse()->getBody() - ); - $this->assertContains("parent.jQuery('#checkout-review-submit').show();", $this->getResponse()->getBody()); - $this->assertContains("parent.jQuery('#iframe-warning').hide();", $this->getResponse()->getBody()); - } - - public function testReturnurlActionIsContentGenerated() - { - $this->dispatch('paypal/payflow/returnurl'); - $this->assertContains( - "parent.jQuery('#checkoutSteps').trigger('gotoSection', 'payment');", - $this->getResponse()->getBody() - ); - $this->assertContains("parent.jQuery('#checkout-review-submit').show();", $this->getResponse()->getBody()); - $this->assertContains("parent.jQuery('#iframe-warning').hide();", $this->getResponse()->getBody()); - } - - public function testFormActionIsContentGenerated() - { - $this->dispatch('paypal/payflow/form'); - $this->assertContains( - '
', - $this->getResponse()->getBody() - ); - // Check P3P header - $headerConstraints = []; - foreach ($this->getResponse()->getHeaders() as $header) { - $headerConstraints[] = new \PHPUnit_Framework_Constraint_IsEqual($header['name']); - } - $constraint = new \PHPUnit_Framework_Constraint_Or(); - $constraint->setConstraints($headerConstraints); - $this->assertThat('P3p', $constraint); - } - - /** - * @magentoDataFixture Magento/Sales/_files/order.php - * @magentoConfigFixture current_store payment/paypal_payflow/active 1 - * @magentoConfigFixture current_store paypal/general/business_account merchant_2012050718_biz@example.com - */ - public function testCancelAction() - { - $order = $this->_objectManager->create('Magento\Sales\Model\Order'); - $session = $this->_objectManager->get('Magento\Checkout\Model\Session'); - - $quote = $this->_objectManager->create('Magento\Sales\Model\Quote'); - $quote->load('test02', 'reserved_order_id'); - $order->load('100000001', 'increment_id')->setQuoteId($quote->getId())->save(); - $session->setQuoteId($quote->getId()); - $session->setPaypalStandardQuoteId($quote->getId())->setLastRealOrderId('100000001'); - $this->dispatch('paypal/payflow/cancelpayment'); - $order->load('100000001', 'increment_id'); - $this->assertEquals('canceled', $order->getState()); - $this->assertEquals($session->getQuote()->getGrandTotal(), $quote->getGrandTotal()); - $this->assertEquals($session->getQuote()->getItemsCount(), $quote->getItemsCount()); - } -} diff --git a/dev/tests/integration/testsuite/Magento/Paypal/Controller/PayflowadvancedTest.php b/dev/tests/integration/testsuite/Magento/Paypal/Controller/PayflowadvancedTest.php deleted file mode 100644 index c6993336272f9..0000000000000 --- a/dev/tests/integration/testsuite/Magento/Paypal/Controller/PayflowadvancedTest.php +++ /dev/null @@ -1,86 +0,0 @@ -_objectManager->create('Magento\Sales\Model\Order'); - $order->load('100000001', 'increment_id'); - $order->getPayment()->setMethod(\Magento\Paypal\Model\Config::METHOD_PAYFLOWADVANCED); - - $quote = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( - 'Magento\Sales\Model\Quote' - )->setStoreId( - $order->getStoreId() - )->save(); - - $order->setQuoteId($quote->getId()); - $order->save(); - - $session = $this->_objectManager->create('Magento\Checkout\Model\Session'); - $session->setLastRealOrderId($order->getRealOrderId())->setLastQuoteId($order->getQuoteId()); - } - - public function testCancelPaymentActionIsContentGenerated() - { - $this->dispatch('paypal/payflowadvanced/cancelpayment'); - $this->assertContains( - "parent.jQuery('#checkoutSteps').trigger('gotoSection', 'payment');", - $this->getResponse()->getBody() - ); - $this->assertContains("parent.jQuery('#checkout-review-submit').show();", $this->getResponse()->getBody()); - $this->assertContains("parent.jQuery('#iframe-warning').hide();", $this->getResponse()->getBody()); - } - - public function testReturnurlActionIsContentGenerated() - { - $this->dispatch('paypal/payflowadvanced/returnurl'); - $this->assertContains( - "parent.jQuery('#checkoutSteps').trigger('gotoSection', 'payment');", - $this->getResponse()->getBody() - ); - $this->assertContains("parent.jQuery('#checkout-review-submit').show();", $this->getResponse()->getBody()); - $this->assertContains("parent.jQuery('#iframe-warning').hide();", $this->getResponse()->getBody()); - } - - public function testFormActionIsContentGenerated() - { - $this->dispatch('paypal/payflowadvanced/form'); - $this->assertContains( - '', - $this->getResponse()->getBody() - ); - } - - /** - * @magentoDataFixture Magento/Sales/_files/order.php - * @magentoConfigFixture current_store payment/paypal_payflow/active 1 - * @magentoConfigFixture current_store paypal/general/business_account merchant_2012050718_biz@example.com - */ - public function testCancelAction() - { - $order = $this->_objectManager->create('Magento\Sales\Model\Order'); - $session = $this->_objectManager->get('Magento\Checkout\Model\Session'); - - $quote = $this->_objectManager->create('Magento\Sales\Model\Quote'); - $quote->load('test02', 'reserved_order_id'); - $order->load('100000001', 'increment_id')->setQuoteId($quote->getId())->save(); - $session->setQuoteId($quote->getId()); - $session->setPaypalStandardQuoteId($quote->getId())->setLastRealOrderId('100000001'); - $this->dispatch('paypal/payflow/cancelpayment'); - - $order->load('100000001', 'increment_id'); - $this->assertEquals('canceled', $order->getState()); - $this->assertEquals($session->getQuote()->getGrandTotal(), $quote->getGrandTotal()); - $this->assertEquals($session->getQuote()->getItemsCount(), $quote->getItemsCount()); - } -} diff --git a/dev/tests/integration/testsuite/Magento/Paypal/Controller/StandardTest.php b/dev/tests/integration/testsuite/Magento/Paypal/Controller/StandardTest.php deleted file mode 100644 index e2a08aa4675c9..0000000000000 --- a/dev/tests/integration/testsuite/Magento/Paypal/Controller/StandardTest.php +++ /dev/null @@ -1,68 +0,0 @@ -_order = $this->_objectManager->create('Magento\Sales\Model\Order'); - $this->_session = $this->_objectManager->get('Magento\Checkout\Model\Session'); - } - - /** - * @magentoDataFixture Magento/Sales/_files/order.php - */ - public function testRedirectActionIsContentGenerated() - { - $this->_order->load('100000001', 'increment_id'); - $this->_order->getPayment()->setMethod(\Magento\Paypal\Model\Config::METHOD_WPS); - $this->_order->save(); - $this->_order->load('100000001', 'increment_id'); - - $this->_session->setLastRealOrderId( - $this->_order->getRealOrderId() - )->setLastQuoteId( - $this->_order->getQuoteId() - ); - - $this->dispatch('paypal/standard/redirect'); - $this->assertContains( - '', - $this->getResponse()->getBody() - ); - } - - /** - * @magentoDataFixture Magento/Paypal/_files/quote_payment_standard.php - * @magentoConfigFixture current_store payment/paypal_standard/active 1 - * @magentoConfigFixture current_store paypal/general/business_account merchant_2012050718_biz@example.com - */ - public function testCancelAction() - { - $quote = $this->_objectManager->create('Magento\Sales\Model\Quote'); - $quote->load('test01', 'reserved_order_id'); - $this->_session->setQuoteId($quote->getId()); - $this->_session->setPaypalStandardQuoteId($quote->getId())->setLastRealOrderId('100000002'); - $this->dispatch('paypal/standard/cancel'); - - $this->_order->load('100000002', 'increment_id'); - $this->assertEquals('canceled', $this->_order->getState()); - $this->assertEquals($this->_session->getQuote()->getGrandTotal(), $quote->getGrandTotal()); - $this->assertEquals($this->_session->getQuote()->getItemsCount(), $quote->getItemsCount()); - } -} diff --git a/dev/tests/integration/testsuite/Magento/Paypal/Model/Express/CheckoutTest.php b/dev/tests/integration/testsuite/Magento/Paypal/Model/Express/CheckoutTest.php deleted file mode 100644 index 5f404a8e5ce3e..0000000000000 --- a/dev/tests/integration/testsuite/Magento/Paypal/Model/Express/CheckoutTest.php +++ /dev/null @@ -1,282 +0,0 @@ -_objectManager = Bootstrap::getObjectManager(); - } - - /** - * Verify that an order placed with an existing customer can re-use the customer addresses. - * - * @magentoDataFixture Magento/Paypal/_files/quote_payment_express_with_customer.php - * @magentoAppIsolation enabled - * @magentoDbIsolation enabled - */ - public function testPrepareCustomerQuote() - { - /** @var Quote $quote */ - $quote = $this->_getFixtureQuote(); - $quote->setCheckoutMethod(Onepage::METHOD_CUSTOMER); // to dive into _prepareCustomerQuote() on switch - $quote->getShippingAddress()->setSameAsBilling(0); - $customer = $this->_objectManager->create('Magento\Customer\Model\Customer')->load(1); - $customer->setDefaultBilling(false) - ->setDefaultShipping(false) - ->save(); - - /** @var \Magento\Customer\Model\Session $customerSession */ - $customerSession = $this->_objectManager->get('Magento\Customer\Model\Session'); - $customerSession->loginById(1); - $checkout = $this->_getCheckout($quote); - $checkout->place('token'); - - /** @var \Magento\Customer\Api\CustomerRepositoryInterface $customerService */ - $customerService = $this->_objectManager->get('Magento\Customer\Api\CustomerRepositoryInterface'); - $customer = $customerService->getById($quote->getCustomerId()); - - $this->assertEquals(1, $quote->getCustomerId()); - $this->assertEquals(2, count($customer->getAddresses())); - - $this->assertEquals(1, $quote->getBillingAddress()->getCustomerAddressId()); - $this->assertEquals(2, $quote->getShippingAddress()->getCustomerAddressId()); - - $order = $checkout->getOrder(); - $this->assertEquals(1, $order->getBillingAddress()->getCustomerAddressId()); - $this->assertEquals(2, $order->getShippingAddress()->getCustomerAddressId()); - } - - /** - * Verify that an order placed with a new customer will create the customer. - * - * @magentoDataFixture Magento/Paypal/_files/quote_payment_express.php - * @magentoAppIsolation enabled - * @magentoDbIsolation enabled - */ - public function testPrepareNewCustomerQuote() - { - /** @var \Magento\Customer\Api\CustomerRepositoryInterface $customerService */ - $customerService = $this->_objectManager->get('Magento\Customer\Api\CustomerRepositoryInterface'); - - /** @var Quote $quote */ - $quote = $this->_getFixtureQuote(); - - $quote->setCheckoutMethod(Onepage::METHOD_REGISTER); // to dive into _prepareNewCustomerQuote() on switch - $quote->setCustomerEmail('user@example.com'); - $quote->setCustomerFirstname('Firstname'); - $quote->setCustomerLastname('Lastname'); - $quote->setCustomerIsGuest(false); - $checkout = $this->_getCheckout($quote); - $checkout->place('token'); - $customer = $customerService->getById($quote->getCustomerId()); - $this->assertEquals('user@example.com', $customer->getEmail()); - $this->assertEquals('11111111', $customer->getAddresses()[0]->getTelephone()); - } - - /** - * Verify that an order placed with a new unconfirmed customer alerts the user that they must confirm the account. - * - * @magentoDataFixture Magento/Paypal/_files/quote_payment_express.php - * @magentoAppIsolation enabled - * @magentoDbIsolation enabled - * @magentoConfigFixture current_store customer/create_account/confirm true - */ - public function testPrepareNewCustomerQuoteConfirmationRequired() - { - /** @var \Magento\Customer\Api\CustomerRepositoryInterface $customerService */ - $customerService = $this->_objectManager->get('Magento\Customer\Api\CustomerRepositoryInterface'); - - /** @var Quote $quote */ - $quote = $this->_getFixtureQuote(); - - $quote->setCheckoutMethod(Onepage::METHOD_REGISTER); // to dive into _prepareNewCustomerQuote() on switch - $quote->setCustomerEmail('user@example.com'); - $quote->setCustomerFirstname('Firstname'); - $quote->setCustomerLastname('Lastname'); - $quote->setCustomerIsGuest(false); - - $checkout = $this->_getCheckout($quote); - $checkout->place('token'); - $customer = $customerService->getById($quote->getCustomerId()); - $this->assertEquals('user@example.com', $customer->getEmail()); - $this->assertEquals('11111111', $customer->getAddresses()[0]->getTelephone()); - - /** @var \Magento\Framework\Message\ManagerInterface $messageManager */ - $messageManager = $this->_objectManager->get('\Magento\Framework\Message\ManagerInterface'); - $confirmationText = sprintf( - 'customer/account/confirmation/email/%s/key/', - $customer->getEmail() - ); - /** @var \Magento\Framework\Message\MessageInterface $message */ - $message = $messageManager->getMessages()->getLastAddedMessage(); - $this->assertInstanceOf('\Magento\Framework\Message\MessageInterface', $message); - $this->assertTrue( - strpos($message->getText(), $confirmationText) !== false - ); - } - - /** - * Verify that after placing the order, addresses are associated with the order and the quote is a guest quote. - * - * @magentoDataFixture Magento/Paypal/_files/quote_payment_express.php - * @magentoAppIsolation enabled - * @magentoDbIsolation enabled - */ - public function testPlaceGuestQuote() - { - /** @var Quote $quote */ - $quote = $this->_getFixtureQuote(); - $quote->setCheckoutMethod(Onepage::METHOD_GUEST); // to dive into _prepareGuestQuote() on switch - $quote->getShippingAddress()->setSameAsBilling(0); - - $checkout = $this->_getCheckout($quote); - $checkout->place('token'); - - $this->assertNull($quote->getCustomerId()); - $this->assertTrue($quote->getCustomerIsGuest()); - $this->assertEquals( - \Magento\Customer\Model\GroupManagement::NOT_LOGGED_IN_ID, - $quote->getCustomerGroupId() - ); - - $this->assertNotEmpty($quote->getBillingAddress()); - $this->assertNotEmpty($quote->getShippingAddress()); - - $order = $checkout->getOrder(); - $this->assertNotEmpty($order->getBillingAddress()); - $this->assertNotEmpty($order->getShippingAddress()); - } - - /** - * @param Quote $quote - * @return Checkout - */ - protected function _getCheckout(Quote $quote) - { - return $this->_objectManager->create( - 'Magento\Paypal\Model\Express\Checkout', - [ - 'params' => [ - 'config' => $this->getMock('Magento\Paypal\Model\Config', [], [], '', false), - 'quote' => $quote, - ] - ] - ); - } - - /** - * Verify that an order placed with an existing customer can re-use the customer addresses. - * - * @magentoDataFixture Magento/Paypal/_files/quote_payment_express_with_customer.php - * @magentoAppIsolation enabled - * @magentoDbIsolation enabled - */ - public function testReturnFromPaypal() - { - $quote = $this->_getFixtureQuote(); - $paypalConfigMock = $this->getMock('Magento\Paypal\Model\Config', [], [], '', false); - $apiTypeFactory = $this->getMock('Magento\Paypal\Model\Api\Type\Factory', [], [], '', false); - $paypalInfo = $this->getMock('Magento\Paypal\Model\Info', [], [], '', false); - $checkoutModel = $this->_objectManager->create( - 'Magento\Paypal\Model\Express\Checkout', - [ - 'params' => ['quote' => $quote, 'config' => $paypalConfigMock], - 'apiTypeFactory' => $apiTypeFactory, - 'paypalInfo' => $paypalInfo - ] - ); - - $api = $this->getMock( - 'Magento\Paypal\Model\Api\Nvp', - ['call', 'getExportedShippingAddress', 'getExportedBillingAddress'], - [], - '', - false - ); - $api->expects($this->any())->method('call')->will($this->returnValue([])); - $apiTypeFactory->expects($this->any())->method('create')->will($this->returnValue($api)); - - $exportedBillingAddress = $this->_getExportedAddressFixture($quote->getBillingAddress()->getData()); - $api->expects($this->any()) - ->method('getExportedBillingAddress') - ->will($this->returnValue($exportedBillingAddress)); - - $exportedShippingAddress = $this->_getExportedAddressFixture($quote->getShippingAddress()->getData()); - $api->expects($this->any()) - ->method('getExportedShippingAddress') - ->will($this->returnValue($exportedShippingAddress)); - - $paypalInfo->expects($this->once())->method('importToPayment')->with($api, $quote->getPayment()); - - $quote->getPayment()->setAdditionalInformation(Checkout::PAYMENT_INFO_BUTTON, 1); - - $checkoutModel->returnFromPaypal('token'); - - $billingAddress = $quote->getBillingAddress(); - - $this->assertContains('exported', $billingAddress->getFirstname()); - $this->assertEquals('note', $billingAddress->getCustomerNote()); - - $shippingAddress = $quote->getShippingAddress(); - $this->assertTrue((bool)$shippingAddress->getSameAsBilling()); - $this->assertNull($shippingAddress->getPrefix()); - $this->assertNull($shippingAddress->getMiddlename()); - $this->assertNull($shippingAddress->getLastname()); - $this->assertNull($shippingAddress->getSuffix()); - $this->assertTrue($shippingAddress->getShouldIgnoreValidation()); - $this->assertContains('exported', $shippingAddress->getFirstname()); - - $paymentAdditionalInformation = $quote->getPayment()->getAdditionalInformation(); - $this->assertArrayHasKey(Checkout::PAYMENT_INFO_TRANSPORT_SHIPPING_METHOD, $paymentAdditionalInformation); - $this->assertArrayHasKey(Checkout::PAYMENT_INFO_TRANSPORT_PAYER_ID, $paymentAdditionalInformation); - $this->assertArrayHasKey(Checkout::PAYMENT_INFO_TRANSPORT_TOKEN, $paymentAdditionalInformation); - $this->assertTrue($quote->getPayment()->hasMethod()); - - $this->assertTrue($quote->getTotalsCollectedFlag()); - $this->assertFalse($quote->hasDataChanges()); - } - - /** - * Prepare fixture for exported address - * - * @param array $addressData - * @return \Magento\Framework\Object - */ - protected function _getExportedAddressFixture(array $addressData) - { - $addressDataKeys = ['firstname', 'lastname', 'street', 'city', 'telephone']; - $result = []; - foreach ($addressDataKeys as $key) { - if (isset($addressData[$key])) { - $result[$key] = 'exported' . $addressData[$key]; - } - } - $fixture = new \Magento\Framework\Object($result); - $fixture->setExportedKeys($addressDataKeys); - $fixture->setData('note', 'note'); - return $fixture; - } - - /** - * @return Quote - */ - protected function _getFixtureQuote() - { - /** @var \Magento\Sales\Model\Resource\Quote\Collection $quoteCollection */ - $quoteCollection = $this->_objectManager->create('Magento\Sales\Model\Resource\Quote\Collection'); - - return $quoteCollection->getLastItem(); - } -} diff --git a/dev/tests/integration/testsuite/Magento/Paypal/Model/IpnTest.php b/dev/tests/integration/testsuite/Magento/Paypal/Model/IpnTest.php deleted file mode 100644 index 7cf622b514fd6..0000000000000 --- a/dev/tests/integration/testsuite/Magento/Paypal/Model/IpnTest.php +++ /dev/null @@ -1,113 +0,0 @@ -_objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); - } - - /** - * @param string $currencyCode - * @dataProvider currencyProvider - * @magentoDataFixture Magento/Paypal/_files/order_express.php - * @magentoConfigFixture current_store payment/paypal_direct/active 1 - * @magentoConfigFixture current_store payment/paypal_express/active 1 - * @magentoConfigFixture current_store paypal/general/merchant_country US - */ - public function testProcessIpnRequestExpressCurrency($currencyCode) - { - $this->_processIpnRequestCurrency($currencyCode); - } - - /** - * @param string $currencyCode - * @dataProvider currencyProvider - * @magentoDataFixture Magento/Paypal/_files/order_standard.php - * @magentoConfigFixture current_store payment/paypal_standard/active 1 - * @magentoConfigFixture current_store paypal/general/business_account merchant_2012050718_biz@example.com - */ - public function testProcessIpnRequestStandardCurrency($currencyCode) - { - $this->_processIpnRequestCurrency($currencyCode); - } - - /** - * Test processIpnRequest() currency check for paypal_express and paypal_standard payment methods - * - * @param string $currencyCode - */ - protected function _processIpnRequestCurrency($currencyCode) - { - $ipnData = require __DIR__ . '/../_files/ipn.php'; - $ipnData['mc_currency'] = $currencyCode; - - /** @var $ipnFactory \Magento\Paypal\Model\IpnFactory */ - $ipnFactory = $this->_objectManager->create('Magento\Paypal\Model\IpnFactory'); - - $model = $ipnFactory->create(['data' => $ipnData, 'curlFactory' => $this->_createMockedHttpAdapter()]); - $model->processIpnRequest(); - - $order = $this->_objectManager->create('Magento\Sales\Model\Order'); - $order->loadByIncrementId('100000001'); - $this->_assertOrder($order, $currencyCode); - } - - /** - * Perform order state and status assertions depending on currency code - * - * @param \Magento\Sales\Model\Order $order - * @param string $currencyCode - */ - protected function _assertOrder($order, $currencyCode) - { - if ($currencyCode == 'USD') { - $this->assertEquals('complete', $order->getState()); - $this->assertEquals('complete', $order->getStatus()); - } else { - $this->assertEquals('payment_review', $order->getState()); - $this->assertEquals('fraud', $order->getStatus()); - } - } - - /** - * Data provider for currency check tests - * - * @static - * @return array - */ - public static function currencyProvider() - { - return [['USD'], ['EUR']]; - } - - /** - * Mocked HTTP adapter to get VERIFIED PayPal IPN postback result - * - * @return \Magento\Framework\HTTP\Adapter\Curl - */ - protected function _createMockedHttpAdapter() - { - $factory = $this->getMock('Magento\Framework\HTTP\Adapter\CurlFactory', ['create'], [], '', false); - $adapter = $this->getMock('Magento\Framework\HTTP\Adapter\Curl', ['read', 'write'], [], '', false); - - $adapter->expects($this->once())->method('read')->with()->will($this->returnValue("\nVERIFIED")); - - $adapter->expects($this->once())->method('write'); - - $factory->expects($this->once())->method('create')->with()->will($this->returnValue($adapter)); - return $factory; - } -} diff --git a/dev/tests/integration/testsuite/Magento/Paypal/Model/PayflowproTest.php b/dev/tests/integration/testsuite/Magento/Paypal/Model/PayflowproTest.php deleted file mode 100644 index 93f3b2a36cdbf..0000000000000 --- a/dev/tests/integration/testsuite/Magento/Paypal/Model/PayflowproTest.php +++ /dev/null @@ -1,65 +0,0 @@ -_objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); - $httpClientFactoryMock = $this->getMockBuilder('Magento\Framework\HTTP\ZendClientFactory') - ->setMethods(['create']) - ->disableOriginalConstructor() - ->getMock(); - $this->_httpClientMock = $this->getMockBuilder('Magento\Framework\HTTP\ZendClient')->setMethods([]) - ->disableOriginalConstructor()->getMock(); - $this->_httpClientMock->expects($this->any())->method('setUri')->will($this->returnSelf()); - $this->_httpClientMock->expects($this->any())->method('setConfig')->will($this->returnSelf()); - $this->_httpClientMock->expects($this->any())->method('setMethod')->will($this->returnSelf()); - $this->_httpClientMock->expects($this->any())->method('setParameterPost')->will($this->returnSelf()); - $this->_httpClientMock->expects($this->any())->method('setHeaders')->will($this->returnSelf()); - $this->_httpClientMock->expects($this->any())->method('setUrlEncodeBody')->will($this->returnSelf()); - - $httpClientFactoryMock->expects($this->any())->method('create') - ->will($this->returnValue($this->_httpClientMock)); - - $this->_model = $this->_objectManager->create( - 'Magento\Paypal\Model\Payflowpro', - ['httpClientFactory' => $httpClientFactoryMock] - ); - } - - /** - * @magentoDataFixture Magento/Sales/_files/order_paid_with_payflowpro.php - */ - public function testReviewPaymentNullResponce() - { - /** @var \Magento\Sales\Model\Order $order */ - $order = $this->_objectManager->create('Magento\Sales\Model\Order'); - $order->loadByIncrementId('100000001'); - - $this->_httpClientMock->expects($this->any())->method('request') - ->will($this->returnValue(new \Magento\Framework\Object(['body' => 'RESULTval=12&val2=34']))); - $expectedResult = ['resultval' => '12', 'val2' => '34', 'result_code' => null, 'respmsg' => null]; - - $this->assertEquals($expectedResult, $this->_model->acceptPayment($order->getPayment())); - } -} diff --git a/dev/tests/integration/testsuite/Magento/Paypal/Model/Payment/Method/Billing/AbstractAgreementTest.php b/dev/tests/integration/testsuite/Magento/Paypal/Model/Payment/Method/Billing/AbstractAgreementTest.php deleted file mode 100644 index 72c2688953ce2..0000000000000 --- a/dev/tests/integration/testsuite/Magento/Paypal/Model/Payment/Method/Billing/AbstractAgreementTest.php +++ /dev/null @@ -1,67 +0,0 @@ -getMockBuilder('\Magento\Paypal\Model\Config')->disableOriginalConstructor()->getMock(); - $config->expects($this->any())->method('isMethodAvailable')->will($this->returnValue(true)); - $proMock = $this->getMockBuilder('Magento\Paypal\Model\Pro')->disableOriginalConstructor()->getMock(); - $proMock->expects($this->any())->method('getConfig')->will($this->returnValue($config)); - $this->_model = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( - 'Magento\Paypal\Model\Method\Agreement', - ['data' => [$proMock]] - ); - } - - /** - * @magentoDataFixture Magento/Sales/_files/quote_with_customer.php - * @magentoDataFixture Magento/Paypal/_files/billing_agreement.php - */ - public function testIsActive() - { - $quote = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( - 'Magento\Sales\Model\Resource\Quote\Collection' - )->getFirstItem(); - $this->assertTrue($this->_model->isAvailable($quote)); - } - - /** - * @magentoDataFixture Magento/Sales/_files/quote_with_customer.php - * @magentoDataFixture Magento/Paypal/_files/billing_agreement.php - */ - public function testAssignData() - { - /** @var \Magento\Sales\Model\Resource\Quote\Collection $collection */ - $collection = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( - 'Magento\Sales\Model\Resource\Quote\Collection' - ); - /** @var \Magento\Sales\Model\Quote $quote */ - $quote = $collection->getFirstItem(); - - /** @var \Magento\Payment\Model\Info $info */ - $info = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( - 'Magento\Payment\Model\Info' - )->setQuote( - $quote - ); - $this->_model->setData('info_instance', $info); - $billingAgreement = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( - 'Magento\Paypal\Model\Resource\Billing\Agreement\Collection' - )->getFirstItem(); - $data = [AbstractAgreement::TRANSPORT_BILLING_AGREEMENT_ID => $billingAgreement->getId()]; - $this->_model->assignData($data); - $this->assertEquals( - 'REF-ID-TEST-678', - $info->getAdditionalInformation(AbstractAgreement::PAYMENT_INFO_REFERENCE_ID) - ); - } -} diff --git a/dev/tests/integration/testsuite/Magento/Paypal/Model/Report/SettlementTest.php b/dev/tests/integration/testsuite/Magento/Paypal/Model/Report/SettlementTest.php deleted file mode 100644 index 2d014fc893d09..0000000000000 --- a/dev/tests/integration/testsuite/Magento/Paypal/Model/Report/SettlementTest.php +++ /dev/null @@ -1,48 +0,0 @@ -create( - 'Magento\Paypal\Model\Report\Settlement' - ); - $connection = $this->getMock('Magento\Framework\Io\Sftp', ['rawls', 'read'], [], '', false); - $filename = 'STL-00000000.00.abc.CSV'; - $connection->expects($this->once())->method('rawls')->will($this->returnValue([$filename => []])); - $connection->expects($this->once())->method('read')->with($filename, $this->anything()); - $model->fetchAndSave($connection); - } - - /** - * @param array $config - * @expectedException \InvalidArgumentException - * @dataProvider createConnectionExceptionDataProvider - */ - public function testCreateConnectionException($config) - { - \Magento\Paypal\Model\Report\Settlement::createConnection($config); - } - - /** - * @return array - */ - public function createConnectionExceptionDataProvider() - { - return [ - [[]], - [['username' => 'test', 'password' => 'test', 'path' => '/']], - [['hostname' => 'example.com', 'password' => 'test', 'path' => '/']], - [['hostname' => 'example.com', 'username' => 'test', 'path' => '/']], - [['hostname' => 'example.com', 'username' => 'test', 'password' => 'test']] - ]; - } -} diff --git a/dev/tests/integration/testsuite/Magento/Paypal/Model/Resource/Billing/Agreement/CollectionTest.php b/dev/tests/integration/testsuite/Magento/Paypal/Model/Resource/Billing/Agreement/CollectionTest.php deleted file mode 100644 index d7d9bcd23eef2..0000000000000 --- a/dev/tests/integration/testsuite/Magento/Paypal/Model/Resource/Billing/Agreement/CollectionTest.php +++ /dev/null @@ -1,47 +0,0 @@ -create( - 'Magento\Paypal\Model\Resource\Billing\Agreement\Collection' - ); - - $billingAgreementCollection->addCustomerDetails(); - - $this->assertEquals(1, $billingAgreementCollection->count(), "Invalid collection items quantity."); - /** @var \Magento\Paypal\Model\Billing\Agreement $billingAgreement */ - $billingAgreement = $billingAgreementCollection->getFirstItem(); - - $expectedData = [ - 'customer_id' => 1, - 'method_code' => 'paypal_express', - 'reference_id' => 'REF-ID-TEST-678', - 'status' => 'active', - 'store_id' => 1, - 'agreement_label' => 'TEST', - 'customer_email' => 'customer@example.com', - 'customer_firstname' => 'John', - 'customer_lastname' => 'Smith', - ]; - foreach ($expectedData as $field => $expectedValue) { - $this->assertEquals( - $expectedValue, - $billingAgreement->getData($field), - "'{$field}' field value is invalid." - ); - } - } -} diff --git a/dev/tests/integration/testsuite/Magento/Paypal/Model/VoidTest.php b/dev/tests/integration/testsuite/Magento/Paypal/Model/VoidTest.php deleted file mode 100644 index ef9a3150b0ae5..0000000000000 --- a/dev/tests/integration/testsuite/Magento/Paypal/Model/VoidTest.php +++ /dev/null @@ -1,79 +0,0 @@ -get('Magento\Framework\Event\ManagerInterface'); - $moduleList = $objectManager->get('Magento\Framework\Module\ModuleListInterface'); - $paymentData = $objectManager->get('Magento\Payment\Helper\Data'); - $scopeConfig = $objectManager->get('Magento\Framework\App\Config\ScopeConfigInterface'); - $logger = $objectManager->get('Magento\Framework\Logger'); - $logAdapterFactory = $objectManager->get('Magento\Framework\Logger\AdapterFactory'); - $localeDate = $objectManager->get('Magento\Framework\Stdlib\DateTime\TimezoneInterface'); - $centinelService = $objectManager->get('Magento\Centinel\Model\Service'); - $storeManager = $objectManager->get('Magento\Store\Model\StoreManagerInterface'); - $configFactory = $objectManager->get('Magento\Paypal\Model\ConfigFactory'); - $mathRandom = $objectManager->get('Magento\Framework\Math\Random'); - $httpClientFactoryMock = $this->getMockBuilder('Magento\Framework\HTTP\ZendClientFactory') - ->setMethods(['create']) - ->disableOriginalConstructor() - ->getMock(); - - /** @var $order \Magento\Sales\Model\Order */ - $order = $objectManager->create('Magento\Sales\Model\Order'); - $order->loadByIncrementId('100000001'); - $payment = $order->getPayment(); - - /** @var \Magento\Paypal\Model\Payflowpro $instance */ - $instance = $this->getMock( - 'Magento\Paypal\Model\Payflowpro', - ['_postRequest'], - [ - $eventManager, - $paymentData, - $scopeConfig, - $logAdapterFactory, - $logger, - $moduleList, - $localeDate, - $centinelService, - $storeManager, - $configFactory, - $mathRandom, - $httpClientFactoryMock - ] - ); - - $response = new \Magento\Framework\Object( - [ - 'result' => '0', - 'pnref' => 'V19A3D27B61E', - 'respmsg' => 'Approved', - 'authcode' => '510PNI', - 'hostcode' => 'A', - 'request_id' => 'f930d3dc6824c1f7230c5529dc37ae5e', - 'result_code' => '0', - ] - ); - - $instance->expects($this->any())->method('_postRequest')->will($this->returnValue($response)); - - $payment->setMethodInstance($instance); - $payment->void(new \Magento\Framework\Object()); - $order->save(); - - $order = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create('Magento\Sales\Model\Order'); - $order->loadByIncrementId('100000001'); - $this->assertFalse($order->canVoidPayment()); - } -} diff --git a/dev/tests/integration/testsuite/Magento/Paypal/_files/address_data.php b/dev/tests/integration/testsuite/Magento/Paypal/_files/address_data.php deleted file mode 100644 index 115090bed1fd8..0000000000000 --- a/dev/tests/integration/testsuite/Magento/Paypal/_files/address_data.php +++ /dev/null @@ -1,16 +0,0 @@ - 'guest', - 'lastname' => 'guest', - 'email' => 'customer@example.com', - 'street' => 'street', - 'city' => 'Los Angeles', - 'region' => 'CA', - 'postcode' => '1', - 'country_id' => 'US', - 'telephone' => '1' -]; diff --git a/dev/tests/integration/testsuite/Magento/Paypal/_files/billing_agreement.php b/dev/tests/integration/testsuite/Magento/Paypal/_files/billing_agreement.php deleted file mode 100644 index e1b329fbc5ff2..0000000000000 --- a/dev/tests/integration/testsuite/Magento/Paypal/_files/billing_agreement.php +++ /dev/null @@ -1,20 +0,0 @@ -create( - 'Magento\Paypal\Model\Billing\Agreement' -)->setAgreementLabel( - 'TEST' -)->setCustomerId( - 1 -)->setMethodCode( - 'paypal_express' -)->setReferenceId( - 'REF-ID-TEST-678' -)->setStatus( - Magento\Paypal\Model\Billing\Agreement::STATUS_ACTIVE -)->setStoreId( - 1 -)->save(); diff --git a/dev/tests/integration/testsuite/Magento/Paypal/_files/ipn.php b/dev/tests/integration/testsuite/Magento/Paypal/_files/ipn.php deleted file mode 100644 index a5ac6dec7b437..0000000000000 --- a/dev/tests/integration/testsuite/Magento/Paypal/_files/ipn.php +++ /dev/null @@ -1,12 +0,0 @@ - '100.00', - 'invoice' => '100000001', - 'payment_status' => 'Completed', - 'mc_currency' => 'USD', - 'receiver_email' => 'merchant_2012050718_biz@example.com' -]; diff --git a/dev/tests/integration/testsuite/Magento/Paypal/_files/order_express.php b/dev/tests/integration/testsuite/Magento/Paypal/_files/order_express.php deleted file mode 100644 index 98b73685dd9cd..0000000000000 --- a/dev/tests/integration/testsuite/Magento/Paypal/_files/order_express.php +++ /dev/null @@ -1,44 +0,0 @@ -create( - 'Magento\Sales\Model\Order\Address', - ['data' => $addressData] -); -$billingAddress->setAddressType('billing'); -$shippingAddress = clone $billingAddress; -$shippingAddress->setId(null)->setAddressType('shipping'); - -$payment = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create('Magento\Sales\Model\Order\Payment'); -$payment->setMethod(\Magento\Paypal\Model\Config::METHOD_WPP_EXPRESS); - -$order = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create('Magento\Sales\Model\Order'); -$order - ->setCustomerEmail('co@co.co') - ->setIncrementId( - '100000001' -)->setSubtotal( - 100 -)->setBaseSubtotal( - 100 -)->setBaseGrandTotal( - 100 -)->setBaseCurrencyCode( - 'USD' -)->setCustomerIsGuest( - true -)->setStoreId( - 1 -)->setEmailSent( - 1 -)->setBillingAddress( - $billingAddress -)->setShippingAddress( - $shippingAddress -)->setPayment( - $payment -); -$order->save(); diff --git a/dev/tests/integration/testsuite/Magento/Paypal/_files/order_payflowpro.php b/dev/tests/integration/testsuite/Magento/Paypal/_files/order_payflowpro.php deleted file mode 100644 index 3e252cdbe5062..0000000000000 --- a/dev/tests/integration/testsuite/Magento/Paypal/_files/order_payflowpro.php +++ /dev/null @@ -1,40 +0,0 @@ -create( - 'Magento\Sales\Model\Order\Address', - ['data' => $addressData] -); -$billingAddress->setAddressType('billing'); - -$shippingAddress = clone $billingAddress; -$shippingAddress->setId(null)->setAddressType('shipping'); - -$payment = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create('Magento\Sales\Model\Order\Payment'); -$payment->setMethod(\Magento\Paypal\Model\Config::METHOD_PAYFLOWPRO); - -$order = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create('Magento\Sales\Model\Order'); -$order->setCustomerEmail('co@co.co') - ->setIncrementId( - '100000001' -)->setSubtotal( - 100 -)->setBaseSubtotal( - 100 -)->setBaseGrandTotal( - 100 -)->setBaseCurrencyCode( - 'USD' -)->setCustomerIsGuest( - true -)->setBillingAddress( - $billingAddress -)->setShippingAddress( - $shippingAddress -)->setPayment( - $payment -); -$order->save(); diff --git a/dev/tests/integration/testsuite/Magento/Paypal/_files/order_standard.php b/dev/tests/integration/testsuite/Magento/Paypal/_files/order_standard.php deleted file mode 100644 index 86ba5d5485ba0..0000000000000 --- a/dev/tests/integration/testsuite/Magento/Paypal/_files/order_standard.php +++ /dev/null @@ -1,45 +0,0 @@ -create( - 'Magento\Sales\Model\Order\Address', - ['data' => $addressData] -); -$billingAddress->setAddressType('billing'); - -$shippingAddress = clone $billingAddress; -$shippingAddress->setId(null)->setAddressType('shipping'); - -$payment = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create('Magento\Sales\Model\Order\Payment'); -$payment->setMethod(\Magento\Paypal\Model\Config::METHOD_WPS); - -$order = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create('Magento\Sales\Model\Order'); -$order - ->setCustomerEmail('co@co.co') - ->setIncrementId( - '100000001' -)->setSubtotal( - 100 -)->setBaseSubtotal( - 100 -)->setBaseGrandTotal( - 100 -)->setBaseCurrencyCode( - 'USD' -)->setCustomerIsGuest( - true -)->setStoreId( - 1 -)->setEmailSent( - 1 -)->setBillingAddress( - $billingAddress -)->setShippingAddress( - $shippingAddress -)->setPayment( - $payment -); -$order->save(); diff --git a/dev/tests/integration/testsuite/Magento/Paypal/_files/quote_payment.php b/dev/tests/integration/testsuite/Magento/Paypal/_files/quote_payment.php deleted file mode 100644 index c2627cb9267d6..0000000000000 --- a/dev/tests/integration/testsuite/Magento/Paypal/_files/quote_payment.php +++ /dev/null @@ -1,12 +0,0 @@ -create('Magento\Sales\Model\Quote'); -$quote->load('test01', 'reserved_order_id'); - -$payment = $quote->getPayment(); -$payment->setMethod(\Magento\Paypal\Model\Config::METHOD_WPP_EXPRESS) - ->setAdditionalInformation(\Magento\Paypal\Model\Express\Checkout::PAYMENT_INFO_TRANSPORT_PAYER_ID, 123); -$quote->collectTotals()->save(); diff --git a/dev/tests/integration/testsuite/Magento/Paypal/_files/quote_payment_express.php b/dev/tests/integration/testsuite/Magento/Paypal/_files/quote_payment_express.php deleted file mode 100644 index 59c0bcff56270..0000000000000 --- a/dev/tests/integration/testsuite/Magento/Paypal/_files/quote_payment_express.php +++ /dev/null @@ -1,101 +0,0 @@ -loadArea('adminhtml'); -\Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get( - 'Magento\Framework\App\Config\MutableScopeConfigInterface' -)->setValue( - 'carriers/flatrate/active', - 1, - \Magento\Store\Model\ScopeInterface::SCOPE_STORE -); -\Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get( - 'Magento\Framework\App\Config\MutableScopeConfigInterface' -)->setValue( - 'payment/paypal_express/active', - 1, - \Magento\Store\Model\ScopeInterface::SCOPE_STORE -); -/** @var $product \Magento\Catalog\Model\Product */ -$product = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create('Magento\Catalog\Model\Product'); -$product->setTypeId('simple') - ->setId(1) - ->setAttributeSetId(4) - ->setName('Simple Product') - ->setSku('simple') - ->setPrice(10) - ->setStockData([ - 'use_config_manage_stock' => 1, - 'qty' => 100, - 'is_qty_decimal' => 0, - 'is_in_stock' => 100, -]) - ->setVisibility(\Magento\Catalog\Model\Product\Visibility::VISIBILITY_BOTH) - ->setStatus(\Magento\Catalog\Model\Product\Attribute\Source\Status::STATUS_ENABLED) - ->save(); -$product->load(1); - -$billingData = [ - 'firstname' => 'testname', - 'lastname' => 'lastname', - 'company' => '', - 'email' => 'test@com.com', - 'street' => [ - 0 => 'test1', - 1 => '', - ], - 'city' => 'Test', - 'region_id' => '1', - 'region' => '', - 'postcode' => '9001', - 'country_id' => 'US', - 'telephone' => '11111111', - 'fax' => '', - 'confirm_password' => '', - 'save_in_address_book' => '1', - 'use_for_shipping' => '1', -]; - -$billingAddress = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() - ->create('Magento\Sales\Model\Quote\Address', ['data' => $billingData]); -$billingAddress->setAddressType('billing'); - -$shippingAddress = clone $billingAddress; -$shippingAddress->setId(null)->setAddressType('shipping'); -$shippingAddress->setShippingMethod('flatrate_flatrate'); -$shippingAddress->setCollectShippingRates(true); - -/** @var $quote \Magento\Sales\Model\Quote */ -$quote = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create('Magento\Sales\Model\Quote'); -$quote->setCustomerIsGuest( - true -)->setStoreId( - \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get( - 'Magento\Store\Model\StoreManagerInterface' - )->getStore()->getId() -)->setReservedOrderId( - 'test02' -)->setBillingAddress( - $billingAddress -)->setShippingAddress( - $shippingAddress -)->addProduct( - $product, - 10 -); -$quote->getShippingAddress()->setShippingMethod('flatrate_flatrate'); -$quote->getShippingAddress()->setCollectShippingRates(true); -$quote->getPayment()->setMethod(\Magento\Paypal\Model\Config::METHOD_WPS); -$quote->collectTotals()->save(); - -$quote->setCustomerEmail('admin@example.com'); - -/** @var $service \Magento\Sales\Model\Service\Quote */ -$service = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() - ->create('Magento\Sales\Model\Service\Quote', ['quote' => $quote]); -$service->setOrderData(['increment_id' => '100000002']); -$service->submitAllWithDataObject(); - -$order = $service->getOrder(); -$order->save(); diff --git a/dev/tests/integration/testsuite/Magento/Paypal/_files/quote_payment_express_with_customer.php b/dev/tests/integration/testsuite/Magento/Paypal/_files/quote_payment_express_with_customer.php deleted file mode 100644 index 67ad722651838..0000000000000 --- a/dev/tests/integration/testsuite/Magento/Paypal/_files/quote_payment_express_with_customer.php +++ /dev/null @@ -1,90 +0,0 @@ -loadArea('adminhtml'); - -\Magento\TestFramework\Helper\Bootstrap::getObjectManager() - ->get('Magento\Framework\App\Config\MutableScopeConfigInterface') - ->setValue('carriers/flatrate/active', 1, \Magento\Store\Model\ScopeInterface::SCOPE_STORE); -\Magento\TestFramework\Helper\Bootstrap::getObjectManager() - ->get('Magento\Framework\App\Config\MutableScopeConfigInterface') - ->setValue('payment/paypal_express/active', 1, \Magento\Store\Model\ScopeInterface::SCOPE_STORE); - -/** @var \Magento\Customer\Api\CustomerRepositoryInterface $customerRepository */ -$customerRepository = $objectManager->create('Magento\Customer\Api\CustomerRepositoryInterface'); -$customer = $customerRepository->getById(1); - -/** @var $product \Magento\Catalog\Model\Product */ -$product = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create('Magento\Catalog\Model\Product'); -$product->setTypeId('simple') - ->setId(1) - ->setAttributeSetId(4) - ->setName('Simple Product') - ->setSku('simple') - ->setPrice(10) - ->setStockData([ - 'use_config_manage_stock' => 1, - 'qty' => 100, - 'is_qty_decimal' => 0, - 'is_in_stock' => 100, -]) - ->setVisibility(\Magento\Catalog\Model\Product\Visibility::VISIBILITY_BOTH) - ->setStatus(\Magento\Catalog\Model\Product\Attribute\Source\Status::STATUS_ENABLED) - ->save(); -$product->load(1); - -$customerBillingAddress = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() - ->create('Magento\Customer\Model\Address'); -$customerBillingAddress->load(1); -$billingAddressDataObject = $customerBillingAddress->getDataModel(); -$billingAddress = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() - ->create('Magento\Sales\Model\Quote\Address'); -$billingAddress->importCustomerAddressData($billingAddressDataObject); -$billingAddress->setAddressType('billing'); - -/** @var \Magento\Customer\Model\Address $customerShippingAddress */ -$customerShippingAddress = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() - ->create('Magento\Customer\Model\Address'); -$customerShippingAddress->load(2); -$shippingAddressDataObject = $customerShippingAddress->getDataModel(); -$shippingAddress = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() - ->create('Magento\Sales\Model\Quote\Address'); -$shippingAddress->importCustomerAddressData($shippingAddressDataObject); -$shippingAddress->setAddressType('shipping'); - -$shippingAddress->setShippingMethod('flatrate_flatrate'); -$shippingAddress->setCollectShippingRates(true); - -/** @var $quote \Magento\Sales\Model\Quote */ -$quote = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() - ->create('Magento\Sales\Model\Quote'); -$quote->setCustomerIsGuest(false) - ->setCustomerId($customer->getId()) - ->setCustomer($customer) - ->setStoreId( - \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\Store\Model\StoreManagerInterface') - ->getStore()->getId() - ) - ->setReservedOrderId('test02') - ->setBillingAddress($billingAddress) - ->setShippingAddress($shippingAddress) - ->addProduct($product, 10); -$quote->getShippingAddress()->setShippingMethod('flatrate_flatrate'); -$quote->getShippingAddress()->setCollectShippingRates(true); -$quote->getPayment()->setMethod(\Magento\Paypal\Model\Config::METHOD_WPS); -$quote->collectTotals()->save(); - -/** @var $service \Magento\Sales\Model\Service\Quote */ -$service = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() - ->create('Magento\Sales\Model\Service\Quote', ['quote' => $quote]); -$service->setOrderData(['increment_id' => '100000002']); -$service->submitAllWithDataObject(); - -$order = $service->getOrder(); - -$order->save(); diff --git a/dev/tests/integration/testsuite/Magento/Paypal/_files/quote_payment_payflow.php b/dev/tests/integration/testsuite/Magento/Paypal/_files/quote_payment_payflow.php deleted file mode 100644 index 3769e8e36310f..0000000000000 --- a/dev/tests/integration/testsuite/Magento/Paypal/_files/quote_payment_payflow.php +++ /dev/null @@ -1,116 +0,0 @@ -loadArea('adminhtml'); -\Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get( - 'Magento\Framework\App\Config\MutableScopeConfigInterface' -)->setValue( - 'carriers/flatrate/active', - 1, - \Magento\Store\Model\ScopeInterface::SCOPE_STORE -); -/** @var $product \Magento\Catalog\Model\Product */ -$product = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create('Magento\Catalog\Model\Product'); -$product->setTypeId( - 'simple' -)->setId( - 1 -)->setAttributeSetId( - 4 -)->setName( - 'Simple Product' -)->setSku( - 'simple' -)->setPrice( - 10 -)->setStockData( - ['use_config_manage_stock' => 1, 'qty' => 100, 'is_qty_decimal' => 0, 'is_in_stock' => 100] -)->setVisibility( - \Magento\Catalog\Model\Product\Visibility::VISIBILITY_BOTH -)->setStatus( - \Magento\Catalog\Model\Product\Attribute\Source\Status::STATUS_ENABLED -)->save(); -$product->load(1); - -$addressData = [ - 'region' => 'CA', - 'postcode' => '11111', - 'lastname' => 'lastname', - 'firstname' => 'firstname', - 'street' => 'street', - 'city' => 'Los Angeles', - 'email' => 'admin@example.com', - 'telephone' => '11111111', - 'country_id' => 'US', -]; - -$billingData = [ - 'address_id' => '', - 'firstname' => 'testname', - 'lastname' => 'lastname', - 'company' => '', - 'email' => 'test@com.com', - 'street' => [0 => 'test1', 1 => ''], - 'city' => 'Test', - 'region_id' => '1', - 'region' => '', - 'postcode' => '9001', - 'country_id' => 'US', - 'telephone' => '11111111', - 'fax' => '', - 'confirm_password' => '', - 'save_in_address_book' => '1', - 'use_for_shipping' => '1', -]; - -$billingAddress = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( - 'Magento\Sales\Model\Quote\Address', - ['data' => $billingData] -); -$billingAddress->setAddressType('billing'); - -$shippingAddress = clone $billingAddress; -$shippingAddress->setId(null)->setAddressType('shipping'); -$shippingAddress->setShippingMethod('flatrate_flatrate'); -$shippingAddress->setCollectShippingRates(true); - -/** @var $quote \Magento\Sales\Model\Quote */ -$quote = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create('Magento\Sales\Model\Quote'); -$quote->setCustomerIsGuest( - true -)->setStoreId( - \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get( - 'Magento\Store\Model\StoreManagerInterface' - )->getStore()->getId() -)->setReservedOrderId( - 'test02' -)->setBillingAddress( - $billingAddress -)->setShippingAddress( - $shippingAddress -)->addProduct( - $product, - 10 -); -$quote->getShippingAddress()->setShippingMethod('flatrate_flatrate'); -$quote->getShippingAddress()->setCollectShippingRates(true); -$quote->collectTotals()->save(); - -$payment = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create('Magento\Sales\Model\Order\Payment'); -$payment->setMethod(\Magento\Paypal\Model\Config::METHOD_WPS); - -$quote->getPayment()->setMethod(\Magento\Paypal\Model\Config::METHOD_WPS)->save(); - -/** @var $service \Magento\Sales\Model\Service\Quote */ -$service = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( - 'Magento\Sales\Model\Service\Quote', - ['quote' => $quote] -); -$service->setOrderData(['increment_id' => '100000001']); -$service->submitAllWithDataObject(); - -$order = $service->getOrder(); -$order->setPayment($payment); -$order->save(); diff --git a/dev/tests/integration/testsuite/Magento/Paypal/_files/quote_payment_standard.php b/dev/tests/integration/testsuite/Magento/Paypal/_files/quote_payment_standard.php deleted file mode 100644 index 0b865a2a5e1eb..0000000000000 --- a/dev/tests/integration/testsuite/Magento/Paypal/_files/quote_payment_standard.php +++ /dev/null @@ -1,112 +0,0 @@ -loadArea('adminhtml'); -\Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get( - 'Magento\Framework\App\Config\MutableScopeConfigInterface' -)->setValue( - 'carriers/flatrate/active', - 1, - \Magento\Store\Model\ScopeInterface::SCOPE_STORE -); -/** @var $product \Magento\Catalog\Model\Product */ -$product = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create('Magento\Catalog\Model\Product'); -$product->setTypeId( - 'simple' -)->setId( - 1 -)->setAttributeSetId( - 4 -)->setName( - 'Simple Product' -)->setSku( - 'simple' -)->setPrice( - 10 -)->setStockData( - ['use_config_manage_stock' => 1, 'qty' => 100, 'is_qty_decimal' => 0, 'is_in_stock' => 100] -)->setVisibility( - \Magento\Catalog\Model\Product\Visibility::VISIBILITY_BOTH -)->setStatus( - \Magento\Catalog\Model\Product\Attribute\Source\Status::STATUS_ENABLED -)->save(); -$product->load(1); - -$addressData = [ - 'region' => 'CA', - 'postcode' => '11111', - 'lastname' => 'lastname', - 'firstname' => 'firstname', - 'street' => 'street', - 'city' => 'Los Angeles', - 'email' => 'admin@example.com', - 'telephone' => '11111111', - 'country_id' => 'US', -]; - -$billingData = [ - 'address_id' => '', - 'firstname' => 'testname', - 'lastname' => 'lastname', - 'company' => '', - 'email' => 'test@com.com', - 'street' => [0 => 'test1', 1 => ''], - 'city' => 'Test', - 'region_id' => '1', - 'region' => '', - 'postcode' => '9001', - 'country_id' => 'US', - 'telephone' => '11111111', - 'fax' => '', - 'confirm_password' => '', - 'save_in_address_book' => '1', - 'use_for_shipping' => '1', -]; - -$billingAddress = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( - 'Magento\Sales\Model\Quote\Address', - ['data' => $billingData] -); -$billingAddress->setAddressType('billing'); - -$shippingAddress = clone $billingAddress; -$shippingAddress->setId(null)->setAddressType('shipping'); -$shippingAddress->setShippingMethod('flatrate_flatrate'); -$shippingAddress->setCollectShippingRates(true); - -/** @var $quote \Magento\Sales\Model\Quote */ -$quote = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create('Magento\Sales\Model\Quote'); -$quote->setCustomerIsGuest( - true -)->setStoreId( - \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get( - 'Magento\Store\Model\StoreManagerInterface' - )->getStore()->getId() -)->setReservedOrderId( - 'test01' -)->setBillingAddress( - $billingAddress -)->setShippingAddress( - $shippingAddress -)->addProduct( - $product, - 10 -); -$quote->getShippingAddress()->setShippingMethod('flatrate_flatrate'); -$quote->getShippingAddress()->setCollectShippingRates(true); -$quote->collectTotals()->save(); - -$quote->getPayment()->setMethod(\Magento\Paypal\Model\Config::METHOD_WPS)->save(); -$quote->setCustomerEmail('admin@example.com'); - -/** @var $service \Magento\Sales\Model\Service\Quote */ -$service = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( - 'Magento\Sales\Model\Service\Quote', - ['quote' => $quote] -); -$service->setOrderData(['increment_id' => '100000002']); -$service->submitAllWithDataObject(); - -$order = $service->getOrder(); -$order->save(); diff --git a/dev/tests/integration/testsuite/Magento/Sales/Model/Order/InvoiceTest.php b/dev/tests/integration/testsuite/Magento/Sales/Model/Order/InvoiceTest.php new file mode 100644 index 0000000000000..9638ee4a86691 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Sales/Model/Order/InvoiceTest.php @@ -0,0 +1,34 @@ +_collection = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( + 'Magento\Sales\Model\Resource\Order\Collection' + ); + } + + /** + * @magentoDataFixture Magento/Sales/_files/invoice.php + */ + public function testOrderTotalItemCount() + { + $expectedResult = [['total_item_count' => 1]]; + $actualResult = []; + /** @var \Magento\Sales\Model\Order $order */ + foreach ($this->_collection->getItems() as $order) { + $actualResult[] = ['total_item_count' => $order->getData('total_item_count')]; + } + $this->assertEquals($expectedResult, $actualResult); + } +} diff --git a/dev/tests/integration/testsuite/Magento/Sales/Model/Resource/OrderTest.php b/dev/tests/integration/testsuite/Magento/Sales/Model/Resource/OrderTest.php new file mode 100644 index 0000000000000..f9da905c795cc --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Sales/Model/Resource/OrderTest.php @@ -0,0 +1,101 @@ +objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); + $this->resourceModel = $this->objectManager->create('\Magento\Sales\Model\Resource\Order'); + $this->orderIncrementId = '100000001'; + } + + protected function tearDown() + { + $registry = $this->objectManager->get('Magento\Framework\Registry'); + $registry->unregister('isSecureArea'); + $registry->register('isSecureArea', true); + + /** @var \Magento\Sales\Model\Order $order */ + $order = $this->objectManager->create('Magento\Sales\Model\Order'); + $order->loadByIncrementId($this->orderIncrementId); + $order->delete(); + + $registry->unregister('isSecureArea'); + $registry->register('isSecureArea', false); + + parent::tearDown(); + } + + /** + * @magentoDataFixture Magento/Catalog/_files/product_simple.php + */ + public function testSaveOrder() + { + $addressData = [ + 'region' => 'CA', + 'postcode' => '11111', + 'lastname' => 'lastname', + 'firstname' => 'firstname', + 'street' => 'street', + 'city' => 'Los Angeles', + 'email' => 'admin@example.com', + 'telephone' => '11111111', + 'country_id' => 'US' + ]; + + $billingAddress = $this->objectManager->create('Magento\Sales\Model\Order\Address', ['data' => $addressData]); + $billingAddress->setAddressType('billing'); + + $shippingAddress = clone $billingAddress; + $shippingAddress->setId(null)->setAddressType('shipping'); + + $payment = $this->objectManager->create('Magento\Sales\Model\Order\Payment'); + $payment->setMethod('checkmo'); + + /** @var \Magento\Sales\Model\Order\Item $orderItem */ + $orderItem = $this->objectManager->create('Magento\Sales\Model\Order\Item'); + $orderItem->setProductId(1) + ->setQtyOrdered(2) + ->setBasePrice(10) + ->setPrice(10) + ->setRowTotal(10); + + /** @var \Magento\Sales\Model\Order $order */ + $order = $this->objectManager->create('Magento\Sales\Model\Order'); + $order->setIncrementId($this->orderIncrementId) + ->setState(\Magento\Sales\Model\Order::STATE_PROCESSING, true) + ->setSubtotal(100) + ->setBaseSubtotal(100) + ->setBaseGrandTotal(100) + ->setCustomerIsGuest(true) + ->setCustomerEmail('customer@null.com') + ->setBillingAddress($billingAddress) + ->setShippingAddress($shippingAddress) + ->setStoreId($this->objectManager->get('Magento\Store\Model\StoreManagerInterface')->getStore()->getId()) + ->addItem($orderItem) + ->setPayment($payment); + + $this->resourceModel->save($order); + $this->assertNotNull($order->getCreatedAt()); + $this->assertNotNull($order->getUpdatedAt()); + } +} diff --git a/dev/tests/integration/testsuite/Magento/Store/Model/StoreTest.php b/dev/tests/integration/testsuite/Magento/Store/Model/StoreTest.php index 7876fdaed2707..73c61a5af1029 100644 --- a/dev/tests/integration/testsuite/Magento/Store/Model/StoreTest.php +++ b/dev/tests/integration/testsuite/Magento/Store/Model/StoreTest.php @@ -68,10 +68,14 @@ protected function tearDown() public function testSetCookie() { + $model = $this->getMock('Magento\Store\Model\Store', ['getStorePath'], $this->modelParams); + $model->expects($this->once()) + ->method('getStorePath') + ->will($this->returnValue('/')); $storeCode = 'store code'; $this->assertArrayNotHasKey(Store::COOKIE_NAME, $_COOKIE); - $this->model->setCode($storeCode); - $this->model->setCookie(); + $model->setCode($storeCode); + $model->setCookie(); $this->assertEquals($storeCode, $_COOKIE[Store::COOKIE_NAME]); } @@ -452,7 +456,7 @@ public function isCurrentlySecureDataProvider() /** * @magentoConfigFixture current_store web/secure/offloader_header SSL_OFFLOADED - * @magentoConfigFixture current_store web/secure/base_url + * @magentoConfigFixture current_store web/secure/base_url */ public function testIsCurrentlySecureNoSecureBaseUrl() { diff --git a/dev/tests/integration/testsuite/Magento/Theme/Block/Adminhtml/System/Design/Theme/Edit/Tab/GeneralTest.php b/dev/tests/integration/testsuite/Magento/Theme/Block/Adminhtml/System/Design/Theme/Edit/Tab/GeneralTest.php index 2f0b41709f533..94230b24a8f4a 100644 --- a/dev/tests/integration/testsuite/Magento/Theme/Block/Adminhtml/System/Design/Theme/Edit/Tab/GeneralTest.php +++ b/dev/tests/integration/testsuite/Magento/Theme/Block/Adminhtml/System/Design/Theme/Edit/Tab/GeneralTest.php @@ -4,6 +4,9 @@ */ namespace Magento\Theme\Block\Adminhtml\System\Design\Theme\Edit\Tab; +use Magento\Framework\App\Filesystem\DirectoryList; +use Magento\Store\Model\StoreManager; + /** * @magentoAppArea adminhtml */ @@ -45,4 +48,16 @@ public function testToHtmlPreviewImageNote() $noticeText = $this->_block->getForm()->getElement('preview_image')->getNote(); $this->assertNotEmpty($noticeText); } + + public function testToHtmlPreviewImageUrl() + { + /** @var $objectManager \Magento\TestFramework\ObjectManager */ + $this->_theme->setType(\Magento\Framework\View\Design\ThemeInterface::TYPE_PHYSICAL); + $this->_theme->setPreviewImage('preview_image_test.jpg'); + $this->_block->setArea('adminhtml'); + + $html = $this->_block->toHtml(); + preg_match_all('/pub\/static\/adminhtml\/_view\/en_US/', $html, $result); + $this->assertEmpty($result[0]); + } } diff --git a/dev/tests/integration/testsuite/Magento/UrlRewrite/Block/Catalog/Edit/FormTest.php b/dev/tests/integration/testsuite/Magento/UrlRewrite/Block/Catalog/Edit/FormTest.php index 2e74d34b0e603..70d4279388e61 100644 --- a/dev/tests/integration/testsuite/Magento/UrlRewrite/Block/Catalog/Edit/FormTest.php +++ b/dev/tests/integration/testsuite/Magento/UrlRewrite/Block/Catalog/Edit/FormTest.php @@ -169,7 +169,10 @@ public function testGetEntityStoresProductCategoryStoresException() */ public function testGetEntityStoresCategoryStoresException() { - $args = ['category' => new \Magento\Framework\Object(['id' => 1])]; + $args = ['category' => $this->objectManager->create( + 'Magento\Catalog\Model\Category', + ['data' => ['entity_id' => 1, 'initial_setup_flag' => true]] + )]; $form = $this->_getFormInstance($args); $this->assertEquals([], $form->getElement('store_id')->getValues()); $this->assertEquals( diff --git a/dev/tests/js/run_js_tests.php b/dev/tests/js/run_js_tests.php index 96732ef7ba5e4..fb7a85c4c2cc7 100644 --- a/dev/tests/js/run_js_tests.php +++ b/dev/tests/js/run_js_tests.php @@ -138,7 +138,12 @@ kill -9 $LSOF fi - pkill Xvfb + DISPLAY_NUM=99 + ps -ef | egrep "[X]vfb.*:$DISPLAY_NUM" + if [ $? -eq 0 ] ; then + pkill Xvfb + fi + XVFB=`which Xvfb` if [ "$?" -eq 1 ]; then @@ -146,9 +151,9 @@ exit 1 fi - $XVFB :99 -nolisten inet6 -ac & + $XVFB :$DISPLAY_NUM -nolisten inet6 -ac & PID_XVFB="$!" # take the process ID - export DISPLAY=:99 # set display to use that of the Xvfb + export DISPLAY=:$DISPLAY_NUM # set display to use that of the Xvfb USER=`whoami` SUDO=`which sudo` diff --git a/dev/tests/js/testsuite/mage/zoom/zoom-test.js b/dev/tests/js/testsuite/mage/zoom/zoom-test.js index f416095c12c33..de2b9b2f94353 100644 --- a/dev/tests/js/testsuite/mage/zoom/zoom-test.js +++ b/dev/tests/js/testsuite/mage/zoom/zoom-test.js @@ -352,19 +352,14 @@ ZoomTest.prototype.testRefreshLargeImage = function() { assertEquals(zoomInstance.largeImage.css('left'), css.left + 'px'); }; ZoomTest.prototype.testRenderLargeImage = function() { - var zoomInstance = this.zoomCreate(), - processStartTriggered = false; + var zoomInstance = this.zoomCreate(); zoomInstance.element.append(jQuery('

')); zoomInstance.options.selectors.image = '[data-role=test-image]'; - jQuery(zoomInstance.options.selectors.image).on('processStart', function() { - processStartTriggered = true; - }); var image = zoomInstance._renderLargeImage(); assertTrue(image.is('img')); assertTrue(image.is(zoomInstance.largeImage)); - assertTrue(processStartTriggered); }; ZoomTest.prototype.testGetZoomRatio = function() { var zoomInstance = this.zoomCreate(), diff --git a/dev/tests/static/testsuite/Magento/Test/Integrity/_files/dependency_test/tables_ce.php b/dev/tests/static/testsuite/Magento/Test/Integrity/_files/dependency_test/tables_ce.php index c2dfbd76a1026..fb76a64799d13 100644 --- a/dev/tests/static/testsuite/Magento/Test/Integrity/_files/dependency_test/tables_ce.php +++ b/dev/tests/static/testsuite/Magento/Test/Integrity/_files/dependency_test/tables_ce.php @@ -106,7 +106,6 @@ 'cms_page' => 'Magento_Cms', 'cms_page_store' => 'Magento_Cms', 'core_cache' => 'Magento_Core', - 'core_cache_option' => 'Magento_Core', 'core_cache_tag' => 'Magento_Core', 'core_config_data' => 'Magento_Core', 'core_config_field' => 'Magento_Core', diff --git a/dev/tests/static/testsuite/Magento/Test/Js/_files/blacklist/core.txt b/dev/tests/static/testsuite/Magento/Test/Js/_files/blacklist/core.txt index 6420dba12a5f1..33b5663b5752f 100644 --- a/dev/tests/static/testsuite/Magento/Test/Js/_files/blacklist/core.txt +++ b/dev/tests/static/testsuite/Magento/Test/Js/_files/blacklist/core.txt @@ -1,4 +1,3 @@ -app/code/Magento/Authorizenet/view/adminhtml/web/js/direct-post.js app/code/Magento/Backend/view/adminhtml/web/variables.js app/code/Magento/Captcha/view/frontend/web/onepage.js app/code/Magento/Catalog/view/adminhtml/web/catalog/category/edit.js diff --git a/dev/tests/static/testsuite/Magento/Test/Js/_files/whitelist/core.txt b/dev/tests/static/testsuite/Magento/Test/Js/_files/whitelist/core.txt index 2f8f8553343c8..92cc3827467b3 100644 --- a/dev/tests/static/testsuite/Magento/Test/Js/_files/whitelist/core.txt +++ b/dev/tests/static/testsuite/Magento/Test/Js/_files/whitelist/core.txt @@ -1,4 +1,3 @@ -app/code/Magento/Authorizenet app/code/Magento/Bundle app/code/Magento/Captcha app/code/Magento/Catalog @@ -10,7 +9,6 @@ app/code/Magento/GiftMessage app/code/Magento/Newsletter app/code/Magento/OfflinePayments app/code/Magento/Payment -app/code/Magento/Paypal app/code/Magento/Persistent app/code/Magento/Sales app/code/Magento/Theme diff --git a/dev/tests/static/testsuite/Magento/Test/Legacy/FilesystemTest.php b/dev/tests/static/testsuite/Magento/Test/Legacy/FilesystemTest.php new file mode 100644 index 0000000000000..eeb4b87ba36ad --- /dev/null +++ b/dev/tests/static/testsuite/Magento/Test/Legacy/FilesystemTest.php @@ -0,0 +1,135 @@ +assertFileNotExists( + \Magento\Framework\Test\Utility\Files::init()->getPathToSource() . '/' . $path + ); + }, + $this->relocationsDataProvider() + ); + } + + /** + * @return array + */ + public function relocationsDataProvider() + { + return [ + 'Relocated to pub/errors' => ['errors'], + 'Eliminated with Magento_Compiler' => ['includes'], + 'Relocated to lib/web' => ['js'], + 'Relocated to pub/media' => ['media'], + 'Eliminated as not needed' => ['pkginfo'], + 'Dissolved into themes under app/design ' => ['skin'], + 'Dissolved into different modules\' view/frontend' => ['app/design/frontend/base'], + 'Dissolved into different modules\' view/email/*.html' => ['app/locale/en_US/template'], + 'The "core" code pool no longer exists. Use root namespace as specified in PSR-0 standard' => [ + 'app/code/core', + ], + 'The "local" code pool no longer exists. Use root namespace as specified in PSR-0 standard' => [ + 'app/code/local', + ], + 'The "community" code pool no longer exists. Use root namespace as specified in PSR-0 standard' => [ + 'app/code/community', + ], + 'Eliminated Magento/plushe theme' => ['app/design/frontend/Magento/plushe'], + ]; + } + + public function testObsoleteDirectories() + { + $area = '*'; + $theme = '*'; + $root = \Magento\Framework\Test\Utility\Files::init()->getPathToSource(); + $dirs = glob("{$root}/app/design/{$area}/{$theme}/template", GLOB_ONLYDIR); + $msg = []; + if ($dirs) { + $msg[] = 'Theme "template" directories are obsolete. Relocate files as follows:'; + foreach ($dirs as $dir) { + $msg[] = str_replace($root, '', "{$dir} => " . realpath($dir . '/..') . '/Namespace_Module/*'); + } + } + + $dirs = glob("{$root}/app/design/{$area}/{$theme}/layout", GLOB_ONLYDIR); + if ($dirs) { + $msg[] = 'Theme "layout" directories are obsolete. Relocate layout files into the root of theme directory.'; + $msg = array_merge($msg, $dirs); + } + + if ($msg) { + $this->fail(implode(PHP_EOL, $msg)); + } + } + + public function testObsoleteViewPaths() + { + $allowedFiles = ['requirejs-config.js', 'layouts.xml']; + $allowedThemeFiles = array_merge( + $allowedFiles, + ['composer.json', 'theme.xml', 'LICENSE.txt', 'LICENSE_AFL.txt'] + ); + $areas = '{frontend,adminhtml,base}'; + $ns = '*'; + $mod = '*'; + $pathsToCheck = [ + "app/code/{$ns}/{$mod}/view/{$areas}/*" => [ + 'allowed_files' => $allowedFiles, + 'allowed_dirs' => ['layout', 'page_layout', 'templates', 'web'], + ], + "app/design/{$areas}/{$ns}/{$mod}/*" => [ + 'allowed_files' => $allowedThemeFiles, + 'allowed_dirs' => ['layout', 'page_layout', 'templates', 'web', 'etc', 'i18n', 'media', '\w+_\w+'], + ], + "app/design/{$areas}/{$ns}/{$mod}/{$ns}_{$mod}/*" => [ + 'allowed_files' => $allowedThemeFiles, + 'allowed_dirs' => ['layout', 'page_layout', 'templates', 'web'], + ], + ]; + $errors = []; + foreach ($pathsToCheck as $path => $allowed) { + $allowedFiles = $allowed['allowed_files']; + $allowedDirs = $allowed['allowed_dirs']; + $foundFiles = glob(BP . '/' . $path, GLOB_BRACE); + if (!$foundFiles) { + $this->fail("Glob pattern returned empty result: {$path}"); + } + foreach ($foundFiles as $file) { + $baseName = basename($file); + if (is_dir($file)) { + foreach ($allowedDirs as $allowedDir) { + if (preg_match("#^$allowedDir$#", $baseName)) { + continue 2; + } + } + } + if (in_array($baseName, $allowedFiles)) { + continue; + } + $errors[] = $file; + } + } + if (!empty($errors)) { + $this->fail( + 'Unexpected files or directories found. Make sure they are not at obsolete locations:' + . PHP_EOL . implode(PHP_EOL, $errors) + ); + } + } +} 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 68e501b6893bb..f89a0ded5448b 100644 --- a/dev/tests/static/testsuite/Magento/Test/Legacy/_files/obsolete_classes.php +++ b/dev/tests/static/testsuite/Magento/Test/Legacy/_files/obsolete_classes.php @@ -2819,6 +2819,15 @@ ['Magento\Customer\Model\Converter'], ['Magento\CatalogRule\Plugin\Indexer\Product\PriceIndexer'], ['Magento\CatalogRule\Plugin\Indexer\Product\PriceIndexerTest'], + [ + 'Magento\Framework\Interception\ObjectManager\Compiled\Config', + 'Magento\Framework\Interception\ObjectManager\Config\Compiled' + ], + [ + 'Magento\Framework\Interception\ObjectManager\Config', + 'Magento\Framework\Interception\ObjectManager\Config\Developer' + ], + ['Magento\Framework\ObjectManager\Config\ProxyConfig'], ['Magento\Catalog\Block\Product\Send'], ['Magento\Catalog\Helper\Product\Options'], ['Magento\Cms\Model\Resource\Page\Service'], @@ -2826,6 +2835,10 @@ ['Magento\GiftMessage\Helper\Url'], ['Magento\Rss\Helper\Data'], ['Magento\Sales\Model\ConverterInterface'], + ['Magento\Paypal\Block\System\Config\Fieldset\Location'], + ['Magento\Paypal\Block\Payflow\Advanced\Review'], + ['Magento\Paypal\Block\Payflow\Link\Review'], + ['Magento\Paypal\Model\System\Config\Source\AuthorizationAmounts'], ['Magento\Rule\Model\Rule', 'Magento\Rule\Model\AbstractModel'], ['Magento\Framework\App\Cache\State\Options', 'Magento\Framework\App\Cache\State'], ['Magento\Framework\App\Cache\State\OptionsInterface', 'Magento\Framework\App\Cache\State'], diff --git a/dev/tests/static/testsuite/Magento/Test/Legacy/_files/obsolete_methods.php b/dev/tests/static/testsuite/Magento/Test/Legacy/_files/obsolete_methods.php index 4ffcca5607537..5b3c80f4e523a 100644 --- a/dev/tests/static/testsuite/Magento/Test/Legacy/_files/obsolete_methods.php +++ b/dev/tests/static/testsuite/Magento/Test/Legacy/_files/obsolete_methods.php @@ -1664,6 +1664,8 @@ ['_detectTheme', 'Magento\Core\Helper\Theme'], ['_detectGroup', 'Magento\Core\Helper\Theme'], ['_sortThemesByHierarchy', 'Magento\Core\Helper\Theme'], + ['set', 'Magento\Framework\Api\ExtensibleObjectBuilder'], + ['toFlatArrayStatic', 'Magento\Framework\Api\ExtensibleDataObjectConverter'], ['_sortArrayByArray', 'Magento\Core\Helper\Theme'], ['_getGroupLabels', 'Magento\Core\Helper\Theme'], ['_sortGroupFilesCallback', 'Magento\Core\Helper\Theme'], @@ -1967,7 +1969,6 @@ ['urlDecode', 'Magento\Framework\App\Helper\AbstractHelper', 'Magento\Framework\Url\DecoderInterface::decode'], ['isModuleEnabled', 'Magento\Framework\App\Helper\AbstractHelper', 'Magento\Framework\Module\Manager::isEnabled()'], ['isModuleOutputEnabled', 'Magento\Framework\App\Helper\AbstractHelper', 'Magento\Framework\Module\Manager::isOutputEnabled()'], - ['toFlatArrayStatic', 'Magento\Framework\Api\ExtensibleDataObjectConverter'], ['_packToTar', 'Magento\Framework\Archive\Tar'], ['_parseHeader', 'Magento\Framework\Archive\Tar'], ['getIdentities', 'Magento\Wishlist\Block\Link'], @@ -1987,7 +1988,6 @@ ['getEnv', 'Magento\Rule\Model\Resource\Rule\Collection\AbstractCollection'], ['setActiveFilter', 'Magento\Rule\Model\Resource\Rule\Collection\AbstractCollection'], ['process', 'Magento\Rule\Model\Resource\Rule\Collection\AbstractCollection'], - ['set', 'Magento\Framework\Api\ExtensibleObjectBuilder'], [ 'isAutomaticCleaningAvailable', 'Magento\Framework\Cache\Backend\Decorator\AbstractDecorator', @@ -2001,4 +2001,7 @@ ['getScriptTranslation', 'Magento\Framework\LocaleInterface'], ['getCountryTranslation', 'Magento\Framework\LocaleInterface'], ['getTerritoryTranslation', 'Magento\Framework\LocaleInterface'], + ['getLinksConfig', 'Magento\Downloadable\Block\Catalog\Product\Links'], + ['getAuthorizationAmounts', 'Magento\Paypal\Model\Config'], + ['cleanTransactions', 'Magento\Paypal\Model\Observer'] ]; diff --git a/dev/tests/static/testsuite/Magento/Test/Legacy/_files/words_ce.xml b/dev/tests/static/testsuite/Magento/Test/Legacy/_files/words_ce.xml index 58820cb3d5abe..cfefeaf22d964 100644 --- a/dev/tests/static/testsuite/Magento/Test/Legacy/_files/words_ce.xml +++ b/dev/tests/static/testsuite/Magento/Test/Legacy/_files/words_ce.xml @@ -61,10 +61,6 @@ dev/tests/static/testsuite/Magento/Test/Legacy/_files/obsolete_constants.php overriden - - app/code/Magento/Paypal/view/frontend/templates/express/shortcut.phtml - head.js - app/code/Magento/Bundle/view/adminhtml/templates/product/edit/bundle.phtml head.js diff --git a/dev/tests/static/testsuite/Magento/Test/Php/_files/phpcpd/blacklist/common.txt b/dev/tests/static/testsuite/Magento/Test/Php/_files/phpcpd/blacklist/common.txt index 618a8a5fd2eb3..89690a5dd6300 100644 --- a/dev/tests/static/testsuite/Magento/Test/Php/_files/phpcpd/blacklist/common.txt +++ b/dev/tests/static/testsuite/Magento/Test/Php/_files/phpcpd/blacklist/common.txt @@ -143,3 +143,4 @@ app/code/Magento/CatalogInventory/Api/Data app/code/Magento/Sales/Model/Spi Magento/Catalog/Model/ProductLink Magento/GroupedProduct/Model/Resource/Product/Type/Grouped +lib/internal/Magento/Framework/Interception/ObjectManager/Config diff --git a/dev/tests/static/testsuite/Magento/Test/Php/_files/whitelist/common.txt b/dev/tests/static/testsuite/Magento/Test/Php/_files/whitelist/common.txt index c0e44ce809bc9..1d53a63755720 100644 --- a/dev/tests/static/testsuite/Magento/Test/Php/_files/whitelist/common.txt +++ b/dev/tests/static/testsuite/Magento/Test/Php/_files/whitelist/common.txt @@ -41,7 +41,6 @@ app/code/Magento/Core/Model/Resource/Theme.php app/code/Magento/Core/Model/Theme app/code/Magento/Core/Model/Theme.php app/code/Magento/Core/Model/Url/SecurityInfo.php -app/code/Magento/Core/sql/core_setup/upgrade-1.6.0.3-1.6.0.4.php app/code/Magento/Cron/Model/Config/Converter app/code/Magento/Cron/Model/Config/Reader app/code/Magento/Cron/Model/Config/Data.php diff --git a/dev/tests/unit/testsuite/Magento/Authorizenet/Block/Authorizenet/Form/CcTest.php b/dev/tests/unit/testsuite/Magento/Authorizenet/Block/Authorizenet/Form/CcTest.php deleted file mode 100644 index d5de89b91b7cf..0000000000000 --- a/dev/tests/unit/testsuite/Magento/Authorizenet/Block/Authorizenet/Form/CcTest.php +++ /dev/null @@ -1,38 +0,0 @@ -_block = $objectManager->getObject('Magento\Authorizenet\Block\Authorizenet\Form\Cc'); - $methodMock = $this->getMock('Magento\Authorizenet\Model\Authorizenet', [], [], '', false); - $this->_block->addData(['method' => $methodMock]); - } - - public function testEscapeMessage() - { - $testString = 'Why don\'t you want to press "OK"?'; - $expected = htmlspecialchars($testString, ENT_QUOTES, 'UTF-8'); - $this->assertEquals($expected, $this->_block->escapeMessage($testString)); - } - - public function testGetWidgetInitData() - { - $widgetInitData = \Zend_Json::decode($this->_block->getWidgetInitData()); - $this->assertArrayHasKey('authorizenetAuthenticate', $widgetInitData); - $this->assertArrayHasKey( - 'partialAuthorizationConfirmationMessage', - $widgetInitData['authorizenetAuthenticate'] - ); - $this->assertArrayHasKey('cancelConfirmationMessage', $widgetInitData['authorizenetAuthenticate']); - $this->assertArrayHasKey('cancelUrl', $widgetInitData['authorizenetAuthenticate']); - } -} diff --git a/dev/tests/unit/testsuite/Magento/Authorizenet/Helper/BackendTest.php b/dev/tests/unit/testsuite/Magento/Authorizenet/Helper/BackendTest.php deleted file mode 100644 index 36b3d0e32aac7..0000000000000 --- a/dev/tests/unit/testsuite/Magento/Authorizenet/Helper/BackendTest.php +++ /dev/null @@ -1,96 +0,0 @@ -_urlBuilder = $this->getMock('Magento\Backend\Model\Url', ['getUrl'], [], '', false); - $contextMock = $this->getMock('Magento\Framework\App\Helper\Context', [], [], '', false); - $contextMock->expects($this->any())->method('getUrlBuilder')->will($this->returnValue($this->_urlBuilder)); - $this->_orderFactory = $this->getMock('Magento\Sales\Model\OrderFactory', ['create'], [], '', false); - $this->_model = new Backend( - $contextMock, - $this->getMock('Magento\Store\Model\StoreManager', [], [], '', false), - $this->_orderFactory, - $this->_urlBuilder - ); - } - - public function testGetPlaceOrderAdminUrl() - { - $this->_urlBuilder->expects( - $this->once() - )->method( - 'getUrl' - )->with( - $this->equalTo('adminhtml/authorizenet_directpost_payment/place'), - $this->equalTo([]) - )->will( - $this->returnValue('some value') - ); - $this->assertEquals('some value', $this->_model->getPlaceOrderAdminUrl()); - } - - public function testGetSuccessOrderUrl() - { - $order = $this->getMock( - 'Magento\Sales\Model\Order', - ['loadByIncrementId', 'getId', '__wakeup'], - [], - '', - false - ); - $order->expects($this->once())->method('loadByIncrementId')->with('invoice number')->will($this->returnSelf()); - $order->expects($this->once())->method('getId')->will($this->returnValue('order id')); - $this->_orderFactory->expects($this->once())->method('create')->will($this->returnValue($order)); - $this->_urlBuilder->expects( - $this->once() - )->method( - 'getUrl' - )->with( - $this->equalTo('sales/order/view'), - $this->equalTo(['order_id' => 'order id']) - )->will( - $this->returnValue('some value') - ); - $this->assertEquals( - 'some value', - $this->_model->getSuccessOrderUrl(['x_invoice_num' => 'invoice number', 'some param']) - ); - } - - public function testGetRedirectIframeUrl() - { - $params = ['some params']; - $this->_urlBuilder->expects( - $this->once() - )->method( - 'getUrl' - )->with( - $this->equalTo('adminhtml/authorizenet_directpost_payment/redirect'), - $this->equalTo($params) - )->will( - $this->returnValue('some value') - ); - $this->assertEquals('some value', $this->_model->getRedirectIframeUrl($params)); - } -} diff --git a/dev/tests/unit/testsuite/Magento/Authorizenet/Helper/DataTest.php b/dev/tests/unit/testsuite/Magento/Authorizenet/Helper/DataTest.php deleted file mode 100644 index 4580350a94ef9..0000000000000 --- a/dev/tests/unit/testsuite/Magento/Authorizenet/Helper/DataTest.php +++ /dev/null @@ -1,100 +0,0 @@ -_model = $helper->getObject('Magento\Authorizenet\Helper\Data'); - } - - /** - * @param $type - * @param $amount - * @param $exception - * @param $additionalMessage - * @param $expected - * @dataProvider getMessagesParamDataProvider - */ - public function testGetTransactionMessage($type, $amount, $exception, $additionalMessage, $expected) - { - $currency = $this->getMock('Magento\Directory\Model\Currency', ['formatTxt', '__wakeup'], [], '', false); - $currency->expects($this->any()) - ->method('formatTxt') - ->will($this->returnValue($amount)); - $order = $this->getMock('Magento\Sales\Model\Order', ['getBaseCurrency', '__wakeup'], [], '', false); - $order->expects($this->any()) - ->method('getBaseCurrency') - ->will($this->returnValue($currency)); - $payment = $this->getMock('Magento\Payment\Model\Info', ['getOrder', '__wakeup'], [], '', false); - $payment->expects($this->any()) - ->method('getOrder') - ->will($this->returnValue($order)); - $card = new \Magento\Framework\Object(['cc_last_4' => self::LAST4]); - $message = $this->_model->getTransactionMessage( - $payment, - $type, - self::TRID, - $card, - $amount, - $exception, - $additionalMessage - ); - - $this->assertEquals($expected, $message); - } - - /** - * @return array - */ - public function getMessagesParamDataProvider() - { - $amount = 12.30; - $additionalMessage = 'Addition message.'; - return [ - [ - 'AUTH_ONLY', - $amount, - false, - $additionalMessage, - 'Credit Card: xxxx-' . self::LAST4 . ' amount 12.3 authorize - successful. ' - . 'Authorize.Net Transaction ID ' . self::TRID . '. Addition message.', - ], - [ - 'AUTH_CAPTURE', - $amount, - 'some exception', - false, - 'Credit Card: xxxx-' . self::LAST4 . ' amount 12.3 authorize and capture - failed. ' - . 'Authorize.Net Transaction ID ' . self::TRID . '. some exception' - ], - [ - 'CREDIT', - false, - false, - $additionalMessage, - 'Credit Card: xxxx-' . self::LAST4 . ' refund - successful. ' - . 'Authorize.Net Transaction ID ' . self::TRID . '. Addition message.' - ], - ]; - } -} diff --git a/dev/tests/unit/testsuite/Magento/Authorizenet/Model/Authorizenet/CardsTest.php b/dev/tests/unit/testsuite/Magento/Authorizenet/Model/Authorizenet/CardsTest.php deleted file mode 100644 index 52bcfa9568e75..0000000000000 --- a/dev/tests/unit/testsuite/Magento/Authorizenet/Model/Authorizenet/CardsTest.php +++ /dev/null @@ -1,90 +0,0 @@ -_object = $objectManagerHelper->getObject('Magento\Authorizenet\Model\Authorizenet\Cards'); - } - - /** - * @dataProvider setPaymentDataProvider - * @param string $cardId - * @param array $cardsData - * @param array $additionalInfo - * @param \Magento\Framework\Object $expectedResult - */ - public function testSetPayment($cardId, $cardsData, $additionalInfo, $expectedResult) - { - $paymentsMock = $this->getMockBuilder('\Magento\Payment\Model\Info')->disableOriginalConstructor()->getMock(); - - $paymentsMock->expects( - $this->at(0) - )->method( - 'getAdditionalInformation' - )->with( - 'authorize_cards' - )->will( - $this->returnValue([$cardId => $cardsData]) - ); - - $paymentsMock->expects( - $this->at(1) - )->method( - 'getAdditionalInformation' - )->will( - $this->returnValue($additionalInfo) - ); - - $this->_object->setPayment($paymentsMock); - - $this->assertEquals($this->_object->getCard($cardId), $expectedResult); - } - - /** - * @return array - */ - public function setPaymentDataProvider() - { - return [ - [ - 'cardId', - ['key' => 'value'], - ['key' => 'value'], - new \Magento\Framework\Object( - [ - 'key' => 'value', - 'additional_information' => ['key' => 'value'], - ] - ), - ], - [ - 'cardId', - ['key' => 'value'], - ['key2' => 'value2'], - new \Magento\Framework\Object( - [ - 'key' => 'value', - 'additional_information' => ['key2' => 'value2'], - ] - ) - ], - [ - 'cardId', - ['key' => 'value'], - [], - new \Magento\Framework\Object(['key' => 'value', 'additional_information' => []]) - ] - ]; - } -} diff --git a/dev/tests/unit/testsuite/Magento/Authorizenet/Model/Directpost/ObserverTest.php b/dev/tests/unit/testsuite/Magento/Authorizenet/Model/Directpost/ObserverTest.php deleted file mode 100644 index 161bb95427f65..0000000000000 --- a/dev/tests/unit/testsuite/Magento/Authorizenet/Model/Directpost/ObserverTest.php +++ /dev/null @@ -1,112 +0,0 @@ -getMock('Magento\Store\Model\Store', [], [], '', false); - $this->coreRegistry = $this->getMock('Magento\Framework\Registry', []); - $storeManager = $this->getMockForAbstractClass('Magento\Store\Model\StoreManagerInterface'); - $storeManager->expects($this->any())->method('getStore')->will($this->returnValue($store)); - $payment = $this->getMock('Magento\Authorizenet\Model\Directpost', null, [], '', false); - $this->coreData = $this->getMock('Magento\Core\Helper\Data', [], [], '', false); - $this->model = $helper->getObject( - 'Magento\Authorizenet\Model\Directpost\Observer', - [ - 'coreRegistry' => $this->coreRegistry, - 'storeManager' => $storeManager, - 'payment' => $payment, - 'coreData' => $this->coreData - ] - ); - } - - public function testAddAdditionalFieldsToResponseFrontend() - { - $directpostRequest = $this->getMock('Magento\Authorizenet\Model\Directpost\Request', []); - $order = $this->getMock('Magento\Sales\Model\Order', [], [], '', false); - - $methodInstance = $this->getMock('Magento\Authorizenet\Model\Directpost', [], [], '', false); - $methodInstance->expects( - $this->once() - )->method( - 'generateRequestFromOrder' - )->with( - $this->identicalTo($order) - )->will( - $this->returnValue($directpostRequest) - ); - - $payment = $this->getMock( - 'Magento\Sales\Model\Order\Payment', - ['getMethodInstance', '__wakeup'], - [], - '', - false - ); - $payment->expects($this->once())->method('getMethodInstance')->will($this->returnValue($methodInstance)); - $payment->setMethod('authorizenet_directpost'); - - $order->expects($this->once())->method('getId')->will($this->returnValue(1)); - $order->expects($this->atLeastOnce())->method('getPayment')->will($this->returnValue($payment)); - - - $this->coreRegistry->expects( - $this->once() - )->method( - 'registry' - )->with( - 'directpost_order' - )->will( - $this->returnValue($order) - ); - - $request = new \Magento\Framework\Object(); - $response = $this->getMock('Magento\Framework\App\Response\Http', [], [], '', false); - $controller = $this->getMock( - 'Magento\Checkout\Controller\Action', - ['getRequest', 'getResponse'], - [], - '', - false - ); - $controller->expects($this->once())->method('getRequest')->will($this->returnValue($request)); - $controller->expects($this->once())->method('getResponse')->will($this->returnValue($response)); - $observer = new \Magento\Framework\Event\Observer( - ['event' => new \Magento\Framework\Object(['controller_action' => $controller])] - ); - - $this->coreData->expects( - $this->once() - )->method( - 'jsonEncode' - )->with( - self::logicalNot(self::isEmpty()) - )->will( - $this->returnValue('encoded response') - ); - $response->expects($this->once())->method('clearHeader')->with('Location'); - $response->expects($this->once())->method('representJson')->with('encoded response'); - $this->model->addAdditionalFieldsToResponseFrontend($observer); - } -} diff --git a/dev/tests/unit/testsuite/Magento/Bundle/Pricing/Price/BundleOptionPriceTest.php b/dev/tests/unit/testsuite/Magento/Bundle/Pricing/Price/BundleOptionPriceTest.php index 8932f3f4f473f..69fde414109f0 100644 --- a/dev/tests/unit/testsuite/Magento/Bundle/Pricing/Price/BundleOptionPriceTest.php +++ b/dev/tests/unit/testsuite/Magento/Bundle/Pricing/Price/BundleOptionPriceTest.php @@ -145,7 +145,7 @@ protected function prepareOptionMocks($selectionCollection) $collection = $this->getMock('Magento\Bundle\Model\Resource\Option\Collection', [], [], '', false); $collection->expects($this->atLeastOnce()) ->method('appendSelections') - ->with($this->equalTo($selectionCollection), $this->equalTo(false), $this->equalTo(false)) + ->with($this->equalTo($selectionCollection), $this->equalTo(true), $this->equalTo(false)) ->will($this->returnValue($selectionCollection)); $priceTypeMock->expects($this->atLeastOnce()) diff --git a/dev/tests/unit/testsuite/Magento/Bundle/Pricing/Price/BundleSelectionPriceTest.php b/dev/tests/unit/testsuite/Magento/Bundle/Pricing/Price/BundleSelectionPriceTest.php index f830d732e948c..68adb8e241a21 100644 --- a/dev/tests/unit/testsuite/Magento/Bundle/Pricing/Price/BundleSelectionPriceTest.php +++ b/dev/tests/unit/testsuite/Magento/Bundle/Pricing/Price/BundleSelectionPriceTest.php @@ -168,9 +168,10 @@ public function testGetValueTypeDynamic($useRegularPrice) { $this->setupSelectionPrice($useRegularPrice); $priceCode = $useRegularPrice ? RegularPrice::PRICE_CODE : FinalPrice::PRICE_CODE; - $regularPrice = 100; - $discountedPrice = 70; - $expectedPrice = $useRegularPrice ? $regularPrice : $discountedPrice; + $regularPrice = 100.125; + $discountedPrice = 70.453; + $actualPrice = $useRegularPrice ? $regularPrice : $discountedPrice; + $expectedPrice = $useRegularPrice ? round($regularPrice, 2) : round($discountedPrice, 2); $this->bundleMock->expects($this->once()) ->method('getPriceType') @@ -181,18 +182,23 @@ public function testGetValueTypeDynamic($useRegularPrice) ->will($this->returnValue($this->finalPriceMock)); $this->finalPriceMock->expects($this->once()) ->method('getValue') - ->will($this->returnValue($regularPrice)); + ->will($this->returnValue($actualPrice)); if (!$useRegularPrice) { $this->discountCalculatorMock->expects($this->once()) ->method('calculateDiscount') ->with( $this->equalTo($this->bundleMock), - $this->equalTo($regularPrice) + $this->equalTo($actualPrice) ) ->will($this->returnValue($discountedPrice)); } - $this->assertEquals($expectedPrice, $this->selectionPrice->getValue()); + + $this->priceCurrencyMock->expects($this->once()) + ->method('round') + ->with($actualPrice) + ->will($this->returnValue($expectedPrice)); + $this->assertEquals($expectedPrice, $this->selectionPrice->getValue()); } @@ -205,9 +211,10 @@ public function testGetValueTypeDynamic($useRegularPrice) public function testGetValueTypeFixedWithSelectionPriceType($useRegularPrice) { $this->setupSelectionPrice($useRegularPrice); - $regularPrice = 100; - $discountedPrice = 70; - $expectedPrice = $useRegularPrice ? $regularPrice : $discountedPrice; + $regularPrice = 100.125; + $discountedPrice = 70.453; + $actualPrice = $useRegularPrice ? $regularPrice : $discountedPrice; + $expectedPrice = $useRegularPrice ? round($regularPrice, 2) : round($discountedPrice, 2); $this->bundleMock->expects($this->once()) ->method('getPriceType') @@ -221,7 +228,7 @@ public function testGetValueTypeFixedWithSelectionPriceType($useRegularPrice) ->will($this->returnValue($this->regularPriceMock)); $this->regularPriceMock->expects($this->once()) ->method('getValue') - ->will($this->returnValue($regularPrice)); + ->will($this->returnValue($actualPrice)); $this->bundleMock->expects($this->once()) ->method('setFinalPrice') ->will($this->returnSelf()); @@ -229,7 +236,8 @@ public function testGetValueTypeFixedWithSelectionPriceType($useRegularPrice) ->method('dispatch'); $this->bundleMock->expects($this->exactly(2)) ->method('getData') - ->will($this->returnValueMap( + ->will( + $this->returnValueMap( [ ['qty', null, 1], ['final_price', null, 100], @@ -241,17 +249,23 @@ public function testGetValueTypeFixedWithSelectionPriceType($useRegularPrice) ->will($this->returnValue(true)); $this->productMock->expects($this->any()) ->method('getSelectionPriceValue') - ->will($this->returnValue($regularPrice)); + ->will($this->returnValue($actualPrice)); if (!$useRegularPrice) { $this->discountCalculatorMock->expects($this->once()) ->method('calculateDiscount') ->with( $this->equalTo($this->bundleMock), - $this->equalTo($regularPrice) + $this->equalTo($actualPrice) ) ->will($this->returnValue($discountedPrice)); } + + $this->priceCurrencyMock->expects($this->once()) + ->method('round') + ->with($actualPrice) + ->will($this->returnValue($expectedPrice)); + $this->assertEquals($expectedPrice, $this->selectionPrice->getValue()); } @@ -264,10 +278,11 @@ public function testGetValueTypeFixedWithSelectionPriceType($useRegularPrice) public function testGetValueTypeFixedWithoutSelectionPriceType($useRegularPrice) { $this->setupSelectionPrice($useRegularPrice); - $regularPrice = 100; - $discountedPrice = 70; - $convertedValue = 100.02; - $expectedPrice = $useRegularPrice ? $convertedValue : $discountedPrice; + $regularPrice = 100.125; + $discountedPrice = 70.453; + $convertedValue = 100.247; + $actualPrice = $useRegularPrice ? $convertedValue : $discountedPrice; + $expectedPrice = $useRegularPrice ? round($convertedValue, 2) : round($discountedPrice, 2); $this->bundleMock->expects($this->once()) ->method('getPriceType') @@ -280,7 +295,7 @@ public function testGetValueTypeFixedWithoutSelectionPriceType($useRegularPrice) ->will($this->returnValue($regularPrice)); $this->priceCurrencyMock->expects($this->once()) - ->method('convertAndRound') + ->method('convert') ->with($regularPrice) ->will($this->returnValue($convertedValue)); @@ -293,6 +308,12 @@ public function testGetValueTypeFixedWithoutSelectionPriceType($useRegularPrice) ) ->will($this->returnValue($discountedPrice)); } + + $this->priceCurrencyMock->expects($this->once()) + ->method('round') + ->with($actualPrice) + ->will($this->returnValue($expectedPrice)); + $this->assertEquals($expectedPrice, $this->selectionPrice->getValue()); } diff --git a/dev/tests/unit/testsuite/Magento/Catalog/Block/Adminhtml/Category/AbstractCategoryTest.php b/dev/tests/unit/testsuite/Magento/Catalog/Block/Adminhtml/Category/AbstractCategoryTest.php new file mode 100644 index 0000000000000..be0554b982b1f --- /dev/null +++ b/dev/tests/unit/testsuite/Magento/Catalog/Block/Adminhtml/Category/AbstractCategoryTest.php @@ -0,0 +1,118 @@ +objectManager = new \Magento\TestFramework\Helper\ObjectManager($this); + + $this->contextMock = $this->getMock( + 'Magento\Backend\Block\Template\Context', + [], + [], + '', + false + ); + + $this->requestMock = $this->getMockBuilder('Magento\Framework\App\RequestInterface') + ->disableOriginalConstructor() + ->getMock(); + + $this->contextMock->expects($this->any()) + ->method('getRequest') + ->will($this->returnValue($this->requestMock)); + + $this->urlBuilderMock = $this->getMockBuilder('Magento\Framework\UrlInterface') + ->disableOriginalConstructor() + ->getMock(); + + $this->storeManagerMock = $this->getMockBuilder('\Magento\Store\Model\StoreManagerInterface') + ->disableOriginalConstructor() + ->getMock(); + + $this->contextMock->expects($this->any()) + ->method('getStoreManager') + ->will($this->returnValue($this->storeManagerMock)); + + $this->storeMock = $this->getMockBuilder('Magento\Store\Model\Store') + ->disableOriginalConstructor() + ->getMock(); + + $this->contextMock->expects($this->any()) + ->method('getUrlBuilder') + ->will($this->returnValue($this->urlBuilderMock)); + + $this->category = $this->objectManager->getObject( + 'Magento\Catalog\Block\Adminhtml\Category\AbstractCategory', + [ + 'context' => $this->contextMock, + ] + ); + } + + /** + * @covers \Magento\Catalog\Block\Adminhtml\Category\AbstractCategory::getStore + * @covers \Magento\Catalog\Block\Adminhtml\Category\AbstractCategory::getSaveUrl + */ + public function testGetSaveUrl() + { + $storeId = 23; + $saveUrl = 'save URL'; + $params = ['_current' => false, '_query' => false, 'store' => $storeId]; + + + $this->requestMock->expects($this->once())->method('getParam')->with('store')->willReturn($storeId); + $this->storeManagerMock->expects($this->once()) + ->method('getStore') + ->with($storeId) + ->willReturn($this->storeMock); + $this->storeMock->expects($this->once())->method('getId')->willReturn($storeId); + + $this->urlBuilderMock->expects($this->once()) + ->method('getUrl') + ->with('catalog/*/save', $params) + ->willReturn($saveUrl); + + $this->assertEquals($saveUrl, $this->category->getSaveUrl()); + } + +} diff --git a/dev/tests/unit/testsuite/Magento/Catalog/Controller/Adminhtml/Product/NewActionTest.php b/dev/tests/unit/testsuite/Magento/Catalog/Controller/Adminhtml/Product/NewActionTest.php index e9bd33dee25ef..7ccc6594333d7 100644 --- a/dev/tests/unit/testsuite/Magento/Catalog/Controller/Adminhtml/Product/NewActionTest.php +++ b/dev/tests/unit/testsuite/Magento/Catalog/Controller/Adminhtml/Product/NewActionTest.php @@ -7,29 +7,31 @@ class NewActionTest extends \Magento\Catalog\Controller\Adminhtml\ProductTest { + /** @var \Magento\Catalog\Controller\Adminhtml\Product\NewAction */ protected $action; - - /** - * @var \Magento\Backend\Model\View\Result\Page|\PHPUnit_Framework_MockObject_MockObject - */ + /** @var \Magento\Backend\Model\View\Result\Page|\PHPUnit_Framework_MockObject_MockObject */ protected $resultPage; - - /** - * @var \Magento\Backend\Model\View\Result\Forward|\PHPUnit_Framework_MockObject_MockObject - */ + /** @var \Magento\Backend\Model\View\Result\Forward|\PHPUnit_Framework_MockObject_MockObject */ protected $resultForward; + /** @var \Magento\Catalog\Controller\Adminhtml\Product\Builder|\PHPUnit_Framework_MockObject_MockObject */ + protected $productBuilder; + /** @var \Magento\Catalog\Model\Product|\PHPUnit_Framework_MockObject_MockObject */ + protected $product; protected function setUp() { - $productBuilder = $this->getMockBuilder('Magento\Catalog\Controller\Adminhtml\Product\Builder')->setMethods([ - 'build', - ])->disableOriginalConstructor()->getMock(); - - $product = $this->getMockBuilder('\Magento\Catalog\Model\Product')->disableOriginalConstructor() - ->setMethods(['getTypeId', 'getStoreId', '__sleep', '__wakeup'])->getMock(); - $product->expects($this->any())->method('getTypeId')->will($this->returnValue('simple')); - $product->expects($this->any())->method('getStoreId')->will($this->returnValue('1')); - $productBuilder->expects($this->any())->method('build')->will($this->returnValue($product)); + $this->productBuilder = $this->getMock( + 'Magento\Catalog\Controller\Adminhtml\Product\Builder', + ['build'], + [], + '', + false + ); + $this->product = $this->getMockBuilder('Magento\Catalog\Model\Product')->disableOriginalConstructor() + ->setMethods(['addData', 'getTypeId', 'getStoreId', '__sleep', '__wakeup'])->getMock(); + $this->product->expects($this->any())->method('getTypeId')->will($this->returnValue('simple')); + $this->product->expects($this->any())->method('getStoreId')->will($this->returnValue('1')); + $this->productBuilder->expects($this->any())->method('build')->will($this->returnValue($this->product)); $this->resultPage = $this->getMockBuilder('Magento\Backend\Model\View\Result\Page') ->disableOriginalConstructor() @@ -56,7 +58,7 @@ protected function setUp() $this->action = new \Magento\Catalog\Controller\Adminhtml\Product\NewAction( $this->initContext(), - $productBuilder, + $this->productBuilder, $this->getMockBuilder('Magento\Catalog\Controller\Adminhtml\Product\Initialization\StockDataFilter') ->disableOriginalConstructor()->getMock(), $resultPageFactory, @@ -68,17 +70,25 @@ protected function setUp() ->willReturn($this->layout); } - /** - * Testing `newAction` method - */ public function testExecute() { - $this->action->getRequest()->expects($this->at(0))->method('getParam') - ->with('set')->will($this->returnValue(true)); - $this->action->getRequest()->expects($this->at(1))->method('getParam') - ->with('popup')->will($this->returnValue(true)); + $this->action->getRequest()->expects($this->any())->method('getParam')->willReturn(true); + $this->action->getRequest()->expects($this->any())->method('getFullActionName') + ->willReturn('catalog_product_new'); + $this->action->execute(); + } + + public function testExecuteObtainsProductDataFromSession() + { + $this->action->getRequest()->expects($this->any())->method('getParam')->willReturn(true); $this->action->getRequest()->expects($this->any())->method('getFullActionName') - ->will($this->returnValue('catalog_product_new')); + ->willReturn('catalog_product_new'); + + $this->session->expects($this->any())->method('getProductData') + ->willReturn(['product' => ['name' => 'test-name']]); + + $this->product->expects($this->once())->method('addData')->with(['name' => 'test-name', 'stock_data' => null]); + $this->action->execute(); } } diff --git a/dev/tests/unit/testsuite/Magento/Catalog/Controller/Adminhtml/Product/SaveTest.php b/dev/tests/unit/testsuite/Magento/Catalog/Controller/Adminhtml/Product/SaveTest.php new file mode 100644 index 0000000000000..3f13f63d9ad7d --- /dev/null +++ b/dev/tests/unit/testsuite/Magento/Catalog/Controller/Adminhtml/Product/SaveTest.php @@ -0,0 +1,128 @@ +productBuilder = $this->getMock( + 'Magento\Catalog\Controller\Adminhtml\Product\Builder', + ['build'], + [], + '', + false + ); + $this->product = $this->getMockBuilder('Magento\Catalog\Model\Product')->disableOriginalConstructor() + ->setMethods(['addData', 'getSku', 'getTypeId', 'getStoreId', '__sleep', '__wakeup'])->getMock(); + $this->product->expects($this->any())->method('getTypeId')->will($this->returnValue('simple')); + $this->product->expects($this->any())->method('getStoreId')->will($this->returnValue('1')); + $this->productBuilder->expects($this->any())->method('build')->will($this->returnValue($this->product)); + + $this->resultPage = $this->getMockBuilder('Magento\Backend\Model\View\Result\Page') + ->disableOriginalConstructor() + ->getMock(); + + $resultPageFactory = $this->getMockBuilder('Magento\Framework\View\Result\PageFactory') + ->disableOriginalConstructor() + ->setMethods(['create']) + ->getMock(); + $resultPageFactory->expects($this->any())->method('create')->willReturn($this->resultPage); + + $this->resultForward = $this->getMockBuilder('Magento\Backend\Model\View\Result\Forward') + ->disableOriginalConstructor() + ->getMock(); + $resultForwardFactory = $this->getMockBuilder('Magento\Backend\Model\View\Result\ForwardFactory') + ->disableOriginalConstructor() + ->setMethods(['create']) + ->getMock(); + $resultForwardFactory->expects($this->any()) + ->method('create') + ->willReturn($this->resultForward); + $this->resultPage->expects($this->any())->method('getLayout')->willReturn($this->layout); + $this->resultRedirectFactory = $this->getMock( + 'Magento\Backend\Model\View\Result\RedirectFactory', + ['create'], + [], + '', + false + ); + $this->resultRedirect = $this->getMock( + 'Magento\Backend\Model\View\Result\Redirect', + [], + [], + '', + false + ); + $this->resultRedirectFactory->expects($this->any())->method('create')->willReturn($this->resultRedirect); + + $this->initializationHelper = $this->getMock( + 'Magento\Catalog\Controller\Adminhtml\Product\Initialization\Helper', + [], + [], + '', + false + ); + + $this->action = (new ObjectManagerHelper($this))->getObject( + 'Magento\Catalog\Controller\Adminhtml\Product\Save', + [ + 'context' => $this->initContext(), + 'productBuilder' => $this->productBuilder, + 'resultPageFactory' => $resultPageFactory, + 'resultForwardFactory' => $resultForwardFactory, + 'resultRedirectFactory' => $this->resultRedirectFactory, + 'initializationHelper' => $this->initializationHelper, + ] + ); + } + + /** + * @dataProvider exceptionTypeDataProvider + * @param string $exceptionType + */ + public function testExecuteSetsProductDataToSessionAndRedirectsToNewActionOnError($exceptionType) + { + $productData = ['product' => ['name' => 'test-name']]; + + $this->request->expects($this->any())->method('getPost')->willReturn($productData); + $this->initializationHelper->expects($this->any())->method('initialize') + ->willReturn($this->product); + $this->product->expects($this->any())->method('getSku')->willThrowException(new $exceptionType()); + + $this->session->expects($this->once())->method('setProductData')->with($productData); + $this->resultRedirect->expects($this->once())->method('setPath')->with('catalog/*/new'); + + $this->action->execute(); + } + + /** + * @return array + */ + public function exceptionTypeDataProvider() + { + return [['Magento\Framework\Model\Exception'], ['Exception']]; + } +} diff --git a/dev/tests/unit/testsuite/Magento/Catalog/Controller/Adminhtml/ProductTest.php b/dev/tests/unit/testsuite/Magento/Catalog/Controller/Adminhtml/ProductTest.php index bbc0ad73c8234..36c35594ae92b 100644 --- a/dev/tests/unit/testsuite/Magento/Catalog/Controller/Adminhtml/ProductTest.php +++ b/dev/tests/unit/testsuite/Magento/Catalog/Controller/Adminhtml/ProductTest.php @@ -6,18 +6,16 @@ abstract class ProductTest extends \PHPUnit_Framework_TestCase { - /** - * @var \PHPUnit_Framework_MockObject_MockObject - */ + /** @var \PHPUnit_Framework_MockObject_MockObject */ protected $context; - - /** - * @var \Magento\Catalog\Controller\Product - */ + /** @var \Magento\Catalog\Controller\Product */ protected $action; - /** @var \Magento\Framework\View\Layout */ protected $layout; + /** @var \Magento\Backend\Model\Session|\PHPUnit_Framework_MockObject_MockObject */ + protected $session; + /** @var \Magento\Framework\App\Request\Http|\PHPUnit_Framework_MockObject_MockObject */ + protected $request; /** * Init context object @@ -42,7 +40,7 @@ protected function initContext() ->setMethods(['add'])->disableOriginalConstructor()->getMock(); $title->expects($this->any())->method('prepend')->withAnyParameters()->will($this->returnSelf()); $requestInterfaceMock = $this->getMockBuilder('Magento\Framework\App\Request\Http')->setMethods( - ['getParam', 'getFullActionName'] + ['getParam', 'getFullActionName', 'getPost'] )->disableOriginalConstructor()->getMock(); $responseInterfaceMock = $this->getMockBuilder('Magento\Framework\App\ResponseInterface')->setMethods( @@ -50,7 +48,13 @@ protected function initContext() )->getMock(); $managerInterfaceMock = $this->getMock('Magento\Framework\Message\ManagerInterface'); - $sessionMock = $this->getMock('Magento\Backend\Model\Session', [], [], '', false); + $sessionMock = $this->getMock( + 'Magento\Backend\Model\Session', + ['getProductData', 'setProductData'], + [], + '', + false + ); $actionFlagMock = $this->getMock('Magento\Framework\App\ActionFlag', [], [], '', false); $helperDataMock = $this->getMock('Magento\Backend\Helper\Data', [], [], '', false); $this->context = $this->getMock( @@ -78,12 +82,15 @@ protected function initContext() $this->context->expects($this->any())->method('getResponse')->will($this->returnValue($responseInterfaceMock)); $this->context->expects($this->any())->method('getObjectManager')->will($this->returnValue($objectManagerMock)); - $this->context->expects($this->any()) - ->method('getMessageManager') + $this->context->expects($this->any())->method('getMessageManager') ->will($this->returnValue($managerInterfaceMock)); $this->context->expects($this->any())->method('getSession')->will($this->returnValue($sessionMock)); $this->context->expects($this->any())->method('getActionFlag')->will($this->returnValue($actionFlagMock)); $this->context->expects($this->any())->method('getHelper')->will($this->returnValue($helperDataMock)); + + $this->session = $sessionMock; + $this->request = $requestInterfaceMock; + return $this->context; } } diff --git a/dev/tests/unit/testsuite/Magento/Catalog/Controller/Product/Compare/IndexTest.php b/dev/tests/unit/testsuite/Magento/Catalog/Controller/Product/Compare/IndexTest.php new file mode 100644 index 0000000000000..a46b5a2806a0c --- /dev/null +++ b/dev/tests/unit/testsuite/Magento/Catalog/Controller/Product/Compare/IndexTest.php @@ -0,0 +1,164 @@ +contextMock = $this->getMock('Magento\Framework\App\Action\Context', + ['getRequest', 'getResponse'], + [], + '', + false + ); + $this->request = $this->getMock('Magento\Framework\App\RequestInterface', [], [], '', false); + $this->response = $this->getMock('Magento\Framework\App\ResponseInterface', [], [], '', false); + $this->contextMock->expects($this->any()) + ->method('getRequest') + ->willReturn($this->request); + $this->contextMock->expects($this->any()) + ->method('getResponse') + ->willReturn($this->response); + + $this->itemFactoryMock = $this->getMock('Magento\Catalog\Model\Product\Compare\ItemFactory', [], [], '', false); + $this->collectionFactoryMock = $this->getMock( + 'Magento\Catalog\Model\Resource\Product\Compare\Item\CollectionFactory', + [], + [], + '', + false + ); + $this->sessionMock = $this->getMock('Magento\Customer\Model\Session', [], [], '', false); + $this->visitorMock = $this->getMock('Magento\Customer\Model\Visitor', [], [], '', false); + $this->listCompareMock = $this->getMock('Magento\Catalog\Model\Product\Compare\ListCompare', [], [], '', false); + $this->catalogSession = $this->getMock('Magento\Catalog\Model\Session', ['setBeforeCompareUrl'], [], '', false); + $this->storeManagerMock = $this->getMock('Magento\Store\Model\StoreManagerInterface'); + $this->formKeyValidatorMock = $this->getMock('Magento\Core\App\Action\FormKeyValidator', [], [], '', false); + $this->redirectFactoryMock = $this->getMock( + 'Magento\Framework\Controller\Result\RedirectFactory', + ['create'], + [], + '', + false + ); + $this->pageFactoryMock = $this->getMock('Magento\Framework\View\Result\PageFactory', [], [], '', false); + $this->productRepositoryMock = $this->getMock('Magento\Catalog\Api\ProductRepositoryInterface'); + $this->decoderMock = $this->getMock('Magento\Framework\Url\DecoderInterface'); + + $this->index = new Index( + $this->contextMock, + $this->itemFactoryMock, + $this->collectionFactoryMock, + $this->sessionMock, + $this->visitorMock, + $this->listCompareMock, + $this->catalogSession, + $this->storeManagerMock, + $this->formKeyValidatorMock, + $this->redirectFactoryMock, + $this->pageFactoryMock, + $this->productRepositoryMock, + $this->decoderMock + ); + } + + public function testExecute() + { + $beforeUrl = 'test_url'; + $this->request->expects($this->any()) + ->method('getParam') + ->willReturnMap([ + ['items', null, null], + ['uenc', null, $beforeUrl], + ]); + $this->decoderMock->expects($this->once()) + ->method('decode') + ->with($beforeUrl) + ->willReturn($beforeUrl . '1'); + $this->catalogSession->expects($this->once()) + ->method('setBeforeCompareUrl') + ->with($beforeUrl . '1') + ->willReturnSelf(); + $this->listCompareMock->expects($this->never())->method('addProducts'); + $this->redirectFactoryMock->expects($this->never())->method('create'); + $this->index->execute(); + } + + public function testExecuteWithItems() + { + $this->request->expects($this->any()) + ->method('getParam') + ->willReturnMap([ + ['items', null, '1,2,3'], + ['uenc', null, null], + ]); + $this->decoderMock->expects($this->never())->method('decode'); + $this->catalogSession->expects($this->never())->method('setBeforeCompareUrl'); + + $this->listCompareMock->expects($this->once()) + ->method('addProducts') + ->with([1, 2, 3]); + $redirect = $this->getMock('Magento\Framework\Controller\Result\Redirect', ['setPath'], [], '', false); + $redirect->expects($this->once()) + ->method('setPath') + ->with('*/*/*'); + $this->redirectFactoryMock->expects($this->once()) + ->method('create') + ->willReturn($redirect); + $this->index->execute(); + } +} diff --git a/dev/tests/unit/testsuite/Magento/Catalog/Model/CategoryTest.php b/dev/tests/unit/testsuite/Magento/Catalog/Model/CategoryTest.php index 07abdac6da914..a918e7be095e2 100644 --- a/dev/tests/unit/testsuite/Magento/Catalog/Model/CategoryTest.php +++ b/dev/tests/unit/testsuite/Magento/Catalog/Model/CategoryTest.php @@ -90,16 +90,27 @@ protected function setUp() $this->registry = $this->getMock('Magento\Framework\Registry'); $this->storeManager = $this->getMock('Magento\Store\Model\StoreManagerInterface'); $this->categoryTreeResource = $this->getMock('Magento\Catalog\Model\Resource\Category\Tree', [], [], '', false); - $this->categoryTreeFactory = $this->getMock('Magento\Catalog\Model\Resource\Category\TreeFactory', ['create']); + $this->categoryTreeFactory = $this->getMock( + 'Magento\Catalog\Model\Resource\Category\TreeFactory', + ['create'], + [], + '', + false); $this->categoryRepository = $this->getMock('Magento\Catalog\Api\CategoryRepositoryInterface'); $this->storeCollectionFactory = $this->getMock( 'Magento\Store\Model\Resource\Store\CollectionFactory', - ['create'] + ['create'], + [], + '', + false ); $this->url = $this->getMock('Magento\Framework\UrlInterface'); $this->productCollectionFactory = $this->getMock( 'Magento\Catalog\Model\Resource\Product\CollectionFactory', - ['create'] + ['create'], + [], + '', + false ); $this->catalogConfig = $this->getMock('Magento\Catalog\Model\Config', [], [], '', false); $this->filterManager = $this->getMock( diff --git a/dev/tests/unit/testsuite/Magento/Catalog/Plugin/Model/Indexer/Category/Product/ExecuteTest.php b/dev/tests/unit/testsuite/Magento/Catalog/Plugin/Model/Indexer/Category/Product/ExecuteTest.php new file mode 100644 index 0000000000000..ed548429e9b65 --- /dev/null +++ b/dev/tests/unit/testsuite/Magento/Catalog/Plugin/Model/Indexer/Category/Product/ExecuteTest.php @@ -0,0 +1,77 @@ +config = $this->getMockBuilder('Magento\PageCache\Model\Config') + ->disableOriginalConstructor() + ->setMethods(['isEnabled']) + ->getMock(); + $this->typeList = $this->getMockBuilder('Magento\Framework\App\Cache\TypeListInterface') + ->disableOriginalConstructor() + ->setMethods(['invalidate']) + ->getMockForAbstractClass(); + + $this->execute = new Execute($this->config, $this->typeList); + } + + public function testAfterExecute() + { + $subject = $this->getMockBuilder('Magento\Catalog\Model\Indexer\Category\Product\AbstractAction') + ->disableOriginalConstructor() + ->getMockForAbstractClass(); + + $result = $this->getMockBuilder('Magento\Catalog\Model\Indexer\Category\Product\AbstractAction') + ->disableOriginalConstructor() + ->getMockForAbstractClass(); + + $this->config->expects($this->once()) + ->method('isEnabled') + ->willReturn(false); + $this->typeList->expects($this->never()) + ->method('invalidate'); + + $this->assertEquals( + $result, + $this->execute->afterExecute($subject, $result) + ); + } + + public function testAfterExecuteInvalidate() + { + $subject = $this->getMockBuilder('Magento\Catalog\Model\Indexer\Category\Product\AbstractAction') + ->disableOriginalConstructor() + ->getMockForAbstractClass(); + + $result = $this->getMockBuilder('Magento\Catalog\Model\Indexer\Category\Product\AbstractAction') + ->disableOriginalConstructor() + ->getMockForAbstractClass(); + + $this->config->expects($this->once()) + ->method('isEnabled') + ->willReturn(true); + $this->typeList->expects($this->once()) + ->method('invalidate') + ->with('full_page'); + + $this->assertEquals( + $result, + $this->execute->afterExecute($subject, $result) + ); + } +} diff --git a/dev/tests/unit/testsuite/Magento/Catalog/Plugin/Model/Resource/Attribute/SaveTest.php b/dev/tests/unit/testsuite/Magento/Catalog/Plugin/Model/Resource/Attribute/SaveTest.php new file mode 100644 index 0000000000000..f19365847b5bf --- /dev/null +++ b/dev/tests/unit/testsuite/Magento/Catalog/Plugin/Model/Resource/Attribute/SaveTest.php @@ -0,0 +1,80 @@ +config = $this->getMockBuilder('Magento\PageCache\Model\Config') + ->disableOriginalConstructor() + ->setMethods(['isEnabled']) + ->getMock(); + $this->typeList = $this->getMockBuilder('Magento\Framework\App\Cache\TypeListInterface') + ->disableOriginalConstructor() + ->setMethods(['invalidate']) + ->getMockForAbstractClass(); + + $this->save = new Save($this->config, $this->typeList); + } + + public function testAroundSaveWithoutInvalidate() + { + $subject = $this->getMockBuilder('Magento\Catalog\Model\Resource\Attribute') + ->disableOriginalConstructor() + ->getMock(); + $attribute = $this->getMockBuilder('Magento\Catalog\Model\Resource\Eav\Attribute') + ->disableOriginalConstructor() + ->getMock(); + $self = $this; + $proceed = function ($object) use ($self, $attribute) { + $self->assertEquals($object, $attribute); + }; + + $this->config->expects($this->once()) + ->method('isEnabled') + ->willReturn(false); + + $this->typeList->expects($this->never()) + ->method('invalidate'); + + $this->save->aroundSave($subject, $proceed, $attribute); + } + + public function testAroundSave() + { + $subject = $this->getMockBuilder('Magento\Catalog\Model\Resource\Attribute') + ->disableOriginalConstructor() + ->getMock(); + $attribute = $this->getMockBuilder('Magento\Catalog\Model\Resource\Eav\Attribute') + ->disableOriginalConstructor() + ->getMock(); + + $self = $this; + $proceed = function ($object) use ($self, $attribute) { + $self->assertEquals($object, $attribute); + }; + + $this->config->expects($this->once()) + ->method('isEnabled') + ->willReturn(true); + + $this->typeList->expects($this->once()) + ->method('invalidate') + ->with('full_page'); + + $this->save->aroundSave($subject, $proceed, $attribute); + } +} diff --git a/dev/tests/unit/testsuite/Magento/CatalogSearch/Model/Layer/Filter/AttributeTest.php b/dev/tests/unit/testsuite/Magento/CatalogSearch/Model/Layer/Filter/AttributeTest.php index 7454a4a0a2c84..85de9a5d76886 100644 --- a/dev/tests/unit/testsuite/Magento/CatalogSearch/Model/Layer/Filter/AttributeTest.php +++ b/dev/tests/unit/testsuite/Magento/CatalogSearch/Model/Layer/Filter/AttributeTest.php @@ -243,10 +243,16 @@ public function testGetItemsWithoutApply() 'value' => 'selectedOptionValue2', 'count' => 13, ], + [ + 'label' => 'selectedOptionLabel3', + 'value' => 'selectedOptionValue3', + 'count' => 10, + ], ]; $facetedData = [ 'selectedOptionValue1' => ['count' => 10], 'selectedOptionValue2' => ['count' => 45], + 'selectedOptionValue3' => ['count' => 50], ]; $builtData = [ @@ -260,14 +266,25 @@ public function testGetItemsWithoutApply() 'value' => $selectedOptions[1]['value'], 'count' => $facetedData[$selectedOptions[1]['value']]['count'], ], + [ + 'label' => $selectedOptions[2]['label'], + 'value' => $selectedOptions[2]['value'], + 'count' => $facetedData[$selectedOptions[2]['value']]['count'], + ], ]; $this->attribute->expects($this->exactly(2)) ->method('getAttributeCode') ->will($this->returnValue($attributeCode)); - $this->attribute->expects($this->exactly(count($selectedOptions))) + $this->attribute->expects($this->at(3)) + ->method('getIsFilterable') + ->will($this->returnValue(1)); + $this->attribute->expects($this->at(4)) + ->method('getIsFilterable') + ->will($this->returnValue(2)); + $this->attribute->expects($this->at(5)) ->method('getIsFilterable') - ->will($this->returnValue(true)); + ->will($this->returnValue(1)); $this->target->setAttributeModel($this->attribute); @@ -306,6 +323,7 @@ public function testGetItemsWithoutApply() $expectedFilterItems = [ $this->createFilterItem(0, $builtData[0]['label'], $builtData[0]['value'], $builtData[0]['count']), $this->createFilterItem(1, $builtData[1]['label'], $builtData[1]['value'], $builtData[1]['count']), + $this->createFilterItem(2, $builtData[2]['label'], $builtData[2]['value'], $builtData[2]['count']), ]; $result = $this->target->getItems(); diff --git a/dev/tests/unit/testsuite/Magento/CatalogSearch/Model/Resource/Fulltext/CollectionTest.php b/dev/tests/unit/testsuite/Magento/CatalogSearch/Model/Resource/Fulltext/CollectionTest.php new file mode 100644 index 0000000000000..d1010e60398ae --- /dev/null +++ b/dev/tests/unit/testsuite/Magento/CatalogSearch/Model/Resource/Fulltext/CollectionTest.php @@ -0,0 +1,146 @@ +getStoreManager(); + $universalFactory = $this->getUniversalFactory(); + $scopeConfig = $this->getScopeConfig(); + $requestBuilder = $this->getRequestBuilder(); + + $this->model = $helper->getObject( + 'Magento\CatalogSearch\Model\Resource\Fulltext\Collection', + [ + 'storeManager' => $storeManager, + 'universalFactory' => $universalFactory, + 'scopeConfig' => $scopeConfig, + 'requestBuilder' => $requestBuilder + ] + ); + } + + /** + * @expectedException \Exception + * @expectedExceptionCode 333 + * @expectedExceptionMessage setRequestName + */ + public function testGetFacetedData() + { + $this->model->getFacetedData('field'); + } + + /** + * @return \PHPUnit_Framework_MockObject_MockObject + */ + protected function getStoreManager() + { + $store = $this->getMockBuilder('Magento\Store\Model\Store') + ->setMethods(['getId']) + ->disableOriginalConstructor() + ->getMock(); + $store->expects($this->once()) + ->method('getId') + ->willReturn(1); + + $storeManager = $this->getMockBuilder('Magento\Store\Model\StoreManagerInterface') + ->setMethods(['getStore']) + ->disableOriginalConstructor() + ->getMockForAbstractClass(); + $storeManager->expects($this->once()) + ->method('getStore') + ->willReturn($store); + + return $storeManager; + } + + /** + * @return \PHPUnit_Framework_MockObject_MockObject + */ + protected function getUniversalFactory() + { + $connection = $this->getMockBuilder('Zend_Db_Adapter_Abstract') + ->disableOriginalConstructor() + ->getMockForAbstractClass(); + + $entity = $this->getMockBuilder('Magento\Eav\Model\Entity\AbstractEntity') + ->setMethods(['getReadConnection', 'getTable', 'getDefaultAttributes', 'getEntityTable']) + ->disableOriginalConstructor() + ->getMock(); + $entity->expects($this->once()) + ->method('getReadConnection') + ->willReturn($connection); + $entity->expects($this->exactly(2)) + ->method('getTable') + ->willReturnArgument(0); + $entity->expects($this->once()) + ->method('getDefaultAttributes') + ->willReturn(['attr1', 'attr2']); + $entity->expects($this->once()) + ->method('getEntityTable') + ->willReturn('table'); + + $universalFactory = $this->getMockBuilder('Magento\Framework\Validator\UniversalFactory') + ->setMethods(['create']) + ->disableOriginalConstructor() + ->getMock(); + $universalFactory->expects($this->once()) + ->method('create') + ->willReturn($entity); + + return $universalFactory; + } + + /** + * @return \PHPUnit_Framework_MockObject_MockObject + */ + protected function getScopeConfig() + { + $scopeConfig = $this->getMockBuilder('Magento\Framework\App\Config\ScopeConfigInterface') + ->setMethods(['getValue']) + ->disableOriginalConstructor() + ->getMockForAbstractClass(); + $scopeConfig->expects($this->once()) + ->method('getValue') + ->willReturn(1); + + return $scopeConfig; + } + + /** + * @return \PHPUnit_Framework_MockObject_MockObject + */ + protected function getRequestBuilder() + { + $requestBuilder = $this->getMockBuilder('Magento\Framework\Search\Request\Builder') + ->setMethods(['bind', 'setRequestName']) + ->disableOriginalConstructor() + ->getMock(); + $requestBuilder->expects($this->once()) + ->method('bind') + ->withConsecutive(['price_dynamic_algorithm', 1]); + $requestBuilder->expects($this->once()) + ->method('setRequestName') + ->withConsecutive(['quick_search_container']) + ->willThrowException(new \Exception('setRequestName', 333)); + + return $requestBuilder; + } +} diff --git a/dev/tests/unit/testsuite/Magento/CatalogSearch/Model/Search/RequestGeneratorTest.php b/dev/tests/unit/testsuite/Magento/CatalogSearch/Model/Search/RequestGeneratorTest.php index a493371230794..eeda495eee7b4 100644 --- a/dev/tests/unit/testsuite/Magento/CatalogSearch/Model/Search/RequestGeneratorTest.php +++ b/dev/tests/unit/testsuite/Magento/CatalogSearch/Model/Search/RequestGeneratorTest.php @@ -68,6 +68,11 @@ public function testGenerate($countResult, $code, $type, $visibleInAdvanced = tr ] ) ); + $collection->expects($this->any()) + ->method('addFieldToFilter') + ->with(['is_searchable', 'is_visible_in_advanced_search', 'is_filterable'], [1, 1, [1, 2]]) + ->will($this->returnSelf()); + $this->productAttributeCollectionFactory->expects($this->any()) ->method('create') ->willReturn($collection); diff --git a/dev/tests/unit/testsuite/Magento/CatalogUrlRewrite/Model/Category/ChildrenCategoriesProviderTest.php b/dev/tests/unit/testsuite/Magento/CatalogUrlRewrite/Model/Category/ChildrenCategoriesProviderTest.php index 24497fcc8ae51..3e5cd649034c2 100644 --- a/dev/tests/unit/testsuite/Magento/CatalogUrlRewrite/Model/Category/ChildrenCategoriesProviderTest.php +++ b/dev/tests/unit/testsuite/Magento/CatalogUrlRewrite/Model/Category/ChildrenCategoriesProviderTest.php @@ -25,15 +25,16 @@ protected function setUp() { $this->category = $this->getMockBuilder('Magento\Catalog\Model\Category') ->disableOriginalConstructor() - ->setMethods(['getPath', 'getResourceCollection', 'getResource', 'getLevel', '__wakeup'])->getMock(); + ->setMethods(['getPath', 'getResourceCollection', 'getResource', 'getLevel', '__wakeup', 'isObjectNew']) + ->getMock(); $categoryCollection = $this->getMockBuilder( 'Magento\Catalog\Model\Resource\Collection\AbstractCollection' )->disableOriginalConstructor()->setMethods(['addAttributeToSelect', 'addIdFilter'])->getMock(); - $this->category->expects($this->once())->method('getPath')->willReturn('category-path'); - $this->category->expects($this->once())->method('getResourceCollection')->willReturn($categoryCollection); + $this->category->expects($this->any())->method('getPath')->willReturn('category-path'); + $this->category->expects($this->any())->method('getResourceCollection')->willReturn($categoryCollection); $categoryCollection->expects($this->any())->method('addAttributeToSelect')->willReturnSelf(); $categoryCollection->expects($this->any())->method('addIdFilter')->with(['id'])->willReturnSelf(); - $this->select = $this->getMockBuilder('Magento\Framework\DB\Selecty') + $this->select = $this->getMockBuilder('Magento\Framework\DB\Select') ->disableOriginalConstructor()->setMethods(['from', 'where', 'deleteFromSelect'])->getMock(); $this->connection = $this->getMock('Magento\Framework\DB\Adapter\AdapterInterface'); $categoryResource = $this->getMockBuilder('Magento\Catalog\Model\Resource\Category') @@ -52,16 +53,24 @@ protected function setUp() public function testGetChildrenRecursive() { $bind = ['c_path' => 'category-path/%']; + $this->category->expects($this->once())->method('isObjectNew')->willReturn(false); $this->select->expects($this->any())->method('where')->with('path LIKE :c_path')->willReturnSelf(); $this->connection->expects($this->any())->method('fetchCol')->with($this->select, $bind)->willReturn(['id']); $this->childrenCategoriesProvider->getChildren($this->category, true); } + public function testGetChildrenForNewCategory() + { + $this->category->expects($this->once())->method('isObjectNew')->willReturn(true); + $this->assertEquals([], $this->childrenCategoriesProvider->getChildren($this->category)); + } + public function testGetChildren() { $categoryLevel = 3; $this->select->expects($this->at(1))->method('where')->with('path LIKE :c_path')->willReturnSelf(); $this->select->expects($this->at(2))->method('where')->with('level <= :c_level')->willReturnSelf(); + $this->category->expects($this->once())->method('isObjectNew')->willReturn(false); $this->category->expects($this->once())->method('getLevel')->willReturn($categoryLevel); $bind = ['c_path' => 'category-path/%', 'c_level' => $categoryLevel + 1]; $this->connection->expects($this->any())->method('fetchCol')->with($this->select, $bind)->willReturn(['id']); diff --git a/dev/tests/unit/testsuite/Magento/CatalogUrlRewrite/Model/CategoryUrlPathGeneratorTest.php b/dev/tests/unit/testsuite/Magento/CatalogUrlRewrite/Model/CategoryUrlPathGeneratorTest.php index 309b812ce89b9..fbf74302f5628 100644 --- a/dev/tests/unit/testsuite/Magento/CatalogUrlRewrite/Model/CategoryUrlPathGeneratorTest.php +++ b/dev/tests/unit/testsuite/Magento/CatalogUrlRewrite/Model/CategoryUrlPathGeneratorTest.php @@ -38,6 +38,7 @@ protected function setUp() 'getId', 'formatUrlKey', 'getName', + 'isObjectNew' ]; $this->category = $this->getMock('Magento\Catalog\Model\Category', $categoryMethods, [], '', false); $this->storeManager = $this->getMock('Magento\Store\Model\StoreManagerInterface'); @@ -54,22 +55,6 @@ protected function setUp() ); } - /** - * @return array - */ - public function getUrlPathDataProvider() - { - $noGenerationLevel = CategoryUrlPathGenerator::MINIMAL_CATEGORY_LEVEL_FOR_PROCESSING - 1; - $requireGenerationLevel = CategoryUrlPathGenerator::MINIMAL_CATEGORY_LEVEL_FOR_PROCESSING; - return [ - [Category::TREE_ROOT_ID, 'url-path', $noGenerationLevel, '', false, false, ''], - ['parent_id', 'url-path', $noGenerationLevel, '', false, false, 'url-path'], - ['parent_id', 'url-path', $noGenerationLevel, 'url-key', true, false, 'url-key'], - ['parent_id', 'url-path', $noGenerationLevel, 'url-key', false, true, 'url-key'], - [null, 'url-path', $requireGenerationLevel, 'url-key', false, true, 'url-key'], - ]; - } - /** * @dataProvider getUrlPathDataProvider * @param int $parentId @@ -77,7 +62,7 @@ public function getUrlPathDataProvider() * @param int $level * @param string $urlKey * @param bool $dataChangedForUrlKey - * @param bool $dataChangedForPathIds + * @param bool $dataChangedForParentId * @param string $result */ public function testGetUrlPath( @@ -86,47 +71,75 @@ public function testGetUrlPath( $level, $urlKey, $dataChangedForUrlKey, - $dataChangedForPathIds, + $dataChangedForParentId, $result ) { $this->category->expects($this->any())->method('getParentId')->will($this->returnValue($parentId)); + $this->category->expects($this->any())->method('isObjectNew')->will($this->returnValue(false)); $this->category->expects($this->any())->method('getLevel')->will($this->returnValue($level)); $this->category->expects($this->any())->method('getUrlPath')->will($this->returnValue($urlPath)); $this->category->expects($this->any())->method('getUrlKey')->will($this->returnValue($urlKey)); $this->category->expects($this->any())->method('dataHasChangedFor') - ->will($this->returnValueMap([['url_key', $dataChangedForUrlKey], ['path_ids', $dataChangedForPathIds]])); + ->will($this->returnValueMap([['url_key', $dataChangedForUrlKey], ['parent_id', $dataChangedForParentId]])); $this->assertEquals($result, $this->categoryUrlPathGenerator->getUrlPath($this->category)); } + /** + * @return array + */ + public function getUrlPathDataProvider() + { + $noGenerationLevel = CategoryUrlPathGenerator::MINIMAL_CATEGORY_LEVEL_FOR_PROCESSING - 1; + return [ + [Category::TREE_ROOT_ID, 'url-path', $noGenerationLevel, '', false, false, ''], + ['parent_id', 'url-path', $noGenerationLevel, '', false, false, 'url-path'], + ['parent_id', 'url-path', $noGenerationLevel, 'url-key', true, false, 'url-key'], + ['parent_id', 'url-path', $noGenerationLevel, 'url-key', false, true, 'url-key'], + ]; + } + /** * @return array */ public function getUrlPathWithParentDataProvider() { + $requireGenerationLevel = CategoryUrlPathGenerator::MINIMAL_CATEGORY_LEVEL_FOR_PROCESSING; + $noGenerationLevel = CategoryUrlPathGenerator::MINIMAL_CATEGORY_LEVEL_FOR_PROCESSING - 1; return [ - ['url-key', 'parent_id', 'parent-category-path', 'parent-category-path/url-key'], - ['url-key', Category::TREE_ROOT_ID, null, 'url-key'], + ['url-key', false, $requireGenerationLevel, 'parent_id', 'parent-path', 'parent-path/url-key'], + ['url-key', false, $requireGenerationLevel, Category::TREE_ROOT_ID, null, 'url-key'], + ['url-key', true, $noGenerationLevel, Category::TREE_ROOT_ID, null, 'url-key'], ]; } /** * @dataProvider getUrlPathWithParentDataProvider * @param string $urlKey + * @param bool $isCategoryNew + * @param bool $level * @param int $parentCategoryParentId * @param string $parentUrlPath * @param string $result */ - public function testGetUrlPathWithParent($urlKey, $parentCategoryParentId, $parentUrlPath, $result) - { + public function testGetUrlPathWithParent( + $urlKey, + $isCategoryNew, + $level, + $parentCategoryParentId, + $parentUrlPath, + $result + ) { $urlPath = null; $parentLevel = CategoryUrlPathGenerator::MINIMAL_CATEGORY_LEVEL_FOR_PROCESSING - 1; $this->category->expects($this->any())->method('getParentId') ->will($this->returnValue('parent_id')); $this->category->expects($this->any())->method('getLevel') - ->will($this->returnValue(CategoryUrlPathGenerator::MINIMAL_CATEGORY_LEVEL_FOR_PROCESSING)); + ->will($this->returnValue($level)); $this->category->expects($this->any())->method('getUrlPath')->will($this->returnValue($urlPath)); $this->category->expects($this->any())->method('getUrlKey')->will($this->returnValue($urlKey)); + $this->category->expects($this->any())->method('isObjectNew')->will($this->returnValue($isCategoryNew)); + $methods = ['__wakeup', 'getUrlPath', 'getParentId', 'getLevel', 'dataHasChangedFor', 'load']; $parentCategory = $this->getMock('Magento\Catalog\Model\Category', $methods, [], '', false); $parentCategory->expects($this->any())->method('getParentId') diff --git a/dev/tests/unit/testsuite/Magento/CatalogUrlRewrite/Observer/CategoryUrlPathAutogeneratorTest.php b/dev/tests/unit/testsuite/Magento/CatalogUrlRewrite/Observer/CategoryUrlPathAutogeneratorTest.php new file mode 100644 index 0000000000000..f819d5c10cf8e --- /dev/null +++ b/dev/tests/unit/testsuite/Magento/CatalogUrlRewrite/Observer/CategoryUrlPathAutogeneratorTest.php @@ -0,0 +1,111 @@ +observer = $this->getMock( + 'Magento\Framework\Event\Observer', + ['getEvent', 'getCategory'], + [], + '', + false + ); + $this->category = $this->getMock( + 'Magento\Catalog\Model\Category', + ['setUrlKey', 'setUrlPath', 'dataHasChangedFor', 'isObjectNew', 'getResource', 'getUrlKey'], + [], + '', + false + ); + $this->observer->expects($this->any())->method('getEvent')->willReturnSelf(); + $this->observer->expects($this->any())->method('getCategory')->willReturn($this->category); + $this->categoryUrlPathGenerator = $this->getMock( + 'Magento\CatalogUrlRewrite\Model\CategoryUrlPathGenerator', + [], + [], + '', + false + ); + $this->childrenCategoriesProvider = $this->getMock( + 'Magento\CatalogUrlRewrite\Model\Category\ChildrenCategoriesProvider' + ); + + $this->categoryUrlPathAutogenerator = (new ObjectManagerHelper($this))->getObject( + 'Magento\CatalogUrlRewrite\Observer\CategoryUrlPathAutogenerator', + [ + 'categoryUrlPathGenerator' => $this->categoryUrlPathGenerator, + 'childrenCategoriesProvider' => $this->childrenCategoriesProvider + ] + ); + } + + public function testSetCategoryUrlAndCategoryPath() + { + $this->category->expects($this->once())->method('getUrlKey')->willReturn('category'); + $this->categoryUrlPathGenerator->expects($this->once())->method('generateUrlKey')->willReturn('urk_key'); + $this->category->expects($this->once())->method('setUrlKey')->with('urk_key')->willReturnSelf(); + $this->categoryUrlPathGenerator->expects($this->once())->method('getUrlPath')->willReturn('url_path'); + $this->category->expects($this->once())->method('setUrlPath')->with('url_path')->willReturnSelf(); + $this->category->expects($this->once())->method('isObjectNew')->willReturn(true); + + $this->categoryUrlPathAutogenerator->invoke($this->observer); + } + + public function testInvokeWithoutGeneration() + { + $this->category->expects($this->once())->method('getUrlKey')->willReturn(false); + $this->category->expects($this->never())->method('setUrlKey'); + $this->category->expects($this->never())->method('setUrlPath'); + $this->categoryUrlPathAutogenerator->invoke($this->observer); + } + + public function testUpdateUrlPathForChildren() + { + $this->category->expects($this->once())->method('getUrlKey')->willReturn('category'); + $this->category->expects($this->once())->method('setUrlKey')->willReturnSelf(); + $this->category->expects($this->once())->method('setUrlPath')->willReturnSelf(); + $this->category->expects($this->once())->method('isObjectNew')->willReturn(false); + $this->category->expects($this->once())->method('dataHasChangedFor')->with('url_path')->willReturn(true); + $categoryResource = $this->getMockBuilder('Magento\Catalog\Model\Resource\Category') + ->disableOriginalConstructor()->getMock(); + $this->category->expects($this->once())->method('getResource')->willReturn($categoryResource); + $categoryResource->expects($this->once())->method('saveAttribute')->with($this->category, 'url_path'); + + $childCategory = $this->getMockBuilder('Magento\Catalog\Model\Category') + ->setMethods(['getUrlPath', 'setUrlPath', 'getResource', 'unsUrlPath']) + ->disableOriginalConstructor()->getMock(); + + $this->childrenCategoriesProvider->expects($this->once())->method('getChildren')->willReturn([$childCategory]); + $childCategoryResource = $this->getMockBuilder('Magento\Catalog\Model\Resource\Category') + ->disableOriginalConstructor()->getMock(); + $childCategory->expects($this->once())->method('unsUrlPath')->willReturnSelf(); + $childCategory->expects($this->once())->method('getResource')->willReturn($childCategoryResource); + $childCategoryResource->expects($this->once())->method('saveAttribute')->with($childCategory, 'url_path'); + $childCategory->expects($this->once())->method('setUrlPath')->with('category-url_path')->willReturnSelf(); + $this->categoryUrlPathGenerator->expects($this->any())->method('getUrlPath')->willReturn('category-url_path'); + + $this->categoryUrlPathAutogenerator->invoke($this->observer); + } +} diff --git a/dev/tests/unit/testsuite/Magento/Centinel/Model/ObserverTest.php b/dev/tests/unit/testsuite/Magento/Centinel/Model/ObserverTest.php index 9fae33ea29383..8a9b8f188a6f2 100644 --- a/dev/tests/unit/testsuite/Magento/Centinel/Model/ObserverTest.php +++ b/dev/tests/unit/testsuite/Magento/Centinel/Model/ObserverTest.php @@ -10,7 +10,7 @@ public function testPaymentFormBlockToHtmlBefore() { $method = $this->getMock( 'Magento\Paypal\Model\Payflowpro', - ['getIsCentinelValidationEnabled'], + ['getIsCentinelValidationEnabled', 'getCode'], [], '', false @@ -19,6 +19,10 @@ public function testPaymentFormBlockToHtmlBefore() ->method('getIsCentinelValidationEnabled') ->will($this->returnValue(true)); + $method->expects($this->once()) + ->method('getCode') + ->willReturn('payflowpro'); + $blockLogo = $this->getMock( 'Magento\Centinel\Block\Logo', ['setMethod'], diff --git a/dev/tests/unit/testsuite/Magento/Core/Model/Theme/Image/PathTest.php b/dev/tests/unit/testsuite/Magento/Core/Model/Theme/Image/PathTest.php index 702b06395ef17..de3b022ae5ab5 100644 --- a/dev/tests/unit/testsuite/Magento/Core/Model/Theme/Image/PathTest.php +++ b/dev/tests/unit/testsuite/Magento/Core/Model/Theme/Image/PathTest.php @@ -9,6 +9,7 @@ namespace Magento\Core\Model\Theme\Image; use Magento\Framework\App\Filesystem\DirectoryList; +use Magento\Framework\View\Design\Theme\Image\PathInterface; class PathTest extends \PHPUnit_Framework_TestCase { @@ -46,11 +47,6 @@ protected function setUp() $this->_assetRepo = $this->getMock('Magento\Framework\View\Asset\Repository', [], [], '', false); $this->_storeManager = $this->getMock('Magento\Store\Model\StoreManager', [], [], '', false); - $this->mediaDirectory->expects($this->any()) - ->method('getAbsolutePath') - ->with(\Magento\Framework\View\Design\Theme\Image\PathInterface::PREVIEW_DIRECTORY_PATH) - ->will($this->returnValue('/theme/preview')); - $this->mediaDirectory->expects($this->any()) ->method('getRelativePath') ->with('/theme/origin') @@ -69,21 +65,19 @@ protected function setUp() $this->_model = new Path($this->filesystem, $this->_assetRepo, $this->_storeManager); } - public function testGetPreviewImageUrlPhysicalTheme() - { - $theme = $this->getGetTheme(true); - - $this->_assetRepo->expects($this->any()) - ->method('getUrlWithParams') - ->with($theme->getPreviewImage(), ['area' => $theme->getData('area'), 'themeModel' => $theme]) - ->will($this->returnValue('http://localhost/theme/preview/image.png')); - - $this->assertEquals('http://localhost/theme/preview/image.png', $this->model->getPreviewImageUrl($theme)); - } - - public function testGetPreviewImageUrlVirtualTheme() + public function testGetPreviewImageUrl() { - $theme = $this->getGetTheme(false); + /** @var $theme \Magento\Core\Model\Theme|\PHPUnit_Framework_MockObject_MockObject */ + $theme = $this->getMock( + 'Magento\Core\Model\Theme', + ['getPreviewImage', 'isPhysical', '__wakeup'], + [], + '', + false + ); + $theme->expects($this->any()) + ->method('getPreviewImage') + ->will($this->returnValue('image.png')); $store = $this->getMock('Magento\Store\Model\Store', [], [], '', false); $store->expects($this->any())->method('getBaseUrl')->will($this->returnValue('http://localhost/')); @@ -91,12 +85,11 @@ public function testGetPreviewImageUrlVirtualTheme() $this->assertEquals('http://localhost/theme/preview/image.png', $this->model->getPreviewImageUrl($theme)); } - /** - * @param bool $isPhysical - * @return \Magento\Core\Model\Theme|\PHPUnit_Framework_MockObject_MockObject - */ - protected function getGetTheme($isPhysical) + public function testGetPreviewImagePath() { + $previewImage = 'preview.jpg'; + $expectedPath = 'theme/preview/preview.jpg'; + /** @var $theme \Magento\Core\Model\Theme|\PHPUnit_Framework_MockObject_MockObject */ $theme = $this->getMock( 'Magento\Core\Model\Theme', @@ -106,17 +99,18 @@ protected function getGetTheme($isPhysical) false ); - $theme->setData('area', 'frontend'); - - $theme->expects($this->any()) - ->method('isPhysical') - ->will($this->returnValue($isPhysical)); + $this->mediaDirectory->expects($this->once()) + ->method('getAbsolutePath') + ->with(PathInterface::PREVIEW_DIRECTORY_PATH . '/' . $previewImage) + ->willReturn($expectedPath); - $theme->expects($this->any()) + $theme->expects($this->once()) ->method('getPreviewImage') - ->will($this->returnValue('image.png')); + ->will($this->returnValue($previewImage)); + + $result = $this->model->getPreviewImagePath($theme); - return $theme; + $this->assertEquals($expectedPath, $result); } /** @@ -134,6 +128,10 @@ public function testDefaultPreviewImageUrlGetter() */ public function testImagePreviewDirectoryGetter() { + $this->mediaDirectory->expects($this->any()) + ->method('getAbsolutePath') + ->with(\Magento\Framework\View\Design\Theme\Image\PathInterface::PREVIEW_DIRECTORY_PATH) + ->will($this->returnValue('/theme/preview')); $this->assertEquals( '/theme/preview', $this->model->getImagePreviewDirectory() diff --git a/dev/tests/unit/testsuite/Magento/Core/Model/ThemeTest.php b/dev/tests/unit/testsuite/Magento/Core/Model/ThemeTest.php index d1395fa4cf05c..f780ee1772b8a 100644 --- a/dev/tests/unit/testsuite/Magento/Core/Model/ThemeTest.php +++ b/dev/tests/unit/testsuite/Magento/Core/Model/ThemeTest.php @@ -9,6 +9,8 @@ namespace Magento\Core\Model; use Magento\Framework\View\Design\ThemeInterface; +use Magento\Framework\App\Filesystem\DirectoryList; +use Magento\Framework\View\Design\Theme\Image\PathInterface; class ThemeTest extends \PHPUnit_Framework_TestCase { @@ -54,7 +56,7 @@ protected function setUp() 'customizationFactory' => $customizationFactory, 'customizationConfig' => $customizationConfig, 'imageFactory' => $this->_imageFactory, - 'resourceCollection' => $resourceCollection + 'resourceCollection' => $resourceCollection, ] ); diff --git a/dev/tests/unit/testsuite/Magento/Cron/Model/ScheduleTest.php b/dev/tests/unit/testsuite/Magento/Cron/Model/ScheduleTest.php index 0ff086f160630..e5b7eb3968374 100644 --- a/dev/tests/unit/testsuite/Magento/Cron/Model/ScheduleTest.php +++ b/dev/tests/unit/testsuite/Magento/Cron/Model/ScheduleTest.php @@ -157,22 +157,35 @@ public function setCronExprExceptionDataProvider() public function testTrySchedule($scheduledAt, $cronExprArr, $expected) { // 1. Create mocks - $date = $this->getMockBuilder('Magento\Framework\Stdlib\DateTime\DateTime') + $timezoneMock = $this->getMockBuilder('Magento\Framework\Stdlib\DateTime\TimezoneInterface') ->disableOriginalConstructor() - ->getMock(); + ->setMethods(['date']) + ->getMockForAbstractClass(); + $dateMock = $this->getMockBuilder('Magento\Framework\Stdlib\DateTime\DateInterface') + ->disableOriginalConstructor() + ->setMethods(['get']) + ->getMockForAbstractClass(); /** @var \Magento\Cron\Model\Schedule $model */ $model = $this->helper->getObject( 'Magento\Cron\Model\Schedule', [ - 'date' => $date + 'timezone' => $timezoneMock ] ); // 2. Set fixtures $model->setScheduledAt($scheduledAt); $model->setCronExprArr($cronExprArr); - $date->expects($this->any())->method('timestamp')->will($this->returnArgument(0)); + if ($scheduledAt && $cronExprArr) { + $timezoneMock->expects($this->once())->method('date')->willReturn($dateMock); + $date = getdate(is_numeric($scheduledAt) ? $scheduledAt : strtotime($scheduledAt)); + $dateMock->expects($this->at(0))->method('get')->with(\Zend_Date::MINUTE)->willReturn($date['minutes']); + $dateMock->expects($this->at(1))->method('get')->with(\Zend_Date::HOUR)->willReturn($date['hours']); + $dateMock->expects($this->at(2))->method('get')->with(\Zend_Date::DAY)->willReturn($date['mday']); + $dateMock->expects($this->at(3))->method('get')->with(\Zend_Date::MONTH)->willReturn($date['mon']); + $dateMock->expects($this->at(4))->method('get')->with(\Zend_Date::WEEKDAY)->willReturn($date['wday']); + } // 3. Run tested method $result = $model->trySchedule(); diff --git a/dev/tests/unit/testsuite/Magento/Customer/Block/NewsletterTest.php b/dev/tests/unit/testsuite/Magento/Customer/Block/NewsletterTest.php new file mode 100644 index 0000000000000..4ddb6f8c5c7ba --- /dev/null +++ b/dev/tests/unit/testsuite/Magento/Customer/Block/NewsletterTest.php @@ -0,0 +1,35 @@ +urlBuilder = $this->getMock('\Magento\Framework\UrlInterface'); + $helper = new \Magento\TestFramework\Helper\ObjectManager($this); + $this->block = $helper->getObject('\Magento\Customer\Block\Newsletter', ['urlBuilder' => $this->urlBuilder]); + } + + public function testGetAction() + { + $this->urlBuilder->expects($this->once()) + ->method('getUrl') + ->with('newsletter/manage/save', []) + ->willReturn('newsletter/manage/save'); + + $this->assertEquals('newsletter/manage/save', $this->block->getAction()); + } +} diff --git a/dev/tests/unit/testsuite/Magento/Customer/Model/Attribute/Backend/BooleanTest.php b/dev/tests/unit/testsuite/Magento/Customer/Model/Attribute/Backend/BooleanTest.php new file mode 100644 index 0000000000000..be8d90c25021d --- /dev/null +++ b/dev/tests/unit/testsuite/Magento/Customer/Model/Attribute/Backend/BooleanTest.php @@ -0,0 +1,78 @@ +model = new \Magento\Customer\Model\Attribute\Backend\Data\Boolean(); + } + + /** + * @param mixed $value + * @param mixed $defaultValue + * @param string|mixed $result + * + * @dataProvider beforeSaveDataProvider + */ + public function testBeforeSave($value, $defaultValue, $result) + { + $attributeMock = $this->getMockBuilder('Magento\Eav\Model\Entity\Attribute\AbstractAttribute') + ->setMethods(['getName', 'getDefaultValue']) + ->disableOriginalConstructor() + ->getMockForAbstractClass(); + $customerMock = $this->getMockBuilder('Magento\Customer\Model\Customer') + ->disableOriginalConstructor() + ->getMock(); + + $this->model->setAttribute($attributeMock); + + $attributeMock->expects($this->once()) + ->method('getName') + ->willReturn('attribute_name'); + $attributeMock->expects($this->any()) + ->method('getDefaultValue') + ->willReturn($defaultValue); + + $customerMock->expects($this->once()) + ->method('getData') + ->with('attribute_name', null) + ->willReturn($value); + $customerMock->expects($this->once()) + ->method('setData') + ->with('attribute_name', $result) + ->willReturnSelf(); + + $this->assertEquals($this->model, $this->model->beforeSave($customerMock)); + } + + /** + * @return array + */ + public function beforeSaveDataProvider() + { + return [ + [null, null, '0'], + [null, '', '0'], + [null, '0', '0'], + [null, '1', '1'], + [null, 'Yes', '1'], + ['', null, '0'], + ['0', null, '0'], + ['0', '1', '0'], + ['1', null, '1'], + ['1', 'Yes', '1'], + ['Yes', null, '1'], + ['Yes', 'Yes', '1'], + ]; + } +} diff --git a/dev/tests/unit/testsuite/Magento/Customer/Model/Config/Backend/CreateAccount/DisableAutoGroupAssignDefaultTest.php b/dev/tests/unit/testsuite/Magento/Customer/Model/Config/Backend/CreateAccount/DisableAutoGroupAssignDefaultTest.php new file mode 100644 index 0000000000000..023c81ab5c107 --- /dev/null +++ b/dev/tests/unit/testsuite/Magento/Customer/Model/Config/Backend/CreateAccount/DisableAutoGroupAssignDefaultTest.php @@ -0,0 +1,58 @@ +eavConfigMock = $this->getMockBuilder('Magento\Eav\Model\Config') + ->disableOriginalConstructor() + ->getMock(); + + $objectManager = new \Magento\TestFramework\Helper\ObjectManager($this); + $this->model = $objectManager->getObject( + 'Magento\Customer\Model\Config\Backend\CreateAccount\DisableAutoGroupAssignDefault', + [ + 'eavConfig' => $this->eavConfigMock, + ] + ); + } + + public function testAfterSave() + { + $value = true; + + $attributeMock = $this->getMockBuilder('Magento\Eav\Model\Entity\Attribute\AbstractAttribute') + ->setMethods(['save', 'setData']) + ->disableOriginalConstructor() + ->getMockForAbstractClass(); + + $this->eavConfigMock->expects($this->once()) + ->method('getAttribute') + ->with('customer', 'disable_auto_group_change') + ->willReturn($attributeMock); + + $attributeMock->expects($this->once()) + ->method('setData') + ->with('default_value', $value); + $attributeMock->expects($this->once()) + ->method('save'); + + $this->model->setValue($value); + + $this->assertEquals($this->model, $this->model->afterSave()); + } +} diff --git a/dev/tests/unit/testsuite/Magento/DesignEditor/Controller/Varien/Router/StandardTest.php b/dev/tests/unit/testsuite/Magento/DesignEditor/Controller/Varien/Router/StandardTest.php index bc4b30a03a8b7..165e730f0af39 100644 --- a/dev/tests/unit/testsuite/Magento/DesignEditor/Controller/Varien/Router/StandardTest.php +++ b/dev/tests/unit/testsuite/Magento/DesignEditor/Controller/Varien/Router/StandardTest.php @@ -74,7 +74,7 @@ public function testMatch( */ public function matchDataProvider() { - $configMock = $this->getMock('Magento\Framework\App\Config\ReinitableConfigInterface'); + $objectManagerMock = $this->getMock('Magento\Framework\ObjectManagerInterface'); $this->_cookieReaderMock = $this->getMock('Magento\Framework\Stdlib\Cookie\CookieReaderInterface'); $uri = self::TEST_HOST . '/' . self::VDE_FRONT_NAME . self::TEST_PATH; $notVdeUrl = self::TEST_HOST . self::TEST_PATH; @@ -96,7 +96,7 @@ public function matchDataProvider() $matchedRequest = $this->getMock( 'Magento\Framework\App\Request\Http', ['_isFrontArea'], - [$routerListMock, $infoProcessorMock, $this->_cookieReaderMock, $configMock, $uri] + [$routerListMock, $infoProcessorMock, $this->_cookieReaderMock, $objectManagerMock, $uri] ); $matchedController = $this->getMockForAbstractClass( @@ -135,7 +135,11 @@ public function matchDataProvider() 'not vde request' => [ '$request' => $this->getMock( 'Magento\Framework\App\Request\Http', ['_isFrontArea'], [ - $routerListMock, $infoProcessorMock, $this->_cookieReaderMock, $configMock, $notVdeUrl + $routerListMock, + $infoProcessorMock, + $this->_cookieReaderMock, + $objectManagerMock, + $notVdeUrl ] ), '$isVde' => false, @@ -145,7 +149,7 @@ public function matchDataProvider() '$request' => $this->getMock( 'Magento\Framework\App\Request\Http', ['_isFrontArea'], - [$routerListMock, $infoProcessorMock, $this->_cookieReaderMock, $configMock, $uri] + [$routerListMock, $infoProcessorMock, $this->_cookieReaderMock, $objectManagerMock, $uri] ), '$isVde' => true, '$isLoggedIn' => false, @@ -154,7 +158,7 @@ public function matchDataProvider() '$request' => $this->getMock( 'Magento\Framework\App\Request\Http', ['_isFrontArea'], - [$routerListMock, $infoProcessorMock, $this->_cookieReaderMock, $configMock, $uri] + [$routerListMock, $infoProcessorMock, $this->_cookieReaderMock, $objectManagerMock, $uri] ), '$isVde' => true, '$isLoggedIn' => true, diff --git a/dev/tests/unit/testsuite/Magento/Downloadable/Block/Catalog/Product/LinksTest.php b/dev/tests/unit/testsuite/Magento/Downloadable/Block/Catalog/Product/LinksTest.php index dfdab0bce8b78..4f3c2ce59bd77 100644 --- a/dev/tests/unit/testsuite/Magento/Downloadable/Block/Catalog/Product/LinksTest.php +++ b/dev/tests/unit/testsuite/Magento/Downloadable/Block/Catalog/Product/LinksTest.php @@ -6,7 +6,6 @@ namespace Magento\Downloadable\Block\Catalog\Product; use Magento\Catalog\Pricing\Price\FinalPrice; -use Magento\Catalog\Pricing\Price\RegularPrice; /** * Tests Magento\Downloadable\Block\Catalog\Product\Links @@ -38,6 +37,11 @@ class LinksTest extends \PHPUnit_Framework_TestCase */ protected $coreHelper; + /** + * @var \Magento\Framework\Json\EncoderInterface | \PHPUnit_Framework_MockObject_MockObject + */ + protected $jsonEncoder; + public function setUp() { $objectManager = new \Magento\TestFramework\Helper\ObjectManager($this); @@ -52,12 +56,14 @@ public function setUp() ->method('getPriceInfo') ->will($this->returnValue($this->priceInfoMock)); $this->coreHelper = $this->getMock('Magento\Core\Helper\Data', [], [], '', false); + $this->jsonEncoder = $this->getMock('Magento\Framework\Json\EncoderInterface', [], [], '', false); $this->linksBlock = $objectManager->getObject( 'Magento\Downloadable\Block\Catalog\Product\Links', [ 'context' => $contextMock, 'coreData' => $this->coreHelper, + 'encoder' => $this->jsonEncoder, 'data' => [ 'product' => $this->productMock, ] @@ -104,42 +110,21 @@ public function testGetLinkPrice() public function testGetJsonConfig() { - $regularPrice = 11.; - $finalPrice = 10.; - $price = 10.; - $oldPrice = 11.; - $linkPrice = 3.; - $linkIncludeTaxPrice = 4.; - $linkExcludeTaxPrice = 3.; - $linkId = 42; $config = [ - 'price' => $price, - 'oldPrice' => $oldPrice, 'links' => [ $linkId => [ - 'price' => $linkPrice, - 'oldPrice' => $linkPrice, - 'inclTaxPrice' => $linkIncludeTaxPrice, - 'exclTaxPrice' => $linkExcludeTaxPrice, + 'finalPrice' => $linkPrice, ], ], ]; - $linkAmountMock = $this->getMock('Magento\Framework\Pricing\Amount\Base', [], [], '', false); + $linkAmountMock = $this->getMock('Magento\Framework\Pricing\Amount\AmountInterface', [], [], '', false); $linkAmountMock->expects($this->once()) ->method('getValue') - ->will($this->returnValue($linkIncludeTaxPrice)); - $linkAmountMock->expects($this->once()) - ->method('getBaseAmount') - ->will($this->returnValue($linkExcludeTaxPrice)); - - $amountMock = $this->getMock('Magento\Framework\Pricing\Amount\Base', [], [], '', false); - $amountMock->expects($this->once()) - ->method('getValue') - ->will($this->returnValue($finalPrice)); + ->will($this->returnValue($linkPrice)); $typeInstanceMock = $this->getMock('Magento\Catalog\Model\Product\Type\Simple', ['getLinks'], [], '', false); $typeInstanceMock->expects($this->once()) @@ -149,38 +134,23 @@ public function testGetJsonConfig() ->method('getTypeInstance') ->will($this->returnValue($typeInstanceMock)); - $regularPriceMock = $this->getMock('Magento\Catalog\Pricing\Price\RegularPrice', [], [], '', false); - $regularPriceMock->expects($this->once()) - ->method('getValue') - ->will($this->returnValue($regularPrice)); - $finalPriceMock = $this->getMock('Magento\Catalog\Pricing\Price\FinalPrice', [], [], '', false); - $finalPriceMock->expects($this->at(0)) - ->method('getAmount') - ->will($this->returnValue($amountMock)); - $finalPriceMock->expects($this->at(1)) + $finalPriceMock->expects($this->once()) ->method('getCustomAmount') ->with($linkPrice) ->will($this->returnValue($linkAmountMock)); - $this->coreHelper->expects($this->at(0)) - ->method('currency') - ->with($linkPrice, false, false) - ->will($this->returnValue($linkPrice)); - - $this->priceInfoMock->expects($this->at(0)) - ->method('getPrice') - ->with(FinalPrice::PRICE_CODE) - ->will($this->returnValue($finalPriceMock)); - $this->priceInfoMock->expects($this->at(1)) - ->method('getPrice') - ->with(RegularPrice::PRICE_CODE) - ->will($this->returnValue($regularPriceMock)); - $this->priceInfoMock->expects($this->at(2)) + $this->priceInfoMock->expects($this->once()) ->method('getPrice') ->with(FinalPrice::PRICE_CODE) ->will($this->returnValue($finalPriceMock)); + $json = json_encode($config); + $this->jsonEncoder->expects($this->once()) + ->method('encode') + ->with($config) + ->will($this->returnValue($json)); + $encodedJsonConfig = $this->linksBlock->getJsonConfig(); $this->assertEquals(json_encode($config), $encodedJsonConfig); } diff --git a/dev/tests/unit/testsuite/Magento/Eav/Model/AttributeManagementTest.php b/dev/tests/unit/testsuite/Magento/Eav/Model/AttributeManagementTest.php index 98d5618440529..03959f7ef8fae 100644 --- a/dev/tests/unit/testsuite/Magento/Eav/Model/AttributeManagementTest.php +++ b/dev/tests/unit/testsuite/Magento/Eav/Model/AttributeManagementTest.php @@ -125,6 +125,40 @@ public function testAssignInputException() $this->model->assign($entityTypeCode, $attributeSetId, $attributeGroupId, $attributeCode, $sortOrder); } + /** + * + * @expectedException \Magento\Framework\Exception\InputException + * @expectedExceptionMessage Attribute group does not belong to attribute set + */ + public function testAssignInputExceptionGroupInSet() + { + $entityTypeCode = 1; + $attributeSetId = 2; + $attributeGroupId = 3; + $attributeCode = 4; + $sortOrder = 5; + $attributeSetMock = $this->getMock('Magento\Eav\Api\Data\AttributeSetInterface', [], [], '', false); + $this->setRepositoryMock->expects($this->once()) + ->method('get') + ->with($attributeSetId) + ->willReturn($attributeSetMock); + $this->entityTypeFactoryMock->expects($this->once())->method('create')->willReturn($this->eavConfigMock); + $attributeSetMock->expects($this->once())->method('getEntityTypeId')->willReturn(66); + $entityTypeMock = $this->getMock('Magento\Eav\Model\Entity\Type', [], [], '', false); + $this->eavConfigMock->expects($this->once())->method('getEntityType')->with(66)->willReturn($entityTypeMock); + $entityTypeMock->expects($this->once())->method('getEntityTypeCode')->willReturn($entityTypeCode); + + $attributeGroup = $this->getMockBuilder('Magento\Eav\Api\Data\AttributeGroupInterface') + ->setMethods(['getAttributeSetId']) + ->disableOriginalConstructor() + ->getMockForAbstractClass(); + + $this->groupRepositoryMock->expects($this->once())->method('get')->willReturn($attributeGroup); + $attributeGroup->expects($this->once())->method('getAttributeSetId')->willReturn($attributeSetId + 1); + + $this->model->assign($entityTypeCode, $attributeSetId, $attributeGroupId, $attributeCode, $sortOrder); + } + public function testAssign() { $entityTypeCode = 1; @@ -142,7 +176,6 @@ public function testAssign() $entityTypeMock = $this->getMock('Magento\Eav\Model\Entity\Type', [], [], '', false); $this->eavConfigMock->expects($this->once())->method('getEntityType')->with(66)->willReturn($entityTypeMock); $entityTypeMock->expects($this->once())->method('getEntityTypeCode')->willReturn($entityTypeCode); - $this->groupRepositoryMock->expects($this->once())->method('get')->with($attributeGroupId); $attributeMock = $this->getMock('Magento\Eav\Model\Attribute', [], [], '', false); $this->attributeRepositoryMock->expects($this->once()) ->method('get') @@ -162,6 +195,14 @@ public function testAssign() $attributeMock->expects($this->once())->method('loadEntityAttributeIdBySet')->willReturnSelf(); $attributeMock->expects($this->once())->method('getData')->with('entity_attribute_id')->willReturnSelf(); + $attributeGroup = $this->getMockBuilder('Magento\Eav\Api\Data\AttributeGroupInterface') + ->setMethods(['getAttributeSetId']) + ->disableOriginalConstructor() + ->getMockForAbstractClass(); + + $this->groupRepositoryMock->expects($this->once())->method('get')->willReturn($attributeGroup); + $attributeGroup->expects($this->once())->method('getAttributeSetId')->willReturn($attributeSetId); + $this->assertEquals( $attributeMock, $this->model->assign($entityTypeCode, $attributeSetId, $attributeGroupId, $attributeCode, $sortOrder) diff --git a/dev/tests/unit/testsuite/Magento/Fedex/Model/CarrierTest.php b/dev/tests/unit/testsuite/Magento/Fedex/Model/CarrierTest.php index 1ed68fb871b59..c770c8f10b3a7 100644 --- a/dev/tests/unit/testsuite/Magento/Fedex/Model/CarrierTest.php +++ b/dev/tests/unit/testsuite/Magento/Fedex/Model/CarrierTest.php @@ -33,7 +33,7 @@ public function setUp() $scopeConfig->expects($this->any())->method('getValue')->will($this->returnValue('ServiceType')); $country = $this->getMock( 'Magento\Directory\Model\Country', - ['load', 'getIso2Code', '__wakeup'], + ['load', 'getData', '__wakeup'], [], '', false diff --git a/dev/tests/unit/testsuite/Magento/Framework/App/HttpTest.php b/dev/tests/unit/testsuite/Magento/Framework/App/HttpTest.php index f0d6bc4524b13..34fab7b34c4aa 100644 --- a/dev/tests/unit/testsuite/Magento/Framework/App/HttpTest.php +++ b/dev/tests/unit/testsuite/Magento/Framework/App/HttpTest.php @@ -190,6 +190,15 @@ public function testHandleDeveloperMode() $this->assertTrue($this->http->catchException($bootstrap, new \Exception('Test'))); } + public function testCatchExceptionSessionException() + { + $this->responseMock->expects($this->once())->method('setRedirect'); + $this->responseMock->expects($this->once())->method('sendHeaders'); + $bootstrap = $this->getMock('Magento\Framework\App\Bootstrap', [], [], '', false); + $bootstrap->expects($this->once())->method('isDeveloperMode')->willReturn(false); + $this->assertTrue($this->http->catchException($bootstrap, new \Magento\Framework\Session\Exception('Test'))); + } + /** * Prepares a mock of bootstrap in "not installed" state * diff --git a/dev/tests/unit/testsuite/Magento/Framework/App/Request/HttpTest.php b/dev/tests/unit/testsuite/Magento/Framework/App/Request/HttpTest.php index 065f3589dcacf..48140770efc35 100644 --- a/dev/tests/unit/testsuite/Magento/Framework/App/Request/HttpTest.php +++ b/dev/tests/unit/testsuite/Magento/Framework/App/Request/HttpTest.php @@ -31,14 +31,9 @@ class HttpTest extends \PHPUnit_Framework_TestCase protected $cookieReaderMock; /** - * @var \Magento\TestFramework\Helper\ObjectManager + * @var \Magento\TestFramework\Helper\ObjectManager | \PHPUnit_Framework_MockObject_MockObject */ - protected $_objectManager; - - /** - * @var \Magento\Framework\App\Config\ReinitableConfigInterface | \PHPUnit_Framework_MockObject_MockObject - */ - protected $configMock; + protected $objectManager; /** * @var array @@ -47,7 +42,6 @@ class HttpTest extends \PHPUnit_Framework_TestCase protected function setUp() { - $this->_objectManager = new \Magento\TestFramework\Helper\ObjectManager($this); $this->_routerListMock = $this->getMock( 'Magento\Framework\App\Route\ConfigInterface\Proxy', @@ -59,7 +53,7 @@ protected function setUp() $this->_infoProcessorMock = $this->getMock('Magento\Framework\App\Request\PathInfoProcessorInterface'); $this->_infoProcessorMock->expects($this->any())->method('process')->will($this->returnArgument(1)); $this->cookieReaderMock = $this->getMock('Magento\Framework\Stdlib\Cookie\CookieReaderInterface'); - $this->configMock = $this->getMock('Magento\Framework\App\Config\ReinitableConfigInterface'); + $this->objectManager = $this->getMock('Magento\Framework\ObjectManagerInterface'); // Stash the $_SERVER array to protect it from modification in test $this->serverArray = $_SERVER; @@ -80,15 +74,12 @@ public function testGetOriginalPathInfoWithTestUri() private function getModel($uri = null) { - return $this->_objectManager->getObject( - 'Magento\Framework\App\Request\Http', - [ - 'pathInfoProcessor' => $this->_infoProcessorMock, - 'routeConfig' => $this->_routerListMock, - 'cookieReader' => $this->cookieReaderMock, - 'uri' => $uri, - 'config' => $this->configMock - ] + return new \Magento\Framework\App\Request\Http( + $this->_routerListMock, + $this->_infoProcessorMock, + $this->cookieReaderMock, + $this->objectManager, + $uri ); } @@ -554,10 +545,19 @@ public function testIsSecure($isSecure, $serverHttps, $headerOffloadKey, $header { $this->_model = $this->getModel(); $configOffloadHeader = 'Header-From-Proxy'; - $this->configMock->expects($this->exactly($configCall)) + $configMock = $this->getMockBuilder('Magento\Framework\App\Config') + ->disableOriginalConstructor() + ->setMethods(['getValue']) + ->getMock(); + $configMock->expects($this->exactly($configCall)) ->method('getValue') ->with(Request::XML_PATH_OFFLOADER_HEADER, ScopeInterface::SCOPE_DEFAULT) ->willReturn($configOffloadHeader); + $this->objectManager->expects($this->exactly($configCall)) + ->method('get') + ->with('Magento\Framework\App\Config') + ->will($this->returnValue($configMock)); + $_SERVER[$headerOffloadKey] = $headerOffloadValue; $_SERVER['HTTPS'] = $serverHttps; diff --git a/dev/tests/unit/testsuite/Magento/Framework/Filter/Template/Tokenizer/ParameterTest.php b/dev/tests/unit/testsuite/Magento/Framework/Filter/Template/Tokenizer/ParameterTest.php index 998e58e3cdfc9..96eed9e4e8467 100644 --- a/dev/tests/unit/testsuite/Magento/Framework/Filter/Template/Tokenizer/ParameterTest.php +++ b/dev/tests/unit/testsuite/Magento/Framework/Filter/Template/Tokenizer/ParameterTest.php @@ -41,7 +41,7 @@ public function testGetValue($string, $expectedValue) public function sampleTokenizeStringProvider() { return [ - [" direct_url='about-magento-demo-store'", ['direct_url' => 'about-magento-demo-store']], + ["%20direct_url='about-magento-demo-store'", ['direct_url' => 'about-magento-demo-store']], [" direct_url='about-magento-demo-store\\[newDemo]", ['direct_url' => 'about-magento-demo-store\\[newDemo]']], [" ", []] diff --git a/dev/tests/unit/testsuite/Magento/Framework/Interception/Config/ConfigTest.php b/dev/tests/unit/testsuite/Magento/Framework/Interception/Config/ConfigTest.php index 6262c9d80a940..a533dd2cf2f52 100644 --- a/dev/tests/unit/testsuite/Magento/Framework/Interception/Config/ConfigTest.php +++ b/dev/tests/unit/testsuite/Magento/Framework/Interception/Config/ConfigTest.php @@ -49,12 +49,8 @@ protected function setUp() ); $this->configScopeMock = $this->getMock('Magento\Framework\Config\ScopeListInterface'); $this->cacheMock = $this->getMock('Magento\Framework\Cache\FrontendInterface'); - $this->omConfigMock = $this->getMock( - 'Magento\Framework\Interception\ObjectManager\Config', - [], - [], - '', - false + $this->omConfigMock = $this->getMockForAbstractClass( + 'Magento\Framework\Interception\ObjectManager\ConfigInterface' ); $this->definitionMock = $this->getMock('Magento\Framework\ObjectManager\DefinitionInterface'); } diff --git a/dev/tests/unit/testsuite/Magento/Framework/Interception/ObjectManager/Config/DeveloperTest.php b/dev/tests/unit/testsuite/Magento/Framework/Interception/ObjectManager/Config/DeveloperTest.php new file mode 100644 index 0000000000000..51cf610cc80ea --- /dev/null +++ b/dev/tests/unit/testsuite/Magento/Framework/Interception/ObjectManager/Config/DeveloperTest.php @@ -0,0 +1,53 @@ +interceptionConfig = $this->getMock('\Magento\Framework\Interception\ConfigInterface'); + $this->model = new Developer(); + } + + public function testGetInstanceTypeReturnsInterceptorClass() + { + $this->interceptionConfig->expects($this->once())->method('hasPlugins')->will($this->returnValue(true)); + $this->model->setInterceptionConfig($this->interceptionConfig); + + $this->assertEquals('SomeClass\Interceptor', $this->model->getInstanceType('SomeClass')); + } + + public function testGetInstanceTypeReturnsSimpleClassIfNoPluginsAreDeclared() + { + $this->model->setInterceptionConfig($this->interceptionConfig); + + $this->assertEquals('SomeClass', $this->model->getInstanceType('SomeClass')); + } + + public function testGetInstanceTypeReturnsSimpleClassIfInterceptionConfigIsNotSet() + { + $this->assertEquals('SomeClass', $this->model->getInstanceType('SomeClass')); + } + + public function testGetOriginalInstanceTypeReturnsInterceptedClass() + { + $this->interceptionConfig->expects($this->once())->method('hasPlugins')->will($this->returnValue(true)); + $this->model->setInterceptionConfig($this->interceptionConfig); + + $this->assertEquals('SomeClass\Interceptor', $this->model->getInstanceType('SomeClass')); + $this->assertEquals('SomeClass', $this->model->getOriginalInstanceType('SomeClass')); + } +} diff --git a/dev/tests/unit/testsuite/Magento/Framework/Interception/ObjectManager/ConfigTest.php b/dev/tests/unit/testsuite/Magento/Framework/Interception/ObjectManager/ConfigTest.php deleted file mode 100644 index 6b670c5a7f17a..0000000000000 --- a/dev/tests/unit/testsuite/Magento/Framework/Interception/ObjectManager/ConfigTest.php +++ /dev/null @@ -1,97 +0,0 @@ -interceptionConfig = $this->getMock('\Magento\Framework\Interception\ConfigInterface'); - - $this->subjectConfigMock = $this->getMockBuilder('\Magento\Framework\ObjectManager\Config\Config') - ->disableOriginalConstructor() - ->setMethods(['getInstanceType']) - ->getMock(); - - $this->model = new Config($this->subjectConfigMock); - } - - public function testGetInstanceTypeReturnsInterceptorClass() - { - $instanceName = 'SomeClass'; - - $this->interceptionConfig->expects($this->once()) - ->method('hasPlugins') - ->willReturn(true); - - $this->subjectConfigMock->expects($this->once()) - ->method('getInstanceType') - ->with($instanceName) - ->willReturn($instanceName); - - $this->model->setInterceptionConfig($this->interceptionConfig); - - $this->assertEquals('SomeClass\Interceptor', $this->model->getInstanceType($instanceName)); - } - - public function testGetInstanceTypeReturnsSimpleClassIfNoPluginsAreDeclared() - { - $instanceName = 'SomeClass'; - - $this->subjectConfigMock->expects($this->once()) - ->method('getInstanceType') - ->with($instanceName) - ->willReturn($instanceName); - - $this->model->setInterceptionConfig($this->interceptionConfig); - - $this->assertEquals('SomeClass', $this->model->getInstanceType($instanceName)); - } - - public function testGetInstanceTypeReturnsSimpleClassIfInterceptionConfigIsNotSet() - { - $instanceName = 'SomeClass'; - - $this->subjectConfigMock->expects($this->once()) - ->method('getInstanceType') - ->with($instanceName) - ->willReturn($instanceName); - - $this->assertEquals('SomeClass', $this->model->getInstanceType($instanceName)); - } - - public function testGetOriginalInstanceTypeReturnsInterceptedClass() - { - $this->interceptionConfig->expects($this->once()) - ->method('hasPlugins') - ->willReturn(true); - - $instanceName = 'SomeClass'; - - $this->subjectConfigMock->expects($this->exactly(2)) - ->method('getInstanceType') - ->with($instanceName) - ->willReturn($instanceName); - - $this->model->setInterceptionConfig($this->interceptionConfig); - - $this->assertEquals('SomeClass\Interceptor', $this->model->getInstanceType($instanceName)); - $this->assertEquals('SomeClass', $this->model->getOriginalInstanceType($instanceName)); - } -} diff --git a/dev/tests/unit/testsuite/Magento/Framework/Interception/PluginList/PluginListTest.php b/dev/tests/unit/testsuite/Magento/Framework/Interception/PluginList/PluginListTest.php index 8b2d5a6695ad5..eb6478fba8c42 100644 --- a/dev/tests/unit/testsuite/Magento/Framework/Interception/PluginList/PluginListTest.php +++ b/dev/tests/unit/testsuite/Magento/Framework/Interception/PluginList/PluginListTest.php @@ -46,10 +46,7 @@ protected function setUp() ->method('get') ->will($this->returnValue(false)); - $omConfigMock = $this->getMockBuilder('Magento\Framework\Interception\ObjectManager\Config') - ->disableOriginalConstructor() - ->setMethods(['getOriginalInstanceType']) - ->getMock(); + $omConfigMock = $this->getMockForAbstractClass('Magento\Framework\Interception\ObjectManager\ConfigInterface'); $omConfigMock->expects($this->any())->method('getOriginalInstanceType')->will($this->returnArgument(0)); diff --git a/dev/tests/unit/testsuite/Magento/Framework/Locale/ListsTest.php b/dev/tests/unit/testsuite/Magento/Framework/Locale/ListsTest.php index 5b186550fea77..e8d9c772e049d 100644 --- a/dev/tests/unit/testsuite/Magento/Framework/Locale/ListsTest.php +++ b/dev/tests/unit/testsuite/Magento/Framework/Locale/ListsTest.php @@ -218,6 +218,11 @@ public function testGetOptionTimezones() foreach ($expectedResults as $value) { $this->assertContains($value, $timeZones); } + + $timeZoneList = \DateTimeZone::listIdentifiers(\DateTimeZone::ALL_WITH_BC); + foreach ($timeZones as $timeZone) { + $this->assertContains($timeZone['value'], $timeZoneList); + } } public function testGetOptionLocales() diff --git a/dev/tests/unit/testsuite/Magento/Framework/Module/DbVersionInfoTest.php b/dev/tests/unit/testsuite/Magento/Framework/Module/DbVersionInfoTest.php new file mode 100644 index 0000000000000..62f18125d8e12 --- /dev/null +++ b/dev/tests/unit/testsuite/Magento/Framework/Module/DbVersionInfoTest.php @@ -0,0 +1,172 @@ +moduleList = $this->getMockForAbstractClass('Magento\Framework\Module\ModuleListInterface'); + $this->moduleList->expects($this->any()) + ->method('getOne') + ->will($this->returnValueMap([ + ['Module_One', ['name' => 'Module_One', 'schema_version' => '1']], + ['Module_Two', ['name' => 'Module_Two', 'schema_version' => '2']], + ['Module_No_Schema', []], + ])); + $this->moduleList->expects($this->any()) + ->method('getNames') + ->will($this->returnValue(['Module_One', 'Module_Two'])); + + $this->_outputConfig = $this->getMockForAbstractClass('Magento\Framework\Module\Output\ConfigInterface'); + $this->moduleResource = $this->getMockForAbstractClass('\Magento\Framework\Module\ResourceInterface'); + $this->resourceResolver = $this->getMockForAbstractClass('\Magento\Framework\Module\ResourceResolverInterface'); + + $this->dbVersionInfo = new DbVersionInfo( + $this->moduleList, + $this->moduleResource, + $this->resourceResolver + ); + } + + /** + * @param string $moduleName + * @param string|bool $dbVersion + * @param bool $expectedResult + * + * @dataProvider isDbUpToDateDataProvider + */ + public function testIsDbSchemaUpToDate($moduleName, $dbVersion, $expectedResult) + { + $resourceName = 'resource'; + $this->moduleResource->expects($this->once()) + ->method('getDbVersion') + ->with($resourceName) + ->will($this->returnValue($dbVersion)); + $this->assertEquals( + $expectedResult, + $this->dbVersionInfo->isSchemaUpToDate($moduleName, $resourceName) + ); + } + + /** + * @param string $moduleName + * @param string|bool $dbVersion + * @param bool $expectedResult + * + * @dataProvider isDbUpToDateDataProvider + */ + public function testIsDbDataUpToDate($moduleName, $dbVersion, $expectedResult) + { + $resourceName = 'resource'; + $this->moduleResource->expects($this->once()) + ->method('getDataVersion') + ->with($resourceName) + ->will($this->returnValue($dbVersion)); + $this->assertEquals( + $expectedResult, + $this->dbVersionInfo->isDataUpToDate($moduleName, $resourceName) + ); + } + + + /** + * @return array + */ + public function isDbUpToDateDataProvider() + { + return [ + 'version in config == version in db' => ['Module_One', '1', true], + 'version in config < version in db' => + [ + 'Module_One', + '2', + false + ], + 'version in config > version in db' => + [ + 'Module_Two', + '1', + false + ], + 'no version in db' => + [ + 'Module_One', + false, + false + ], + ]; + } + + public function testGetDbVersionErrors() + { + $this->moduleResource->expects($this->any()) + ->method('getDataVersion') + ->will($this->returnValue(2)); + $this->moduleResource->expects($this->any()) + ->method('getDbVersion') + ->will($this->returnValue(2)); + + $this->resourceResolver->expects($this->any())->method('getResourceList')->will($this->returnValueMap([ + ['Module_One', ['resource_one']], + ['Module_Two', ['resource_two']], + ])); + + $expectedErrors = [ + [ + DbVersionInfo::KEY_MODULE => 'Module_One', + DbVersionInfo::KEY_CURRENT => '2', + DbVersionInfo::KEY_REQUIRED => '1', + DbVersionInfo::KEY_TYPE => 'schema', + ], + [ + DbVersionInfo::KEY_MODULE => 'Module_One', + DbVersionInfo::KEY_CURRENT => '2', + DbVersionInfo::KEY_REQUIRED => '1', + DbVersionInfo::KEY_TYPE => 'data', + ] + ]; + $this->assertEquals($expectedErrors, $this->dbVersionInfo->getDbVersionErrors()); + } + + /** + * @expectedException \UnexpectedValueException + * @expectedExceptionMessage Schema version for module 'Module_No_Schema' is not specified + */ + public function testIsDbSchemaUpToDateException() + { + $this->dbVersionInfo->isSchemaUpToDate('Module_No_Schema', 'resource_name'); + } + + /** + * @expectedException \UnexpectedValueException + * @expectedExceptionMessage Schema version for module 'Module_No_Schema' is not specified + */ + public function testIsDbDataUpToDateException() + { + $this->dbVersionInfo->isDataUpToDate('Module_No_Schema', 'resource_name'); + } +} diff --git a/dev/tests/unit/testsuite/Magento/Framework/Module/ManagerTest.php b/dev/tests/unit/testsuite/Magento/Framework/Module/ManagerTest.php index 3446047bb03da..f19b4828ab7fb 100644 --- a/dev/tests/unit/testsuite/Magento/Framework/Module/ManagerTest.php +++ b/dev/tests/unit/testsuite/Magento/Framework/Module/ManagerTest.php @@ -4,6 +4,8 @@ */ namespace Magento\Framework\Module; +use Magento\Framework\Module\Plugin\DbStatusValidator; + class ManagerTest extends \PHPUnit_Framework_TestCase { /** @@ -26,11 +28,6 @@ class ManagerTest extends \PHPUnit_Framework_TestCase */ private $_outputConfig; - /** - * @var \Magento\Framework\Module\ResourceInterface|\PHPUnit_Framework_MockObject_MockObject - */ - private $moduleResource; - protected function setUp() { $this->_moduleList = $this->getMockForAbstractClass('Magento\Framework\Module\ModuleListInterface'); @@ -42,11 +39,9 @@ protected function setUp() ['Module_Three', ['name' => 'Two_Three']], ])); $this->_outputConfig = $this->getMockForAbstractClass('Magento\Framework\Module\Output\ConfigInterface'); - $this->moduleResource = $this->getMockForAbstractClass('\Magento\Framework\Module\ResourceInterface'); $this->_model = new \Magento\Framework\Module\Manager( $this->_outputConfig, $this->_moduleList, - $this->moduleResource, [ 'Module_Two' => self::XML_PATH_OUTPUT_ENABLED, ] @@ -111,69 +106,4 @@ public function isOutputEnabledCustomConfigPathDataProvider() 'path literal, output enabled' => [true, true], ]; } - - /** - * @param string $moduleName - * @param string|bool $dbVersion - * @param bool $expectedResult - * - * @dataProvider isDbUpToDateDataProvider - */ - public function testIsDbSchemaUpToDate($moduleName, $dbVersion, $expectedResult) - { - $resourceName = 'resource'; - $this->moduleResource->expects($this->once()) - ->method('getDbVersion') - ->with($resourceName) - ->will($this->returnValue($dbVersion)); - $this->assertSame($expectedResult, $this->_model->isDbSchemaUpToDate($moduleName, $resourceName)); - } - - /** - * @param string $moduleName - * @param string|bool $dbVersion - * @param bool $expectedResult - * - * @dataProvider isDbUpToDateDataProvider - */ - public function testIsDbDataUpToDate($moduleName, $dbVersion, $expectedResult) - { - $resourceName = 'resource'; - $this->moduleResource->expects($this->once()) - ->method('getDataVersion') - ->with($resourceName) - ->will($this->returnValue($dbVersion)); - $this->assertSame($expectedResult, $this->_model->isDbDataUpToDate($moduleName, $resourceName)); - } - - /** - * @return array - */ - public function isDbUpToDateDataProvider() - { - return [ - 'version in config == version in db' => ['Module_One', '1', true], - 'version in config < version in db' => ['Module_One', '2', false], - 'version in config > version in db' => ['Module_Two', '1', false], - 'no version in db' => ['Module_One', false, false], - ]; - } - - /** - * @expectedException \UnexpectedValueException - * @expectedExceptionMessage Schema version for module 'Module_Three' is not specified - */ - public function testIsDbSchemaUpToDateException() - { - $this->_model->isDbSchemaUpToDate('Module_Three', 'resource'); - } - - /** - * @expectedException \UnexpectedValueException - * @expectedExceptionMessage Schema version for module 'Module_Three' is not specified - */ - public function testIsDbDataUpToDateException() - { - $this->_model->isDbDataUpToDate('Module_Three', 'resource'); - } } diff --git a/dev/tests/unit/testsuite/Magento/Framework/Module/Plugin/DbStatusValidatorTest.php b/dev/tests/unit/testsuite/Magento/Framework/Module/Plugin/DbStatusValidatorTest.php index 0ec872b012a0f..bde57cb3b924d 100644 --- a/dev/tests/unit/testsuite/Magento/Framework/Module/Plugin/DbStatusValidatorTest.php +++ b/dev/tests/unit/testsuite/Magento/Framework/Module/Plugin/DbStatusValidatorTest.php @@ -4,6 +4,8 @@ */ namespace Magento\Framework\Module\Plugin; +use Magento\Framework\Module\DbVersionInfo; + class DbStatusValidatorTest extends \PHPUnit_Framework_TestCase { /** @@ -41,6 +43,11 @@ class DbStatusValidatorTest extends \PHPUnit_Framework_TestCase */ private $moduleManager; + /** + * @var \Magento\Framework\Module\DbVersionInfo|\PHPUnit_Framework_MockObject_MockObject + */ + private $dbVersionInfoMock; + protected function setUp() { $this->_cacheMock = $this->getMock('\Magento\Framework\Cache\FrontendInterface'); @@ -61,11 +68,10 @@ protected function setUp() return ['resource_' . $moduleName]; })); $this->moduleManager = $this->getMock('\Magento\Framework\Module\Manager', [], [], '', false); + $this->dbVersionInfoMock = $this->getMock('\Magento\Framework\Module\DbVersionInfo', [], [], '', false); $this->_model = new DbStatusValidator( $this->_cacheMock, - $moduleList, - $resourceResolver, - $this->moduleManager + $this->dbVersionInfoMock ); } @@ -109,26 +115,24 @@ public function testAroundDispatchCached() } /** - * @param array $schemaValueMap - * @param array $dataValueMap + * @param array $dbVersionErrors * * @dataProvider aroundDispatchExceptionDataProvider * @expectedException \Magento\Framework\Module\Exception - * @expectedExceptionMessage Looks like database is outdated. Please, use setup tool to perform update + * @expectedExceptionMessage Please update your database: */ - public function testAroundDispatchException(array $schemaValueMap, array $dataValueMap) + public function testAroundDispatchException(array $dbVersionErrors) { $this->_cacheMock->expects($this->once()) ->method('load') ->with('db_is_up_to_date') ->will($this->returnValue(false)); $this->_cacheMock->expects($this->never())->method('save'); - $this->moduleManager->expects($this->any()) - ->method('isDbSchemaUpToDate') - ->will($this->returnValueMap($schemaValueMap)); - $this->moduleManager->expects($this->any()) - ->method('isDbDataUpToDate') - ->will($this->returnValueMap($dataValueMap)); + + $this->dbVersionInfoMock->expects($this->any()) + ->method('getDbVersionErrors') + ->will($this->returnValue($dbVersionErrors)); + $this->_model->aroundDispatch($this->subjectMock, $this->closureMock, $this->requestMock); } @@ -140,32 +144,50 @@ public function aroundDispatchExceptionDataProvider() return [ 'schema is outdated' => [ [ - ['Module_One', 'resource_Module_One', false], - ['Module_Two', 'resource_Module_Two', true], - ], - [ - ['Module_One', 'resource_Module_One', true], - ['Module_Two', 'resource_Module_Two', true], + [ + DbVersionInfo::KEY_MODULE => 'Module_One', + DbVersionInfo::KEY_TYPE => 'schema', + DbVersionInfo::KEY_CURRENT => 'none', + DbVersionInfo::KEY_REQUIRED => '1' + ] ], ], 'data is outdated' => [ [ - ['Module_One', 'resource_Module_One', true], - ['Module_Two', 'resource_Module_Two', true], - ], - [ - ['Module_One', 'resource_Module_One', true], - ['Module_Two', 'resource_Module_Two', false], + [ + DbVersionInfo::KEY_MODULE => 'Module_Two', + DbVersionInfo::KEY_TYPE => 'data', + DbVersionInfo::KEY_CURRENT => 'none', + DbVersionInfo::KEY_REQUIRED => '1' + ] ], ], 'both schema and data are outdated' => [ [ - ['Module_One', 'resource_Module_One', false], - ['Module_Two', 'resource_Module_Two', false], - ], - [ - ['Module_One', 'resource_Module_One', false], - ['Module_Two', 'resource_Module_Two', false], + [ + DbVersionInfo::KEY_MODULE => 'Module_One', + DbVersionInfo::KEY_TYPE => 'schema', + DbVersionInfo::KEY_CURRENT => 'none', + DbVersionInfo::KEY_REQUIRED => '1' + ], + [ + DbVersionInfo::KEY_MODULE => 'Module_Two', + DbVersionInfo::KEY_TYPE => 'schema', + DbVersionInfo::KEY_CURRENT => 'none', + DbVersionInfo::KEY_REQUIRED => '1' + ], + [ + DbVersionInfo::KEY_MODULE => 'Module_One', + DbVersionInfo::KEY_TYPE => 'data', + DbVersionInfo::KEY_CURRENT => 'none', + DbVersionInfo::KEY_REQUIRED => '1' + ], + [ + DbVersionInfo::KEY_MODULE => 'Module_Two', + DbVersionInfo::KEY_TYPE => 'data', + DbVersionInfo::KEY_CURRENT => 'none', + DbVersionInfo::KEY_REQUIRED => '1' + ] ], ], ]; diff --git a/dev/tests/unit/testsuite/Magento/Framework/Module/UpdaterTest.php b/dev/tests/unit/testsuite/Magento/Framework/Module/UpdaterTest.php index 50f919c422121..35cb6ef433511 100644 --- a/dev/tests/unit/testsuite/Magento/Framework/Module/UpdaterTest.php +++ b/dev/tests/unit/testsuite/Magento/Framework/Module/UpdaterTest.php @@ -27,9 +27,9 @@ class UpdaterTest extends \PHPUnit_Framework_TestCase protected $_resourceSetupMock; /** - * @var \Magento\Framework\Module\Manager|\PHPUnit_Framework_MockObject_MockObject + * @var \Magento\Framework\Module\DbVersionInfo|\PHPUnit_Framework_MockObject_MockObject */ - private $moduleManager; + private $_dbVersionInfo; /** * @var \Magento\Framework\Module\Updater @@ -63,36 +63,24 @@ protected function setUp() ->with('Test_Module') ->will($this->returnValue($resourceList)); - $this->moduleManager = $this->getMock('\Magento\Framework\Module\Manager', [], [], '', false); + $this->_dbVersionInfo = $this->getMock('Magento\Framework\Module\DbVersionInfo', [], [], '', false); $this->_model = new \Magento\Framework\Module\Updater( $this->_factoryMock, $this->_moduleListMock, $this->_resourceResolver, - $this->moduleManager + $this->_dbVersionInfo ); } - /** - * @covers \Magento\Framework\Module\Updater::updateData - */ - public function testUpdateDataNotApplied() - { - $this->moduleManager->expects($this->once()) - ->method('isDbDataUpToDate') - ->with('Test_Module', 'catalog_setup') - ->will($this->returnValue(true)); - $this->_factoryMock->expects($this->never()) - ->method('create'); - $this->_model->updateData(); - } - public function testUpdateData() { - $this->moduleManager->expects($this->once()) - ->method('isDbDataUpToDate') + $this->_dbVersionInfo->expects($this->once()) + ->method('isDataUpToDate') ->with('Test_Module', 'catalog_setup') - ->will($this->returnValue(false)); + ->will( + $this->returnValue(false) + ); $this->_factoryMock->expects($this->any()) ->method('create') ->with('catalog_setup', 'Test_Module') @@ -105,8 +93,8 @@ public function testUpdateData() public function testUpdateDataNoUpdates() { - $this->moduleManager->expects($this->once()) - ->method('isDbDataUpToDate') + $this->_dbVersionInfo->expects($this->once()) + ->method('isDataUpToDate') ->with('Test_Module', 'catalog_setup') ->will($this->returnValue(true)); $this->_factoryMock->expects($this->never()) diff --git a/dev/tests/unit/testsuite/Magento/Framework/ObjectManager/Config/ProxyConfigTest.php b/dev/tests/unit/testsuite/Magento/Framework/ObjectManager/Config/ProxyConfigTest.php deleted file mode 100644 index 5d1872c123cb2..0000000000000 --- a/dev/tests/unit/testsuite/Magento/Framework/ObjectManager/Config/ProxyConfigTest.php +++ /dev/null @@ -1,112 +0,0 @@ -_config = $this->getMock('Magento\Framework\ObjectManager\ConfigInterface', [], [], '', false); - $this->_proxyConfig = new \Magento\Framework\ObjectManager\Config\ProxyConfig($this->_config); - } - - public function testSetRelations() - { - $relation = $this->getMock('Magento\Framework\ObjectManager\RelationsInterface', [], [], '', false); - $this->_config->expects($this->once()) - ->method('setRelations') - ->with($relation); - $this->_proxyConfig->setRelations($relation); - } - - public function testSetCache() - { - $configCache = $this->getMock('Magento\Framework\ObjectManager\ConfigCacheInterface', [], [], '', false); - $this->_config->expects($this->once()) - ->method('setCache') - ->with($configCache); - $this->_proxyConfig->setCache($configCache); - } - - public function testGetArguments() - { - $stringArgs = 'string'; - $this->_config->expects($this->once()) - ->method('getArguments') - ->with($stringArgs) - ->willReturn([]); - $this->assertEquals([], $this->_proxyConfig->getArguments($stringArgs)); - } - - /** - * @dataProvider isSharedDataProvider - */ - public function testIsShared($returnValue) - { - $type = 'string'; - $this->_config->expects($this->once()) - ->method('isShared') - ->with($type) - ->willReturn($returnValue); - $this->assertEquals($returnValue, $this->_proxyConfig->isShared($type)); - } - - /** - * @return array - */ - public function isSharedDataProvider() - { - return [ - [true], - [false] - ]; - } - - public function testGetInstanceType() - { - $instanceName = 'string'; - $this->_config->expects($this->once()) - ->method('getInstanceType') - ->with($instanceName) - ->willReturn('instanceType'); - $this->assertEquals('instanceType', $this->_proxyConfig->getInstanceType($instanceName)); - } - - public function testGetPreference() - { - $type = 'string'; - $this->_config->expects($this->once()) - ->method('getPreference') - ->with($type) - ->willReturn('someString'); - $this->assertEquals('someString', $this->_proxyConfig->getPreference($type)); - } - - public function testExtend() - { - $this->_config->expects($this->once()) - ->method('extend') - ->with([]); - $this->_proxyConfig->extend([]); - } - - public function testGetVirtualTypes() - { - $this->_config->expects($this->once()) - ->method('getVirtualTypes') - ->willReturn([]); - $this->assertEquals([], $this->_proxyConfig->getVirtualTypes()); - } -} diff --git a/dev/tests/unit/testsuite/Magento/Framework/Search/Request/Aggregation/StatusTest.php b/dev/tests/unit/testsuite/Magento/Framework/Search/Request/Aggregation/StatusTest.php new file mode 100644 index 0000000000000..8090b4a80c007 --- /dev/null +++ b/dev/tests/unit/testsuite/Magento/Framework/Search/Request/Aggregation/StatusTest.php @@ -0,0 +1,29 @@ +objectManagerHelper = new ObjectManagerHelper($this); + $this->status = $this->objectManagerHelper->getObject('Magento\Framework\Search\Request\Aggregation\Status'); + } + + public function testIsEnabled() + { + $this->assertFalse($this->status->isEnabled()); + } +} diff --git a/dev/tests/unit/testsuite/Magento/Framework/Search/Request/CleanerTest.php b/dev/tests/unit/testsuite/Magento/Framework/Search/Request/CleanerTest.php index d481832c30189..cd3280965f2ac 100644 --- a/dev/tests/unit/testsuite/Magento/Framework/Search/Request/CleanerTest.php +++ b/dev/tests/unit/testsuite/Magento/Framework/Search/Request/CleanerTest.php @@ -8,6 +8,9 @@ class CleanerTest extends \PHPUnit_Framework_TestCase { + /** @var \Magento\Framework\Search\Request\Aggregation\StatusInterface|\PHPUnit_Framework_MockObject_MockObject */ + private $status; + /** * @var \Magento\Framework\Search\Request\Cleaner */ @@ -17,11 +20,103 @@ protected function setUp() { $helper = new ObjectManager($this); - $this->cleaner = $helper->getObject('Magento\Framework\Search\Request\Cleaner'); + $this->status = $this->getMockBuilder('\Magento\Framework\Search\Request\Aggregation\StatusInterface') + ->disableOriginalConstructor() + ->setMethods(['isEnabled']) + ->getMockForAbstractClass(); + + $this->cleaner = $helper->getObject( + 'Magento\Framework\Search\Request\Cleaner', + ['aggregationStatus' => $this->status] + ); } public function testClean() { + $this->status->expects($this->once()) + ->method('isEnabled') + ->will($this->returnValue(true)); + $requestData = [ + 'query' => 'bool_query', + 'queries' => [ + 'bool_query' => [ + 'queryReference' => [ + ['ref' => 'bool_query_rm'], + ['ref' => 'match_query'], + ['ref' => 'filtered_query_to_filter2'], + ], + 'type' => 'boolQuery', + ], + 'match_query' => ['value' => 'ok', 'type' => 'matchQuery'], + 'bool_query_rm' => [ + 'queryReference' => [ + ['ref' => 'match_query_rm'], + ['ref' => 'filtered_query_to_query'], + ['ref' => 'filtered_query_to_filter'], + ], + 'type' => 'boolQuery', + ], + 'match_query_rm' => ['value' => '$some$', 'type' => 'matchQuery'], + 'match_query_rm2' => ['value' => '$some2$', 'type' => 'matchQuery'], + 'filtered_query_to_query' => [ + 'queryReference' => [['ref' => 'match_query_rm2']], + 'type' => 'filteredQuery', + ], + 'filtered_query_to_filter' => [ + 'filterReference' => [['ref' => 'bool_filter']], + 'type' => 'filteredQuery', + ], + 'filtered_query_to_filter2' => [ + 'filterReference' => [['ref' => 'bool_filter2']], + 'type' => 'filteredQuery', + ], + ], + 'filters' => [ + 'bool_filter' => [ + 'filterReference' => [['ref' => 'term_filter'], ['ref' => 'range_filter']], + 'type' => 'boolFilter', + ], + 'term_filter' => ['value' => '$val$', 'type' => 'termFilter'], + 'range_filter' => ['from' => '$from$', 'to' => '$to$', 'type' => 'rangeFilter'], + 'bool_filter2' => [ + 'filterReference' => [['ref' => 'term_filter2']], + 'type' => 'boolFilter', + ], + 'term_filter2' => ['value' => 'value_good', 'type' => 'termFilter'], + ], + ]; + $exceptedRequestData = [ + 'query' => 'bool_query', + 'queries' => [ + 'bool_query' => [ + 'queryReference' => [['ref' => 'match_query'], ['ref' => 'filtered_query_to_filter2']], + 'type' => 'boolQuery', + ], + 'match_query' => ['value' => 'ok', 'type' => 'matchQuery'], + 'filtered_query_to_filter2' => [ + 'filterReference' => [['ref' => 'bool_filter2']], + 'type' => 'filteredQuery', + ], + ], + 'filters' => [ + 'bool_filter2' => [ + 'filterReference' => [['ref' => 'term_filter2']], + 'type' => 'boolFilter', + ], + 'term_filter2' => ['value' => 'value_good', 'type' => 'termFilter'], + ], + ]; + + $result = $this->cleaner->clean($requestData); + + $this->assertEquals($exceptedRequestData, $result); + } + + public function testCleanWithoutAggregations() + { + $this->status->expects($this->once()) + ->method('isEnabled') + ->will($this->returnValue(false)); $requestData = [ 'query' => 'bool_query', 'queries' => [ @@ -91,6 +186,7 @@ public function testClean() ], 'term_filter2' => ['value' => 'value_good', 'type' => 'termFilter'], ], + 'aggregations' => [], ]; $result = $this->cleaner->clean($requestData); diff --git a/dev/tests/unit/testsuite/Magento/GoogleShopping/Model/Attribute/SalePriceEffectiveDateTest.php b/dev/tests/unit/testsuite/Magento/GoogleShopping/Model/Attribute/SalePriceEffectiveDateTest.php new file mode 100644 index 0000000000000..d7b77c400c1db --- /dev/null +++ b/dev/tests/unit/testsuite/Magento/GoogleShopping/Model/Attribute/SalePriceEffectiveDateTest.php @@ -0,0 +1,73 @@ +getObject('\Magento\GoogleShopping\Model\Attribute\SalePriceEffectiveDate'); + $product = $this->getMock('\Magento\Catalog\Model\Product', ['__wakeup'], [], '', false); + $effectiveDateFrom = $this->getMock( + '\Magento\GoogleShopping\Model\Attribute\DefaultAttribute', + ['getProductAttributeValue'], + [], + '', + false + ); + $effectiveDateFrom->expects($this->any()) + ->method('getProductAttributeValue') + ->with($product) + ->will($this->returnValue($dateFrom)); + + $effectiveDateTo = $this->getMock( + '\Magento\GoogleShopping\Model\Attribute\DefaultAttribute', + ['getProductAttributeValue'], + [], + '', + false + ); + $effectiveDateTo->expects($this->any()) + ->method('getProductAttributeValue') + ->with($product) + ->will($this->returnValue($dataTo)); + $model->setGroupAttributeSalePriceEffectiveDateFrom($effectiveDateFrom); + $model->setGroupAttributeSalePriceEffectiveDateTo($effectiveDateTo); + $attribute = $this->getMock('\Magento\Framework\Gdata\Gshopping\Extension\Attribute'); + $entry = $this->getMock( + '\Magento\Framework\Gdata\Gshopping\Entry', + ['getContentAttributeByName'], + [], + '', + false + ); + $entry->expects($this->any()) + ->method('getContentAttributeByName') + ->with('sale_price_effective_date') + ->will($this->returnValue($attribute)); + $this->assertEquals($entry, $model->convertAttribute($product, $entry)); + } + + /** + * @return array + */ + public function testConvertAttributeDataProvider() + { + $dateFrom = date(DATE_ATOM, strtotime("-2 day")); + $dateTo = date(DATE_ATOM); + return [ + [$dateFrom, $dateTo], + [null, $dateTo], + [$dateFrom, null] + ]; + } +} diff --git a/dev/tests/unit/testsuite/Magento/LayeredNavigation/Model/Aggregation/StatusTest.php b/dev/tests/unit/testsuite/Magento/LayeredNavigation/Model/Aggregation/StatusTest.php new file mode 100644 index 0000000000000..d1863feb20d8f --- /dev/null +++ b/dev/tests/unit/testsuite/Magento/LayeredNavigation/Model/Aggregation/StatusTest.php @@ -0,0 +1,29 @@ +objectManagerHelper = new ObjectManagerHelper($this); + $this->resolver = $this->objectManagerHelper->getObject('Magento\LayeredNavigation\Model\Aggregation\Status'); + } + + public function testIsEnabled() + { + $this->assertTrue($this->resolver->isEnabled()); + } +} diff --git a/dev/tests/unit/testsuite/Magento/Multishipping/Block/Checkout/Address/SelectTest.php b/dev/tests/unit/testsuite/Magento/Multishipping/Block/Checkout/Address/SelectTest.php new file mode 100644 index 0000000000000..2b87525d0ba73 --- /dev/null +++ b/dev/tests/unit/testsuite/Magento/Multishipping/Block/Checkout/Address/SelectTest.php @@ -0,0 +1,191 @@ +objectManager = new ObjectManager($this); + $this->multishippingMock = + $this->getMock('Magento\Multishipping\Model\Checkout\Type\Multishipping', [], [], '', false); + $this->addressMock = $this->getMock('Magento\Customer\Api\Data\AddressInterface'); + $this->customerMock = $this->getMock('Magento\Customer\Api\Data\CustomerInterface'); + $this->filterBuilderMock = $this->getMock('Magento\Framework\Api\FilterBuilder', [], [], '', false); + $this->searchCriteriaBuilderMock = + $this->getMock('Magento\Framework\Api\SearchCriteriaBuilder', [], [], '', false); + $this->addressRepositoryMock = $this->getMock('Magento\Customer\Api\AddressRepositoryInterface'); + $this->filterMock = $this->getMock('Magento\Framework\Api\Filter', [], [], '', false); + $this->searchCriteriaMock = $this->getMock('Magento\Framework\Api\SearchCriteria', [], [], '', false); + $this->block = $this->objectManager->getObject('Magento\Multishipping\Block\Checkout\Address\Select', [ + 'multishipping' => $this->multishippingMock, + 'addressRepository' => $this->addressRepositoryMock, + 'searchCriteriaBuilder' => $this->searchCriteriaBuilderMock, + 'filterBuilder' => $this->filterBuilderMock + ] + ); + } + + /** + * @param string $id + * @param bool $expectedValue + * @dataProvider isDefaultAddressDataProvider + */ + public function testIsAddressDefaultBilling($id, $expectedValue) + { + $this->addressMock->expects($this->once())->method('getId')->willReturn(1); + $this->multishippingMock->expects($this->once())->method('getCustomer')->willReturn($this->customerMock); + $this->customerMock->expects($this->once())->method('getDefaultBilling')->willReturn($id); + $this->assertEquals($expectedValue, $this->block->isAddressDefaultBilling($this->addressMock)); + } + + /** + * @param string $id + * @param bool $expectedValue + * @dataProvider isDefaultAddressDataProvider + */ + public function testIsAddressDefaultShipping($id, $expectedValue) + { + $this->addressMock->expects($this->once())->method('getId')->willReturn(1); + $this->multishippingMock->expects($this->once())->method('getCustomer')->willReturn($this->customerMock); + $this->customerMock->expects($this->once())->method('getDefaultShipping')->willReturn($id); + $this->assertEquals($expectedValue, $this->block->isAddressDefaultShipping($this->addressMock)); + } + + public function isDefaultAddressDataProvider() + { + return [ + 'yes' => [1, true], + 'no' => [2, false], + ]; + } + + public function testGetAddress() + { + $searchResultMock = $this->getMock('Magento\Customer\Api\Data\AddressSearchResultsInterface'); + $this->multishippingMock->expects($this->once())->method('getCustomer')->willReturn($this->customerMock); + $this->customerMock->expects($this->once())->method('getId')->willReturn(1); + $this->filterBuilderMock->expects($this->once())->method('setField')->with('parent_id')->willReturnSelf(); + $this->filterBuilderMock->expects($this->once())->method('setValue')->with(1)->willReturnSelf(); + $this->filterBuilderMock->expects($this->once())->method('setConditionType')->with('eq')->willReturnSelf(); + $this->filterBuilderMock->expects($this->once())->method('create')->willReturn($this->filterMock); + $this->searchCriteriaBuilderMock + ->expects($this->once()) + ->method('addFilter') + ->with([$this->filterMock]) + ->willReturnSelf(); + $this->searchCriteriaBuilderMock + ->expects($this->once()) + ->method('create') + ->willReturn($this->searchCriteriaMock); + $this->addressRepositoryMock + ->expects($this->once()) + ->method('getList') + ->with($this->searchCriteriaMock) + ->willReturn($searchResultMock); + $searchResultMock->expects($this->once())->method('getItems')->willReturn([$this->addressMock]); + $this->assertEquals([$this->addressMock], $this->block->getAddress()); + $this->assertEquals([$this->addressMock], $this->block->getData('address_collection')); + } + + public function testGetAlreadyExistingAddress() + { + $this->block = $this->objectManager->getObject('Magento\Multishipping\Block\Checkout\Address\Select', [ + 'addressRepository' => $this->addressRepositoryMock, + 'filterBuilder' => $this->filterBuilderMock, + 'data' => [ + 'address_collection' => [$this->addressMock + ] + ] + ] + ); + $this->filterBuilderMock->expects($this->never())->method('setField'); + $this->addressRepositoryMock + ->expects($this->never()) + ->method('getList'); + $this->assertEquals([$this->addressMock], $this->block->getAddress()); + } + + public function testGetAddressWhenItNotExistInCustomer() + { + $searchResultMock = $this->getMock('Magento\Customer\Api\Data\AddressSearchResultsInterface'); + $this->multishippingMock->expects($this->once())->method('getCustomer')->willReturn($this->customerMock); + $this->customerMock->expects($this->once())->method('getId')->willReturn(1); + $this->filterBuilderMock->expects($this->once())->method('setField')->with('parent_id')->willReturnSelf(); + $this->filterBuilderMock->expects($this->once())->method('setValue')->with(1)->willReturnSelf(); + $this->filterBuilderMock->expects($this->once())->method('setConditionType')->with('eq')->willReturnSelf(); + $this->filterBuilderMock->expects($this->once())->method('create')->willReturn($this->filterMock); + $this->searchCriteriaBuilderMock + ->expects($this->once()) + ->method('addFilter') + ->with([$this->filterMock]) + ->willReturnSelf(); + $this->searchCriteriaBuilderMock + ->expects($this->once()) + ->method('create') + ->willReturn($this->searchCriteriaMock); + $this->addressRepositoryMock + ->expects($this->once()) + ->method('getList') + ->with($this->searchCriteriaMock) + ->willReturn($searchResultMock); + + $searchResultMock->expects($this->once())->method('getItems')->willThrowException(new NoSuchEntityException()); + $this->assertEquals([], $this->block->getAddress()); + } +} diff --git a/dev/tests/unit/testsuite/Magento/Multishipping/Controller/Checkout/Address/EditAddressTest.php b/dev/tests/unit/testsuite/Magento/Multishipping/Controller/Checkout/Address/EditAddressTest.php new file mode 100644 index 0000000000000..a16266fae67fb --- /dev/null +++ b/dev/tests/unit/testsuite/Magento/Multishipping/Controller/Checkout/Address/EditAddressTest.php @@ -0,0 +1,141 @@ +configMock = $this->getMock('Magento\Framework\View\Page\Config', [], [], '', false); + $this->checkoutMock = + $this->getMock('Magento\Multishipping\Model\Checkout\Type\Multishipping', [], [], '', false); + $this->titleMock = $this->getMock('Magento\Framework\View\Page\Title', [], [], '', false); + $this->layoutMock = $this->getMock('Magento\Framework\View\Layout', [], [], '', false); + $this->viewMock = $this->getMock('Magento\Framework\App\ViewInterface'); + $this->request = $this->getMockBuilder('\Magento\Framework\App\RequestInterface') + ->disableOriginalConstructor() + ->setMethods([]) + ->getMockForAbstractClass(); + $response = $this->getMockBuilder('\Magento\Framework\App\ResponseInterface') + ->disableOriginalConstructor() + ->setMethods([]) + ->getMockForAbstractClass(); + $contextMock = $this->getMock('\Magento\Framework\App\Action\Context', [], [], '', false); + $contextMock->expects($this->atLeastOnce()) + ->method('getRequest') + ->will($this->returnValue($this->request)); + $contextMock->expects($this->atLeastOnce()) + ->method('getResponse') + ->will($this->returnValue($response)); + $contextMock->expects($this->any())->method('getView')->willReturn($this->viewMock); + $methods = ['setTitle', 'getTitle', 'setSuccessUrl', 'setBackUrl', 'setErrorUrl', '__wakeUp']; + $this->addressFormMock = + $this->getMock('Magento\Customer\Block\Address\Edit', $methods, [], '', false); + $this->urlMock = $this->getMock('Magento\Framework\UrlInterface'); + $contextMock->expects($this->any())->method('getUrl')->willReturn($this->urlMock); + $this->pageMock = $this->getMock('Magento\Framework\View\Result\Page', [], [], '', false); + $this->pageMock->expects($this->any())->method('getConfig')->willReturn($this->configMock); + $this->configMock->expects($this->any())->method('getTitle')->willReturn($this->titleMock); + $this->viewMock->expects($this->any())->method('getPage')->willReturn($this->pageMock); + $this->controller = $objectManager->getObject('\Magento\Multishipping\Controller\Checkout\Address\EditAddress', + ['context' => $contextMock]); + } + + public function testExecute() + { + $this->viewMock->expects($this->once())->method('loadLayout')->willReturnSelf(); + $this->request->expects($this->once())->method('getParam')->with('id')->willReturn(1); + $this->viewMock->expects($this->any())->method('getLayout')->willReturn($this->layoutMock); + $this->layoutMock + ->expects($this->once()) + ->method('getBlock') + ->with('customer_address_edit') + ->willReturn($this->addressFormMock); + $this->addressFormMock + ->expects($this->once()) + ->method('setTitle') + ->with('Edit Address') + ->willReturnSelf(); + $helperMock = $this->getMock('Magento\Multishipping\Helper\Data', [], [], '', false); + $helperMock->expects($this->any())->method('__')->willReturn('Edit Address'); + $valueMap = [ + ['*/*/selectBilling', null, 'success/url'], + ['*/*/*', ['id' => 1], 'error/url'], + ]; + $this->urlMock->expects($this->any())->method('getUrl')->willReturnMap($valueMap); + $this->addressFormMock->expects($this->once())->method('setSuccessUrl')->with('success/url')->willReturnSelf(); + $this->addressFormMock->expects($this->once())->method('setErrorUrl')->with('error/url')->willReturnSelf(); + + $this->titleMock->expects($this->once())->method('getDefault')->willReturn('default_title'); + $this->addressFormMock->expects($this->once())->method('getTitle')->willReturn('Address title'); + $this->titleMock->expects($this->once())->method('set')->with('Address title - default_title'); + $this->addressFormMock->expects($this->once())->method('setBackUrl')->with('success/url'); + $this->viewMock->expects($this->once())->method('renderLayout'); + $this->controller->execute(); + } + + + public function testExecuteWhenCustomerAddressBlockNotExist() + { + $this->viewMock->expects($this->once())->method('loadLayout')->willReturnSelf(); + $this->viewMock->expects($this->any())->method('getLayout')->willReturn($this->layoutMock); + $this->layoutMock + ->expects($this->once()) + ->method('getBlock') + ->with('customer_address_edit'); + $this->urlMock->expects($this->never())->method('getUrl'); + $this->viewMock->expects($this->once())->method('renderLayout'); + $this->controller->execute(); + } +} diff --git a/dev/tests/unit/testsuite/Magento/Multishipping/Controller/Checkout/Address/EditBillingTest.php b/dev/tests/unit/testsuite/Magento/Multishipping/Controller/Checkout/Address/EditBillingTest.php new file mode 100644 index 0000000000000..3ba5dec09094e --- /dev/null +++ b/dev/tests/unit/testsuite/Magento/Multishipping/Controller/Checkout/Address/EditBillingTest.php @@ -0,0 +1,172 @@ +configMock = $this->getMock('Magento\Framework\View\Page\Config', [], [], '', false); + $this->checkoutMock = + $this->getMock('Magento\Multishipping\Model\Checkout\Type\Multishipping', [], [], '', false); + $this->titleMock = $this->getMock('Magento\Framework\View\Page\Title', [], [], '', false); + $this->layoutMock = $this->getMock('Magento\Framework\View\Layout', [], [], '', false); + $this->viewMock = $this->getMock('Magento\Framework\App\ViewInterface'); + $this->objectManagerMock = $this->getMock('Magento\Framework\ObjectManagerInterface'); + $this->stateMock = + $this->getMock('Magento\Multishipping\Model\Checkout\Type\Multishipping\State', [], [], '', false); + $valueMap = [ + ['Magento\Multishipping\Model\Checkout\Type\Multishipping\State', $this->stateMock], + ['Magento\Multishipping\Model\Checkout\Type\Multishipping', $this->checkoutMock] + ]; + $this->objectManagerMock->expects($this->any())->method('get')->willReturnMap($valueMap); + $this->request = $this->getMockBuilder('\Magento\Framework\App\RequestInterface') + ->disableOriginalConstructor() + ->setMethods([]) + ->getMockForAbstractClass(); + $response = $this->getMockBuilder('\Magento\Framework\App\ResponseInterface') + ->disableOriginalConstructor() + ->setMethods([]) + ->getMockForAbstractClass(); + $contextMock = $this->getMock('\Magento\Framework\App\Action\Context', [], [], '', false); + $contextMock->expects($this->atLeastOnce()) + ->method('getRequest') + ->will($this->returnValue($this->request)); + $contextMock->expects($this->atLeastOnce()) + ->method('getResponse') + ->will($this->returnValue($response)); + $contextMock->expects($this->any())->method('getView')->willReturn($this->viewMock); + $contextMock->expects($this->any())->method('getObjectManager')->willReturn($this->objectManagerMock); + $methods = ['setTitle', 'getTitle', 'setSuccessUrl', 'setBackUrl', 'setErrorUrl', '__wakeUp']; + $this->addressFormMock = + $this->getMock('Magento\Customer\Block\Address\Edit', $methods, [], '', false); + $this->urlMock = $this->getMock('Magento\Framework\UrlInterface'); + $contextMock->expects($this->any())->method('getUrl')->willReturn($this->urlMock); + $this->pageMock = $this->getMock('Magento\Framework\View\Result\Page', [], [], '', false); + $this->pageMock->expects($this->any())->method('getConfig')->willReturn($this->configMock); + $this->configMock->expects($this->any())->method('getTitle')->willReturn($this->titleMock); + $this->viewMock->expects($this->any())->method('getPage')->willReturn($this->pageMock); + $this->controller = $objectManager->getObject('Magento\Multishipping\Controller\Checkout\Address\EditBilling', + ['context' => $contextMock]); + } + + public function testExecute() + { + $this->stateMock + ->expects($this->once()) + ->method('setActiveStep') + ->with( \Magento\Multishipping\Model\Checkout\Type\Multishipping\State::STEP_BILLING); + $this->request->expects($this->once())->method('getParam')->with('id')->willReturn(1); + $this->viewMock->expects($this->once())->method('loadLayout')->willReturnSelf(); + $this->viewMock->expects($this->any())->method('getLayout')->willReturn($this->layoutMock); + $this->layoutMock + ->expects($this->once()) + ->method('getBlock') + ->with('customer_address_edit') + ->willReturn($this->addressFormMock); + $this->addressFormMock + ->expects($this->once()) + ->method('setTitle') + ->with('Edit Billing Address') + ->willReturnSelf(); + $helperMock = $this->getMock('Magento\Multishipping\Helper\Data', [], [], '', false); + $helperMock->expects($this->any())->method('__')->willReturn('Edit Billing Address'); + $this->addressFormMock->expects($this->once())->method('setSuccessUrl')->with('success/url')->willReturnSelf(); + $this->addressFormMock->expects($this->once())->method('setErrorUrl')->with('error/url')->willReturnSelf(); + $valueMap = [ + ['*/*/saveBilling', ['id' => 1], 'success/url'], + ['*/*/*', ['id' => 1], 'error/url'], + ['*/checkout/overview', null, 'back/address'] + ]; + $this->urlMock->expects($this->any())->method('getUrl')->willReturnMap($valueMap); + $this->titleMock->expects($this->once())->method('getDefault')->willReturn('default_title'); + $this->addressFormMock->expects($this->once())->method('getTitle')->willReturn('Address title'); + $this->titleMock->expects($this->once())->method('set')->with('Address title - default_title'); + $this->addressFormMock->expects($this->once())->method('setBackUrl')->with('back/address'); + $this->viewMock->expects($this->once())->method('renderLayout'); + $this->controller->execute(); + } + + public function testExecuteWhenCustomerAddressBlockNotExist() + { + $this->stateMock + ->expects($this->once()) + ->method('setActiveStep') + ->with(\Magento\Multishipping\Model\Checkout\Type\Multishipping\State::STEP_BILLING); + $this->viewMock->expects($this->once())->method('loadLayout')->willReturnSelf(); + $this->viewMock->expects($this->any())->method('getLayout')->willReturn($this->layoutMock); + $this->layoutMock + ->expects($this->once()) + ->method('getBlock') + ->with('customer_address_edit'); + $this->urlMock->expects($this->never())->method('getUrl'); + $this->viewMock->expects($this->once())->method('renderLayout'); + $this->controller->execute(); + } + +} diff --git a/dev/tests/unit/testsuite/Magento/Multishipping/Controller/Checkout/Address/EditShippingTest.php b/dev/tests/unit/testsuite/Magento/Multishipping/Controller/Checkout/Address/EditShippingTest.php new file mode 100644 index 0000000000000..fd8ca0515670a --- /dev/null +++ b/dev/tests/unit/testsuite/Magento/Multishipping/Controller/Checkout/Address/EditShippingTest.php @@ -0,0 +1,175 @@ +configMock = $this->getMock('Magento\Framework\View\Page\Config', [], [], '', false); + $this->checkoutMock = + $this->getMock('Magento\Multishipping\Model\Checkout\Type\Multishipping', [], [], '', false); + $this->titleMock = $this->getMock('Magento\Framework\View\Page\Title', [], [], '', false); + $this->layoutMock = $this->getMock('Magento\Framework\View\Layout', [], [], '', false); + $this->viewMock = $this->getMock('Magento\Framework\App\ViewInterface'); + $this->objectManagerMock = $this->getMock('Magento\Framework\ObjectManagerInterface'); + $this->stateMock = + $this->getMock('Magento\Multishipping\Model\Checkout\Type\Multishipping\State', [], [], '', false); + $valueMap = [ + ['Magento\Multishipping\Model\Checkout\Type\Multishipping\State', $this->stateMock], + ['Magento\Multishipping\Model\Checkout\Type\Multishipping', $this->checkoutMock] + ]; + $this->objectManagerMock->expects($this->any())->method('get')->willReturnMap($valueMap); + $this->request = $this->getMockBuilder('\Magento\Framework\App\RequestInterface') + ->disableOriginalConstructor() + ->setMethods([]) + ->getMockForAbstractClass(); + $response = $this->getMockBuilder('\Magento\Framework\App\ResponseInterface') + ->disableOriginalConstructor() + ->setMethods([]) + ->getMockForAbstractClass(); + $contextMock = $this->getMock('\Magento\Framework\App\Action\Context', [], [], '', false); + $contextMock->expects($this->atLeastOnce()) + ->method('getRequest') + ->will($this->returnValue($this->request)); + $contextMock->expects($this->atLeastOnce()) + ->method('getResponse') + ->will($this->returnValue($response)); + $contextMock->expects($this->any())->method('getView')->willReturn($this->viewMock); + $contextMock->expects($this->any())->method('getObjectManager')->willReturn($this->objectManagerMock); + $methods = ['setTitle', 'getTitle', 'setSuccessUrl', 'setBackUrl', 'setErrorUrl', '__wakeUp']; + $this->addressFormMock = + $this->getMock('Magento\Customer\Block\Address\Edit', $methods, [], '', false); + $this->urlMock = $this->getMock('Magento\Framework\UrlInterface'); + $contextMock->expects($this->any())->method('getUrl')->willReturn($this->urlMock); + $this->pageMock = $this->getMock('Magento\Framework\View\Result\Page', [], [], '', false); + $this->pageMock->expects($this->any())->method('getConfig')->willReturn($this->configMock); + $this->configMock->expects($this->any())->method('getTitle')->willReturn($this->titleMock); + $this->viewMock->expects($this->any())->method('getPage')->willReturn($this->pageMock); + $this->controller = $objectManager->getObject('Magento\Multishipping\Controller\Checkout\Address\EditShipping', + ['context' => $contextMock]); + } + + public function testExecute() + { + $this->stateMock + ->expects($this->once()) + ->method('setActiveStep') + ->with(\Magento\Multishipping\Model\Checkout\Type\Multishipping\State::STEP_SHIPPING); + $this->request->expects($this->once())->method('getParam')->with('id')->willReturn(1); + $this->viewMock->expects($this->once())->method('loadLayout')->willReturnSelf(); + $this->viewMock->expects($this->any())->method('getLayout')->willReturn($this->layoutMock); + $this->layoutMock + ->expects($this->once()) + ->method('getBlock') + ->with('customer_address_edit') + ->willReturn($this->addressFormMock); + $this->addressFormMock + ->expects($this->once()) + ->method('setTitle') + ->with('Edit Shipping Address') + ->willReturnSelf(); + $helperMock = $this->getMock('Magento\Multishipping\Helper\Data', [], [], '', false); + $helperMock->expects($this->any())->method('__')->willReturn('Edit Shipping Address'); + $this->addressFormMock->expects($this->once())->method('setSuccessUrl')->with('success/url')->willReturnSelf(); + $this->addressFormMock->expects($this->once())->method('setErrorUrl')->with('error/url')->willReturnSelf(); + $valueMap = [ + ['*/*/editShippingPost', ['id' => 1], 'success/url'], + ['*/*/*', null, 'error/url'], + ['*/checkout/shipping', null, 'back/address'] + ]; + $this->urlMock->expects($this->any())->method('getUrl')->willReturnMap($valueMap); + $this->titleMock->expects($this->once())->method('getDefault')->willReturn('default_title'); + $this->addressFormMock->expects($this->once())->method('getTitle')->willReturn('Address title'); + $this->titleMock->expects($this->once())->method('set')->with('Address title - default_title'); + $this->checkoutMock + ->expects($this->once()) + ->method('getCustomerDefaultShippingAddress') + ->willReturn('shipping_addres'); + $this->addressFormMock->expects($this->once())->method('setBackUrl')->with('back/address'); + $this->viewMock->expects($this->once())->method('renderLayout'); + $this->controller->execute(); + } + + public function testExecuteWhenCustomerAddressBlockNotExist() + { + $this->stateMock + ->expects($this->once()) + ->method('setActiveStep') + ->with(\Magento\Multishipping\Model\Checkout\Type\Multishipping\State::STEP_SHIPPING); + $this->viewMock->expects($this->once())->method('loadLayout')->willReturnSelf(); + $this->viewMock->expects($this->any())->method('getLayout')->willReturn($this->layoutMock); + $this->layoutMock + ->expects($this->once()) + ->method('getBlock') + ->with('customer_address_edit'); + $this->urlMock->expects($this->never())->method('getUrl'); + $this->viewMock->expects($this->once())->method('renderLayout'); + $this->controller->execute(); + } +} diff --git a/dev/tests/unit/testsuite/Magento/Multishipping/Controller/Checkout/Address/NewBillingTest.php b/dev/tests/unit/testsuite/Magento/Multishipping/Controller/Checkout/Address/NewBillingTest.php new file mode 100644 index 0000000000000..0c3925db9b7c7 --- /dev/null +++ b/dev/tests/unit/testsuite/Magento/Multishipping/Controller/Checkout/Address/NewBillingTest.php @@ -0,0 +1,133 @@ +configMock = $this->getMock('Magento\Framework\View\Page\Config', [], [], '', false); + $this->titleMock = $this->getMock('Magento\Framework\View\Page\Title', [], [], '', false); + $this->layoutMock = $this->getMock('Magento\Framework\View\Layout', [], [], '', false); + $this->viewMock = $this->getMock('Magento\Framework\App\ViewInterface'); + $request = $this->getMockBuilder('\Magento\Framework\App\RequestInterface') + ->disableOriginalConstructor() + ->setMethods([]) + ->getMockForAbstractClass(); + $response = $this->getMockBuilder('\Magento\Framework\App\ResponseInterface') + ->disableOriginalConstructor() + ->setMethods([]) + ->getMockForAbstractClass(); + $contextMock = $this->getMock('\Magento\Framework\App\Action\Context', [], [], '', false); + $contextMock->expects($this->atLeastOnce()) + ->method('getRequest') + ->will($this->returnValue($request)); + $contextMock->expects($this->atLeastOnce()) + ->method('getResponse') + ->will($this->returnValue($response)); + $contextMock->expects($this->any())->method('getView')->willReturn($this->viewMock); + $methods = ['setTitle', 'getTitle', 'setSuccessUrl', 'setErrorUrl', 'setBackUrl', '__wakeUp']; + $this->addressFormMock = + $this->getMock('Magento\Customer\Block\Address\Edit', $methods, [], '', false); + $this->urlMock = $this->getMock('Magento\Framework\UrlInterface'); + $contextMock->expects($this->any())->method('getUrl')->willReturn($this->urlMock); + $this->pageMock = $this->getMock('Magento\Framework\View\Result\Page', [], [], '', false); + $this->pageMock->expects($this->any())->method('getConfig')->willReturn($this->configMock); + $this->configMock->expects($this->any())->method('getTitle')->willReturn($this->titleMock); + $this->viewMock->expects($this->any())->method('getPage')->willReturn($this->pageMock); + $this->controller = $objectManager->getObject('Magento\Multishipping\Controller\Checkout\Address\NewBilling', + ['context' => $contextMock]); + } + + public function testExecute() + { + $this->viewMock->expects($this->once())->method('loadLayout')->willReturnSelf(); + $this->viewMock->expects($this->any())->method('getLayout')->willReturn($this->layoutMock); + $this->layoutMock + ->expects($this->once()) + ->method('getBlock') + ->with('customer_address_edit') + ->willReturn($this->addressFormMock); + $this->addressFormMock + ->expects($this->once()) + ->method('setTitle') + ->with('Create Billing Address') + ->willReturnSelf(); + $helperMock = $this->getMock('Magento\Multishipping\Helper\Data', [], [], '', false); + $helperMock->expects($this->any())->method('__')->willReturn('Create Billing Address'); + $valueMap = [ + ['*/*/selectBilling', null, 'success/url'], + ['*/*/*', null, 'error/url'], + ]; + $this->urlMock->expects($this->any())->method('getUrl')->willReturnMap($valueMap); + $this->addressFormMock->expects($this->once())->method('setSuccessUrl')->with('success/url')->willReturnSelf(); + $this->addressFormMock->expects($this->once())->method('setErrorUrl')->with('error/url')->willReturnSelf(); + + $this->titleMock->expects($this->once())->method('getDefault')->willReturn('default_title'); + $this->addressFormMock->expects($this->once())->method('getTitle')->willReturn('Address title'); + $this->titleMock->expects($this->once())->method('set')->with('Address title - default_title'); + $this->addressFormMock->expects($this->once())->method('setBackUrl')->with('success/url'); + $this->viewMock->expects($this->once())->method('renderLayout'); + $this->controller->execute(); + } + + + public function testExecuteWhenCustomerAddressBlockNotExist() + { + $this->viewMock->expects($this->once())->method('loadLayout')->willReturnSelf(); + $this->viewMock->expects($this->any())->method('getLayout')->willReturn($this->layoutMock); + $this->layoutMock + ->expects($this->once()) + ->method('getBlock') + ->with('customer_address_edit'); + $this->urlMock->expects($this->never())->method('getUrl'); + $this->viewMock->expects($this->once())->method('renderLayout'); + $this->controller->execute(); + } +} diff --git a/dev/tests/unit/testsuite/Magento/Multishipping/Controller/Checkout/Address/NewShippingTest.php b/dev/tests/unit/testsuite/Magento/Multishipping/Controller/Checkout/Address/NewShippingTest.php new file mode 100644 index 0000000000000..a0e703c3e20cc --- /dev/null +++ b/dev/tests/unit/testsuite/Magento/Multishipping/Controller/Checkout/Address/NewShippingTest.php @@ -0,0 +1,184 @@ +configMock = $this->getMock('Magento\Framework\View\Page\Config', [], [], '', false); + $this->checkoutMock = + $this->getMock('Magento\Multishipping\Model\Checkout\Type\Multishipping', [], [], '', false); + $this->titleMock = $this->getMock('Magento\Framework\View\Page\Title', [], [], '', false); + $this->layoutMock = $this->getMock('Magento\Framework\View\Layout', [], [], '', false); + $this->viewMock = $this->getMock('Magento\Framework\App\ViewInterface'); + $this->objectManagerMock = $this->getMock('Magento\Framework\ObjectManagerInterface'); + $this->stateMock = + $this->getMock('Magento\Multishipping\Model\Checkout\Type\Multishipping\State', [], [], '', false); + $valueMap = [ + ['Magento\Multishipping\Model\Checkout\Type\Multishipping\State', $this->stateMock], + ['Magento\Multishipping\Model\Checkout\Type\Multishipping', $this->checkoutMock] + ]; + $this->objectManagerMock->expects($this->any())->method('get')->willReturnMap($valueMap); + $request = $this->getMockBuilder('\Magento\Framework\App\RequestInterface') + ->disableOriginalConstructor() + ->setMethods([]) + ->getMockForAbstractClass(); + $response = $this->getMockBuilder('\Magento\Framework\App\ResponseInterface') + ->disableOriginalConstructor() + ->setMethods([]) + ->getMockForAbstractClass(); + $contextMock = $this->getMock('\Magento\Framework\App\Action\Context', [], [], '', false); + $contextMock->expects($this->atLeastOnce()) + ->method('getRequest') + ->will($this->returnValue($request)); + $contextMock->expects($this->atLeastOnce()) + ->method('getResponse') + ->will($this->returnValue($response)); + $contextMock->expects($this->any())->method('getView')->willReturn($this->viewMock); + $contextMock->expects($this->any())->method('getObjectManager')->willReturn($this->objectManagerMock); + $methods = ['setTitle', 'getTitle', 'setSuccessUrl', 'setBackUrl', 'setErrorUrl', '__wakeUp']; + $this->addressFormMock = + $this->getMock('Magento\Customer\Block\Address\Edit', $methods, [], '', false); + $this->urlMock = $this->getMock('Magento\Framework\UrlInterface'); + $contextMock->expects($this->any())->method('getUrl')->willReturn($this->urlMock); + $this->pageMock = $this->getMock('Magento\Framework\View\Result\Page', [], [], '', false); + $this->pageMock->expects($this->any())->method('getConfig')->willReturn($this->configMock); + $this->configMock->expects($this->any())->method('getTitle')->willReturn($this->titleMock); + $this->viewMock->expects($this->any())->method('getPage')->willReturn($this->pageMock); + $this->controller = $objectManager->getObject('Magento\Multishipping\Controller\Checkout\Address\NewShipping', + ['context' => $contextMock]); + } + + /** + * @param string $backUrl + * @param string $shippingAddress + * @param string $url + * @dataProvider executeDataProvider + */ + public function testExecute($backUrl, $shippingAddress, $url) + { + $this->stateMock + ->expects($this->once()) + ->method('setActiveStep') + ->with(\Magento\Multishipping\Model\Checkout\Type\Multishipping\State::STEP_SELECT_ADDRESSES); + $this->viewMock->expects($this->once())->method('loadLayout')->willReturnSelf(); + $this->viewMock->expects($this->any())->method('getLayout')->willReturn($this->layoutMock); + $this->layoutMock + ->expects($this->once()) + ->method('getBlock') + ->with('customer_address_edit') + ->willReturn($this->addressFormMock); + $this->addressFormMock + ->expects($this->once()) + ->method('setTitle') + ->with('Create Shipping Address') + ->willReturnSelf(); + $helperMock = $this->getMock('Magento\Multishipping\Helper\Data', [], [], '', false); + $helperMock->expects($this->any())->method('__')->willReturn('Create Shipping Address'); + $this->addressFormMock->expects($this->once())->method('setSuccessUrl')->with('success/url')->willReturnSelf(); + $this->addressFormMock->expects($this->once())->method('setErrorUrl')->with('error/url')->willReturnSelf(); + $valueMap = [ + ['*/*/shippingSaved', null, 'success/url'], + ['*/*/*', null, 'error/url'], + [$backUrl, null, $url] + ]; + $this->urlMock->expects($this->any())->method('getUrl')->willReturnMap($valueMap); + $this->titleMock->expects($this->once())->method('getDefault')->willReturn('default_title'); + $this->addressFormMock->expects($this->once())->method('getTitle')->willReturn('Address title'); + $this->titleMock->expects($this->once())->method('set')->with('Address title - default_title'); + $this->checkoutMock + ->expects($this->once()) + ->method('getCustomerDefaultShippingAddress') + ->willReturn($shippingAddress); + $this->addressFormMock->expects($this->once())->method('setBackUrl')->with($url); + $this->viewMock->expects($this->once())->method('renderLayout'); + $this->controller->execute(); + } + + public function executeDataProvider() + { + return [ + 'shipping_address_exists' => ['*/checkout/addresses', 'shipping_address', 'back/address'], + 'shipping_address_not_exist' => ['*/cart/', null, 'back/cart'] + ]; + } + + + public function testExecuteWhenCustomerAddressBlockNotExist() + { + $this->stateMock + ->expects($this->once()) + ->method('setActiveStep') + ->with(\Magento\Multishipping\Model\Checkout\Type\Multishipping\State::STEP_SELECT_ADDRESSES); + $this->viewMock->expects($this->once())->method('loadLayout')->willReturnSelf(); + $this->viewMock->expects($this->any())->method('getLayout')->willReturn($this->layoutMock); + $this->layoutMock + ->expects($this->once()) + ->method('getBlock') + ->with('customer_address_edit'); + $this->urlMock->expects($this->never())->method('getUrl'); + $this->viewMock->expects($this->once())->method('renderLayout'); + $this->controller->execute(); + } +} diff --git a/dev/tests/unit/testsuite/Magento/Multishipping/Controller/Checkout/Address/ShippingSavedTest.php b/dev/tests/unit/testsuite/Magento/Multishipping/Controller/Checkout/Address/ShippingSavedTest.php new file mode 100644 index 0000000000000..28136ff1454f6 --- /dev/null +++ b/dev/tests/unit/testsuite/Magento/Multishipping/Controller/Checkout/Address/ShippingSavedTest.php @@ -0,0 +1,149 @@ +checkoutMock = $this->getMock( + 'Magento\Multishipping\Model\Checkout\Type\Multishipping', + [], + [], + '', + false + ); + $this->objectManagerMock = $this->getMock('Magento\Framework\ObjectManagerInterface'); + $this->objectManagerMock->expects($this->any()) + ->method('get') + ->with('Magento\Multishipping\Model\Checkout\Type\Multishipping') + ->willReturn($this->checkoutMock); + $this->contextMock = $this->getMock('Magento\Framework\App\Action\Context', [], [], '', false); + $requestMock = $this->getMock('Magento\Framework\App\RequestInterface'); + $responseMock = $this->getMock('Magento\Framework\App\ResponseInterface'); + $this->redirectMock = $this->getMock('Magento\Framework\App\Response\RedirectInterface'); + $this->contextMock->expects($this->any())->method('getObjectManager')->willReturn($this->objectManagerMock); + $this->contextMock->expects($this->any())->method('getRequest')->willReturn($requestMock); + $this->contextMock->expects($this->any())->method('getResponse')->willReturn($responseMock); + $this->contextMock->expects($this->any())->method('getRedirect')->willReturn($this->redirectMock); + + $this->addressRepositoryMock = $this->getMock('Magento\Customer\Api\AddressRepositoryInterface'); + $this->filterBuilderMock = $this->getMock('Magento\Framework\Api\FilterBuilder', [], [], '', false); + $this->criteriaBuilderMock = $this->getMock('Magento\Framework\Api\SearchCriteriaBuilder', [], [], '', false); + $this->controller = new ShippingSaved( + $this->contextMock, + $this->addressRepositoryMock, + $this->filterBuilderMock, + $this->criteriaBuilderMock + ); + } + + public function testExecuteResetsCheckoutIfCustomerHasAddedNewShippingAddressAndItIsTheOnlyAddressHeHas() + { + $customerId = 1; + $customerMock = $this->getMock('Magento\Customer\Api\Data\CustomerInterface'); + $customerMock->expects($this->any())->method('getId')->willReturn($customerId); + $this->checkoutMock->expects($this->any())->method('getCustomer')->willReturn($customerMock); + + $this->mockCustomerAddressRepository( + $customerId, + [$this->getMock('Magento\Customer\Api\Data\AddressInterface')] + ); + + // check that checkout is reset + $this->checkoutMock->expects($this->once())->method('reset'); + $this->controller->execute(); + } + + public function testExecuteDoesNotResetCheckoutIfCustomerHasMoreThanOneAddress() + { + $customerId = 1; + $customerMock = $this->getMock('Magento\Customer\Api\Data\CustomerInterface'); + $customerMock->expects($this->any())->method('getId')->willReturn($customerId); + $this->checkoutMock->expects($this->any())->method('getCustomer')->willReturn($customerMock); + + $this->mockCustomerAddressRepository( + $customerId, + [ + $this->getMock('Magento\Customer\Api\Data\AddressInterface'), + $this->getMock('Magento\Customer\Api\Data\AddressInterface'), + ] + ); + + // check that checkout is not reset + $this->checkoutMock->expects($this->never())->method('reset'); + $this->controller->execute(); + } + + /** + * Mock customer address repository + * + * @param int $customerId + * @param array $addresses list of customer addresses + */ + private function mockCustomerAddressRepository($customerId, array $addresses) + { + $filterMock = $this->getMock('Magento\Framework\Api\Filter', [], [], '', false); + $this->filterBuilderMock->expects($this->once())->method('setField')->with('parent_id')->willReturnSelf(); + $this->filterBuilderMock->expects($this->once())->method('setValue')->with($customerId)->willReturnSelf(); + $this->filterBuilderMock->expects($this->once())->method('setConditionType')->with('eq')->willReturnSelf(); + $this->filterBuilderMock->expects($this->once())->method('create')->willReturn($filterMock); + + $searchCriteriaMock = $this->getMock('Magento\Framework\Api\SearchCriteria', [], [], '', false); + $this->criteriaBuilderMock->expects($this->once())->method('addFilter')->with([$filterMock])->willReturnSelf(); + $this->criteriaBuilderMock->expects($this->once())->method('create')->willReturn($searchCriteriaMock); + + $searchResultMock = $this->getMock('Magento\Customer\Api\Data\AddressSearchResultsInterface'); + $this->addressRepositoryMock->expects($this->once()) + ->method('getList') + ->with($searchCriteriaMock) + ->willReturn($searchResultMock); + + $searchResultMock->expects($this->once())->method('getItems')->willReturn($addresses); + } +} diff --git a/dev/tests/unit/testsuite/Magento/Ogone/Model/ApiTest.php b/dev/tests/unit/testsuite/Magento/Ogone/Model/ApiTest.php deleted file mode 100644 index a9caa901e08a5..0000000000000 --- a/dev/tests/unit/testsuite/Magento/Ogone/Model/ApiTest.php +++ /dev/null @@ -1,47 +0,0 @@ -getMock('Magento\Store\Model\StoreManagerInterface', [], [], '', false); - $localeResolver = $this->getMock('\Magento\Framework\Locale\ResolverInterface', [], [], '', false); - $urlBuilder = $this->getMock('Magento\Framework\UrlInterface', [], [], '', false); - $eventManager = $this->getMock('Magento\Framework\Event\ManagerInterface', [], [], '', false); - $string = $this->getMock('\Magento\Framework\Stdlib\String', [], [], '', false); - $config = $this->getMock('Magento\Ogone\Model\Config', [], [], '', false); - $paymentDataMock = $this->getMock('Magento\Payment\Helper\Data', [], [], '', false); - $scopeConfig = $this->getMock('Magento\Framework\App\Config\ScopeConfigInterface'); - $loggerFactory = $this->getMock('\Magento\Framework\Logger\AdapterFactory', [], [], '', false); - $object = new \Magento\Ogone\Model\Api( - $eventManager, - $paymentDataMock, - $scopeConfig, - $loggerFactory, - $storeManager, - $localeResolver, - $urlBuilder, - $string, - $config - ); - - $method = new \ReflectionMethod('Magento\Ogone\Model\Api', '_translate'); - $method->setAccessible(true); - - $result = $method->invoke($object, $sourceString); - $this->assertEquals('Ë£', $result); - } -} diff --git a/dev/tests/unit/testsuite/Magento/Ogone/Model/ConfigTest.php b/dev/tests/unit/testsuite/Magento/Ogone/Model/ConfigTest.php deleted file mode 100644 index fde5cf7bba8b0..0000000000000 --- a/dev/tests/unit/testsuite/Magento/Ogone/Model/ConfigTest.php +++ /dev/null @@ -1,45 +0,0 @@ -_scopeConfig = $this->getMock('\Magento\Framework\App\Config\ScopeConfigInterface', [], [], '', false); - $helper = new \Magento\TestFramework\Helper\ObjectManager($this); - $this->_model = $helper->getObject('Magento\Ogone\Model\Config', [ - 'scopeConfig' => $this->_scopeConfig - ]); - } - - public function testGetShaInCode() - { - $this->_scopeConfig->expects($this->any())->method('getValue')->with('payment/ogone/secret_key_in')->will( - $this->returnValue(self::EXPECTED_VALUE) - ); - $this->assertEquals(self::EXPECTED_VALUE, $this->_model->getShaInCode()); - } - - public function testGetShaOutCode() - { - $this->_scopeConfig->expects($this->any())->method('getValue')->with('payment/ogone/secret_key_out')->will( - $this->returnValue(self::EXPECTED_VALUE) - ); - $this->assertEquals(self::EXPECTED_VALUE, $this->_model->getShaOutCode()); - } -} diff --git a/dev/tests/unit/testsuite/Magento/Paypal/Block/Adminhtml/Store/SwitcherPluginTest.php b/dev/tests/unit/testsuite/Magento/Paypal/Block/Adminhtml/Store/SwitcherPluginTest.php deleted file mode 100644 index 334f6181d64a7..0000000000000 --- a/dev/tests/unit/testsuite/Magento/Paypal/Block/Adminhtml/Store/SwitcherPluginTest.php +++ /dev/null @@ -1,46 +0,0 @@ -_model = new SwitcherPlugin(); - } - - /** - * @param null|string $countryParam - * @param array $getUrlParams - * @dataProvider aroundGetUrlDataProvider - */ - public function testAroundGetUrl($countryParam, $getUrlParams) - { - $subjectRequest = $this->getMockForAbstractClass('Magento\Framework\App\RequestInterface'); - $subjectRequest->expects($this->once()) - ->method('getParam') - ->with(\Magento\Paypal\Model\Config\StructurePlugin::REQUEST_PARAM_COUNTRY) - ->will($this->returnValue($countryParam)); - $subject = $this->getMock('Magento\Backend\Block\Store\Switcher', ['getRequest'], [], '', false); - $subject->expects($this->any())->method('getRequest')->will($this->returnValue($subjectRequest)); - $getUrl = function ($route, $params) { - return [$route, $params]; - }; - $this->assertEquals(['', $getUrlParams], $this->_model->aroundGetUrl($subject, $getUrl, '', [])); - } - - public function aroundGetUrlDataProvider() - { - return [ - ['any value', [\Magento\Paypal\Model\Config\StructurePlugin::REQUEST_PARAM_COUNTRY => null]], - [null, []] - ]; - } -} diff --git a/dev/tests/unit/testsuite/Magento/Paypal/Block/Adminhtml/System/Config/Field/CountryTest.php b/dev/tests/unit/testsuite/Magento/Paypal/Block/Adminhtml/System/Config/Field/CountryTest.php deleted file mode 100644 index 481463c7b8203..0000000000000 --- a/dev/tests/unit/testsuite/Magento/Paypal/Block/Adminhtml/System/Config/Field/CountryTest.php +++ /dev/null @@ -1,128 +0,0 @@ -_element = $this->getMockForAbstractClass( - 'Magento\Framework\Data\Form\Element\AbstractElement', - [], - '', - false, - true, - true, - ['getHtmlId', 'getElementHtml', 'getName'] - ); - $this->_element->expects($this->any()) - ->method('getHtmlId') - ->will($this->returnValue('html id')); - $this->_element->expects($this->any()) - ->method('getElementHtml') - ->will($this->returnValue('element html')); - $this->_element->expects($this->any()) - ->method('getName') - ->will($this->returnValue('name')); - $this->_request = $this->getMockForAbstractClass('Magento\Framework\App\RequestInterface'); - $this->_jsHelper = $this->getMock('Magento\Framework\View\Helper\Js', [], [], '', false); - $this->_url = $this->getMock('Magento\Backend\Model\Url', [], [], '', false); - $this->_model = $helper->getObject( - 'Magento\Paypal\Block\Adminhtml\System\Config\Field\Country', - ['request' => $this->_request, 'jsHelper' => $this->_jsHelper, 'url' => $this->_url] - ); - } - - /** - * @param null|string $requestCountry - * @param null|string $requestDefaultCountry - * @param bool $canUseDefault - * @param bool $inherit - * @dataProvider renderDataProvider - */ - public function testRender($requestCountry, $requestDefaultCountry, $canUseDefault, $inherit) - { - $this->_request->expects($this->any()) - ->method('getParam') - ->will($this->returnCallback(function ($param) use ($requestCountry, $requestDefaultCountry) { - if ($param == \Magento\Paypal\Model\Config\StructurePlugin::REQUEST_PARAM_COUNTRY) { - return $requestCountry; - } - if ($param == Country::REQUEST_PARAM_DEFAULT_COUNTRY) { - return $requestDefaultCountry; - } - return $param; - })); - $this->_element->setInherit($inherit); - $this->_element->setCanUseDefaultValue($canUseDefault); - $constraints = [ - new \PHPUnit_Framework_Constraint_StringContains('document.observe("dom:loaded", function() {'), - new \PHPUnit_Framework_Constraint_StringContains( - '$("' . $this->_element->getHtmlId() . '").observe("change", function () {' - ), - ]; - if ($canUseDefault && ($requestCountry == 'US') && $requestDefaultCountry) { - $constraints[] = new \PHPUnit_Framework_Constraint_StringContains( - '$("' . $this->_element->getHtmlId() . '_inherit").observe("click", function () {' - ); - } - $this->_jsHelper->expects($this->once()) - ->method('getScript') - ->with(new \PHPUnit_Framework_Constraint_And($constraints)); - $this->_url->expects($this->once()) - ->method('getUrl') - ->with( - '*/*/*', - [ - 'section' => 'section', - 'website' => 'website', - 'store' => 'store', - \Magento\Paypal\Model\Config\StructurePlugin::REQUEST_PARAM_COUNTRY => '__country__' - ] - ); - $this->_model->render($this->_element); - } - - public function renderDataProvider() - { - return [ - [null, null, false, false], - [null, null, true, true], - [null, null, true, false], - ['IT', null, true, false], - ['IT', null, true, true], - ['IT', 'GB', true, false], - ['US', 'GB', true, true], - ['US', 'GB', true, false], - ['US', null, true, false], - ]; - } -} diff --git a/dev/tests/unit/testsuite/Magento/Paypal/Block/Adminhtml/System/Config/Fieldset/GroupTest.php b/dev/tests/unit/testsuite/Magento/Paypal/Block/Adminhtml/System/Config/Fieldset/GroupTest.php deleted file mode 100644 index 677bbb54b584b..0000000000000 --- a/dev/tests/unit/testsuite/Magento/Paypal/Block/Adminhtml/System/Config/Fieldset/GroupTest.php +++ /dev/null @@ -1,102 +0,0 @@ -_group = $this->getMock('Magento\Backend\Model\Config\Structure\Element\Group', [], [], '', false); - $this->_element = $this->getMockForAbstractClass( - 'Magento\Framework\Data\Form\Element\AbstractElement', - [], - '', - false, - true, - true, - ['getHtmlId', 'getElementHtml', 'getName', 'getElements', 'getId'] - ); - $this->_element->expects($this->any()) - ->method('getHtmlId') - ->will($this->returnValue('html id')); - $this->_element->expects($this->any()) - ->method('getElementHtml') - ->will($this->returnValue('element html')); - $this->_element->expects($this->any()) - ->method('getName') - ->will($this->returnValue('name')); - $this->_element->expects($this->any()) - ->method('getElements') - ->will($this->returnValue([])); - $this->_element->expects($this->any()) - ->method('getId') - ->will($this->returnValue('id')); - $this->_user = $this->getMock('Magento\User\Model\User', [], [], '', false); - $this->_authSession = $this->getMock('Magento\Backend\Model\Auth\Session', [], [], '', false); - $this->_authSession->expects($this->any()) - ->method('__call') - ->with('getUser') - ->will($this->returnValue($this->_user)); - $this->_model = $helper->getObject( - 'Magento\Paypal\Block\Adminhtml\System\Config\Fieldset\Group', - ['authSession' => $this->_authSession] - ); - $this->_model->setGroup($this->_group); - } - - /** - * @param mixed $expanded - * @param int $expected - * @dataProvider isCollapseStateDataProvider - */ - public function testIsCollapseState($expanded, $expected) - { - $this->_user->setExtra(['configState' => []]); - $this->_element->setGroup(isset($expanded) ? ['expanded' => $expanded] : []); - $html = $this->_model->render($this->_element); - $this->assertContains( - '', - $html - ); - } - - public function isCollapseStateDataProvider() - { - return [ - [null, 0], - [false, 0], - ['', 0], - [1, 1], - ['1', 1], - ]; - } -} diff --git a/dev/tests/unit/testsuite/Magento/Paypal/Block/Adminhtml/System/Config/Fieldset/PaymentTest.php b/dev/tests/unit/testsuite/Magento/Paypal/Block/Adminhtml/System/Config/Fieldset/PaymentTest.php deleted file mode 100644 index a5edc0f2a73a9..0000000000000 --- a/dev/tests/unit/testsuite/Magento/Paypal/Block/Adminhtml/System/Config/Fieldset/PaymentTest.php +++ /dev/null @@ -1,125 +0,0 @@ -_group = $this->getMock('Magento\Backend\Model\Config\Structure\Element\Group', [], [], '', false); - $this->_element = $this->getMockForAbstractClass( - 'Magento\Framework\Data\Form\Element\AbstractElement', - [], - '', - false, - true, - true, - ['getHtmlId', 'getElementHtml', 'getName', 'getElements', 'getId'] - ); - $this->_element->expects($this->any()) - ->method('getHtmlId') - ->will($this->returnValue('html id')); - $this->_element->expects($this->any()) - ->method('getElementHtml') - ->will($this->returnValue('element html')); - $this->_element->expects($this->any()) - ->method('getName') - ->will($this->returnValue('name')); - $this->_element->expects($this->any()) - ->method('getElements') - ->will($this->returnValue([])); - $this->_element->expects($this->any()) - ->method('getId') - ->will($this->returnValue('id')); - $this->_backendConfig = $this->getMock('Magento\Backend\Model\Config', [], [], '', false); - $this->_model = $helper->getObject( - 'Magento\Paypal\Block\Adminhtml\System\Config\Fieldset\Payment', - ['backendConfig' => $this->_backendConfig] - ); - $this->_model->setGroup($this->_group); - } - - /** - * @dataProvider isPaymentEnabledDataProvider - */ - public function testIsPaymentEnabled($groupConfig, $expected) - { - $this->_element->setGroup($groupConfig); - $this->_backendConfig->expects($this->any()) - ->method('getConfigDataValue') - ->will($this->returnValueMap( - [[self::CONFIG_PATH_ACTIVE, null, null, '1'], [self::CONFIG_PATH_NOT_ACTIVE, null, null, '0']] - )); - $html = $this->_model->render($this->_element); - $this->assertContains($expected, $html); - } - - public function isPaymentEnabledDataProvider() - { - return [ - [[], ' class="section-config with-button">'], - [['fieldset_css' => 'any-css'], ' class="section-config any-css with-button">'], - [['activity_path' => self::CONFIG_PATH_ACTIVE], ' class="section-config with-button enabled">'], - [['activity_path' => self::CONFIG_PATH_NOT_ACTIVE], ' class="section-config with-button">'], - [['activity_path' => [self::CONFIG_PATH_ACTIVE]], ' class="section-config with-button enabled">'], - [['activity_path' => [self::CONFIG_PATH_NOT_ACTIVE]], ' class="section-config with-button">'], - [ - ['activity_path' => [self::CONFIG_PATH_ACTIVE, self::CONFIG_PATH_NOT_ACTIVE]], - ' class="section-config with-button enabled">' - ], - [ - ['activity_path' => self::CONFIG_PATH_ACTIVE, 'fieldset_css' => 'any-css'], - ' class="section-config any-css with-button enabled">' - ], - [ - ['activity_path' => self::CONFIG_PATH_NOT_ACTIVE, 'fieldset_css' => 'any-css'], - ' class="section-config any-css with-button">' - ], - [ - ['activity_path' => [self::CONFIG_PATH_ACTIVE], 'fieldset_css' => 'any-css'], - ' class="section-config any-css with-button enabled">' - ], - [ - ['activity_path' => [self::CONFIG_PATH_NOT_ACTIVE], 'fieldset_css' => 'any-css'], - ' class="section-config any-css with-button">' - ], - [ - [ - 'activity_path' => [self::CONFIG_PATH_ACTIVE, self::CONFIG_PATH_NOT_ACTIVE], - 'fieldset_css' => 'any-css', - ], - ' class="section-config any-css with-button enabled">' - ], - ]; - } -} diff --git a/dev/tests/unit/testsuite/Magento/Paypal/Block/Billing/Agreement/ViewTest.php b/dev/tests/unit/testsuite/Magento/Paypal/Block/Billing/Agreement/ViewTest.php deleted file mode 100644 index e74c5d4e6d42f..0000000000000 --- a/dev/tests/unit/testsuite/Magento/Paypal/Block/Billing/Agreement/ViewTest.php +++ /dev/null @@ -1,84 +0,0 @@ -orderCollectionFactory = $this->getMock( - 'Magento\Sales\Model\Resource\Order\CollectionFactory', - ['create'], - [], - '', - false - ); - $this->orderConfig = $this->getMock('Magento\Sales\Model\Order\Config', [], [], '', false); - - $this->block = $objectManager->getObject( - 'Magento\Paypal\Block\Billing\Agreement\View', - [ - 'orderCollectionFactory' => $this->orderCollectionFactory, - 'orderConfig' => $this->orderConfig, - ] - ); - } - - public function testGetRelatedOrders() - { - $visibleStatuses = []; - - $orderCollection = $this->getMock( - 'Magento\Sales\Model\Resource\Order\Collection', - ['addFieldToSelect', 'addFieldToFilter', 'setOrder'], - [], - '', - false - ); - $orderCollection->expects($this->at(0)) - ->method('addFieldToSelect') - ->will($this->returnValue($orderCollection)); - $orderCollection->expects($this->at(1)) - ->method('addFieldToFilter') - ->will($this->returnValue($orderCollection)); - $orderCollection->expects($this->at(2)) - ->method('addFieldToFilter') - ->with('status', ['in' => $visibleStatuses]) - ->will($this->returnValue($orderCollection)); - $orderCollection->expects($this->at(3)) - ->method('setOrder') - ->will($this->returnValue($orderCollection)); - - $this->orderCollectionFactory->expects($this->once()) - ->method('create') - ->will($this->returnValue($orderCollection)); - $this->orderConfig->expects($this->once()) - ->method('getVisibleOnFrontStatuses') - ->will($this->returnValue($visibleStatuses)); - - $this->block->getRelatedOrders(); - } -} diff --git a/dev/tests/unit/testsuite/Magento/Paypal/Block/Bml/ShortcutTest.php b/dev/tests/unit/testsuite/Magento/Paypal/Block/Bml/ShortcutTest.php deleted file mode 100644 index e4a3aff9f45cd..0000000000000 --- a/dev/tests/unit/testsuite/Magento/Paypal/Block/Bml/ShortcutTest.php +++ /dev/null @@ -1,126 +0,0 @@ -paymentHelperMock = $this->getMock('Magento\Payment\Helper\Data', [], [], '', false); - $this->randomMock = $this->getMock('Magento\Framework\Math\Random'); - $this->paypalShortcutHelperMock = $this->getMock('Magento\Paypal\Helper\Shortcut\ValidatorInterface'); - - $this->objectManagerHelper = new ObjectManagerHelper($this); - $this->shortcut = $this->objectManagerHelper->getObject( - 'Magento\Paypal\Block\Bml\Shortcut', - [ - 'paymentData' => $this->paymentHelperMock, - 'mathRandom' => $this->randomMock, - 'shortcutValidator' => $this->paypalShortcutHelperMock, - ] - ); - } - - public function testIsOrPositionBefore() - { - $this->assertFalse($this->shortcut->isOrPositionBefore()); - $this->shortcut->setShowOrPosition(CatalogBlock\ShortcutButtons::POSITION_BEFORE); - $this->assertTrue($this->shortcut->isOrPositionBefore()); - } - - public function testIsOrPositionAfter() - { - $this->assertFalse($this->shortcut->isOrPositionAfter()); - $this->shortcut->setShowOrPosition(CatalogBlock\ShortcutButtons::POSITION_AFTER); - $this->assertTrue($this->shortcut->isOrPositionAfter()); - } - - public function testGetAlias() - { - $this->assertEmpty($this->shortcut->getAlias()); - } - - public function testToHtmlWrongValidation() - { - $isInCatalog = true; - $paymentMethodCode = ''; - $this->shortcut->setIsInCatalogProduct($isInCatalog); - - $this->paypalShortcutHelperMock->expects($this->once())->method('validate') - ->with($paymentMethodCode, $isInCatalog)->will($this->returnValue(false)); - - $this->assertEmpty($this->shortcut->toHtml()); - } - - public function testToHtmlMethodNotAvailable() - { - $isInCatalog = true; - $paymentMethodCode = ''; - $bmlMethodCode = ''; - $this->shortcut->setIsInCatalogProduct($isInCatalog); - $expressMethod = $this->getMockBuilder('Magento\Paypal\Model\Express')->disableOriginalConstructor() - ->setMethods([])->getMock(); - - $this->paypalShortcutHelperMock->expects($this->once())->method('validate') - ->with($paymentMethodCode, $isInCatalog)->will($this->returnValue(true)); - $this->paymentHelperMock->expects($this->once())->method('getMethodInstance')->with($bmlMethodCode) - ->will($this->returnValue($expressMethod)); - $expressMethod->expects($this->once())->method('isAvailable')->will($this->returnValue(false)); - - $this->assertEmpty($this->shortcut->toHtml()); - } - - public function testToHtmlMethodSetBmlData() - { - $isInCatalog = true; - $paymentMethodCode = ''; - $bmlMethodCode = ''; - $hash = 'hash'; - $this->shortcut->setIsInCatalogProduct($isInCatalog); - $expressMethod = $this->getMockBuilder('Magento\Paypal\Model\Express')->disableOriginalConstructor() - ->setMethods([])->getMock(); - $expectedData = [ - 'is_in_catalog_product' => $isInCatalog, - 'shortcut_html_id' => $hash, - 'checkout_url' => null, - 'image_url' => 'https://www.paypalobjects.com/webstatic/en_US/btn/btn_bml_SM.png', - 'additional_link_image' => [ - 'href' => 'https://www.securecheckout.billmelater.com/paycapture-content/' - . 'fetch?hash=AU826TU8&content=/bmlweb/ppwpsiw.html', - 'src' => 'https://www.paypalobjects.com/webstatic/en_US/btn/btn_bml_text.png', - ], - ]; - - $this->paypalShortcutHelperMock->expects($this->once())->method('validate') - ->with($paymentMethodCode, $isInCatalog)->will($this->returnValue(true)); - $this->paymentHelperMock->expects($this->once())->method('getMethodInstance')->with($bmlMethodCode) - ->will($this->returnValue($expressMethod)); - $expressMethod->expects($this->once())->method('isAvailable')->will($this->returnValue(true)); - $this->randomMock->expects($this->once())->method('getUniqueHash')->with('ec_shortcut_bml_') - ->will($this->returnValue($hash)); - - $this->assertEmpty($this->shortcut->toHtml()); - $this->assertContains($expectedData, $this->shortcut->getData()); - } -} diff --git a/dev/tests/unit/testsuite/Magento/Paypal/Block/Express/FormTest.php b/dev/tests/unit/testsuite/Magento/Paypal/Block/Express/FormTest.php deleted file mode 100644 index e0d4b58191dfd..0000000000000 --- a/dev/tests/unit/testsuite/Magento/Paypal/Block/Express/FormTest.php +++ /dev/null @@ -1,95 +0,0 @@ -_paypalData = $this->getMock('Magento\Paypal\Helper\Data', [], [], '', false); - $this->_paypalConfig = $this->getMock('Magento\Paypal\Model\Config', [], [], '', false); - $this->_paypalConfig->expects($this->once()) - ->method('setMethod') - ->will($this->returnSelf()); - $paypalConfigFactory = $this->getMock('Magento\Paypal\Model\ConfigFactory', ['create'], [], '', false); - $paypalConfigFactory->expects($this->once())->method('create')->will($this->returnValue($this->_paypalConfig)); - $mark = $this->getMock('Magento\Framework\View\Element\Template', [], [], '', false); - $mark->expects($this->once())->method('setTemplate')->will($this->returnSelf()); - $mark->expects($this->any())->method('__call')->will($this->returnSelf()); - $layout = $this->getMockForAbstractClass('Magento\Framework\View\LayoutInterface'); - $layout->expects($this->once()) - ->method('createBlock') - ->with('Magento\Framework\View\Element\Template') - ->will($this->returnValue($mark)); - $this->currentCustomer = $this->getMockBuilder('\Magento\Customer\Helper\Session\CurrentCustomer') - ->disableOriginalConstructor() - ->getMock(); - - $localeResolver = $this->getMock( - 'Magento\Framework\Locale\ResolverInterface', - [], - [], - '', - false, - false - ); - $helper = new \Magento\TestFramework\Helper\ObjectManager($this); - $this->_model = $helper->getObject( - 'Magento\Paypal\Block\Express\Form', - [ - 'paypalData' => $this->_paypalData, - 'paypalConfigFactory' => $paypalConfigFactory, - 'currentCustomer' => $this->currentCustomer, - 'layout' => $layout, - 'localeResolver' => $localeResolver - ] - ); - } - - /** - * @param bool $ask - * @param string|null $expected - * @dataProvider getBillingAgreementCodeDataProvider - */ - public function testGetBillingAgreementCode($ask, $expected) - { - $this->currentCustomer->expects($this->once()) - ->method('getCustomerId') - ->will($this->returnValue('customer id')); - $this->_paypalData->expects($this->once()) - ->method('shouldAskToCreateBillingAgreement') - ->with($this->identicalTo($this->_paypalConfig), 'customer id') - ->will($this->returnValue($ask)); - $this->assertEquals($expected, $this->_model->getBillingAgreementCode()); - } - - public function getBillingAgreementCodeDataProvider() - { - return [ - [true, \Magento\Paypal\Model\Express\Checkout::PAYMENT_INFO_TRANSPORT_BILLING_AGREEMENT], - [false, null] - ]; - } -} diff --git a/dev/tests/unit/testsuite/Magento/Paypal/Block/Express/ReviewTest.php b/dev/tests/unit/testsuite/Magento/Paypal/Block/Express/ReviewTest.php deleted file mode 100644 index 6ccaf93c81755..0000000000000 --- a/dev/tests/unit/testsuite/Magento/Paypal/Block/Express/ReviewTest.php +++ /dev/null @@ -1,159 +0,0 @@ -getMock('Magento\Framework\View\LayoutInterface', [], [], '', false); - $eventManager = $this->getMock('Magento\Framework\Event\ManagerInterface', [], [], '', false); - $scopeConfig = $this->getMock('Magento\Framework\App\Config\ScopeConfigInterface', [], [], '', false); - - $scopeConfig->expects($this->any()) - ->method('getValue') - ->with( - $this->stringContains('advanced/modules_disable_output/'), - \Magento\Store\Model\ScopeInterface::SCOPE_STORE - )->will($this->returnValue(false)); - - $urlBuilder = $this->getMock('Magento\Framework\UrlInterface'); - $urlBuilder->expects($this->any())->method('getUrl')->will($this->returnArgument(0)); - - $context = $this->getMock( - 'Magento\Framework\View\Element\Template\Context', - ['getLayout', 'getEventManager', 'getScopeConfig', 'getRequest', 'getAssetRepository', 'getUrlBuilder'], - [], - '', - false - ); - - $this->request = $this->getMock('Magento\Framework\App\Request\Http', [], [], '', false); - $this->assetRepo = $this->getMock('Magento\Framework\View\Asset\Repository', [], [], '', false); - - $context->expects($this->any())->method('getLayout')->will($this->returnValue($layout)); - $context->expects($this->any())->method('getEventManager')->will($this->returnValue($eventManager)); - $context->expects($this->any())->method('getScopeConfig')->will($this->returnValue($scopeConfig)); - $context->expects($this->any())->method('getRequest')->will($this->returnValue($this->request)); - $context->expects($this->any())->method('getAssetRepository')->will($this->returnValue($this->assetRepo)); - $context->expects($this->any())->method('getUrlBuilder')->will($this->returnValue($urlBuilder)); - - $this->model = $helper->getObject('Magento\Paypal\Block\Express\Review', ['context' => $context]); - } - - /** - * @param bool $isSecure - * @dataProvider getViewFileUrlDataProvider - */ - public function testGetViewFileUrl($isSecure) - { - $this->request->expects($this->once())->method('isSecure')->will($this->returnValue($isSecure)); - $this->assetRepo->expects($this->once()) - ->method('getUrlWithParams') - ->with('some file', $this->callback(function ($value) use ($isSecure) { - return isset($value['_secure']) && $value['_secure'] === $isSecure; - })) - ->will($this->returnValue('result url')); - $this->assertEquals('result url', $this->model->getViewFileUrl('some file')); - } - - public function getViewFileUrlDataProvider() - { - return [[true], [false]]; - } - - public function testBeforeToHtmlWhenQuoteIsNotVirtual() - { - $quote = $this->_getQuoteMock(); - $quote->expects($this->any())->method('getIsVirtual')->will($this->returnValue(false)); - $quote->setMayEditShippingMethod('MayEditShippingMethod'); - - $shippingRate = new \Magento\Framework\Object(['code' => 'Rate 1']); - $shippingRates = [ - [$shippingRate], - ]; - $quote->getShippingAddress() - ->expects($this->any()) - ->method('getGroupedAllShippingRates') - ->will($this->returnValue($shippingRates)); - $quote->getShippingAddress() - ->expects($this->any()) - ->method('getShippingMethod') - ->will($this->returnValue($shippingRate->getCode())); - - $this->model->setQuote($quote); - $this->model->toHtml(); - - $this->assertEquals( - $this->model->getPaymentMethodTitle(), - $quote->getPayment()->getMethodInstance()->getTitle() - ); - $this->assertTrue($this->model->getShippingRateRequired()); - $this->assertSame($shippingRates, $this->model->getShippingRateGroups()); - $this->assertSame($shippingRate, $this->model->getCurrentShippingRate()); - $this->assertNotNull($this->model->getCanEditShippingAddress()); - $this->assertEquals($quote->getMayEditShippingMethod(), $this->model->getCanEditShippingMethod()); - $this->assertContains('paypal/express/saveShippingMethod', $this->model->getShippingMethodSubmitUrl()); - $this->assertContains('paypal/express/edit', $this->model->getEditUrl()); - $this->assertContains('paypal/express/placeOrder', $this->model->getPlaceOrderUrl()); - } - - public function testBeforeToHtmlWhenQuoteIsVirtual() - { - $quote = $this->_getQuoteMock(); - $quote->expects($this->any())->method('getIsVirtual')->will($this->returnValue(true)); - $this->model->setQuote($quote); - $this->model->toHtml(); - $this->assertEquals( - $this->model->getPaymentMethodTitle(), - $quote->getPayment()->getMethodInstance()->getTitle() - ); - $this->assertFalse($this->model->getShippingRateRequired()); - $this->assertContains('paypal/express/edit', $this->model->getEditUrl()); - $this->assertContains('paypal/express/placeOrder', $this->model->getPlaceOrderUrl()); - } - - /** - * Create mock of sales quote model - * - * @return \PHPUnit_Framework_MockObject_MockObject - */ - protected function _getQuoteMock() - { - $methodInstance = new \Magento\Framework\Object(['title' => 'Payment Method']); - $payment = $this->getMock('Magento\Sales\Model\Quote\Payment', [], [], '', false); - $payment->expects($this->any())->method('getMethodInstance')->will($this->returnValue($methodInstance)); - - $quote = $this->getMock('Magento\Sales\Model\Quote', [], [], '', false); - $quote->expects($this->any())->method('getPayment')->will($this->returnValue($payment)); - $quote->setPayment($payment); - - $address = $this->getMockBuilder('Magento\Sales\Model\Quote\Address') - ->disableOriginalConstructor() - ->setMethods(['getShippingMethod', 'getGroupedAllShippingRates', '__wakeup']) - ->getMock(); - $quote->expects($this->any())->method('getShippingAddress')->will($this->returnValue($address)); - - return $quote; - } -} diff --git a/dev/tests/unit/testsuite/Magento/Paypal/Block/Express/ShortcutTest.php b/dev/tests/unit/testsuite/Magento/Paypal/Block/Express/ShortcutTest.php deleted file mode 100644 index f18091af3492c..0000000000000 --- a/dev/tests/unit/testsuite/Magento/Paypal/Block/Express/ShortcutTest.php +++ /dev/null @@ -1,20 +0,0 @@ -getObject('Magento\Paypal\Block\Express\Shortcut', ['alias' => self::ALIAS]); - $this->assertEquals(self::ALIAS, $model->getAlias()); - } -} diff --git a/dev/tests/unit/testsuite/Magento/Paypal/Block/Payflow/Link/IframeTest.php b/dev/tests/unit/testsuite/Magento/Paypal/Block/Payflow/Link/IframeTest.php deleted file mode 100644 index 357145be3f8a8..0000000000000 --- a/dev/tests/unit/testsuite/Magento/Paypal/Block/Payflow/Link/IframeTest.php +++ /dev/null @@ -1,46 +0,0 @@ -getMock('Magento\Framework\View\Element\Template\Context', [], [], '', false); - $checkoutSessionMock = $this->getMock('Magento\Checkout\Model\Session', [], [], '', false); - $orderFactoryMock = $this->getMock('Magento\Sales\Model\OrderFactory', ['getQuote'], [], '', false); - $hssHelperMock = $this->getMock('Magento\Paypal\Helper\Hss', [], [], '', false); - $paymentDataMock = $this->getMock('Magento\Payment\Helper\Data', [], [], '', false); - $quoteMock = $this->getMock('Magento\Sales\Model\Quote', ['getPayment', '__wakeup'], [], '', false); - $paymentMock = $this->getMock('Magento\Sales\Model\Quote\Payment', [], [], '', false); - - $checkoutSessionMock->expects($this->any()) - ->method('getQuote') - ->will($this->returnValue($quoteMock)); - $quoteMock->expects($this->any()) - ->method('getPayment') - ->will($this->returnValue($paymentMock)); - $hssHelperMock->expects($this->any()) - ->method('getHssMethods') - ->will($this->returnValue([])); - - $block = new \Magento\Paypal\Block\Payflow\Advanced\Iframe( - $contextMock, - $orderFactoryMock, - $checkoutSessionMock, - $hssHelperMock, - $paymentDataMock - ); - - $this->assertFalse($block->isScopePrivate()); - } -} diff --git a/dev/tests/unit/testsuite/Magento/Paypal/Block/PayflowExpress/FormTest.php b/dev/tests/unit/testsuite/Magento/Paypal/Block/PayflowExpress/FormTest.php deleted file mode 100644 index 43fc7a9b93afc..0000000000000 --- a/dev/tests/unit/testsuite/Magento/Paypal/Block/PayflowExpress/FormTest.php +++ /dev/null @@ -1,67 +0,0 @@ -_paypalConfig = $this->getMock('Magento\Paypal\Model\Config', [], [], '', false); - $this->_paypalConfig->expects($this->once())->method('setMethod')->will($this->returnSelf()); - $paypalConfigFactory = $this->getMock( - 'Magento\Paypal\Model\ConfigFactory', - ['create'], - [], - '', - false - ); - $paypalConfigFactory->expects($this->once())->method('create')->will($this->returnValue($this->_paypalConfig)); - $mark = $this->getMock('Magento\Framework\View\Element\Template', [], [], '', false); - $mark->expects($this->once())->method('setTemplate')->will($this->returnSelf()); - $mark->expects($this->any())->method('__call')->will($this->returnSelf()); - $layout = $this->getMockForAbstractClass('Magento\Framework\View\LayoutInterface'); - $layout->expects( - $this->once() - )->method( - 'createBlock' - )->with( - 'Magento\Framework\View\Element\Template' - )->will( - $this->returnValue($mark) - ); - $localeResolver = $this->getMock( - 'Magento\Framework\Locale\ResolverInterface', - [], - [], - '', - false, - false - ); - $helper = new \Magento\TestFramework\Helper\ObjectManager($this); - $this->_model = $helper->getObject( - 'Magento\Paypal\Block\PayflowExpress\Form', - [ - 'paypalConfigFactory' => $paypalConfigFactory, - 'layout' => $layout, - 'localeResolver' => $localeResolver - ] - ); - } - - public function testGetBillingAgreementCode() - { - $this->assertFalse($this->_model->getBillingAgreementCode()); - } -} diff --git a/dev/tests/unit/testsuite/Magento/Paypal/Controller/Billing/Agreement/CancelTest.php b/dev/tests/unit/testsuite/Magento/Paypal/Controller/Billing/Agreement/CancelTest.php deleted file mode 100644 index d400b2101eb01..0000000000000 --- a/dev/tests/unit/testsuite/Magento/Paypal/Controller/Billing/Agreement/CancelTest.php +++ /dev/null @@ -1,157 +0,0 @@ -_session = $this->getMock('Magento\Customer\Model\Session', [], [], '', false); - - $this->_agreement = $this->getMock( - 'Magento\Paypal\Model\Billing\Agreement', - ['load', 'getId', 'getCustomerId', 'getReferenceId', 'canCancel', 'cancel', '__wakeup'], - [], - '', - false - ); - $this->_agreement->expects($this->once())->method('load')->with(15)->will($this->returnSelf()); - $this->_agreement->expects($this->once())->method('getId')->will($this->returnValue(15)); - $this->_agreement->expects($this->once())->method('getCustomerId')->will($this->returnValue(871)); - - $this->_objectManager = $this->getMock('Magento\Framework\ObjectManagerInterface'); - $this->_objectManager->expects( - $this->atLeastOnce() - )->method( - 'get' - )->will( - $this->returnValueMap([['Magento\Customer\Model\Session', $this->_session]]) - ); - $this->_objectManager->expects( - $this->once() - )->method( - 'create' - )->with( - 'Magento\Paypal\Model\Billing\Agreement' - )->will( - $this->returnValue($this->_agreement) - ); - - $this->_request = $this->getMock('Magento\Framework\App\RequestInterface'); - $this->_request->expects($this->once())->method('getParam')->with('agreement')->will($this->returnValue(15)); - - $response = $this->getMock('Magento\Framework\App\ResponseInterface'); - - $redirect = $this->getMock('Magento\Framework\App\Response\RedirectInterface'); - - $this->_messageManager = $this->getMock('Magento\Framework\Message\ManagerInterface'); - - $context = $this->getMock('Magento\Framework\App\Action\Context', [], [], '', false); - $context->expects($this->any())->method('getObjectManager')->will($this->returnValue($this->_objectManager)); - $context->expects($this->any())->method('getRequest')->will($this->returnValue($this->_request)); - $context->expects($this->any())->method('getResponse')->will($this->returnValue($response)); - $context->expects($this->any())->method('getRedirect')->will($this->returnValue($redirect)); - $context->expects($this->any())->method('getMessageManager')->will($this->returnValue($this->_messageManager)); - - $this->_registry = $this->getMock('Magento\Framework\Registry', [], [], '', false); - - $title = $this->getMock('Magento\Framework\App\Action\Title', [], [], '', false); - - $this->_controller = new Cancel($context, $this->_registry, $title); - } - - public function testExecuteActionSuccess() - { - $this->_agreement->expects($this->once())->method('getReferenceId')->will($this->returnValue('r15')); - $this->_agreement->expects($this->once())->method('canCancel')->will($this->returnValue(true)); - $this->_agreement->expects($this->once())->method('cancel'); - - $noticeMessage = 'The billing agreement "r15" has been canceled.'; - $this->_session->expects($this->once())->method('getCustomerId')->will($this->returnValue(871)); - $this->_messageManager->expects($this->once())->method('addNotice')->with($noticeMessage); - $this->_messageManager->expects($this->never())->method('addError'); - - $this->_registry->expects( - $this->once() - )->method( - 'register' - )->with( - 'current_billing_agreement', - $this->identicalTo($this->_agreement) - ); - - $this->_controller->execute(); - } - - public function testExecuteAgreementDoesNotBelongToCustomer() - { - $this->_agreement->expects($this->never())->method('canCancel'); - $this->_agreement->expects($this->never())->method('cancel'); - - $errorMessage = 'Please specify the correct billing agreement ID and try again.'; - $this->_session->expects($this->once())->method('getCustomerId')->will($this->returnValue(938)); - $this->_messageManager->expects($this->once())->method('addError')->with($errorMessage); - - $this->_registry->expects($this->never())->method('register'); - - $this->_controller->execute(); - } - - public function testExecuteAgreementStatusDoesNotAllowToCancel() - { - $this->_agreement->expects($this->once())->method('canCancel')->will($this->returnValue(false)); - $this->_agreement->expects($this->never())->method('cancel'); - - $this->_session->expects($this->once())->method('getCustomerId')->will($this->returnValue(871)); - $this->_messageManager->expects($this->never())->method('addNotice'); - $this->_messageManager->expects($this->never())->method('addError'); - - $this->_registry->expects( - $this->once() - )->method( - 'register' - )->with( - 'current_billing_agreement', - $this->identicalTo($this->_agreement) - ); - - $this->_controller->execute(); - } -} diff --git a/dev/tests/unit/testsuite/Magento/Paypal/Controller/Express/PlaceOrderTest.php b/dev/tests/unit/testsuite/Magento/Paypal/Controller/Express/PlaceOrderTest.php deleted file mode 100644 index 6ae0489d35d70..0000000000000 --- a/dev/tests/unit/testsuite/Magento/Paypal/Controller/Express/PlaceOrderTest.php +++ /dev/null @@ -1,154 +0,0 @@ -request->expects($this->once()) - ->method('getPost') - ->with('agreement', []) - ->will($this->returnValue([])); - } - $this->_expectRedirect(); - $this->model->execute(); - } - - /** - * @param string $path - */ - protected function _expectRedirect($path = '*/*/review') - { - $this->redirect->expects($this->once()) - ->method('redirect') - ->with($this->anything(), $path, []); - } - - public function trueFalseDataProvider() - { - return [[true], [false]]; - } - - /** - * @param int $code - * @param null|string $paymentAction - * @dataProvider executeProcessableExceptionDataProvider - */ - public function testExecuteProcessableException($code, $paymentAction = null) - { - $this->request->expects($this->once()) - ->method('getPost') - ->with('agreement', []) - ->will($this->returnValue([])); - $oldCallback = &$this->objectManagerCallback; - $this->objectManagerCallback = function ($className) use ($code, $oldCallback) { - $instance = call_user_func($oldCallback, $className); - if ($className == 'Magento\Checkout\Model\Agreements\AgreementsValidator') { - $exception = $this->getMock( - 'Magento\Paypal\Model\Api\ProcessableException', - ['getUserMessage'], - ['message', $code] - ); - $exception->expects($this->any()) - ->method('getUserMessage') - ->will($this->returnValue('User Message')); - $instance->expects($this->once()) - ->method('isValid') - ->will($this->throwException($exception)); - } - return $instance; - }; - if (isset($paymentAction)) { - $this->config->expects($this->once()) - ->method('getPaymentAction') - ->will($this->returnValue($paymentAction)); - } - $this->_expectErrorCodes($code, $paymentAction); - $this->model->execute(); - } - - public function executeProcessableExceptionDataProvider() - { - return [ - [\Magento\Paypal\Model\Api\ProcessableException::API_MAX_PAYMENT_ATTEMPTS_EXCEEDED], - [\Magento\Paypal\Model\Api\ProcessableException::API_TRANSACTION_EXPIRED], - [\Magento\Paypal\Model\Api\ProcessableException::API_DO_EXPRESS_CHECKOUT_FAIL], - [ - \Magento\Paypal\Model\Api\ProcessableException::API_UNABLE_TRANSACTION_COMPLETE, - \Magento\Payment\Model\Method\AbstractMethod::ACTION_ORDER - ], - [\Magento\Paypal\Model\Api\ProcessableException::API_UNABLE_TRANSACTION_COMPLETE, 'other'], - [999999], - ]; - } - - /** - * @param int $code - * @param null|string $paymentAction - */ - protected function _expectErrorCodes($code, $paymentAction) - { - $redirectUrl = 'redirect by test'; - if (in_array( - $code, - [ - \Magento\Paypal\Model\Api\ProcessableException::API_MAX_PAYMENT_ATTEMPTS_EXCEEDED, - \Magento\Paypal\Model\Api\ProcessableException::API_TRANSACTION_EXPIRED, - ] - ) - ) { - $payment = new \Magento\Framework\Object(['checkout_redirect_url' => $redirectUrl]); - $this->quote->expects($this->once()) - ->method('getPayment') - ->will($this->returnValue($payment)); - } - if ($code == \Magento\Paypal\Model\Api\ProcessableException::API_UNABLE_TRANSACTION_COMPLETE - && $paymentAction == \Magento\Payment\Model\Method\AbstractMethod::ACTION_ORDER - ) { - $this->config->expects($this->once()) - ->method('getExpressCheckoutOrderUrl') - ->will($this->returnValue($redirectUrl)); - } - if ($code == \Magento\Paypal\Model\Api\ProcessableException::API_DO_EXPRESS_CHECKOUT_FAIL - || $code == \Magento\Paypal\Model\Api\ProcessableException::API_UNABLE_TRANSACTION_COMPLETE - && $paymentAction != \Magento\Payment\Model\Method\AbstractMethod::ACTION_ORDER - ) { - $this->config->expects($this->once()) - ->method('getExpressCheckoutStartUrl') - ->will($this->returnValue($redirectUrl)); - $this->request->expects($this->once()) - ->method('getParam') - ->with('token'); - } - if (in_array( - $code, - [ - \Magento\Paypal\Model\Api\ProcessableException::API_MAX_PAYMENT_ATTEMPTS_EXCEEDED, - \Magento\Paypal\Model\Api\ProcessableException::API_TRANSACTION_EXPIRED, - \Magento\Paypal\Model\Api\ProcessableException::API_DO_EXPRESS_CHECKOUT_FAIL, - \Magento\Paypal\Model\Api\ProcessableException::API_UNABLE_TRANSACTION_COMPLETE, - ] - ) - ) { - $this->response->expects($this->once()) - ->method('setRedirect') - ->with($redirectUrl); - } else { - $this->messageManager->expects($this->once()) - ->method('addError') - ->with('User Message'); - $this->_expectRedirect('checkout/cart'); - } - } -} diff --git a/dev/tests/unit/testsuite/Magento/Paypal/Controller/Express/ReturnActionTest.php b/dev/tests/unit/testsuite/Magento/Paypal/Controller/Express/ReturnActionTest.php deleted file mode 100644 index 925508a70e590..0000000000000 --- a/dev/tests/unit/testsuite/Magento/Paypal/Controller/Express/ReturnActionTest.php +++ /dev/null @@ -1,70 +0,0 @@ -redirect->expects($this->once()) - ->method('redirect') - ->with($this->anything(), $path, []); - } - - public function testExecuteAuthorizationRetrial() - { - $this->request->expects($this->once()) - ->method('getParam') - ->with('retry_authorization') - ->will($this->returnValue('true')); - $this->checkoutSession->expects($this->once()) - ->method('__call') - ->with('getPaypalTransactionData') - ->will($this->returnValue(['any array'])); - $this->_expectForwardPlaceOrder(); - $this->model->execute(); - } - - public function trueFalseDataProvider() - { - return [[true], [false]]; - } - - /** - * @param bool $canSkipOrderReviewStep - * @dataProvider trueFalseDataProvider - */ - public function testExecute($canSkipOrderReviewStep) - { - $this->checkoutSession->expects($this->at(0)) - ->method('__call') - ->with('unsPaypalTransactionData'); - $this->checkout->expects($this->once()) - ->method('canSkipOrderReviewStep') - ->will($this->returnValue($canSkipOrderReviewStep)); - if ($canSkipOrderReviewStep) { - $this->_expectForwardPlaceOrder(); - } else { - $this->_expectRedirect(); - } - $this->model->execute(); - } - - private function _expectForwardPlaceOrder() - { - $this->request->expects($this->once()) - ->method('setActionName') - ->with('placeOrder'); - $this->request->expects($this->once()) - ->method('setDispatched') - ->with(false); - } -} diff --git a/dev/tests/unit/testsuite/Magento/Paypal/Controller/Express/StartTest.php b/dev/tests/unit/testsuite/Magento/Paypal/Controller/Express/StartTest.php deleted file mode 100644 index 5fcf5fce461c8..0000000000000 --- a/dev/tests/unit/testsuite/Magento/Paypal/Controller/Express/StartTest.php +++ /dev/null @@ -1,43 +0,0 @@ -request->expects($this->at(1)) - ->method('getParam') - ->with('bml') - ->will($this->returnValue($buttonParam)); - $this->checkout->expects($this->once()) - ->method('setIsBml') - ->with((bool)$buttonParam); - - $this->request->expects($this->at(2)) - ->method('getParam') - ->with(\Magento\Paypal\Model\Express\Checkout::PAYMENT_INFO_BUTTON) - ->will($this->returnValue($buttonParam)); - $this->customerData->expects($this->any()) - ->method('getId') - ->will($this->returnValue(1)); - $this->checkout->expects($this->once()) - ->method('start') - ->with($this->anything(), $this->anything(), (bool)$buttonParam); - $this->model->execute(); - } - - public function startActionDataProvider() - { - return [['1'], [null]]; - } -} diff --git a/dev/tests/unit/testsuite/Magento/Paypal/Controller/ExpressTest.php b/dev/tests/unit/testsuite/Magento/Paypal/Controller/ExpressTest.php deleted file mode 100644 index f8d1bc3c28daa..0000000000000 --- a/dev/tests/unit/testsuite/Magento/Paypal/Controller/ExpressTest.php +++ /dev/null @@ -1,120 +0,0 @@ -markTestIncomplete(); - $this->messageManager = $this->getMockForAbstractClass('Magento\Framework\Message\ManagerInterface'); - $this->config = $this->getMock('Magento\Paypal\Model\Config', [], [], '', false); - $this->request = $this->getMock('Magento\Framework\App\Request\Http', [], [], '', false); - $this->quote = $this->getMock('Magento\Sales\Model\Quote', [], [], '', false); - $this->quote->expects($this->any()) - ->method('hasItems') - ->will($this->returnValue(true)); - $this->redirect = $this->getMockForAbstractClass('Magento\Framework\App\Response\RedirectInterface'); - $this->response = $this->getMock('Magento\Framework\App\Response\Http', [], [], '', false); - $this->customerData = $this->getMock('Magento\Customer\Api\Data\CustomerInterface', [], [], '', false); - $this->checkout = $this->getMock('Magento\Paypal\Model\Express\Checkout', [], [], '', false); - $this->customerSession = $this->getMock('Magento\Customer\Model\Session', [], [], '', false); - $this->customerSession->expects($this->any()) - ->method('getCustomerDataObject') - ->will($this->returnValue($this->customerData)); - $this->checkoutSession = $this->getMock('Magento\Checkout\Model\Session', [], [], '', false); - $this->checkoutFactory = $this->getMock('Magento\Paypal\Model\Express\Checkout\Factory', [], [], '', false); - $this->checkoutFactory->expects($this->any()) - ->method('create') - ->will($this->returnValue($this->checkout)); - $this->checkoutSession->expects($this->any()) - ->method('getQuote') - ->will($this->returnValue($this->quote)); - $this->session = $this->getMock('Magento\Framework\Session\Generic', [], [], '', false); - $objectManager = $this->getMock('Magento\Framework\ObjectManagerInterface'); - $this->objectManagerCallback = function ($className) { - if ($className == 'Magento\Paypal\Model\Config') { - return $this->config; - } - return $this->getMock($className, [], [], '', false); - }; - $objectManager->expects($this->any()) - ->method('get') - ->will($this->returnCallback(function ($className) { - return call_user_func($this->objectManagerCallback, $className); - })); - $objectManager->expects($this->any()) - ->method('create') - ->will($this->returnCallback(function ($className) { - return call_user_func($this->objectManagerCallback, $className); - })); - - $helper = new ObjectManagerHelper($this); - $this->model = $helper->getObject( - '\\Magento\\\Paypal\\Controller\\Express\\' . $this->name, - [ - 'messageManager' => $this->messageManager, - 'response' => $this->response, - 'redirect' => $this->redirect, - 'request' => $this->request, - 'customerSession' => $this->customerSession, - 'checkoutSession' => $this->checkoutSession, - 'checkoutFactory' => $this->checkoutFactory, - 'paypalSession' => $this->session, - 'objectManager' => $objectManager, - ] - ); - } -} diff --git a/dev/tests/unit/testsuite/Magento/Paypal/Controller/Ipn/IndexTest.php b/dev/tests/unit/testsuite/Magento/Paypal/Controller/Ipn/IndexTest.php deleted file mode 100644 index 46c6dbb972fb8..0000000000000 --- a/dev/tests/unit/testsuite/Magento/Paypal/Controller/Ipn/IndexTest.php +++ /dev/null @@ -1,48 +0,0 @@ -logger = $this->getMock('Magento\Framework\Logger', [], [], '', false); - $this->request = $this->getMock('Magento\Framework\App\Request\Http', [], [], '', false); - $this->response = $this->getMock('Magento\Framework\App\Response\Http', [], [], '', false); - - $objectManagerHelper = new \Magento\TestFramework\Helper\ObjectManager($this); - $this->model = $objectManagerHelper->getObject( - 'Magento\Paypal\Controller\Ipn\Index', - [ - 'logger' => $this->logger, - 'request' => $this->request, - 'response' => $this->response, - ] - ); - } - - public function testIndexActionException() - { - $this->request->expects($this->once())->method('isPost')->will($this->returnValue(true)); - $exception = new \Exception(); - $this->request->expects($this->once())->method('getPost')->will($this->throwException($exception)); - $this->logger->expects($this->once())->method('logException')->with($this->identicalTo($exception)); - $this->response->expects($this->once())->method('setHttpResponseCode')->with(500); - $this->model->execute(); - } -} diff --git a/dev/tests/unit/testsuite/Magento/Paypal/Helper/BackendTest.php b/dev/tests/unit/testsuite/Magento/Paypal/Helper/BackendTest.php deleted file mode 100644 index 727b5ac89fcd7..0000000000000 --- a/dev/tests/unit/testsuite/Magento/Paypal/Helper/BackendTest.php +++ /dev/null @@ -1,131 +0,0 @@ -_request = $this->getMockForAbstractClass('Magento\Framework\App\RequestInterface'); - $this->_coreHelper = $this->getMock('Magento\Core\Helper\Data', [], [], '', false); - $this->_backendConfig = $this->getMock('Magento\Backend\Model\Config', [], [], '', false); - - $objectManager = new \Magento\TestFramework\Helper\ObjectManager($this); - $this->_helper = $objectManager->getObject( - 'Magento\Paypal\Helper\Backend', - [ - 'httpRequest' => $this->_request, - 'coreHelper' => $this->_coreHelper, - 'backendConfig' => $this->_backendConfig - ] - ); - } - - public function testGetConfigurationCountryCodeFromRequest() - { - $this->_configurationCountryCodePrepareRequest('US'); - $this->_configurationCountryCodeAssertResult('US'); - } - - /** - * @param string|null $request - * @dataProvider getConfigurationCountryCodeFromConfigDataProvider - */ - public function testGetConfigurationCountryCodeFromConfig($request) - { - $this->_configurationCountryCodePrepareRequest($request); - $this->_configurationCountryCodePrepareConfig('GB'); - $this->_configurationCountryCodeAssertResult('GB'); - } - - public function getConfigurationCountryCodeFromConfigDataProvider() - { - return [ - [null], - ['not country code'], - ]; - } - - /** - * @param string|null $request - * @param string|null|false $config - * @param string|null $default - * @dataProvider getConfigurationCountryCodeFromDefaultDataProvider - */ - public function testGetConfigurationCountryCodeFromDefault($request, $config, $default) - { - $this->_configurationCountryCodePrepareRequest($request); - $this->_configurationCountryCodePrepareConfig($config); - $this->_coreHelper->expects($this->once()) - ->method('getDefaultCountry') - ->will($this->returnValue($default)); - $this->_configurationCountryCodeAssertResult($default); - } - - public function getConfigurationCountryCodeFromDefaultDataProvider() - { - return [ - [null, false, 'DE'], - ['not country code', false, 'DE'], - ['not country code', '', 'any final result'] - ]; - } - - /** - * Prepare request for test - * - * @param string|null $request - */ - private function _configurationCountryCodePrepareRequest($request) - { - $this->_request->expects($this->once()) - ->method('getParam') - ->with(\Magento\Paypal\Model\Config\StructurePlugin::REQUEST_PARAM_COUNTRY) - ->will($this->returnValue($request)); - } - - /** - * Prepare backend config for test - * - * @param string|null|false $config - */ - private function _configurationCountryCodePrepareConfig($config) - { - $this->_backendConfig->expects($this->once()) - ->method('getConfigDataValue') - ->with(\Magento\Paypal\Block\Adminhtml\System\Config\Field\Country::FIELD_CONFIG_PATH) - ->will($this->returnValue($config)); - } - - /** - * Assert result of getConfigurationCountryCode method - * - * @param string $expected - */ - private function _configurationCountryCodeAssertResult($expected) - { - $this->assertEquals($expected, $this->_helper->getConfigurationCountryCode()); - } -} diff --git a/dev/tests/unit/testsuite/Magento/Paypal/Helper/CheckoutTest.php b/dev/tests/unit/testsuite/Magento/Paypal/Helper/CheckoutTest.php deleted file mode 100644 index ba6df787b1313..0000000000000 --- a/dev/tests/unit/testsuite/Magento/Paypal/Helper/CheckoutTest.php +++ /dev/null @@ -1,112 +0,0 @@ -_session = $this->getMockBuilder( - 'Magento\Checkout\Model\Session' - )->disableOriginalConstructor()->setMethods( - ['getLastRealOrder', 'replaceQuote', 'unsLastRealOrderId', '__wakeup'] - )->getMock(); - $this->_quoteFactory = $this->getMockBuilder( - 'Magento\Sales\Model\QuoteFactory' - )->disableOriginalConstructor()->setMethods( - ['create', '__wakeup'] - )->getMock(); - - $this->_checkout = new \Magento\Paypal\Helper\Checkout($this->_session, $this->_quoteFactory); - } - - /** - * Get order mock - * - * @param bool $hasOrderId - * @param array $mockMethods - * @return \Magento\Sales\Model\Order|PHPUnit_Framework_MockObject_MockObject - */ - protected function _getOrderMock($hasOrderId, $mockMethods = []) - { - $order = $this->getMockBuilder( - 'Magento\Sales\Model\Order' - )->disableOriginalConstructor()->setMethods( - array_merge(['getId', '__wakeup'], $mockMethods) - )->getMock(); - $order->expects($this->once())->method('getId')->will($this->returnValue($hasOrderId ? 'order id' : null)); - return $order; - } - - /** - * @param bool $hasOrderId - * @param bool $isOrderCancelled - * @param bool $expectedResult - * @dataProvider cancelCurrentOrderDataProvider - */ - public function testCancelCurrentOrder($hasOrderId, $isOrderCancelled, $expectedResult) - { - $comment = 'Some test comment'; - $order = $this->_getOrderMock($hasOrderId, ['registerCancellation', 'save']); - $order->setData( - 'state', - $isOrderCancelled ? \Magento\Sales\Model\Order::STATE_CANCELED : 'some another state' - ); - if ($expectedResult) { - $order->expects( - $this->once() - )->method( - 'registerCancellation' - )->with( - $this->equalTo($comment) - )->will( - $this->returnSelf() - ); - $order->expects($this->once())->method('save'); - } else { - $order->expects($this->never())->method('registerCancellation'); - $order->expects($this->never())->method('save'); - } - - $this->_session->expects($this->any())->method('getLastRealOrder')->will($this->returnValue($order)); - $this->assertEquals($expectedResult, $this->_checkout->cancelCurrentOrder($comment)); - } - - /** - * @return array - */ - public function cancelCurrentOrderDataProvider() - { - return [ - [true, false, true], - [true, true, false], - [false, true, false], - [false, false, false] - ]; - } -} diff --git a/dev/tests/unit/testsuite/Magento/Paypal/Helper/DataTest.php b/dev/tests/unit/testsuite/Magento/Paypal/Helper/DataTest.php deleted file mode 100644 index d2e3e0cdbbb3c..0000000000000 --- a/dev/tests/unit/testsuite/Magento/Paypal/Helper/DataTest.php +++ /dev/null @@ -1,75 +0,0 @@ -_paymentDataMock = $this->getMockBuilder( - 'Magento\Payment\Helper\Data' - )->disableOriginalConstructor()->setMethods( - ['getStoreMethods', 'getPaymentMethods'] - )->getMock(); - - $objectManager = new \Magento\TestFramework\Helper\ObjectManager($this); - $this->_helper = $objectManager->getObject( - 'Magento\Paypal\Helper\Data', - ['paymentData' => $this->_paymentDataMock] - ); - } - - /** - * @dataProvider getBillingAgreementMethodsDataProvider - * @param $store - * @param $quote - * @param $paymentMethods - * @param $expectedResult - */ - public function testGetBillingAgreementMethods($store, $quote, $paymentMethods, $expectedResult) - { - $this->_paymentDataMock->expects( - $this->any() - )->method( - 'getStoreMethods' - )->with( - $store, - $quote - )->will( - $this->returnValue($paymentMethods) - ); - $this->assertEquals($expectedResult, $this->_helper->getBillingAgreementMethods($store, $quote)); - } - - /** - * @return array - */ - public function getBillingAgreementMethodsDataProvider() - { - $quoteMock = $this->getMockBuilder( - 'Magento\Sales\Model\Quote' - )->disableOriginalConstructor()->setMethods( - null - ); - $methodInterfaceMock = $this->getMockBuilder( - 'Magento\Paypal\Model\Billing\Agreement\MethodInterface' - )->getMock(); - - return [ - ['1', $quoteMock, [$methodInterfaceMock], [$methodInterfaceMock]], - ['1', $quoteMock, [new \StdClass()], []] - ]; - } -} diff --git a/dev/tests/unit/testsuite/Magento/Paypal/Helper/Shortcut/CheckoutValidatorTest.php b/dev/tests/unit/testsuite/Magento/Paypal/Helper/Shortcut/CheckoutValidatorTest.php deleted file mode 100644 index c68463b3ddefa..0000000000000 --- a/dev/tests/unit/testsuite/Magento/Paypal/Helper/Shortcut/CheckoutValidatorTest.php +++ /dev/null @@ -1,158 +0,0 @@ -sessionMock = $this->getMock('Magento\Checkout\Model\Session', [], [], '', false); - $this->paypalShortcutHelperMock = $this->getMock('Magento\Paypal\Helper\Shortcut\Validator', [], [], '', false); - $this->paymentHelperMock = $this->getMock('Magento\Payment\Helper\Data', [], [], '', false); - - $this->objectManagerHelper = new ObjectManagerHelper($this); - $this->checkoutValidator = $this->objectManagerHelper->getObject( - 'Magento\Paypal\Helper\Shortcut\CheckoutValidator', - [ - 'checkoutSession' => $this->sessionMock, - 'shortcutValidator' => $this->paypalShortcutHelperMock, - 'paymentData' => $this->paymentHelperMock - ] - ); - } - - public function testValidate() - { - $code = 'code'; - $isInCatalog = true; - $methodInstanceMock = $this->getMockBuilder('Magento\Payment\Model\Method\AbstractMethod') - ->disableOriginalConstructor()->setMethods([])->getMock(); - - $this->paypalShortcutHelperMock->expects($this->once())->method('isContextAvailable') - ->with($code, $isInCatalog)->will($this->returnValue(true)); - $this->paypalShortcutHelperMock->expects($this->once())->method('isPriceOrSetAvailable') - ->with($isInCatalog)->will($this->returnValue(true)); - $this->paymentHelperMock->expects($this->once())->method('getMethodInstance')->with($code) - ->will($this->returnValue($methodInstanceMock)); - $methodInstanceMock->expects($this->once())->method('isAvailable')->with(null) - ->will($this->returnValue(true)); - - $this->assertTrue($this->checkoutValidator->validate($code, $isInCatalog)); - } - - public function testIsMethodQuoteAvailableNoQuoteMethodNotAvailableFalse() - { - $quote = null; - $isInCatalog = true; - $paymentCode = 'code'; - $methodInstanceMock = $this->getMockBuilder('Magento\Payment\Model\Method\AbstractMethod') - ->disableOriginalConstructor()->setMethods([])->getMock(); - - $this->paymentHelperMock->expects($this->once())->method('getMethodInstance')->with($paymentCode) - ->will($this->returnValue($methodInstanceMock)); - $methodInstanceMock->expects($this->once())->method('isAvailable')->with($quote) - ->will($this->returnValue(false)); - - $this->assertFalse($this->checkoutValidator->isMethodQuoteAvailable($paymentCode, $isInCatalog)); - } - - /** - * @dataProvider methodAvailabilityDataProvider - * @param bool $availability - */ - public function testIsMethodQuoteAvailableWithQuoteMethodNotAvailable($availability) - { - $quote = $this->getMockBuilder('Magento\Sales\Model\Quote')->disableOriginalConstructor()->setMethods([]) - ->getMock(); - $isInCatalog = false; - $paymentCode = 'code'; - $methodInstanceMock = $this->getMockBuilder('Magento\Payment\Model\Method\AbstractMethod') - ->disableOriginalConstructor()->setMethods([])->getMock(); - - $this->sessionMock->expects($this->once())->method('getQuote')->will($this->returnValue($quote)); - $this->paymentHelperMock->expects($this->once())->method('getMethodInstance')->with($paymentCode) - ->will($this->returnValue($methodInstanceMock)); - $methodInstanceMock->expects($this->once())->method('isAvailable')->with($quote) - ->will($this->returnValue($availability)); - - $this->assertEquals( - $availability, - $this->checkoutValidator->isMethodQuoteAvailable($paymentCode, $isInCatalog) - ); - } - - /** - * @return array - */ - public function methodAvailabilityDataProvider() - { - return [[true], [false]]; - } - - public function testIsQuoteSummaryValidNoQuote() - { - $isInCatalog = true; - $this->assertTrue($this->checkoutValidator->isQuoteSummaryValid($isInCatalog)); - } - - public function testIsQuoteSummaryValidMinimumAmountFalse() - { - $isInCatalog = false; - $quote = $this->getMockBuilder('Magento\Sales\Model\Quote')->disableOriginalConstructor()->setMethods([]) - ->getMock(); - - $this->sessionMock->expects($this->once())->method('getQuote')->will($this->returnValue($quote)); - $quote->expects($this->once())->method('validateMinimumAmount')->will($this->returnValue(false)); - - $this->assertFalse($this->checkoutValidator->isQuoteSummaryValid($isInCatalog)); - } - - public function testIsQuoteSummaryValidGrandTotalFalse() - { - $isInCatalog = false; - $quote = $this->getMockBuilder('Magento\Sales\Model\Quote')->disableOriginalConstructor() - ->setMethods(['getGrandTotal', 'validateMinimumAmount', 'hasNominalItems', '__wakeup']) - ->getMock(); - - $this->sessionMock->expects($this->once())->method('getQuote')->will($this->returnValue($quote)); - $quote->expects($this->once())->method('validateMinimumAmount')->will($this->returnValue(true)); - $quote->expects($this->once())->method('getGrandTotal')->will($this->returnValue(0)); - $quote->expects($this->once())->method('hasNominalItems')->will($this->returnValue(false)); - - $this->assertFalse($this->checkoutValidator->isQuoteSummaryValid($isInCatalog)); - } - - public function testIsQuoteSummaryValidTrue() - { - $isInCatalog = false; - $quote = $this->getMockBuilder('Magento\Sales\Model\Quote')->disableOriginalConstructor() - ->setMethods(['getGrandTotal', 'validateMinimumAmount', 'hasNominalItems', '__wakeup']) - ->getMock(); - - $this->sessionMock->expects($this->once())->method('getQuote')->will($this->returnValue($quote)); - $quote->expects($this->once())->method('validateMinimumAmount')->will($this->returnValue(true)); - $quote->expects($this->once())->method('getGrandTotal')->will($this->returnValue(1)); - - $this->assertTrue($this->checkoutValidator->isQuoteSummaryValid($isInCatalog)); - } -} diff --git a/dev/tests/unit/testsuite/Magento/Paypal/Helper/Shortcut/FactoryTest.php b/dev/tests/unit/testsuite/Magento/Paypal/Helper/Shortcut/FactoryTest.php deleted file mode 100644 index 4343828e7c5db..0000000000000 --- a/dev/tests/unit/testsuite/Magento/Paypal/Helper/Shortcut/FactoryTest.php +++ /dev/null @@ -1,61 +0,0 @@ -objectManagerMock = $this->getMock('Magento\Framework\ObjectManagerInterface'); - - $this->objectManagerHelper = new ObjectManagerHelper($this); - $this->factory = $this->objectManagerHelper->getObject( - 'Magento\Paypal\Helper\Shortcut\Factory', - [ - 'objectManager' => $this->objectManagerMock - ] - ); - } - - public function testCreateDefault() - { - $instance = $this->getMockBuilder('Magento\Paypal\Helper\Shortcut\ValidatorInterface')->getMock(); - - $this->objectManagerMock->expects($this->once())->method('create')->with(Factory::DEFAULT_VALIDATOR) - ->will($this->returnValue($instance)); - - $this->assertInstanceOf( - 'Magento\Paypal\Helper\Shortcut\ValidatorInterface', - $this->factory->create() - ); - } - - public function testCreateCheckout() - { - $checkoutMock = $this->getMockBuilder('Magento\Checkout\Model\Session')->disableOriginalConstructor() - ->setMethods([])->getMock(); - $instance = $this->getMockBuilder('Magento\Paypal\Helper\Shortcut\ValidatorInterface')->getMock(); - - $this->objectManagerMock->expects($this->once())->method('create')->with(Factory::CHECKOUT_VALIDATOR) - ->will($this->returnValue($instance)); - - $this->assertInstanceOf( - 'Magento\Paypal\Helper\Shortcut\ValidatorInterface', - $this->factory->create($checkoutMock) - ); - } -} diff --git a/dev/tests/unit/testsuite/Magento/Paypal/Helper/Shortcut/ValidatorTest.php b/dev/tests/unit/testsuite/Magento/Paypal/Helper/Shortcut/ValidatorTest.php deleted file mode 100644 index b5eaf5c30edfe..0000000000000 --- a/dev/tests/unit/testsuite/Magento/Paypal/Helper/Shortcut/ValidatorTest.php +++ /dev/null @@ -1,163 +0,0 @@ -_paypalConfigFactory = $this->getMock('\Magento\Paypal\Model\ConfigFactory', ['create'], [], '', false); - $this->_productTypeConfig = $this->getMock( - 'Magento\Catalog\Model\ProductTypes\ConfigInterface', - [], - [], - '', - false - ); - $this->_registry = $this->getMock('Magento\Framework\Registry', [], [], '', false); - $this->_paymentData = $this->getMock('Magento\Payment\Helper\Data', [], [], '', false); - - $objectManager = new \Magento\TestFramework\Helper\ObjectManager($this); - $this->helper = $objectManager->getObject( - 'Magento\Paypal\Helper\Shortcut\Validator', - [ - 'paypalConfigFactory' => $this->_paypalConfigFactory, - 'registry' => $this->_registry, - 'productTypeConfig' => $this->_productTypeConfig, - 'paymentData' => $this->_paymentData - ] - ); - } - - /** - * @dataProvider testIsContextAvailableDataProvider - * @param bool $isVisible - * @param bool $expected - */ - public function testIsContextAvailable($isVisible, $expected) - { - $paypalConfig = $this->getMock('PaypalConfig', ['setMethod', 'getConfigValue']); - $paypalConfig->expects($this->any()) - ->method('getConfigValue') - ->with($this->stringContains('visible_on')) - ->will($this->returnValue($isVisible)); - - $this->_paypalConfigFactory->expects($this->any()) - ->method('create') - ->will($this->returnValue($paypalConfig)); - - $this->assertEquals($expected, $this->helper->isContextAvailable('payment_code', true)); - } - - /** - * @return array - */ - public function testIsContextAvailableDataProvider() - { - return [ - [false, false], - [true, true] - ]; - } - - /** - * @dataProvider testIsPriceOrSetAvailableDataProvider - * @param bool $isInCatalog - * @param double $productPrice - * @param bool $isProductSet - * @param bool $expected - */ - public function testIsPriceOrSetAvailable($isInCatalog, $productPrice, $isProductSet, $expected) - { - $currentProduct = $this->getMockBuilder('Magento\Catalog\Model\Product')->disableOriginalConstructor() - ->setMethods(['__wakeup', 'getFinalPrice', 'getTypeId', 'getTypeInstance']) - ->getMock(); - $typeInstance = $this->getMockBuilder('Magento\Catalog\Model\Product\Type\AbstractType') - ->disableOriginalConstructor() - ->setMethods([]) - ->getMock(); - $currentProduct->expects($this->any())->method('getFinalPrice')->will($this->returnValue($productPrice)); - $currentProduct->expects($this->any())->method('getTypeId')->will($this->returnValue('simple')); - $currentProduct->expects($this->any())->method('getTypeInstance')->will($this->returnValue($typeInstance)); - - $this->_registry->expects($this->any()) - ->method('registry') - ->with($this->equalTo('current_product')) - ->will($this->returnValue($currentProduct)); - - $this->_productTypeConfig->expects($this->any()) - ->method('isProductSet') - ->will($this->returnValue($isProductSet)); - - $typeInstance->expects($this->any()) - ->method('canConfigure') - ->with($currentProduct) - ->will($this->returnValue(false)); - - $this->assertEquals($expected, $this->helper->isPriceOrSetAvailable($isInCatalog)); - } - - /** - * @return array - */ - public function testIsPriceOrSetAvailableDataProvider() - { - return [ - [false, 1, true, true], - [false, null, null, true], - [true, 0, false, false], - [true, 10, false, true], - [true, 0, true, true] - ]; - } - - /** - * @dataProvider testIsMethodAvailableDataProvider - * @param bool $methodIsAvailable - * @param bool $expected - */ - public function testIsMethodAvailable($methodIsAvailable, $expected) - { - $methodInstance = $this->getMock('MethodInstance', ['isAvailable']); - $methodInstance->expects($this->any()) - ->method('isAvailable') - ->will($this->returnValue($methodIsAvailable)); - - $this->_paymentData->expects($this->any()) - ->method('getMethodInstance') - ->will( - $this->returnValue($methodInstance) - ); - - $this->assertEquals($expected, $this->helper->isMethodAvailable('payment_code')); - } - - /** - * @return array - */ - public function testIsMethodAvailableDataProvider() - { - return [ - [true, true], - [false, false] - ]; - } -} diff --git a/dev/tests/unit/testsuite/Magento/Paypal/Model/Api/NvpTest.php b/dev/tests/unit/testsuite/Magento/Paypal/Model/Api/NvpTest.php deleted file mode 100644 index 5c9b931611eb6..0000000000000 --- a/dev/tests/unit/testsuite/Magento/Paypal/Model/Api/NvpTest.php +++ /dev/null @@ -1,167 +0,0 @@ -customerAddressHelper = $this->getMock('Magento\Customer\Helper\Address', [], [], '', false); - $this->logger = $this->getMock('Magento\Framework\Logger', [], [], '', false); - $this->resolver = $this->getMock('Magento\Framework\Locale\ResolverInterface'); - $this->regionFactory = $this->getMock('Magento\Directory\Model\RegionFactory', [], [], '', false); - $this->adapterFactory = $this->getMock('Magento\Framework\Logger\AdapterFactory', [], [], '', false); - $this->countryFactory = $this->getMock('Magento\Directory\Model\CountryFactory', [], [], '', false); - $processableExceptionFactory = $this->getMock( - 'Magento\Paypal\Model\Api\ProcessableExceptionFactory', - ['create'] - ); - $processableExceptionFactory->expects($this->any()) - ->method('create') - ->will($this->returnCallback(function ($arguments) { - $this->processableException = $this->getMock( - 'Magento\Paypal\Model\Api\ProcessableException', - null, - [$arguments['message'], $arguments['code']] - ); - return $this->processableException; - })); - $exceptionFactory = $this->getMock('Magento\Framework\Model\ExceptionFactory', ['create']); - $exceptionFactory->expects($this->any()) - ->method('create') - ->will($this->returnCallback(function ($arguments) { - $this->exception = $this->getMock( - 'Magento\Paypal\Model\Api\ProcessableException', - null, - [$arguments['message'], $arguments['code']] - ); - return $this->exception; - })); - $this->curl = $this->getMock('Magento\Framework\HTTP\Adapter\Curl', [], [], '', false); - $curlFactory = $this->getMock('Magento\Framework\HTTP\Adapter\CurlFactory', ['create']); - $curlFactory->expects($this->any())->method('create')->will($this->returnValue($this->curl)); - $this->config = $this->getMock('Magento\Paypal\Model\Config', [], [], '', false); - - $helper = new ObjectManagerHelper($this); - $this->model = $helper->getObject( - 'Magento\Paypal\Model\Api\Nvp', - [ - 'customerAddress' => $this->customerAddressHelper, - 'logger' => $this->logger, - 'localeResolver' => $this->resolver, - 'regionFactory' => $this->regionFactory, - 'logAdapterFactory' => $this->adapterFactory, - 'countryFactory' => $this->countryFactory, - 'processableExceptionFactory' => $processableExceptionFactory, - 'frameworkExceptionFactory' => $exceptionFactory, - 'curlFactory' => $curlFactory, - ] - ); - $this->model->setConfigObject($this->config); - } - - /** - * @param string $response - * @param array $processableErrors - * @param null|string $exception - * @param string $exceptionMessage - * @param null|int $exceptionCode - * @dataProvider callDataProvider - */ - public function testCall($response, $processableErrors, $exception, $exceptionMessage = '', $exceptionCode = null) - { - if (isset($exception)) { - $this->setExpectedException($exception, $exceptionMessage, $exceptionCode); - } - $this->curl->expects($this->once()) - ->method('read') - ->will($this->returnValue($response)); - $this->model->setProcessableErrors($processableErrors); - $this->model->call('some method', ['data' => 'some data']); - } - - public function callDataProvider() - { - return [ - ['', [], null], - [ - "\r\n" . 'ACK=Failure&L_ERRORCODE0=10417&L_SHORTMESSAGE0=Message.&L_LONGMESSAGE0=Long%20Message.', - [], - 'Magento\Framework\Model\Exception', - 'PayPal gateway has rejected request. Long Message (#10417: Message).', - 0 - ], - [ - "\r\n" . 'ACK=Failure&L_ERRORCODE0=10417&L_SHORTMESSAGE0=Message.&L_LONGMESSAGE0=Long%20Message.', - [10417, 10422], - 'Magento\Paypal\Model\Api\ProcessableException', - 'PayPal gateway has rejected request. Long Message (#10417: Message).', - 10417 - ], - [ - "\r\n" . 'ACK[7]=Failure&L_ERRORCODE0[5]=10417' - . '&L_SHORTMESSAGE0[8]=Message.&L_LONGMESSAGE0[15]=Long%20Message.', - [10417, 10422], - 'Magento\Paypal\Model\Api\ProcessableException', - 'PayPal gateway has rejected request. Long Message (#10417: Message).', - 10417 - ], - [ - "\r\n" . 'ACK[7]=Failure&L_ERRORCODE0[5]=10417&L_SHORTMESSAGE0[8]=Message.', - [10417, 10422], - 'Magento\Paypal\Model\Api\ProcessableException', - 'PayPal gateway has rejected request. #10417: Message.', - 10417 - ], - ]; - } - - public function testCallGetExpressCheckoutDetails() - { - $this->curl->expects($this->once()) - ->method('read') - ->will($this->returnValue( - "\r\n" . 'ACK=Success&SHIPTONAME=Ship%20To%20Name' - )); - $this->model->callGetExpressCheckoutDetails(); - $this->assertEquals('Ship To Name', $this->model->getExportedShippingAddress()->getData('firstname')); - } -} diff --git a/dev/tests/unit/testsuite/Magento/Paypal/Model/Api/ProcessableExceptionTest.php b/dev/tests/unit/testsuite/Magento/Paypal/Model/Api/ProcessableExceptionTest.php deleted file mode 100644 index 81bd75a508c4d..0000000000000 --- a/dev/tests/unit/testsuite/Magento/Paypal/Model/Api/ProcessableExceptionTest.php +++ /dev/null @@ -1,62 +0,0 @@ -objectManagerHelper = new ObjectManagerHelper($this); - $this->model = $this->objectManagerHelper->getObject( - 'Magento\Paypal\Model\Api\ProcessableException', - ['message' => $msg, 'code' => $code] - ); - $this->assertEquals($msg, $this->model->getUserMessage()); - } - - /** - * @return array - */ - public function getUserMessageDataProvider() - { - return [ - [ - 10001, - "I'm sorry - but we were not able to process your payment. " - . "Please try another payment method or contact us so we can assist you.", - ], - [ - 10417, - "I'm sorry - but we were not able to process your payment. " - . "Please try another payment method or contact us so we can assist you." - ], - [ - 10537, - "I'm sorry - but we are not able to complete your transaction. Please contact us so we can assist you." - ], - [ - 10538, - "I'm sorry - but we are not able to complete your transaction. Please contact us so we can assist you." - ], - [ - 10539, - "I'm sorry - but we are not able to complete your transaction. Please contact us so we can assist you." - ], - [10411, "something went wrong"] - ]; - } -} diff --git a/dev/tests/unit/testsuite/Magento/Paypal/Model/Billing/AbstractAgreementTest.php b/dev/tests/unit/testsuite/Magento/Paypal/Model/Billing/AbstractAgreementTest.php deleted file mode 100644 index 45e85beba738e..0000000000000 --- a/dev/tests/unit/testsuite/Magento/Paypal/Model/Billing/AbstractAgreementTest.php +++ /dev/null @@ -1,51 +0,0 @@ -paymentDataMock = $this->getMockBuilder('Magento\Payment\Helper\Data') - ->disableOriginalConstructor() - ->getMock(); - - $this->model = $objectManager->getObject('Magento\Paypal\Model\Billing\Agreement', [ - 'paymentData' => $this->paymentDataMock - ]); - } - - public function testGetPaymentMethodInstance() - { - $paymentMethodInstance = $this->getMockBuilder('Magento\Payment\Model\Method\AbstractMethod') - ->disableOriginalConstructor() - ->setMethods(['setStore']) - ->getMockForAbstractClass(); - - $paymentMethodInstance->expects($this->once()) - ->method('setStore'); - - $this->paymentDataMock->expects($this->once()) - ->method('getMethodInstance') - ->willReturn($paymentMethodInstance); - - $this->assertSame($paymentMethodInstance, $this->model->getPaymentMethodInstance()); - } -} diff --git a/dev/tests/unit/testsuite/Magento/Paypal/Model/Billing/Agreement/OrdersUpdaterTest.php b/dev/tests/unit/testsuite/Magento/Paypal/Model/Billing/Agreement/OrdersUpdaterTest.php deleted file mode 100644 index c0029fea15663..0000000000000 --- a/dev/tests/unit/testsuite/Magento/Paypal/Model/Billing/Agreement/OrdersUpdaterTest.php +++ /dev/null @@ -1,87 +0,0 @@ -_registry = $this->getMock('Magento\Framework\Registry', [], [], '', false); - $this->_agreementResource = $this->getMock( - '\Magento\Paypal\Model\Resource\Billing\Agreement', - [], - [], - '', - false - ); - - $helper = new \Magento\TestFramework\Helper\ObjectManager($this); - $this->_model = $helper->getObject( - 'Magento\Paypal\Model\Billing\Agreement\OrdersUpdater', - ['coreRegistry' => $this->_registry, 'agreementResource' => $this->_agreementResource] - ); - } - - public function testUpdate() - { - $agreement = $this->getMock('Magento\Paypal\Model\Billing\Agreement', [], [], '', false); - $argument = $this->getMock('Magento\Sales\Model\Resource\Order\Collection', [], [], '', false); - - $this->_registry->expects( - $this->once() - )->method( - 'registry' - )->with( - 'current_billing_agreement' - )->will( - $this->returnValue($agreement) - ); - - $agreement->expects($this->once())->method('getId')->will($this->returnValue('agreement id')); - $this->_agreementResource->expects( - $this->once() - )->method( - 'addOrdersFilter' - )->with( - $this->identicalTo($argument), - 'agreement id' - ); - - $this->assertSame($argument, $this->_model->update($argument)); - } - - /** - * @expectedException \DomainException - */ - public function testUpdateWhenBillingAgreementIsNotSet() - { - $this->_registry->expects( - $this->once() - )->method( - 'registry' - )->with( - 'current_billing_agreement' - )->will( - $this->returnValue(null) - ); - - $this->_model->update('any argument'); - } -} diff --git a/dev/tests/unit/testsuite/Magento/Paypal/Model/Billing/AgreementTest.php b/dev/tests/unit/testsuite/Magento/Paypal/Model/Billing/AgreementTest.php deleted file mode 100644 index e58edf5578241..0000000000000 --- a/dev/tests/unit/testsuite/Magento/Paypal/Model/Billing/AgreementTest.php +++ /dev/null @@ -1,182 +0,0 @@ -paymentDataMock = $this->getMockBuilder('Magento\Payment\Helper\Data') - ->disableOriginalConstructor() - ->setMethods(['getMethodInstance']) - ->getMock(); - - $this->paymentMethodInstanceMock = $this->getMockBuilder('Magento\Payment\Model\Method\AbstractMethod') - ->disableOriginalConstructor() - ->setMethods([ - 'setStore', - 'getCode', - 'getFormBlockType', - 'getTitle', - 'getStore', - 'initBillingAgreementToken', - 'getBillingAgreementTokenInfo', - 'placeBillingAgreement' - ]) - ->getMock(); - - $this->model = $objectManager->getObject('Magento\Paypal\Model\Billing\Agreement', [ - 'paymentData' => $this->paymentDataMock - ]); - } - - - public function testImportOrderPaymentWithMethodCode() - { - $baData = [ - 'billing_agreement_id' => 'B-5E3253653W103435Y', - 'method_code' => 'paypal_billing_agreement' - ]; - - $paymentMock = $this->importOrderPaymentCommonPart($baData); - - $paymentMock->expects($this->once()) - ->method('getMethodInstance') - ->willReturn($this->paymentMethodInstanceMock); - - $this->paymentMethodInstanceMock->expects($this->once()) - ->method('getCode') - ->willReturn($baData['method_code']); - - $this->paymentDataMock->expects($this->once()) - ->method('getMethodInstance') - ->with($baData['method_code']) - ->willReturn($this->paymentMethodInstanceMock); - - $this->assertSame($this->model, $this->model->importOrderPayment($paymentMock)); - } - - - public function testImportOrderPaymentWithoutMethodCode() - { - $baData = [ - 'billing_agreement_id' => 'B-5E3253653W103435Y' - ]; - - $paymentMock = $this->importOrderPaymentCommonPart($baData); - - $paymentMock->expects($this->exactly(2)) - ->method('getMethodInstance') - ->willReturn($this->paymentMethodInstanceMock); - - $this->paymentMethodInstanceMock->expects($this->once()) - ->method('getCode') - ->willReturn('paypal_billing_agreement'); - - $this->assertSame($this->model, $this->model->importOrderPayment($paymentMock)); - } - - /** - * @param $baData - * @return \Magento\Payment\Helper\Data|\PHPUnit_Framework_MockObject_MockObject| - */ - private function importOrderPaymentCommonPart($baData) - { - $paymentMock = $this->getMockBuilder('Magento\Sales\Model\Order\Payment') - ->disableOriginalConstructor() - ->setMethods(['getBillingAgreementData', 'getMethodInstance', 'getOrder']) - ->getMock(); - - $storeId = null; - $customerId = 2; - - $order = $this->getMockBuilder('Magento\Sales\Model\Order') - ->disableOriginalConstructor() - ->setMethods(['getCustomerId']) - ->getMock(); - - $order->expects($this->once()) - ->method('getCustomerId') - ->willReturn($customerId); - - $paymentMock->expects($this->once()) - ->method('getOrder') - ->willReturn($order); - - $paymentMock->expects($this->once()) - ->method('getBillingAgreementData') - ->willReturn($baData); - - $this->paymentMethodInstanceMock->expects($this->once()) - ->method('setStore') - ->with($storeId); - - $this->paymentMethodInstanceMock->expects($this->once()) - ->method('getTitle') - ->willReturn('some title'); - - $this->paymentMethodInstanceMock->expects($this->once()) - ->method('getStore') - ->willReturn($storeId); - - return $paymentMock; - } - - public function testInitToken() - { - $this->initGetMethodInstance(); - - $this->paymentMethodInstanceMock->expects($this->once()) - ->method('initBillingAgreementToken') - ->with($this->model) - ->willReturn($this->model); - - $url = 'http://dddd'; - $this->model->setRedirectUrl($url); - $this->assertEquals($url, $this->model->initToken()); - } - - public function testVerifyToken() - { - $this->initGetMethodInstance(); - - $this->paymentMethodInstanceMock->expects($this->once()) - ->method('getBillingAgreementTokenInfo') - ->with($this->model) - ->willReturn($this->model); - - $this->assertEquals($this->model, $this->model->verifyToken()); - } - - private function initGetMethodInstance() - { - $this->paymentDataMock->expects($this->once()) - ->method('getMethodInstance') - ->willReturn($this->paymentMethodInstanceMock); - - $this->paymentMethodInstanceMock->expects($this->once()) - ->method('setStore'); - } -} diff --git a/dev/tests/unit/testsuite/Magento/Paypal/Model/CartTest.php b/dev/tests/unit/testsuite/Magento/Paypal/Model/CartTest.php deleted file mode 100644 index 8035ebce65fd8..0000000000000 --- a/dev/tests/unit/testsuite/Magento/Paypal/Model/CartTest.php +++ /dev/null @@ -1,371 +0,0 @@ -_validItem = new \Magento\Framework\Object( - [ - 'parent_item' => null, - 'price' => 2.0, - 'qty' => 3, - 'name' => 'valid item', - 'original_item' => new \Magento\Framework\Object(['base_row_total' => 6.0]), - ] - ); - } - - protected function setUp() - { - $this->_salesModel = $this->getMockForAbstractClass( - 'Magento\Payment\Model\Cart\SalesModel\SalesModelInterface' - ); - $factoryMock = $this->getMock('Magento\Payment\Model\Cart\SalesModel\Factory', [], [], '', false); - $factoryMock->expects( - $this->once() - )->method( - 'create' - )->with( - 'sales model' - )->will( - $this->returnValue($this->_salesModel) - ); - $eventManagerMock = $this->getMockForAbstractClass('Magento\Framework\Event\ManagerInterface'); - - $this->_model = new \Magento\Paypal\Model\Cart($factoryMock, $eventManagerMock, 'sales model'); - } - - /** - * @param array $items - * @dataProvider invalidGetAllItemsDataProvider - */ - public function testInvalidGetAllItems($items) - { - $taxContainer = new \Magento\Framework\Object( - ['base_hidden_tax_amount' => 0.2, 'base_shipping_hidden_tax_amnt' => 0.1] - ); - $this->_salesModel->expects($this->once())->method('getTaxContainer')->will($this->returnValue($taxContainer)); - $this->_salesModel->expects($this->once())->method('getAllItems')->will($this->returnValue($items)); - $this->_salesModel->expects($this->once())->method('getBaseSubtotal')->will($this->returnValue(2.1)); - $this->_salesModel->expects($this->once())->method('getBaseTaxAmount')->will($this->returnValue(0.1)); - $this->_salesModel->expects($this->once())->method('getBaseShippingAmount')->will($this->returnValue(1.1)); - $this->_salesModel->expects($this->once())->method('getBaseDiscountAmount')->will($this->returnValue(0.3)); - $this->assertEmpty($this->_model->getAllItems()); - $this->assertEquals(2.1, $this->_model->getSubtotal()); - $this->assertEquals(0.1 + 0.2 + 0.1, $this->_model->getTax()); - $this->assertEquals(1.1, $this->_model->getShipping()); - $this->assertEquals(0.3, $this->_model->getDiscount()); - } - - public function invalidGetAllItemsDataProvider() - { - return [ - [[]], - [ - [ - new \Magento\Framework\Object( - [ - 'parent_item' => new \Magento\Framework\Object(), - 'price' => 2.0, - 'qty' => 3, - 'name' => 'item 1', - ] - ), - ] - ], - [ - [ - $this->_validItem, - new \Magento\Framework\Object( - [ - 'price' => 2.0, - 'qty' => 3, - 'name' => 'item 2', - 'original_item' => new \Magento\Framework\Object(['base_row_total' => 6.01]), - ] - ), - ] - ], - [ - [ - $this->_validItem, - new \Magento\Framework\Object( - [ - 'price' => sqrt(2), - 'qty' => sqrt(2), - 'name' => 'item 3', - 'original_item' => new \Magento\Framework\Object(['base_row_total' => 2]), - ] - ), - ] - ] - ]; - } - - /** - * @param array $values - * @param bool $transferDiscount - * @dataProvider invalidTotalsGetAllItemsDataProvider - */ - public function testInvalidTotalsGetAllItems($values, $transferDiscount) - { - $expectedSubtotal = $this->_prepareInvalidModelData($values, $transferDiscount); - $this->assertEmpty($this->_model->getAllItems()); - $this->assertEquals($expectedSubtotal, $this->_model->getSubtotal()); - $this->assertEquals( - $values['base_tax_amount'] + $values['base_hidden_tax_amount'] + $values['base_shipping_hidden_tax_amnt'], - $this->_model->getTax() - ); - $this->assertEquals($values['base_shipping_amount'], $this->_model->getShipping()); - $this->assertEquals($transferDiscount ? 0.0 : $values['base_discount_amount'], $this->_model->getDiscount()); - } - - public function invalidTotalsGetAllItemsDataProvider() - { - return [ - [ - [ - 'base_hidden_tax_amount' => 0, - 'base_shipping_hidden_tax_amnt' => 0, - 'base_subtotal' => 0, - 'base_tax_amount' => 0, - 'base_shipping_amount' => 0, - 'base_discount_amount' => 6.1, - 'base_grand_total' => 0, - ], - false, - ], - [ - [ - 'base_hidden_tax_amount' => 1, - 'base_shipping_hidden_tax_amnt' => 2, - 'base_subtotal' => 3, - 'base_tax_amount' => 4, - 'base_shipping_amount' => 5, - 'base_discount_amount' => 100, - 'base_grand_total' => 5.5, - ], - true - ] - ]; - } - - public function testGetAllItems() - { - $totals = $this->_prepareValidModelData(); - $this->assertEquals( - [ - new \Magento\Framework\Object( - [ - 'name' => $this->_validItem->getName(), - 'qty' => $this->_validItem->getQty(), - 'amount' => $this->_validItem->getPrice(), - ] - ), - ], - $this->_model->getAllItems() - ); - $this->assertEquals($totals['subtotal'], $this->_model->getSubtotal()); - $this->assertEquals($totals['tax'], $this->_model->getTax()); - $this->assertEquals($totals['shipping'], $this->_model->getShipping()); - $this->assertEquals($totals['discount'], $this->_model->getDiscount()); - } - - /** - * @param array $values - * @param bool $transferDiscount - * @param bool $transferShipping - * @dataProvider invalidGetAmountsDataProvider - */ - public function testInvalidGetAmounts($values, $transferDiscount, $transferShipping) - { - $expectedSubtotal = $this->_prepareInvalidModelData($values, $transferDiscount); - if ($transferShipping) { - $this->_model->setTransferShippingAsItem(); - } - $result = $this->_model->getAmounts(); - $expectedSubtotal += $this->_model->getTax(); - $expectedSubtotal += $values['base_shipping_amount']; - if (!$transferDiscount) { - $expectedSubtotal -= $this->_model->getDiscount(); - } - $this->assertEquals([Cart::AMOUNT_SUBTOTAL => $expectedSubtotal], $result); - } - - public function invalidGetAmountsDataProvider() - { - $data = []; - $invalidTotalsData = $this->invalidTotalsGetAllItemsDataProvider(); - foreach ($invalidTotalsData as $dataItem) { - $data[] = [$dataItem[0], $dataItem[1], true]; - $data[] = [$dataItem[0], $dataItem[1], false]; - } - return $data; - } - - /** - * Prepare invalid data for cart - * - * @param array $values - * @param bool $transferDiscount - * @return float - */ - protected function _prepareInvalidModelData($values, $transferDiscount) - { - $taxContainer = new \Magento\Framework\Object( - [ - 'base_hidden_tax_amount' => $values['base_hidden_tax_amount'], - 'base_shipping_hidden_tax_amnt' => $values['base_shipping_hidden_tax_amnt'], - ] - ); - $expectedSubtotal = $values['base_subtotal']; - if ($transferDiscount) { - $this->_model->setTransferDiscountAsItem(); - $expectedSubtotal -= $values['base_discount_amount']; - } - $this->_salesModel->expects($this->once())->method('getTaxContainer')->will($this->returnValue($taxContainer)); - $this->_salesModel->expects( - $this->once() - )->method( - 'getAllItems' - )->will( - $this->returnValue([$this->_validItem]) - ); - $this->_salesModel->expects( - $this->once() - )->method( - 'getBaseSubtotal' - )->will( - $this->returnValue($values['base_subtotal']) - ); - $this->_salesModel->expects( - $this->once() - )->method( - 'getBaseTaxAmount' - )->will( - $this->returnValue($values['base_tax_amount']) - ); - $this->_salesModel->expects( - $this->once() - )->method( - 'getBaseShippingAmount' - )->will( - $this->returnValue($values['base_shipping_amount']) - ); - $this->_salesModel->expects( - $this->once() - )->method( - 'getBaseDiscountAmount' - )->will( - $this->returnValue($values['base_discount_amount']) - ); - $this->_salesModel->expects( - $this->once() - )->method( - 'getDataUsingMethod' - )->with( - 'base_grand_total' - )->will( - $this->returnValue($values['base_grand_total']) - ); - return $expectedSubtotal; - } - - public function testGetAmounts() - { - $totals = $this->_prepareValidModelData(); - $this->assertEquals($totals, $this->_model->getAmounts()); - } - - /** - * Prepare valid cart data - * - * @return array - */ - protected function _prepareValidModelData() - { - $totals = ['discount' => 0.1, 'shipping' => 0.2, 'subtotal' => 0.3, 'tax' => 0.4]; - $taxContainer = new \Magento\Framework\Object( - ['base_hidden_tax_amount' => 0, 'base_shipping_hidden_tax_amnt' => 0] - ); - $this->_salesModel->expects($this->once())->method('getTaxContainer')->will($this->returnValue($taxContainer)); - $this->_salesModel->expects( - $this->once() - )->method( - 'getAllItems' - )->will( - $this->returnValue([$this->_validItem]) - ); - $this->_salesModel->expects( - $this->once() - )->method( - 'getBaseSubtotal' - )->will( - $this->returnValue($totals['subtotal']) - ); - $this->_salesModel->expects( - $this->once() - )->method( - 'getBaseTaxAmount' - )->will( - $this->returnValue($totals['tax']) - ); - $this->_salesModel->expects( - $this->once() - )->method( - 'getBaseShippingAmount' - )->will( - $this->returnValue($totals['shipping']) - ); - $this->_salesModel->expects( - $this->once() - )->method( - 'getBaseDiscountAmount' - )->will( - $this->returnValue($totals['discount']) - ); - $this->_salesModel->expects( - $this->once() - )->method( - 'getDataUsingMethod' - )->with( - 'base_grand_total' - )->will( - $this->returnValue(6.0 + $totals['tax'] + $totals['shipping'] - $totals['discount']) - ); - return $totals; - } - - public function testHasNegativeItemAmount() - { - $this->_model->addCustomItem('item1', 1, 2.1); - $this->assertFalse($this->_model->hasNegativeItemAmount()); - $this->_model->addCustomItem('item1', 1, -1.3); - $this->assertTrue($this->_model->hasNegativeItemAmount()); - } -} diff --git a/dev/tests/unit/testsuite/Magento/Paypal/Model/Config/Structure/Element/FieldPluginTest.php b/dev/tests/unit/testsuite/Magento/Paypal/Model/Config/Structure/Element/FieldPluginTest.php deleted file mode 100644 index 6565f3b2b29ce..0000000000000 --- a/dev/tests/unit/testsuite/Magento/Paypal/Model/Config/Structure/Element/FieldPluginTest.php +++ /dev/null @@ -1,81 +0,0 @@ -request = $this->getMockForAbstractClass('Magento\Framework\App\RequestInterface'); - $this->subject = $this->getMock('Magento\Backend\Model\Config\Structure\Element\Field', [], [], '', false); - - $helper = new \Magento\TestFramework\Helper\ObjectManager($this); - $this->model = $helper->getObject( - 'Magento\Paypal\Model\Config\Structure\Element\FieldPlugin', - ['request' => $this->request] - ); - } - - public function testAroundGetConfigPathHasResult() - { - $someResult = 'some result'; - $callback = function () use ($someResult) { - return $someResult; - }; - $this->assertEquals($someResult, $this->model->aroundGetConfigPath($this->subject, $callback)); - } - - public function testAroundGetConfigPathNonPaymentSection() - { - $callback = function () { - return null; - }; - $this->request->expects($this->once()) - ->method('getParam') - ->with('section') - ->will($this->returnValue('non-payment')); - $this->assertNull($this->model->aroundGetConfigPath($this->subject, $callback)); - } - - /** - * @param string $subjectPath - * @param string $expectedConfigPath - * @dataProvider aroundGetConfigPathDataProvider - */ - public function testAroundGetConfigPath($subjectPath, $expectedConfigPath) - { - $callback = function () { - return null; - }; - $this->request->expects($this->once()) - ->method('getParam') - ->with('section') - ->will($this->returnValue('payment')); - $this->subject->expects($this->once()) - ->method('getPath') - ->will($this->returnValue($subjectPath)); - $this->assertEquals($expectedConfigPath, $this->model->aroundGetConfigPath($this->subject, $callback)); - } - - public function aroundGetConfigPathDataProvider() - { - return [ - ['payment_us/group/field', 'payment/group/field'], - ['payment_other/group/field', 'payment/group/field'], - ['payment_us', 'payment_us'], - ['payment_wrong_country/group/field', 'payment_wrong_country/group/field'], - ]; - } -} diff --git a/dev/tests/unit/testsuite/Magento/Paypal/Model/Config/StructurePluginTest.php b/dev/tests/unit/testsuite/Magento/Paypal/Model/Config/StructurePluginTest.php deleted file mode 100644 index f6e21eb2e23f1..0000000000000 --- a/dev/tests/unit/testsuite/Magento/Paypal/Model/Config/StructurePluginTest.php +++ /dev/null @@ -1,203 +0,0 @@ -_scopeDefiner = $this->getMock('Magento\Backend\Model\Config\ScopeDefiner', [], [], '', false); - $this->_helper = $this->getMock('Magento\Paypal\Helper\Backend', [], [], '', false); - - $objectManagerHelper = new ObjectManagerHelper($this); - $this->_model = $objectManagerHelper->getObject( - 'Magento\Paypal\Model\Config\StructurePlugin', - ['scopeDefiner' => $this->_scopeDefiner, 'helper' => $this->_helper] - ); - } - - public function testGetPaypalConfigCountriesWithOther() - { - $countries = StructurePlugin::getPaypalConfigCountries(true); - $this->assertContains('payment_us', $countries); - $this->assertContains('payment_other', $countries); - } - - public function testGetPaypalConfigCountries() - { - $countries = StructurePlugin::getPaypalConfigCountries(false); - $this->assertContains('payment_us', $countries); - $this->assertNotContains('payment_other', $countries); - } - - /** - * @param array $pathParts - * @param bool $returnResult - * @dataProvider aroundGetElementByPathPartsNonPaymentDataProvider - */ - public function testAroundGetElementByPathPartsNonPayment($pathParts, $returnResult) - { - $result = $returnResult - ? $this->getMockForAbstractClass('Magento\Backend\Model\Config\Structure\ElementInterface') - : null; - $this->_aroundGetElementByPathPartsAssertResult( - $result, - $this->_getElementByPathPartsCallback($pathParts, $result), - $pathParts - ); - } - - public function aroundGetElementByPathPartsNonPaymentDataProvider() - { - return [ - [['non-payment', 'group1', 'group2', 'field'], true], - [['non-payment'], true], - [['non-payment', 'group1', 'group2', 'field'], false], - [['non-payment'], false], - ]; - } - - /** - * @param array $pathParts - * @param string $countryCode - * @param array $expectedPathParts - * @dataProvider aroundGetElementByPathPartsDataProvider - */ - public function testAroundGetElementByPathPartsNoResult($pathParts, $countryCode, $expectedPathParts) - { - $this->_getElementByPathPartsPrepareHelper($countryCode); - $this->_aroundGetElementByPathPartsAssertResult( - null, - $this->_getElementByPathPartsCallback($expectedPathParts, null), - $pathParts - ); - } - - /** - * @param array $pathParts - * @param string $countryCode - * @param array $expectedPathParts - * @dataProvider aroundGetElementByPathPartsDataProvider - */ - public function testAroundGetElementByPathParts($pathParts, $countryCode, $expectedPathParts) - { - $this->_getElementByPathPartsPrepareHelper($countryCode); - $result = $this->getMockForAbstractClass('Magento\Backend\Model\Config\Structure\ElementInterface'); - $this->_aroundGetElementByPathPartsAssertResult( - $result, - $this->_getElementByPathPartsCallback($expectedPathParts, $result), - $pathParts - ); - } - - public function aroundGetElementByPathPartsDataProvider() - { - return [ - [ - ['payment', 'group1', 'group2', 'field'], - 'any', - ['payment_other', 'group1', 'group2', 'field'], - ], - [ - ['payment', 'group1', 'group2', 'field'], - 'DE', - ['payment_de', 'group1', 'group2', 'field'] - ], - ]; - } - - /** - * @param array $pathParts - * @param string $countryCode - * @param array $expectedPathParts - * @dataProvider aroundGetSectionByPathPartsDataProvider - */ - public function testAroundGetSectionByPathParts($pathParts, $countryCode, $expectedPathParts) - { - $this->_getElementByPathPartsPrepareHelper($countryCode); - $result = $this->getMock('Magento\Backend\Model\Config\Structure\Element\Section', [], [], '', false); - $self = $this; - $getElementByPathParts = function ($pathParts) use ($self, $expectedPathParts, $result) { - $self->assertEquals($expectedPathParts, $pathParts); - $scope = 'any scope'; - $self->_scopeDefiner->expects($self->once()) - ->method('getScope') - ->will($self->returnValue($scope)); - $result->expects($self->once()) - ->method('getData') - ->will($self->returnValue([])); - $result->expects($self->once()) - ->method('setData') - ->with(['showInDefault' => true, 'showInWebsite' => true, 'showInStore' => true], $scope) - ->will($self->returnSelf()); - return $result; - }; - $this->_aroundGetElementByPathPartsAssertResult($result, $getElementByPathParts, $pathParts); - } - - public function aroundGetSectionByPathPartsDataProvider() - { - return [ - [['payment'], 'GB', ['payment_gb']], - [['payment'], 'any', ['payment_other']], - ]; - } - - /** - * Assert result of aroundGetElementByPathParts method - * - * @param \PHPUnit_Framework_MockObject_MockObject|null $result - * @param \Closure $getElementByPathParts - * @param array $pathParts - */ - private function _aroundGetElementByPathPartsAssertResult($result, $getElementByPathParts, $pathParts) - { - $this->assertEquals($result, $this->_model->aroundGetElementByPathParts( - $this->getMock('Magento\Backend\Model\Config\Structure', [], [], '', false), - $getElementByPathParts, - $pathParts - )); - } - - /** - * Get callback for aroundGetElementByPathParts method - * - * @param array $expectedPathParts - * @param \PHPUnit_Framework_MockObject_MockObject|null $result - * @return \Closure - */ - private function _getElementByPathPartsCallback($expectedPathParts, $result) - { - $self = $this; - return function ($pathParts) use ($self, $expectedPathParts, $result) { - $self->assertEquals($expectedPathParts, $pathParts); - return $result; - }; - } - - /** - * Prepare helper for test - * - * @param string $countryCode - */ - private function _getElementByPathPartsPrepareHelper($countryCode) - { - $this->_helper->expects($this->once()) - ->method('getConfigurationCountryCode') - ->will($this->returnValue($countryCode)); - } -} diff --git a/dev/tests/unit/testsuite/Magento/Paypal/Model/ConfigTest.php b/dev/tests/unit/testsuite/Magento/Paypal/Model/ConfigTest.php deleted file mode 100644 index 8b6bed6a26eb9..0000000000000 --- a/dev/tests/unit/testsuite/Magento/Paypal/Model/ConfigTest.php +++ /dev/null @@ -1,257 +0,0 @@ -_scopeConfig = $this->getMock( - 'Magento\Framework\App\Config\ScopeConfigInterface', - ['getValue', 'isSetFlag'], - [], - '', - false - ); - $this->_coreData = $this->getMock('Magento\Core\Helper\Data', ['getDefaultCountry'], [], '', false); - $this->_model = $helper->getObject( - 'Magento\Paypal\Model\Config', - ['scopeConfig' => $this->_scopeConfig, 'coreData' => $this->_coreData] - ); - } - - public function testGetCountryMethods() - { - $this->assertNotContains('payflow_direct', $this->_model->getCountryMethods('GB')); - $this->assertContains(Config::METHOD_WPP_PE_EXPRESS, $this->_model->getCountryMethods('CA')); - $this->assertNotContains(Config::METHOD_WPP_PE_EXPRESS, $this->_model->getCountryMethods('GB')); - $this->assertContains(Config::METHOD_WPP_PE_EXPRESS, $this->_model->getCountryMethods('CA')); - $this->assertContains(Config::METHOD_WPP_EXPRESS, $this->_model->getCountryMethods('DE')); - $this->assertContains(Config::METHOD_BILLING_AGREEMENT, $this->_model->getCountryMethods('DE')); - } - - public function testGetBuildNotationCode() - { - $this->_model->setMethod('payflow_direct'); - $this->_model->setStoreId(123); - $this->_scopeConfig->expects($this->once()) - ->method('getValue') - ->with('paypal/bncode', \Magento\Store\Model\ScopeInterface::SCOPE_STORE, 123) - ->will($this->returnValue('some BN code')); - $this->assertEquals('some BN code', $this->_model->getBuildNotationCode()); - } - - public function testIsMethodActive() - { - $this->assertFalse($this->_model->isMethodActive('payflow_direct')); - } - - /** - * test for eliminating payflow_direct - */ - public function testIsMethodAvailableWPPPE() - { - $this->assertFalse($this->_model->isMethodAvailable('payflow_direct')); - } - - /** - * @dataProvider isMethodAvailableDataProvider - */ - public function testIsMethodAvailableForIsMethodActive($methodName, $expected) - { - $this->_scopeConfig->expects($this->any()) - ->method('getValue') - ->with('paypal/general/merchant_country') - ->will($this->returnValue('US')); - $this->_scopeConfig->expects($this->exactly(2)) - ->method('isSetFlag') - ->withAnyParameters() - ->will($this->returnValue(true)); - - $this->_model->setMethod($methodName); - $this->assertEquals($expected, $this->_model->isMethodAvailable($methodName)); - } - - /** - * @return array - */ - public function isMethodAvailableDataProvider() - { - return [ - [Config::METHOD_WPP_EXPRESS, true], - [Config::METHOD_WPP_BML, true], - [Config::METHOD_WPP_PE_EXPRESS, true], - [Config::METHOD_WPP_PE_BML, true], - ]; - } - - public function testIsCreditCardMethod() - { - $this->assertFalse($this->_model->getIsCreditCardMethod('payflow_direct')); - } - - public function testGetSpecificConfigPath() - { - $this->_model->setMethod('payflow_direct'); - $this->assertNull($this->_model->getConfigValue('useccv')); - $this->assertNull($this->_model->getConfigValue('vendor')); - - // _mapBmlFieldset - $this->_model->setMethod(Config::METHOD_WPP_BML); - $this->_scopeConfig->expects($this->once()) - ->method('getValue') - ->with('payment/' . Config::METHOD_WPP_EXPRESS . '/allow_ba_signup') - ->will($this->returnValue(1)); - $this->assertEquals(1, $this->_model->getConfigValue('allow_ba_signup')); - } - - public function testGetSpecificConfigPathPayflow() - { - // _mapBmlPayflowFieldset - $this->_model->setMethod(Config::METHOD_WPP_PE_BML); - $this->_scopeConfig->expects($this->once()) - ->method('getValue') - ->with('payment/' . Config::METHOD_WPP_PE_EXPRESS . '/allow_ba_signup') - ->will($this->returnValue(1)); - $this->assertEquals(1, $this->_model->getConfigValue('allow_ba_signup')); - } - - /** - * @dataProvider skipOrderReviewStepDataProvider - */ - public function testGetPayPalBasicStartUrl($value, $url) - { - $this->_scopeConfig->expects($this->once()) - ->method('getValue') - ->with('payment/paypal_express/skip_order_review_step') - ->will($this->returnValue($value)); - $this->assertEquals($url, $this->_model->getPayPalBasicStartUrl('token')); - } - - /** - * @return array - */ - public function skipOrderReviewStepDataProvider() - { - return [ - [true, 'https://www.paypal.com/cgi-bin/webscr?cmd=_express-checkout&token=token&useraction=commit'], - [false, 'https://www.paypal.com/cgi-bin/webscr?cmd=_express-checkout&token=token'] - ]; - } - - public function testGetExpressCheckoutOrderUrl() - { - $url = 'https://www.paypal.com/cgi-bin/webscr?cmd=_express-checkout&order_id=orderId'; - $this->assertEquals($url, $this->_model->getExpressCheckoutOrderUrl('orderId')); - } - - public function testGetBmlPublisherId() - { - $this->_scopeConfig->expects($this->once()) - ->method('getValue') - ->with('payment/' . Config::METHOD_WPP_BML . '/publisher_id') - ->will($this->returnValue('12345')); - $this->assertEquals('12345', $this->_model->getBmlPublisherId()); - } - - /** - * @dataProvider getBmlPositionDataProvider - */ - public function testGetBmlPosition($section, $expected) - { - $this->_scopeConfig->expects($this->once()) - ->method('getValue') - ->with('payment/' . Config::METHOD_WPP_BML . '/' . $section . '_position') - ->will($this->returnValue($expected)); - $this->assertEquals($expected, $this->_model->getBmlPosition($section)); - } - - /** - * @return array - */ - public function getBmlPositionDataProvider() - { - return [ - ['head', 'left'], - ['checkout', 'top'] - ]; - } - - /** - * @dataProvider getBmlSizeDataProvider - */ - public function testGetBmlSize($section, $expected) - { - $this->_scopeConfig->expects($this->once()) - ->method('getValue') - ->with('payment/' . Config::METHOD_WPP_BML . '/' . $section . '_size') - ->will($this->returnValue($expected)); - $this->assertEquals($expected, $this->_model->getBmlSize($section)); - } - - /** - * @return array - */ - public function getBmlSizeDataProvider() - { - return [ - ['head', '125x75'], - ['checkout', ['50x50']] - ]; - } - - /** - * @dataProvider dataProviderGetBmlDisplay - */ - public function testGetBmlDisplay($section, $expectedValue, $expectedFlag, $expected) - { - $this->_model->setStoreId(1); - $this->_coreData->expects($this->any()) - ->method('getDefaultCountry') - ->with(1) - ->will($this->returnValue('US')); - $this->_scopeConfig->expects($this->any()) - ->method('isSetFlag') - ->will($this->returnValue($expectedFlag)); - $this->_scopeConfig->expects($this->any()) - ->method('getValue') - ->will($this->returnValueMap([ - ['payment/' . Config::METHOD_WPP_BML . '/' . $section . '_display', 'store', 1, $expectedValue], - ['payment/' . Config::METHOD_WPP_BML . '/active', 'store', 1, $expectedValue], - ['payment/' . Config::METHOD_WPP_PE_BML . '/active', 'store', 1, $expectedValue], - ])); - $this->assertEquals($expected, $this->_model->getBmlDisplay($section)); - } - - /** - * @return array - */ - public function dataProviderGetBmlDisplay() - { - return [ - ['head', true, true, true], - ['head', true, false, false], - ['head', false, true, false], - ['head', false, false, false], - ]; - } -} diff --git a/dev/tests/unit/testsuite/Magento/Paypal/Model/Express/Checkout/QuoteTest.php b/dev/tests/unit/testsuite/Magento/Paypal/Model/Express/Checkout/QuoteTest.php deleted file mode 100644 index 3f0c168711069..0000000000000 --- a/dev/tests/unit/testsuite/Magento/Paypal/Model/Express/Checkout/QuoteTest.php +++ /dev/null @@ -1,149 +0,0 @@ -addressBuilderMock = $this->getMock( - 'Magento\Customer\Api\Data\AddressDataBuilder', - ['populateWithArray', 'create'], - [], - '', - false - ); - $this->copyObjectMock = $this->getMock( - 'Magento\Framework\Object\Copy', - [], - [], - '', - false - ); - $this->customerBuilderMock = $this->getMock( - 'Magento\Customer\Api\Data\CustomerDataBuilder', - [ - 'populateWithArray', 'setEmail', 'setPrefix', 'setFirstname', 'setMiddlename', - 'setLastname', 'setSuffix', 'create' - ], - [], - '', - false - ); - $this->customerRepositoryMock = $this->getMockForAbstractClass( - 'Magento\Customer\Api\CustomerRepositoryInterface', - [], - '', - false, - true, - true, - [] - ); - $this->customerSessionMock = $this->getMock( - 'Magento\Customer\Model\Session', - [], - [], - '', - false - ); - $this->quoteMock = $this->getMock( - 'Magento\Sales\Model\Quote', - [], - [], - '', - false - ); - $this->addressMock = $this->getMock('Magento\Sales\Model\Quote\Address', [], [], '', false); - - $this->quote = new \Magento\Paypal\Model\Express\Checkout\Quote( - $this->addressBuilderMock, - $this->customerBuilderMock, - $this->customerRepositoryMock, - $this->copyObjectMock, - $this->customerSessionMock - ); - } - - public function testPrepareQuoteForNewCustomer() - { - $this->quoteMock->expects($this->once()) - ->method('getBillingAddress') - ->willReturn($this->addressMock); - $this->quoteMock->expects($this->once()) - ->method('getShippingAddress') - ->willReturn($this->addressMock); - $customerAddressMock = $this->getMockBuilder('Magento\Customer\Api\Data\AddressInterface') - ->disableOriginalConstructor() - ->getMock(); - $this->addressMock->expects($this->once()) - ->method('exportCustomerAddress') - ->willReturn($customerAddressMock); - $this->quoteMock->expects($this->once()) - ->method('getShippingAddress') - ->willReturn($this->addressMock); - $this->addressMock->expects($this->exactly(2)) - ->method('getData') - ->willReturn([]); - $this->addressBuilderMock->expects($this->exactly(2)) - ->method('populateWithArray') - ->willReturnSelf(); - $customerDataMock = $this->getMockBuilder('Magento\Customer\Api\Data\CustomerInterface') - ->disableOriginalConstructor() - ->getMock(); - $this->customerBuilderMock->expects($this->once()) - ->method('populateWithArray') - ->willReturnSelf(); - $this->customerBuilderMock->expects($this->once()) - ->method('create') - ->willReturn($customerDataMock); - $this->assertInstanceOf( - 'Magento\Sales\Model\Quote', - $this->quote->prepareQuoteForNewCustomer($this->quoteMock) - ); - } -} diff --git a/dev/tests/unit/testsuite/Magento/Paypal/Model/Express/CheckoutTest.php b/dev/tests/unit/testsuite/Magento/Paypal/Model/Express/CheckoutTest.php deleted file mode 100644 index 1bca1c26716ae..0000000000000 --- a/dev/tests/unit/testsuite/Magento/Paypal/Model/Express/CheckoutTest.php +++ /dev/null @@ -1,150 +0,0 @@ -objectManager = new \Magento\TestFramework\Helper\ObjectManager($this); - $this->customerMock = $this->getMock('Magento\Customer\Model\Customer', [], [], '', false); - $this->quoteMock = $this->getMock('Magento\Sales\Model\Quote', - [ - 'getId', 'assignCustomer', 'assignCustomerWithAddressChange', 'getBillingAddress', - 'getShippingAddress', 'isVirtual', 'addCustomerAddress', 'collectTotals', '__wakeup', - 'save', 'getCustomerData' - ], [], '', false); - $this->serviceQuote = $this->getMock('\Magento\Sales\Model\Service\Quote', [], [], '', false); - $this->quoteFactoryMock = $this->getMock( - '\Magento\Sales\Model\Service\QuoteFactory', - ['create'], - [], - '', - false - ); - $this->customerAccountManagementMock = $this->getMock( - '\Magento\Customer\Model\AccountManagement', - [], - [], - '', - false - ); - $this->addressBuilderFactoryMock = $this->getMockBuilder( - '\Magento\Customer\Api\Data\AddressDataBuilderFactory' - ) - ->setMethods(['create', 'populate']) - ->disableOriginalConstructor() - ->getMock(); - $this->customerBuilderMock = $this->getMock( - 'Magento\Customer\Api\Data\CustomerDataBuilder', - [ - 'populateWithArray', 'setEmail', 'create', 'setPrefix', 'setFirstname', 'setMiddlename', - 'setLastname', 'setSuffix' - ], [], '', false - ); - $this->objectCopyServiceMock = $this->getMockBuilder('\Magento\Framework\Object\Copy') - ->disableOriginalConstructor() - ->getMock(); - $this->customerSessionMock = $this->getMockBuilder('\Magento\Customer\Model\Session') - ->disableOriginalConstructor() - ->getMock(); - $paypalConfigMock = $this->getMock('Magento\Paypal\Model\Config', [], [], '', false); - $this->checkoutModel = $this->objectManager->getObject( - 'Magento\Paypal\Model\Express\Checkout', - [ - 'params' => [ - 'quote' => $this->quoteMock, - 'config' => $paypalConfigMock, - 'session' => $this->customerSessionMock, - ], - 'accountManagement' => $this->customerAccountManagementMock, - 'serviceQuoteFactory' => $this->quoteFactoryMock, - 'addressBuilderFactory' => $this->addressBuilderFactoryMock, - 'objectCopyService' => $this->objectCopyServiceMock, - 'customerBuilder' => $this->customerBuilderMock - ] - ); - parent::setUp(); - } - - public function testSetCustomerData() - { - $customerDataMock = $this->getMock('Magento\Customer\Api\Data\CustomerInterface', [], [], '', false); - $this->quoteMock->expects($this->once())->method('assignCustomer')->with($customerDataMock); - $customerDataMock->expects($this->once()) - ->method('getId'); - $this->checkoutModel->setCustomerData($customerDataMock); - } - - public function testSetCustomerWithAddressChange() - { - /** @var \Magento\Customer\Api\Data\CustomerInterface $customerDataMock */ - $customerDataMock = $this->getMock('Magento\Customer\Api\Data\CustomerInterface', [], [], '', false); - /** @var \Magento\Sales\Model\Quote\Address $customerDataMock */ - $quoteAddressMock = $this->getMock('Magento\Sales\Model\Quote\Address', [], [], '', false); - $this->quoteMock - ->expects($this->once()) - ->method('assignCustomerWithAddressChange') - ->with($customerDataMock, $quoteAddressMock, $quoteAddressMock); - $customerDataMock->expects($this->once())->method('getId'); - $this->checkoutModel->setCustomerWithAddressChange($customerDataMock, $quoteAddressMock, $quoteAddressMock); - } -} diff --git a/dev/tests/unit/testsuite/Magento/Paypal/Model/ExpressTest.php b/dev/tests/unit/testsuite/Magento/Paypal/Model/ExpressTest.php deleted file mode 100644 index ad16315e17d09..0000000000000 --- a/dev/tests/unit/testsuite/Magento/Paypal/Model/ExpressTest.php +++ /dev/null @@ -1,119 +0,0 @@ -_checkoutSession = $this->getMock( - 'Magento\Checkout\Model\Session', - ['getPaypalTransactionData', 'setPaypalTransactionData'], - [], - '', - false - ); - $this->_nvp = $this->getMock( - 'Magento\Paypal\Model\Api\Nvp', - ['setProcessableErrors', 'setAmount', 'setCurrencyCode', 'setTransactionId', 'callDoAuthorization'], - [], - '', - false - ); - $this->_pro = $this->getMock( - 'Magento\Paypal\Model\ProFactory', - ['create', 'setMethod', 'getApi', 'importPaymentInfo', 'resetApi'], - [], - '', - false - ); - $this->_pro->expects($this->any())->method('create')->will($this->returnSelf()); - $this->_helper = new \Magento\TestFramework\Helper\ObjectManager($this); - } - - public function testSetApiProcessableErrors() - { - $this->_nvp->expects($this->once())->method('setProcessableErrors')->with($this->errorCodes); - $this->_pro->expects($this->any())->method('getApi')->will($this->returnValue($this->_nvp)); - $this->_model = $this->_helper->getObject( - 'Magento\Paypal\Model\Express', - ['proFactory' => $this->_pro, 'checkoutSession' => $this->_checkoutSession] - ); - } - - public function testOrder() - { - $this->_nvp->expects($this->any())->method('setProcessableErrors')->will($this->returnSelf()); - $this->_nvp->expects($this->any())->method('setAmount')->will($this->returnSelf()); - $this->_nvp->expects($this->any())->method('setCurrencyCode')->will($this->returnSelf()); - $this->_nvp->expects($this->any())->method('setTransactionId')->will($this->returnSelf()); - $this->_nvp->expects($this->any())->method('callDoAuthorization')->will($this->returnSelf()); - $this->_pro->expects($this->any())->method('getApi')->will($this->returnValue($this->_nvp)); - $this->_checkoutSession->expects($this->once())->method('getPaypalTransactionData')->will( - $this->returnValue([]) - ); - $this->_checkoutSession->expects($this->once())->method('setPaypalTransactionData')->with([]); - - $currency = $this->getMock('Magento\Directory\Model\Currency', ['__wakeup', 'formatTxt'], [], '', false); - $paymentModel = $this->getMock( - 'Magento\Sales\Model\Order\Payment', - ['__wakeup', 'getBaseCurrency', 'getOrder', 'getIsTransactionPending', 'addStatusHistoryComment'], - [], - '', - false - ); - $paymentModel->expects($this->any())->method('getOrder')->will($this->returnSelf()); - $paymentModel->expects($this->any())->method('getBaseCurrency')->will($this->returnValue($currency)); - $paymentModel->expects($this->any())->method('getIsTransactionPending')->will($this->returnSelf()); - $this->_model = $this->_helper->getObject( - 'Magento\Paypal\Model\Express', - ['proFactory' => $this->_pro, 'checkoutSession' => $this->_checkoutSession] - ); - $this->_model->order($paymentModel, 12.3); - $this->assertEquals('payment_review', $paymentModel->getState()); - } -} diff --git a/dev/tests/unit/testsuite/Magento/Paypal/Model/Hostedpro/RequestTest.php b/dev/tests/unit/testsuite/Magento/Paypal/Model/Hostedpro/RequestTest.php deleted file mode 100644 index 068bb48beda12..0000000000000 --- a/dev/tests/unit/testsuite/Magento/Paypal/Model/Hostedpro/RequestTest.php +++ /dev/null @@ -1,94 +0,0 @@ -_model = $helper->getObject( - 'Magento\Paypal\Model\Hostedpro\Request' - ); - } - - /** - * @dataProvider addressesDataProvider - */ - public function testSetOrderAddresses($billing, $shipping, $billingState, $state) - { - $payment = $this->getMock('Magento\Sales\Model\Order\Payment', ['__wakeup'], [], '', false); - $order = $this->getMock( - 'Magento\Sales\Model\Order', - ['getPayment', '__wakeup', 'getBillingAddress', 'getShippingAddress'], - [], - '', - false - ); - $order->expects($this->any()) - ->method('getPayment') - ->will($this->returnValue($payment)); - $order->expects($this->any()) - ->method('getBillingAddress') - ->will($this->returnValue($billing)); - $order->expects($this->any()) - ->method('getShippingAddress') - ->will($this->returnValue($shipping)); - $this->_model->setOrder($order); - $this->assertEquals($billingState, $this->_model->getData('billing_state')); - $this->assertEquals($state, $this->_model->getData('state')); - } - - /** - * @return array - */ - public function addressesDataProvider() - { - $billing = new \Magento\Framework\Object([ - 'firstname' => 'Firstname', - 'lastname' => 'Lastname', - 'city' => 'City', - 'region_code' => 'CA', - 'postcode' => '12346', - 'country' => 'United States', - 'Street' => '1 Ln Ave', - ]); - $shipping = new \Magento\Framework\Object([ - 'firstname' => 'ShipFirstname', - 'lastname' => 'ShipLastname', - 'city' => 'ShipCity', - 'region' => 'olala', - 'postcode' => '12346', - 'country' => 'United States', - 'Street' => '1 Ln Ave', - ]); - $billing2 = new \Magento\Framework\Object([ - 'firstname' => 'Firstname', - 'lastname' => 'Lastname', - 'city' => 'City', - 'region_code' => 'muuuu', - 'postcode' => '12346', - 'country' => 'United States', - 'Street' => '1 Ln Ave', - ]); - $shipping2 = new \Magento\Framework\Object([ - 'firstname' => 'ShipFirstname', - 'lastname' => 'ShipLastname', - 'city' => 'ShipCity', - 'postcode' => '12346', - 'country' => 'United States', - 'Street' => '1 Ln Ave', - ]); - return [ - [$billing, $shipping, 'CA', 'olala'], - [$billing2, $shipping2, 'muuuu', 'ShipCity'] - ]; - } -} diff --git a/dev/tests/unit/testsuite/Magento/Paypal/Model/InfoTest.php b/dev/tests/unit/testsuite/Magento/Paypal/Model/InfoTest.php deleted file mode 100644 index 0dc9087bc7751..0000000000000 --- a/dev/tests/unit/testsuite/Magento/Paypal/Model/InfoTest.php +++ /dev/null @@ -1,257 +0,0 @@ -objectManagerHelper = new ObjectManagerHelper($this); - $this->info = $this->objectManagerHelper->getObject( - 'Magento\Paypal\Model\Info' - ); - } - - /** - * @dataProvider additionalInfoDataProvider - * @param array $additionalInfo - * @param array $expectation - */ - public function testGetPaymentInfo($additionalInfo, $expectation) - { - /** @var \Magento\Payment\Model\Info $paymentInfo */ - $paymentInfo = $this->objectManagerHelper->getObject('Magento\Payment\Model\Info'); - $paymentInfo->setAdditionalInformation($additionalInfo); - $this->assertEquals($expectation, $this->info->getPaymentInfo($paymentInfo)); - } - - /** - * @dataProvider additionalInfoDataProvider - * @param array $additionalInfo - * @param array $expectation - */ - public function testGetPaymentInfoLabelValues($additionalInfo, $expectation) - { - /** @var \Magento\Payment\Model\Info $paymentInfo */ - $paymentInfo = $this->objectManagerHelper->getObject('Magento\Payment\Model\Info'); - $paymentInfo->setAdditionalInformation($additionalInfo); - $this->assertEquals( - $this->_prepareLabelValuesExpectation($expectation), - $this->info->getPaymentInfo($paymentInfo, true) - ); - } - - /** - * @dataProvider additionalInfoPublicDataProvider - * @param array $additionalInfo - * @param array $expectation - */ - public function testGetPublicPaymentInfo($additionalInfo, $expectation) - { - /** @var \Magento\Payment\Model\Info $paymentInfo */ - $paymentInfo = $this->objectManagerHelper->getObject('Magento\Payment\Model\Info'); - $paymentInfo->setAdditionalInformation($additionalInfo); - $this->assertEquals( - $this->_prepareLabelValuesExpectation($expectation), - $this->info->getPublicPaymentInfo($paymentInfo, true) - ); - } - - /** - * @dataProvider additionalInfoPublicDataProvider - * @param array $additionalInfo - * @param array $expectation - */ - public function testGetPublicPaymentInfoLabelValues($additionalInfo, $expectation) - { - /** @var \Magento\Payment\Model\Info $paymentInfo */ - $paymentInfo = $this->objectManagerHelper->getObject('Magento\Payment\Model\Info'); - $paymentInfo->setAdditionalInformation($additionalInfo); - $this->assertEquals($expectation, $this->info->getPublicPaymentInfo($paymentInfo)); - } - - /** - * @dataProvider importToPaymentDataProvider - * @param array $mapping - * @param array $expectation - */ - public function testImportToPayment($mapping, $expectation) - { - // we create $from object, based on mapping - $from = new \Magento\Framework\Object($mapping); - /** @var \Magento\Payment\Model\Info $paymentInfo */ - $paymentInfo = $this->objectManagerHelper->getObject('Magento\Payment\Model\Info'); - $this->info->importToPayment($from, $paymentInfo); - $this->assertEquals($expectation, $paymentInfo->getAdditionalInformation()); - } - - /** - * @dataProvider importToPaymentDataProvider - * @param array $mapping - * @param array $expectation - */ - public function testExportFromPayment($mapping, $expectation) - { - /** @var \Magento\Payment\Model\Info $paymentInfo */ - $paymentInfo = $this->objectManagerHelper->getObject('Magento\Payment\Model\Info'); - $paymentInfo->setAdditionalInformation($expectation); - - // we create $to empty object - $to = new \Magento\Framework\Object(); - $this->info->exportFromPayment($paymentInfo, $to); - $this->assertEquals($mapping, $to->getData()); - } - - /** - * @dataProvider importToPaymentDataProvider - * @param array $mapping - * @param array $expectation - */ - public function testExportFromPaymentCustomMapping($mapping, $expectation) - { - /** @var \Magento\Payment\Model\Info $paymentInfo */ - $paymentInfo = $this->objectManagerHelper->getObject('Magento\Payment\Model\Info'); - $paymentInfo->setAdditionalInformation($expectation); - - // we create $to empty object - $to = new \Magento\Framework\Object(); - $this->info->exportFromPayment($paymentInfo, $to, array_flip($mapping)); - $this->assertEquals($mapping, $to->getData()); - } - - /** - * Converts expectation result from ['key' => ['label' => 'Label', 'value' => 'Value']] to ['Label' => 'Value'] - * - * @param $expectation - * @return array - */ - private function _prepareLabelValuesExpectation($expectation) - { - $labelValueExpectation = []; - foreach ($expectation as $data) { - $labelValueExpectation[$data['label']] = $data['value']; - } - return $labelValueExpectation; - } - - /** - * List of Labels - * - * @return array - */ - public function additionalInfoDataProvider() - { - return include __DIR__ . '/_files/additional_info_data.php'; - } - - /** - *List of public labels - * - * @return array - */ - public function additionalInfoPublicDataProvider() - { - return [ - [ - [ - Info::PAYPAL_PAYER_EMAIL => Info::PAYPAL_PAYER_EMAIL, - Info::BUYER_TAX_ID => Info::BUYER_TAX_ID, - Info::BUYER_TAX_ID_TYPE => Info::BUYER_TAX_ID_TYPE_CNPJ, - ], - [ - Info::PAYPAL_PAYER_EMAIL => [ - 'label' => 'Payer Email', - 'value' => Info::PAYPAL_PAYER_EMAIL, - ], - Info::BUYER_TAX_ID => [ - 'label' => 'Buyer\'s Tax ID', - 'value' => Info::BUYER_TAX_ID, - ], - Info::BUYER_TAX_ID_TYPE => [ - 'label' => 'Buyer\'s Tax ID Type', - 'value' => 'CNPJ', - ] - ], - ], - [ - [ - Info::PAYPAL_PAYER_EMAIL => Info::PAYPAL_PAYER_EMAIL, - Info::BUYER_TAX_ID => Info::BUYER_TAX_ID, - Info::BUYER_TAX_ID_TYPE => Info::BUYER_TAX_ID_TYPE, - ], - [ - Info::PAYPAL_PAYER_EMAIL => [ - 'label' => 'Payer Email', - 'value' => Info::PAYPAL_PAYER_EMAIL, - ], - Info::BUYER_TAX_ID => [ - 'label' => 'Buyer\'s Tax ID', - 'value' => Info::BUYER_TAX_ID, - ] - ] - ] - ]; - } - - /** - * Mapping and expectation - * - * @return array - */ - public function importToPaymentDataProvider() - { - return [ - [ - [ - Info::PAYER_ID => Info::PAYPAL_PAYER_ID, - Info::PAYER_EMAIL => Info::PAYPAL_PAYER_EMAIL, - Info::PAYER_STATUS => Info::PAYPAL_PAYER_STATUS, - Info::ADDRESS_ID => Info::PAYPAL_ADDRESS_ID, - Info::ADDRESS_STATUS => Info::PAYPAL_ADDRESS_STATUS, - Info::PROTECTION_EL => Info::PAYPAL_PROTECTION_ELIGIBILITY, - Info::FRAUD_FILTERS => Info::PAYPAL_FRAUD_FILTERS, - Info::CORRELATION_ID => Info::PAYPAL_CORRELATION_ID, - Info::AVS_CODE => Info::PAYPAL_AVS_CODE, - Info::CVV_2_MATCH => Info::PAYPAL_CVV_2_MATCH, - Info::CENTINEL_VPAS => Info::CENTINEL_VPAS, - Info::CENTINEL_ECI => Info::CENTINEL_ECI, - Info::BUYER_TAX_ID => Info::BUYER_TAX_ID, - Info::BUYER_TAX_ID_TYPE => Info::BUYER_TAX_ID_TYPE, - Info::PAYMENT_STATUS => Info::PAYMENT_STATUS_GLOBAL, - Info::PENDING_REASON => Info::PENDING_REASON_GLOBAL, - Info::IS_FRAUD => Info::IS_FRAUD_GLOBAL, - ], - [ - Info::PAYPAL_PAYER_ID => Info::PAYPAL_PAYER_ID, - Info::PAYPAL_PAYER_EMAIL => Info::PAYPAL_PAYER_EMAIL, - Info::PAYPAL_PAYER_STATUS => Info::PAYPAL_PAYER_STATUS, - Info::PAYPAL_ADDRESS_ID => Info::PAYPAL_ADDRESS_ID, - Info::PAYPAL_ADDRESS_STATUS => Info::PAYPAL_ADDRESS_STATUS, - Info::PAYPAL_PROTECTION_ELIGIBILITY => Info::PAYPAL_PROTECTION_ELIGIBILITY, - Info::PAYPAL_FRAUD_FILTERS => Info::PAYPAL_FRAUD_FILTERS, - Info::PAYPAL_CORRELATION_ID => Info::PAYPAL_CORRELATION_ID, - Info::PAYPAL_AVS_CODE => Info::PAYPAL_AVS_CODE, - Info::PAYPAL_CVV_2_MATCH => Info::PAYPAL_CVV_2_MATCH, - Info::CENTINEL_VPAS => Info::CENTINEL_VPAS, - Info::CENTINEL_ECI => Info::CENTINEL_ECI, - Info::BUYER_TAX_ID => Info::BUYER_TAX_ID, - Info::BUYER_TAX_ID_TYPE => Info::BUYER_TAX_ID_TYPE, - Info::PAYMENT_STATUS_GLOBAL => Info::PAYMENT_STATUS_GLOBAL, - Info::PENDING_REASON_GLOBAL => Info::PENDING_REASON_GLOBAL, - Info::IS_FRAUD_GLOBAL => Info::IS_FRAUD_GLOBAL - ], - ] - ]; - } -} diff --git a/dev/tests/unit/testsuite/Magento/Paypal/Model/IpnTest.php b/dev/tests/unit/testsuite/Magento/Paypal/Model/IpnTest.php deleted file mode 100644 index 1c13879a5a15e..0000000000000 --- a/dev/tests/unit/testsuite/Magento/Paypal/Model/IpnTest.php +++ /dev/null @@ -1,197 +0,0 @@ -_orderMock = $this->getMock('Magento\Sales\Model\OrderFactory', $methods, [], '', false); - $this->_orderMock->expects($this->any())->method('create')->will($this->returnSelf()); - $this->_orderMock->expects($this->any())->method('loadByIncrementId')->will($this->returnSelf()); - $this->_orderMock->expects($this->any())->method('getId')->will($this->returnSelf()); - $this->_orderMock->expects($this->any())->method('getMethod')->will($this->returnSelf()); - $this->_orderMock->expects($this->any())->method('getStoreId')->will($this->returnSelf()); - $this->_orderMock->expects($this->any())->method('getEmailSent')->will($this->returnValue(true)); - - $this->configFactory = $this->getMock( - 'Magento\Paypal\Model\ConfigFactory', - ['create', 'isMethodActive', 'isMethodAvailable', 'getConfigValue', 'getPaypalUrl'], - [], - '', - false - ); - $this->configFactory->expects($this->any())->method('create')->will($this->returnSelf()); - $this->configFactory->expects($this->any())->method('isMethodActive')->will($this->returnValue(true)); - $this->configFactory->expects($this->any())->method('isMethodAvailable')->will($this->returnValue(true)); - $this->configFactory->expects($this->any())->method('getConfigValue')->will($this->returnValue(null)); - $this->configFactory->expects($this->any())->method('getPaypalUrl') - ->will($this->returnValue('http://paypal_url')); - - $this->curlFactory = $this->getMock( - 'Magento\Framework\HTTP\Adapter\CurlFactory', - ['create', 'setConfig', 'write', 'read'], - [], - '', - false - ); - $this->curlFactory->expects($this->any())->method('create')->will($this->returnSelf()); - $this->curlFactory->expects($this->any())->method('setConfig')->will($this->returnSelf()); - $this->curlFactory->expects($this->any())->method('write')->will($this->returnSelf()); - $this->curlFactory->expects($this->any())->method('read')->will($this->returnValue( - ' - VERIFIED' - )); - $this->_paypalInfo = $this->getMock( - 'Magento\Paypal\Model\Info', - ['importToPayment', 'getMethod', 'getAdditionalInformation'], - [], - '', - false - ); - $this->_paypalInfo->expects($this->any())->method('getMethod')->will($this->returnValue('some_method')); - $objectHelper = new \Magento\TestFramework\Helper\ObjectManager($this); - $this->_ipn = $objectHelper->getObject('Magento\Paypal\Model\Ipn', - [ - 'configFactory' => $this->configFactory, - 'logAdapterFactory' => $this->getMock('Magento\Framework\Logger\AdapterFactory', [], [], '', false), - 'curlFactory' => $this->curlFactory, - 'orderFactory' => $this->_orderMock, - 'paypalInfo' => $this->_paypalInfo, - 'data' => ['payment_status' => 'Pending', 'pending_reason' => 'authorization'] - ] - ); - } - - public function testLegacyRegisterPaymentAuthorization() - { - $this->_orderMock->expects($this->any())->method('canFetchPaymentReviewUpdate')->will( - $this->returnValue(false) - ); - $methods = [ - 'setPreparedMessage', - '__wakeup', - 'setTransactionId', - 'setParentTransactionId', - 'setIsTransactionClosed', - 'registerAuthorizationNotification', - ]; - $payment = $this->getMock('Magento\Sales\Model\Order\Payment', $methods, [], '', false); - $payment->expects($this->any())->method('setPreparedMessage')->will($this->returnSelf()); - $payment->expects($this->any())->method('setTransactionId')->will($this->returnSelf()); - $payment->expects($this->any())->method('setParentTransactionId')->will($this->returnSelf()); - $payment->expects($this->any())->method('setIsTransactionClosed')->will($this->returnSelf()); - $this->_orderMock->expects($this->any())->method('getPayment')->will($this->returnValue($payment)); - $this->_orderMock->expects($this->any())->method('getAdditionalInformation')->will($this->returnValue([])); - - $this->_paypalInfo->expects($this->once())->method('importToPayment'); - $this->_ipn->processIpnRequest(); - } - - public function testPaymentReviewRegisterPaymentAuthorization() - { - $this->_orderMock->expects($this->any())->method('getPayment')->will($this->returnSelf()); - $this->_orderMock->expects($this->any())->method('canFetchPaymentReviewUpdate')->will($this->returnValue(true)); - $this->_orderMock->expects($this->once())->method('registerPaymentReviewAction')->with( - 'update', - true - )->will($this->returnSelf()); - $this->_ipn->processIpnRequest(); - } - - public function testPaymentReviewRegisterPaymentFraud() - { - $paymentMock = $this->getMock( - '\Magento\Sales\Model\Order\Payment', - ['getAdditionalInformation', '__wakeup', 'registerCaptureNotification'], - [], - '', - false - ); - $paymentMock->expects($this->any()) - ->method('getAdditionalInformation') - ->will($this->returnValue([])); - $paymentMock->expects($this->any()) - ->method('registerCaptureNotification') - ->will($this->returnValue(true)); - $this->_orderMock->expects($this->any())->method('getPayment')->will($this->returnValue($paymentMock)); - $this->_orderMock->expects($this->any())->method('canFetchPaymentReviewUpdate')->will($this->returnValue(true)); - $this->_orderMock->expects($this->once())->method('getState')->will( - $this->returnValue(Order::STATE_PENDING_PAYMENT) - ); - $this->_paypalInfo->expects($this->once()) - ->method('importToPayment') - ->with( - [ - 'payment_status' => 'pending', - 'pending_reason' => 'fraud', - 'collected_fraud_filters' => ['Maximum Transaction Amount'], - ], - $paymentMock - ); - $objectHelper = new \Magento\TestFramework\Helper\ObjectManager($this); - $this->_ipn = $objectHelper->getObject('Magento\Paypal\Model\Ipn', - [ - 'configFactory' => $this->configFactory, - 'logAdapterFactory' => $this->getMock('Magento\Framework\Logger\AdapterFactory', [], [], '', false), - 'curlFactory' => $this->curlFactory, - 'orderFactory' => $this->_orderMock, - 'paypalInfo' => $this->_paypalInfo, - 'data' => [ - 'payment_status' => 'Pending', - 'pending_reason' => 'fraud', - 'fraud_management_pending_filters_1' => 'Maximum Transaction Amount', - ] - ] - ); - $this->_ipn->processIpnRequest(); - $this->assertEquals('IPN "Pending"', $paymentMock->getPreparedMessage()); - } -} diff --git a/dev/tests/unit/testsuite/Magento/Paypal/Model/Method/AgreementTest.php b/dev/tests/unit/testsuite/Magento/Paypal/Model/Method/AgreementTest.php deleted file mode 100644 index 3bffbfb8660d6..0000000000000 --- a/dev/tests/unit/testsuite/Magento/Paypal/Model/Method/AgreementTest.php +++ /dev/null @@ -1,101 +0,0 @@ -_helper = new \Magento\TestFramework\Helper\ObjectManager($this); - - $paypalConfigMock = $this->getMockBuilder( - '\Magento\Paypal\Model\Config' - )->disableOriginalConstructor()->setMethods( - ['getConfigValue'] - )->getMock(); - $this->_apiNvpMock = $this->getMockBuilder( - '\Magento\Paypal\Model\Api\Nvp' - )->disableOriginalConstructor()->setMethods( - ['callDoReferenceTransaction', 'callGetTransactionDetails'] - )->getMock(); - $proMock = $this->getMockBuilder( - '\Magento\Paypal\Model\Pro' - )->setMethods( - ['getApi', 'setMethod', 'getConfig', 'importPaymentInfo'] - )->disableOriginalConstructor()->getMock(); - $proMock->expects($this->any())->method('getApi')->will($this->returnValue($this->_apiNvpMock)); - $proMock->expects($this->any())->method('getConfig')->will($this->returnValue($paypalConfigMock)); - - $billingAgreementMock = $this->getMockBuilder( - '\Magento\Paypal\Model\Billing\Agreement' - )->disableOriginalConstructor()->setMethods( - ['load', '__wakeup'] - )->getMock(); - $billingAgreementMock->expects($this->any())->method('load')->will($this->returnValue($billingAgreementMock)); - - $agreementFactoryMock = $this->getMockBuilder( - '\Magento\Paypal\Model\Billing\AgreementFactory' - )->disableOriginalConstructor()->setMethods( - ['create'] - )->getMock(); - $agreementFactoryMock->expects( - $this->any() - )->method( - 'create' - )->will( - $this->returnValue($billingAgreementMock) - ); - - $cartMock = $this->getMockBuilder('\Magento\Paypal\Model\Cart')->disableOriginalConstructor()->getMock(); - $cartFactoryMock = $this->getMockBuilder( - '\Magento\Paypal\Model\CartFactory' - )->disableOriginalConstructor()->setMethods( - ['create'] - )->getMock(); - $cartFactoryMock->expects($this->any())->method('create')->will($this->returnValue($cartMock)); - - $arguments = [ - 'agreementFactory' => $agreementFactoryMock, - 'cartFactory' => $cartFactoryMock, - 'data' => [$proMock], - ]; - - $this->_model = $this->_helper->getObject('Magento\Paypal\Model\Method\Agreement', $arguments); - } - - public function testAuthorizeWithBaseCurrency() - { - $payment = $this->getMockBuilder( - '\Magento\Sales\Model\Order\Payment' - )->disableOriginalConstructor()->setMethods( - ['__wakeup'] - )->getMock(); - $order = $this->getMockBuilder( - 'Magento\Sales\Model\Order' - )->disableOriginalConstructor()->setMethods( - ['__wakeup'] - )->getMock(); - $order->setBaseCurrencyCode('USD'); - $payment->setOrder($order); - - $this->_model->authorize($payment, 10.00); - $this->assertEquals($order->getBaseCurrencyCode(), $this->_apiNvpMock->getCurrencyCode()); - } -} diff --git a/dev/tests/unit/testsuite/Magento/Paypal/Model/Method/Checks/SpecificationPluginTest.php b/dev/tests/unit/testsuite/Magento/Paypal/Model/Method/Checks/SpecificationPluginTest.php deleted file mode 100644 index 2ea5e6a57cbf1..0000000000000 --- a/dev/tests/unit/testsuite/Magento/Paypal/Model/Method/Checks/SpecificationPluginTest.php +++ /dev/null @@ -1,153 +0,0 @@ -agreementFactory = $this->getMock('Magento\Paypal\Model\Billing\AgreementFactory', ['create']); - - $objectManagerHelper = new ObjectManagerHelper($this); - $this->model = $objectManagerHelper->getObject( - 'Magento\Paypal\Model\Method\Checks\SpecificationPlugin', - [ - 'agreementFactory' => $this->agreementFactory - ] - ); - } - - public function testAroundIsApplicableNotOriginallyApplicable() - { - $paymentMethod = $this->getPaymentMethod('any'); - $quote = $this->getQuote('any'); - $proceed = $this->getProceedClosure(false, $paymentMethod, $quote); - $this->assertFalse($this->callAroundIsApplicable($proceed, $paymentMethod, $quote)); - } - - public function testAroundIsApplicableNotAgreement() - { - $paymentMethod = $this->getPaymentMethod('not_agreement'); - $quote = $this->getQuote('any'); - $proceed = $this->getProceedClosure(true, $paymentMethod, $quote); - $this->assertTrue($this->callAroundIsApplicable($proceed, $paymentMethod, $quote)); - } - - public function testAroundIsApplicableNoCustomerId() - { - $paymentMethod = $this->getPaymentMethod('paypal_billing_agreement'); - $quote = $this->getQuote(null); - $proceed = $this->getProceedClosure(true, $paymentMethod, $quote); - $this->assertTrue($this->callAroundIsApplicable($proceed, $paymentMethod, $quote)); - } - - /** - * @param int $count - * @dataProvider aroundIsApplicableDataProvider - */ - public function testAroundIsApplicable($count) - { - $paymentMethod = $this->getPaymentMethod('paypal_billing_agreement'); - $quote = $this->getQuote(1); - $proceed = $this->getProceedClosure(true, $paymentMethod, $quote); - $agreementCollection = $this->getMock( - 'Magento\Paypal\Model\Resource\Billing\Agreement\Collection', - [], - [], - '', - false - ); - $agreementCollection->expects($this->once()) - ->method('count') - ->will($this->returnValue($count)); - $agreement = $this->getMock('Magento\Paypal\Model\Billing\Agreement', [], [], '', false); - $agreement->expects($this->once()) - ->method('getAvailableCustomerBillingAgreements') - ->with(1) - ->will($this->returnValue($agreementCollection)); - $this->agreementFactory->expects($this->once()) - ->method('create') - ->will($this->returnValue($agreement)); - $this->assertEquals($count > 0, $this->callAroundIsApplicable($proceed, $paymentMethod, $quote)); - } - - public function aroundIsApplicableDataProvider() - { - return [[0], [1], [2]]; - } - - /** - * @param bool $result - * @param PaymentMethodChecksInterface $paymentMethod - * @param Quote $quote - * @return \Closure - */ - private function getProceedClosure($result, PaymentMethodChecksInterface $paymentMethod, Quote $quote) - { - $self = $this; - return function ($parameter1, $parameter2) use ($result, $paymentMethod, $quote, $self) { - $self->assertSame($paymentMethod, $parameter1); - $self->assertSame($quote, $parameter2); - return $result; - }; - } - - /** - * Get payment method parameter - * - * @param string $code - * @return PaymentMethodChecksInterface|\PHPUnit_Framework_MockObject_MockObject - */ - private function getPaymentMethod($code) - { - $paymentMethod = $this->getMockForAbstractClass('Magento\Payment\Model\Checks\PaymentMethodChecksInterface'); - $paymentMethod->expects($this->any()) - ->method('getCode') - ->will($this->returnValue($code)); - return $paymentMethod; - } - - /** - * Get quote parameter - * - * @param mixed $customerId - * @return Quote|\PHPUnit_Framework_MockObject_MockObject - */ - private function getQuote($customerId) - { - $quote = $this->getMock('Magento\Sales\Model\Quote', ['__wakeup'], [], '', false); - $quote->setCustomerId($customerId); - return $quote; - } - - /** - * Call aroundIsApplicable method - * - * @param \Closure $proceed - * @param PaymentMethodChecksInterface $paymentMethod - * @param Quote $quote - * @return bool - */ - private function callAroundIsApplicable( - \Closure $proceed, - PaymentMethodChecksInterface $paymentMethod, - Quote $quote - ) { - $specification = $this->getMockForAbstractClass('Magento\Payment\Model\Checks\SpecificationInterface'); - return $this->model->aroundIsApplicable($specification, $proceed, $paymentMethod, $quote); - } -} diff --git a/dev/tests/unit/testsuite/Magento/Paypal/Model/Observer/RestrictAdminBillingAgreementUsageTest.php b/dev/tests/unit/testsuite/Magento/Paypal/Model/Observer/RestrictAdminBillingAgreementUsageTest.php deleted file mode 100644 index 8e06ad9475051..0000000000000 --- a/dev/tests/unit/testsuite/Magento/Paypal/Model/Observer/RestrictAdminBillingAgreementUsageTest.php +++ /dev/null @@ -1,93 +0,0 @@ -_event = new \Magento\Framework\Object(); - - $this->_observer = new \Magento\Framework\Event\Observer(); - $this->_observer->setEvent($this->_event); - - $this->_authorization = $this->getMockForAbstractClass('Magento\Framework\AuthorizationInterface'); - - $this->_model = new \Magento\Paypal\Model\Observer\RestrictAdminBillingAgreementUsage($this->_authorization); - } - - public function restrictAdminBillingAgreementUsageDataProvider() - { - return [ - [new \stdClass(), false, true], - [ - $this->getMockForAbstractClass( - 'Magento\Paypal\Model\Payment\Method\Billing\AbstractAgreement', - [], - '', - false - ), - true, - true - ], - [ - $this->getMockForAbstractClass( - 'Magento\Paypal\Model\Payment\Method\Billing\AbstractAgreement', - [], - '', - false - ), - false, - false - ] - ]; - } - - /** - * @param object $methodInstance - * @param bool $isAllowed - * @param bool $isAvailable - * @dataProvider restrictAdminBillingAgreementUsageDataProvider - */ - public function testExecute($methodInstance, $isAllowed, $isAvailable) - { - $this->_event->setMethodInstance($methodInstance); - $this->_authorization->expects( - $this->any() - )->method( - 'isAllowed' - )->with( - 'Magento_Paypal::use' - )->will( - $this->returnValue($isAllowed) - ); - $result = new \stdClass(); - $result->isAvailable = true; - $this->_event->setResult($result); - $this->_model->execute($this->_observer); - $this->assertEquals($isAvailable, $result->isAvailable); - } -} diff --git a/dev/tests/unit/testsuite/Magento/Paypal/Model/ObserverTest.php b/dev/tests/unit/testsuite/Magento/Paypal/Model/ObserverTest.php deleted file mode 100644 index 8a422d7c3065f..0000000000000 --- a/dev/tests/unit/testsuite/Magento/Paypal/Model/ObserverTest.php +++ /dev/null @@ -1,224 +0,0 @@ -_event = new \Magento\Framework\Object(); - - $this->_observer = new \Magento\Framework\Event\Observer(); - $this->_observer->setEvent($this->_event); - - $this->_authorization = $this->getMockForAbstractClass('Magento\Framework\AuthorizationInterface'); - $this->_agreementFactory = $this->getMock( - 'Magento\Paypal\Model\Billing\AgreementFactory', - ['create'], - [], - '', - false - ); - $this->_checkoutSession = $this->getMock('Magento\Checkout\Model\Session', [], [], '', false); - - $objectManagerHelper = new \Magento\TestFramework\Helper\ObjectManager($this); - $this->_model = $objectManagerHelper->getObject( - 'Magento\Paypal\Model\Observer', - [ - 'authorization' => $this->_authorization, - 'agreementFactory' => $this->_agreementFactory, - 'checkoutSession' => $this->_checkoutSession - ] - ); - } - - public function testAddPaypalShortcuts() - { - $layoutMock = $this->getMockBuilder( - 'Magento\Framework\View\Layout' - )->setMethods( - ['createBlock'] - )->disableOriginalConstructor()->getMock(); - $blocks = [ - 'Magento\Paypal\Block\Express\ShortcutContainer' => 'Magento\Paypal\Block\Express\Shortcut', - 'Magento\Paypal\Block\Express\Shortcut' => 'Magento\Paypal\Block\Express\Shortcut', - 'Magento\Paypal\Block\PayflowExpress\Shortcut' => 'Magento\Paypal\Block\Express\Shortcut', - 'Magento\Paypal\Block\Bml\Shortcut' => 'Magento\Paypal\Block\Bml\Shortcut', - 'Magento\Paypal\Block\Payflow\Bml\Shortcut' => 'Magento\Paypal\Block\Bml\Shortcut', - ]; - - $blockInstances = []; - $atPosition = 0; - foreach ($blocks as $blockName => $blockInstance) { - $block = $this->getMockBuilder($blockInstance)->setMethods(null)->disableOriginalConstructor()->getMock(); - - $blockInstances[$blockName] = $block; - - $layoutMock->expects(new MethodInvokedAtIndex($atPosition))->method('createBlock')->with($blockName) - ->will($this->returnValue($block)); - $atPosition++; - } - - $shortcutButtonsMock = $this->getMockBuilder( - 'Magento\Catalog\Block\ShortcutButtons' - )->setMethods( - ['getLayout', 'addShortcut'] - )->disableOriginalConstructor()->getMock(); - - $shortcutButtonsMock->expects($this->any())->method('getLayout')->will($this->returnValue($layoutMock)); - - $atPosition = 0; - foreach (array_keys($blocks) as $blockName) { - $shortcutButtonsMock->expects(new MethodInvokedAtIndex($atPosition))->method('addShortcut') - ->with($this->identicalTo($blockInstances[$blockName])); - $atPosition++; - } - $this->_event->setContainer($shortcutButtonsMock); - $this->_model->addPaypalShortcuts($this->_observer); - } - - public function testAddBillingAgreementToSessionNoData() - { - $payment = $this->getMock('Magento\Sales\Model\Order\Payment', [], [], '', false); - $payment->expects( - $this->once() - )->method( - '__call' - )->with( - 'getBillingAgreementData' - )->will( - $this->returnValue(null) - ); - $this->_event->setPayment($payment); - $this->_agreementFactory->expects($this->never())->method('create'); - $this->_checkoutSession->expects($this->once())->method('__call')->with('unsLastBillingAgreementReferenceId'); - $this->_model->addBillingAgreementToSession($this->_observer); - } - - /** - * @param bool $isValid - * @dataProvider addBillingAgreementToSessionDataProvider - */ - public function testAddBillingAgreementToSession($isValid) - { - $agreement = $this->getMock('Magento\Paypal\Model\Billing\Agreement', [], [], '', false); - $agreement->expects($this->once())->method('isValid')->will($this->returnValue($isValid)); - $comment = $this->getMockForAbstractClass( - 'Magento\Framework\Model\AbstractModel', - [], - '', - false, - true, - true, - ['__wakeup'] - ); - $order = $this->getMock('Magento\Sales\Model\Order', [], [], '', false); - $order->expects( - $this->once() - )->method( - 'addStatusHistoryComment' - )->with( - $isValid ? __( - 'Created billing agreement #%1.', - 'agreement reference id' - ) : __( - 'We couldn\'t create a billing agreement for this order.' - ) - )->will( - $this->returnValue($comment) - ); - if ($isValid) { - $agreement->expects( - $this->any() - )->method( - '__call' - )->with( - 'getReferenceId' - )->will( - $this->returnValue('agreement reference id') - ); - $order->expects(new MethodInvokedAtIndex(0))->method('addRelatedObject')->with($agreement); - $this->_checkoutSession->expects( - $this->once() - )->method( - '__call' - )->with( - 'setLastBillingAgreementReferenceId', - ['agreement reference id'] - ); - } else { - $this->_checkoutSession->expects( - $this->once() - )->method( - '__call' - )->with( - 'unsLastBillingAgreementReferenceId' - ); - $agreement->expects($this->never())->method('__call'); - } - $order->expects(new MethodInvokedAtIndex($isValid ? 1 : 0))->method('addRelatedObject')->with($comment); - - $payment = $this->getMock('Magento\Sales\Model\Order\Payment', [], [], '', false); - $payment->expects( - $this->once() - )->method( - '__call' - )->with( - 'getBillingAgreementData' - )->will( - $this->returnValue('not empty') - ); - $payment->expects($this->once())->method('getOrder')->will($this->returnValue($order)); - $agreement->expects( - $this->once() - )->method( - 'importOrderPayment' - )->with( - $payment - )->will( - $this->returnValue($agreement) - ); - $this->_event->setPayment($payment); - $this->_agreementFactory->expects($this->once())->method('create')->will($this->returnValue($agreement)); - $this->_model->addBillingAgreementToSession($this->_observer); - } - - public function addBillingAgreementToSessionDataProvider() - { - return [[true], [false]]; - } -} diff --git a/dev/tests/unit/testsuite/Magento/Paypal/Model/PayflowExpressTest.php b/dev/tests/unit/testsuite/Magento/Paypal/Model/PayflowExpressTest.php deleted file mode 100644 index ca9ee20916c8f..0000000000000 --- a/dev/tests/unit/testsuite/Magento/Paypal/Model/PayflowExpressTest.php +++ /dev/null @@ -1,100 +0,0 @@ -getMockBuilder( - 'Magento\Paypal\Model\ProFactory' - )->disableOriginalConstructor()->setMethods(['create'])->getMock(); - $api = $this->getMock('Magento\Paypal\Model\Api\Nvp', [], [], '', false); - $paypalPro = $this->getMockBuilder( - 'Magento\Paypal\Model\Pro' - )->disableOriginalConstructor()->setMethods([])->getMock(); - $paypalPro->expects($this->any())->method('getApi')->will($this->returnValue($api)); - - $proFactory->expects($this->once())->method('create')->will($this->returnValue($paypalPro)); - - $this->_model = $objectManager->getObject('Magento\Paypal\Model\PayflowExpress', ['proFactory' => $proFactory]); - } - - public function testCanRefundCaptureNotExist() - { - $paymentInfo = $this->_getPreparedPaymentInfo(); - - $paymentInfo->expects($this->once())->method('lookupTransaction')->with('', Transaction::TYPE_CAPTURE)->will( - $this->returnValue(false) - ); - $this->assertFalse($this->_model->canRefund()); - } - - public function testCanRefundCaptureExistNoAdditionalInfo() - { - $paymentInfo = $this->_getPreparedPaymentInfo(); - $captureTransaction = $this->_getCaptureTransaction(); - $captureTransaction->expects($this->once())->method('getAdditionalInformation')->with( - Payflow\Pro::TRANSPORT_PAYFLOW_TXN_ID - )->will($this->returnValue(null)); - $paymentInfo->expects($this->once())->method('lookupTransaction')->with('', Transaction::TYPE_CAPTURE)->will( - $this->returnValue($captureTransaction) - ); - $this->assertFalse($this->_model->canRefund()); - } - - public function testCanRefundCaptureExistValid() - { - $paymentInfo = $this->_getPreparedPaymentInfo(); - $captureTransaction = $this->_getCaptureTransaction(); - $captureTransaction->expects($this->once())->method('getAdditionalInformation')->with( - Payflow\Pro::TRANSPORT_PAYFLOW_TXN_ID - )->will($this->returnValue(self::TRANSPORT_PAYFLOW_TXN_ID)); - $paymentInfo->expects($this->once())->method('lookupTransaction')->with('', Transaction::TYPE_CAPTURE)->will( - $this->returnValue($captureTransaction) - ); - $this->assertTrue($this->_model->canRefund()); - } - - /** - * Prepares payment info mock and adds it to the model - * - * @return \PHPUnit_Framework_MockObject_MockObject - */ - protected function _getPreparedPaymentInfo() - { - $paymentInfo = $this->getMockBuilder( - 'Magento\Sales\Model\Order\Payment' - )->disableOriginalConstructor()->setMethods([])->getMock(); - $this->_model->setData('info_instance', $paymentInfo); - return $paymentInfo; - } - - /** - * Prepares capture transaction - * - * @return \PHPUnit_Framework_MockObject_MockObject - */ - protected function _getCaptureTransaction() - { - return $this->getMockBuilder( - 'Magento\Sales\Model\Order\Payment\Transaction' - )->disableOriginalConstructor()->setMethods([])->getMock(); - } -} diff --git a/dev/tests/unit/testsuite/Magento/Paypal/Model/PayflowlinkTest.php b/dev/tests/unit/testsuite/Magento/Paypal/Model/PayflowlinkTest.php deleted file mode 100644 index ebb4de12cc7a6..0000000000000 --- a/dev/tests/unit/testsuite/Magento/Paypal/Model/PayflowlinkTest.php +++ /dev/null @@ -1,101 +0,0 @@ -store = $this->getMock('Magento\Store\Model\Store', [], [], '', false); - $storeManager = $this->getMock('Magento\Store\Model\StoreManagerInterface'); - $storeManager->expects($this->any())->method('getStore')->will($this->returnValue($this->store)); - $this->paypalConfig = $this->getMock('Magento\Paypal\Model\Config', [], [], '', false); - $configFactory = $this->getMock('Magento\Paypal\Model\ConfigFactory', ['create']); - $configFactory->expects($this->any())->method('create')->will($this->returnValue($this->paypalConfig)); - $this->payflowRequest = $this->getMock('Magento\Paypal\Model\Payflow\Request', [], [], '', false); - $this->payflowRequest->expects($this->any()) - ->method('__call') - ->will($this->returnCallback(function ($method) { - if (strpos($method, 'set') === 0) { - return $this->payflowRequest; - } - return null; - })); - $requestFactory = $this->getMock('Magento\Paypal\Model\Payflow\RequestFactory', ['create']); - $requestFactory->expects($this->any())->method('create')->will($this->returnValue($this->payflowRequest)); - $this->infoInstance = $this->getMock('Magento\Sales\Model\Order\Payment', [], [], '', false); - - $client = $this->getMock( - 'Magento\Framework\HTTP\ZendClient', - [ - 'setUri', - 'setConfig', - 'setMethod', - 'setParameterPost', - 'setHeaders', - 'setUrlEncodeBody', - 'request', - 'getBody' - ], - [], - '', - false - ); - $client->expects($this->any())->method('create')->will($this->returnSelf()); - $client->expects($this->any())->method('setUri')->will($this->returnSelf()); - $client->expects($this->any())->method('setConfig')->will($this->returnSelf()); - $client->expects($this->any())->method('setMethod')->will($this->returnSelf()); - $client->expects($this->any())->method('setParameterPost')->will($this->returnSelf()); - $client->expects($this->any())->method('setHeaders')->will($this->returnSelf()); - $client->expects($this->any())->method('setUrlEncodeBody')->will($this->returnSelf()); - $client->expects($this->any())->method('request')->will($this->returnSelf()); - $client->expects($this->any())->method('getBody')->will($this->returnValue('RESULT name=value&name2=value2')); - $clientFactory = $this->getMock('Magento\Framework\HTTP\ZendClientFactory', ['create'], [], '', false); - $clientFactory->expects($this->any())->method('create')->will($this->returnValue($client)); - - $helper = new ObjectManagerHelper($this); - $this->model = $helper->getObject( - 'Magento\Paypal\Model\Payflowlink', - [ - 'storeManager' => $storeManager, - 'configFactory' => $configFactory, - 'requestFactory' => $requestFactory, - 'httpClientFactory' => $clientFactory - ] - ); - $this->model->setInfoInstance($this->infoInstance); - } - - public function testInitialize() - { - $order = $this->getMock('Magento\Sales\Model\Order', [], [], '', false); - $this->infoInstance->expects($this->any())->method('getOrder')->will($this->returnValue($order)); - $this->infoInstance->expects($this->any())->method('setAdditionalInformation')->will($this->returnSelf()); - $this->paypalConfig->expects($this->once())->method('getBuildNotationCode') - ->will($this->returnValue('build notation code')); - $this->payflowRequest->expects($this->once())->method('setData')->with('BNCODE', 'build notation code') - ->will($this->returnSelf()); - $stateObject = new \Magento\Framework\Object(); - $this->model->initialize(\Magento\Paypal\Model\Config::PAYMENT_ACTION_AUTH, $stateObject); - } -} diff --git a/dev/tests/unit/testsuite/Magento/Paypal/Model/PayflowproTest.php b/dev/tests/unit/testsuite/Magento/Paypal/Model/PayflowproTest.php deleted file mode 100644 index eb1822507b522..0000000000000 --- a/dev/tests/unit/testsuite/Magento/Paypal/Model/PayflowproTest.php +++ /dev/null @@ -1,124 +0,0 @@ -_configFactory = $this->getMock( - 'Magento\Paypal\Model\ConfigFactory', - ['create', 'getBuildNotationCode'], - [], - '', - false - ); - $client = $this->getMock( - 'Magento\Framework\HTTP\ZendClient', - [ - 'setUri', - 'setConfig', - 'setMethod', - 'setParameterPost', - 'setHeaders', - 'setUrlEncodeBody', - 'request', - 'getBody' - ], - [], - '', - false - ); - $client->expects($this->any())->method('create')->will($this->returnSelf()); - $client->expects($this->any())->method('setUri')->will($this->returnSelf()); - $client->expects($this->any())->method('setConfig')->will($this->returnSelf()); - $client->expects($this->any())->method('setMethod')->will($this->returnSelf()); - $client->expects($this->any())->method('setParameterPost')->will($this->returnSelf()); - $client->expects($this->any())->method('setHeaders')->will($this->returnSelf()); - $client->expects($this->any())->method('setUrlEncodeBody')->will($this->returnSelf()); - $client->expects($this->any())->method('request')->will($this->returnSelf()); - $client->expects($this->any())->method('getBody')->will($this->returnValue('RESULT name=value&name2=value2')); - $clientFactory = $this->getMock('Magento\Framework\HTTP\ZendClientFactory', ['create'], [], '', false); - $clientFactory->expects($this->any())->method('create')->will($this->returnValue($client)); - - $this->_helper = new \Magento\TestFramework\Helper\ObjectManager($this); - $this->_model = $this->_helper->getObject( - 'Magento\Paypal\Model\Payflowpro', - [ - 'configFactory' => $this->_configFactory, - 'httpClientFactory' => $clientFactory - ] - ); - } - - /** - * @param mixed $amountPaid - * @param string $paymentType - * @param bool $expected - * @dataProvider canVoidDataProvider - */ - public function testCanVoid($amountPaid, $paymentType, $expected) - { - $payment = $this->_helper->getObject($paymentType); - $payment->setAmountPaid($amountPaid); - $this->assertEquals($expected, $this->_model->canVoid($payment)); - } - - /** - * @return array - */ - public function canVoidDataProvider() - { - return [ - [0, 'Magento\Sales\Model\Order\Invoice', false], - [0, 'Magento\Sales\Model\Order\Creditmemo', false], - [12.1, 'Magento\Sales\Model\Order\Payment', false], - [0, 'Magento\Sales\Model\Order\Payment', true], - [null, 'Magento\Sales\Model\Order\Payment', true] - ]; - } - - public function testCanCapturePartial() - { - $this->assertTrue($this->_model->canCapturePartial()); - } - - public function testCanRefundPartialPerInvoice() - { - $this->assertTrue($this->_model->canRefundPartialPerInvoice()); - } - - /** - * test for _buildBasicRequest (BDCODE) - */ - public function testFetchTransactionInfoForBN() - { - $this->_configFactory->expects($this->once())->method('create')->will($this->returnSelf()); - $this->_configFactory->expects($this->once())->method('getBuildNotationCode') - ->will($this->returnValue('BNCODE')); - $payment = $this->getMock('Magento\Payment\Model\Info', ['setTransactionId', '__wakeup'], [], '', false); - $payment->expects($this->once())->method('setTransactionId')->will($this->returnSelf()); - $this->_model->fetchTransactionInfo($payment, 'AD49G8N825'); - } -} diff --git a/dev/tests/unit/testsuite/Magento/Paypal/Model/ProTest.php b/dev/tests/unit/testsuite/Magento/Paypal/Model/ProTest.php deleted file mode 100644 index b034f1406dae3..0000000000000 --- a/dev/tests/unit/testsuite/Magento/Paypal/Model/ProTest.php +++ /dev/null @@ -1,74 +0,0 @@ -getConstructArguments( - 'Magento\Paypal\Model\Pro', - ['infoFactory' => $this->getMock('Magento\Paypal\Model\InfoFactory')] - ); - /** @var $pro \Magento\Paypal\Model\Pro */ - $this->_pro = $this->getMock('Magento\Paypal\Model\Pro', ['_isPaymentReviewRequired'], $args); - } - - /** - * @param bool $pendingReason - * @param bool $isReviewRequired - * @param bool $expected - * @dataProvider canReviewPaymentDataProvider - */ - public function testCanReviewPayment($pendingReason, $isReviewRequired, $expected) - { - $this->_pro->expects( - $this->any() - )->method( - '_isPaymentReviewRequired' - )->will( - $this->returnValue($isReviewRequired) - ); - $payment = $this->getMockBuilder( - 'Magento\Payment\Model\Info' - )->disableOriginalConstructor()->setMethods( - ['getAdditionalInformation', '__wakeup'] - )->getMock(); - $payment->expects( - $this->once() - )->method( - 'getAdditionalInformation' - )->with( - $this->equalTo(\Magento\Paypal\Model\Info::PENDING_REASON_GLOBAL) - )->will( - $this->returnValue($pendingReason) - ); - - $this->assertEquals($expected, $this->_pro->canReviewPayment($payment)); - } - - /** - * @return array - */ - public function canReviewPaymentDataProvider() - { - return [ - [\Magento\Paypal\Model\Info::PAYMENTSTATUS_REVIEW, true, false], - [\Magento\Paypal\Model\Info::PAYMENTSTATUS_REVIEW, false, false], - ['another_pending_reason', false, false], - ['another_pending_reason', true, true] - ]; - } -} diff --git a/dev/tests/unit/testsuite/Magento/Paypal/Model/Report/Settlement/RowTest.php b/dev/tests/unit/testsuite/Magento/Paypal/Model/Report/Settlement/RowTest.php deleted file mode 100644 index e2d48ee6a83e6..0000000000000 --- a/dev/tests/unit/testsuite/Magento/Paypal/Model/Report/Settlement/RowTest.php +++ /dev/null @@ -1,113 +0,0 @@ -row = $objectManagerHelper->getObject('Magento\Paypal\Model\Report\Settlement\Row'); - } - - /** - * @param string $code - * @param string $expectation - * @dataProvider getReferenceTypeDataProvider - */ - public function testGetReferenceType($code, $expectation) - { - $this->assertEquals($expectation, $this->row->getReferenceType($code)); - } - - /** - * @param string $code - * @param string $expectation - * @dataProvider getTransactionEventDataProvider - */ - public function testGetTransactionEvent($code, $expectation) - { - $this->assertEquals($expectation, $this->row->getTransactionEvent($code)); - } - - /** - * @param string $code - * @param string $expectation - * @dataProvider getDebitCreditTextDataProvider - */ - public function testGetDebitCreditText($code, $expectation) - { - $this->assertEquals($expectation, $this->row->getDebitCreditText($code)); - } - - /** - * @param string $code - * @param array $modelData - * @param int $expectation - * @dataProvider getCastedAmountDataProvider - */ - public function testGetCastedAmount($code, $modelData, $expectation) - { - $this->row->setData($modelData); - $this->assertEquals($expectation, $this->row->getCastedAmount($code)); - } - - public function testGetTransactionEvents() - { - $this->assertArrayHasKey('T1502', $this->row->getTransactionEvents()); - } - - /** - * @return array - */ - public function getReferenceTypeDataProvider() - { - return [ - ['ODR', __('Order ID')], - ['EX_VALUE', 'EX_VALUE'] - ]; - } - - /** - * @return array - */ - public function getTransactionEventDataProvider() - { - return [ - ['T1502', __('ACH Deposit (Hold for Dispute or Other Investigation)')], - ['EX_VALUE', 'EX_VALUE'] - ]; - } - - /** - * @return array - */ - public function getDebitCreditTextDataProvider() - { - return [ - ['CR', __('Credit')], - ['EX_VALUE', 'EX_VALUE'] - ]; - } - - /** - * @return array - */ - public function getCastedAmountDataProvider() - { - return [ - ['fee_amount', ['fee_amount' => 100, 'fee_debit_or_credit' => 'CR'], -1], - ['fee_amount', ['fee_amount' => 100, 'fee_debit_or_credit' => 'DB'], 1] - ]; - } -} diff --git a/dev/tests/unit/testsuite/Magento/Paypal/Model/_files/additional_info_data.php b/dev/tests/unit/testsuite/Magento/Paypal/Model/_files/additional_info_data.php deleted file mode 100644 index 2932fc78dee8a..0000000000000 --- a/dev/tests/unit/testsuite/Magento/Paypal/Model/_files/additional_info_data.php +++ /dev/null @@ -1,164 +0,0 @@ - Info::PAYPAL_PAYER_ID, - Info::PAYPAL_PAYER_EMAIL => Info::PAYPAL_PAYER_EMAIL, - Info::PAYPAL_PAYER_STATUS => Info::PAYPAL_PAYER_STATUS, - Info::PAYPAL_ADDRESS_ID => Info::PAYPAL_ADDRESS_ID, - Info::PAYPAL_ADDRESS_STATUS => Info::PAYPAL_ADDRESS_STATUS, - Info::PAYPAL_PROTECTION_ELIGIBILITY => Info::PAYPAL_PROTECTION_ELIGIBILITY, - Info::PAYPAL_FRAUD_FILTERS => Info::PAYPAL_FRAUD_FILTERS, - Info::PAYPAL_CORRELATION_ID => Info::PAYPAL_CORRELATION_ID, - Info::BUYER_TAX_ID => Info::BUYER_TAX_ID, - Info::PAYPAL_AVS_CODE => 'A', - Info::PAYPAL_CVV_2_MATCH => 'M', - Info::BUYER_TAX_ID_TYPE => Info::BUYER_TAX_ID_TYPE_CNPJ, - Info::CENTINEL_VPAS => '2', - Info::CENTINEL_ECI => '01', - ], - [ - Info::PAYPAL_PAYER_ID => [ - 'label' => 'Payer ID', - 'value' => Info::PAYPAL_PAYER_ID, - ], - Info::PAYPAL_PAYER_EMAIL => [ - 'label' => 'Payer Email', - 'value' => Info::PAYPAL_PAYER_EMAIL, - ], - Info::PAYPAL_PAYER_STATUS => [ - 'label' => 'Payer Status', - 'value' => Info::PAYPAL_PAYER_STATUS, - ], - Info::PAYPAL_ADDRESS_ID => [ - 'label' => 'Payer Address ID', - 'value' => Info::PAYPAL_ADDRESS_ID, - ], - Info::PAYPAL_ADDRESS_STATUS => [ - 'label' => 'Payer Address Status', - 'value' => Info::PAYPAL_ADDRESS_STATUS, - ], - Info::PAYPAL_PROTECTION_ELIGIBILITY => [ - 'label' => 'Merchant Protection Eligibility', - 'value' => Info::PAYPAL_PROTECTION_ELIGIBILITY, - ], - Info::PAYPAL_FRAUD_FILTERS => [ - 'label' => 'Triggered Fraud Filters', - 'value' => Info::PAYPAL_FRAUD_FILTERS, - ], - Info::PAYPAL_CORRELATION_ID => [ - 'label' => 'Last Correlation ID', - 'value' => Info::PAYPAL_CORRELATION_ID, - ], - Info::PAYPAL_AVS_CODE => [ - 'label' => 'Address Verification System Response', - 'value' => '#A: Matched Address only (no ZIP)', - ], - Info::PAYPAL_CVV_2_MATCH => [ - 'label' => 'CVV2 Check Result by PayPal', - 'value' => '#M: Matched (CVV2CSC)', - ], - Info::CENTINEL_VPAS => [ - 'label' => 'PayPal/Centinel Visa Payer Authentication Service Result', - 'value' => '#2: Authenticated, Good Result', - ], - Info::CENTINEL_ECI => [ - 'label' => 'PayPal/Centinel Electronic Commerce Indicator', - 'value' => '#01: Merchant Liability', - ], - Info::BUYER_TAX_ID => [ - 'label' => 'Buyer\'s Tax ID', - 'value' => Info::BUYER_TAX_ID, - ], - Info::BUYER_TAX_ID_TYPE => [ - 'label' => 'Buyer\'s Tax ID Type', - 'value' => 'CNPJ', - ], - 'last_trans_id' => [ - 'label' => 'Last Transaction ID', - 'value' => NULL, - ] - ], - ], - [ - [ - Info::PAYPAL_PAYER_ID => Info::PAYPAL_PAYER_ID, - Info::PAYPAL_PAYER_EMAIL => Info::PAYPAL_PAYER_EMAIL, - Info::PAYPAL_PAYER_STATUS => Info::PAYPAL_PAYER_STATUS, - Info::PAYPAL_ADDRESS_ID => Info::PAYPAL_ADDRESS_ID, - Info::PAYPAL_ADDRESS_STATUS => Info::PAYPAL_ADDRESS_STATUS, - Info::PAYPAL_PROTECTION_ELIGIBILITY => Info::PAYPAL_PROTECTION_ELIGIBILITY, - Info::PAYPAL_FRAUD_FILTERS => Info::PAYPAL_FRAUD_FILTERS, - Info::PAYPAL_CORRELATION_ID => Info::PAYPAL_CORRELATION_ID, - Info::BUYER_TAX_ID => Info::BUYER_TAX_ID, - Info::PAYPAL_AVS_CODE => Info::PAYPAL_AVS_CODE, - Info::PAYPAL_CVV_2_MATCH => Info::PAYPAL_CVV_2_MATCH, - Info::BUYER_TAX_ID_TYPE => Info::BUYER_TAX_ID_TYPE, - Info::CENTINEL_VPAS => Info::CENTINEL_VPAS, - Info::CENTINEL_ECI => Info::CENTINEL_ECI, - ], - [ - Info::PAYPAL_PAYER_ID => [ - 'label' => 'Payer ID', - 'value' => Info::PAYPAL_PAYER_ID, - ], - Info::PAYPAL_PAYER_EMAIL => [ - 'label' => 'Payer Email', - 'value' => Info::PAYPAL_PAYER_EMAIL, - ], - Info::PAYPAL_PAYER_STATUS => [ - 'label' => 'Payer Status', - 'value' => Info::PAYPAL_PAYER_STATUS, - ], - Info::PAYPAL_ADDRESS_ID => [ - 'label' => 'Payer Address ID', - 'value' => Info::PAYPAL_ADDRESS_ID, - ], - Info::PAYPAL_ADDRESS_STATUS => [ - 'label' => 'Payer Address Status', - 'value' => Info::PAYPAL_ADDRESS_STATUS, - ], - Info::PAYPAL_PROTECTION_ELIGIBILITY => [ - 'label' => 'Merchant Protection Eligibility', - 'value' => Info::PAYPAL_PROTECTION_ELIGIBILITY, - ], - Info::PAYPAL_FRAUD_FILTERS => [ - 'label' => 'Triggered Fraud Filters', - 'value' => Info::PAYPAL_FRAUD_FILTERS, - ], - Info::PAYPAL_CORRELATION_ID => [ - 'label' => 'Last Correlation ID', - 'value' => Info::PAYPAL_CORRELATION_ID, - ], - Info::PAYPAL_AVS_CODE => [ - 'label' => 'Address Verification System Response', - 'value' => '#paypal_avs_code', - ], - Info::PAYPAL_CVV_2_MATCH => [ - 'label' => 'CVV2 Check Result by PayPal', - 'value' => '#paypal_cvv_2_match', - ], - Info::CENTINEL_VPAS => [ - 'label' => 'PayPal/Centinel Visa Payer Authentication Service Result', - 'value' => '#centinel_vpas_result', - ], - Info::CENTINEL_ECI => [ - 'label' => 'PayPal/Centinel Electronic Commerce Indicator', - 'value' => '#centinel_eci_result', - ], - Info::BUYER_TAX_ID => [ - 'label' => 'Buyer\'s Tax ID', - 'value' => Info::BUYER_TAX_ID, - ], - 'last_trans_id' => [ - 'label' => 'Last Transaction ID', - 'value' => NULL, - ] - ] - ] -]; diff --git a/dev/tests/unit/testsuite/Magento/ProductAlert/Block/Product/ViewTest.php b/dev/tests/unit/testsuite/Magento/ProductAlert/Block/Product/ViewTest.php new file mode 100644 index 0000000000000..d2e8626481443 --- /dev/null +++ b/dev/tests/unit/testsuite/Magento/ProductAlert/Block/Product/ViewTest.php @@ -0,0 +1,44 @@ +postHelper = $this->getMock( + 'Magento\Core\Helper\PostData', + [], + [], + '', + false + ); + $this->block = $objectManager->getObject( + 'Magento\ProductAlert\Block\Product\View', + ['coreHelper' => $this->postHelper] + ); + } + + public function testGetPostAction() + { + $this->block->setSignupUrl('someUrl'); + $this->postHelper->expects($this->once()) + ->method('getPostData') + ->with('someUrl') + ->will($this->returnValue('{parsedAction}')); + $this->assertEquals('{parsedAction}', $this->block->getPostAction()); + } +} diff --git a/dev/tests/unit/testsuite/Magento/Reports/Model/Event/ObserverTest.php b/dev/tests/unit/testsuite/Magento/Reports/Model/Event/ObserverTest.php new file mode 100644 index 0000000000000..941fb7843d459 --- /dev/null +++ b/dev/tests/unit/testsuite/Magento/Reports/Model/Event/ObserverTest.php @@ -0,0 +1,222 @@ +customerSessionMock = $this->getMockBuilder('Magento\Customer\Model\Session') + ->disableOriginalConstructor()->getMock(); + $this->customerVisitorMock = $this->getMockBuilder('Magento\Customer\Model\Visitor') + ->disableOriginalConstructor()->getMock(); + + $productIndexFactoryMock = $this->getMockBuilder('Magento\Reports\Model\Product\Index\ViewedFactory') + ->setMethods(['create']) + ->disableOriginalConstructor()->getMock(); + $this->productIndexMock = $this->getMockBuilder('Magento\Reports\Model\Product\Index\Viewed') + ->disableOriginalConstructor()->getMock(); + + $productIndexFactoryMock->expects($this->any()) + ->method('create') + ->willReturn($this->productIndexMock); + + $reportEventFactory = $this->getMockBuilder('Magento\Reports\Model\EventFactory') + ->setMethods(['create'])->disableOriginalConstructor()->getMock(); + $this->reportEventMock = $this->getMockBuilder('Magento\Reports\Model\Event') + ->disableOriginalConstructor()->getMock(); + + $reportEventFactory->expects($this->any()) + ->method('create') + ->willReturn($this->reportEventMock); + + /** @var \Magento\Store\Model\StoreManagerInterfac|\PHPUnit_Framework_MockObject_MockObject $storeManager */ + $storeManager = $this->getMock('Magento\Store\Model\StoreManagerInterface'); + + $this->storeMock = $this->getMockBuilder('\Magento\Store\Model\Store') + ->disableOriginalConstructor()->getMock(); + + $storeManager->expects($this->any()) + ->method('getStore') + ->willReturn($this->storeMock); + + $this->observer = $objectManager->getObject( + 'Magento\Reports\Model\Event\Observer', + [ + 'customerSession' => $this->customerSessionMock, + 'customerVisitor' => $this->customerVisitorMock, + 'productIndxFactory' => $productIndexFactoryMock, + 'storeManager' => $storeManager, + 'event' => $reportEventFactory + ] + ); + } + + public function testCatalogProductViewCustomer() + { + $productId = 5; + $customerId = 77; + $storeId = 1; + $expectedViewedData = [ + 'product_id' => $productId, + 'customer_id' => $customerId + ]; + + $expectedEventData = [ + 'event_type_id' => \Magento\Reports\Model\Event::EVENT_PRODUCT_VIEW, + 'object_id' => $productId, + 'subject_id' => $customerId, + 'subtype' => 0, + 'store_id' => $storeId, + ]; + + $this->storeMock->expects($this->any()) + ->method('getId') + ->willReturn($storeId); + + $this->customerSessionMock->expects($this->any()) + ->method('isLoggedIn') + ->willReturn(true); + + $this->customerSessionMock->expects($this->any()) + ->method('getCustomerId') + ->willReturn($customerId); + + $this->prepareProductIndexMock($expectedViewedData); + $this->prepareReportEventModel($expectedEventData); + $eventObserver = $this->getObserverMock($productId); + $this->observer->catalogProductView($eventObserver); + } + + public function testCatalogProductViewVisitor() + { + $productId = 6; + $visitorId = 88; + $storeId = 1; + $expectedViewedData = [ + 'product_id' => $productId, + 'visitor_id' => $visitorId + ]; + + $expectedEventData = [ + 'event_type_id' => \Magento\Reports\Model\Event::EVENT_PRODUCT_VIEW, + 'object_id' => $productId, + 'subject_id' => $visitorId, + 'subtype' => 1, + 'store_id' => $storeId, + ]; + + $this->storeMock->expects($this->any()) + ->method('getId') + ->willReturn($storeId); + + $this->customerSessionMock->expects($this->any()) + ->method('isLoggedIn') + ->willReturn(false); + + $this->customerVisitorMock->expects($this->any()) + ->method('getId') + ->willReturn($visitorId); + + $this->prepareProductIndexMock($expectedViewedData); + $this->prepareReportEventModel($expectedEventData); + $eventObserver = $this->getObserverMock($productId); + $this->observer->catalogProductView($eventObserver); + } + + /** + * @param array $expectedViewedData + * @return void + */ + protected function prepareProductIndexMock($expectedViewedData) + { + $this->productIndexMock->expects($this->any()) + ->method('setData') + ->with($expectedViewedData) + ->willReturnSelf(); + + $this->productIndexMock->expects($this->any()) + ->method('save') + ->willReturnSelf(); + + $this->productIndexMock->expects($this->any()) + ->method('calculate') + ->willReturnSelf(); + } + + /** + * @param array $expectedEventData + * @return void + */ + protected function prepareReportEventModel($expectedEventData) + { + $this->reportEventMock->expects($this->any()) + ->method('setData') + ->with($expectedEventData) + ->willReturnSelf(); + + $this->reportEventMock->expects($this->any()) + ->method('save') + ->willReturnSelf(); + } + + /** + * @param int $productId + * @return \PHPUnit_Framework_MockObject_MockObject + */ + protected function getObserverMock($productId) + { + $eventObserverMock = $this->getMockBuilder('Magento\Framework\Event\Observer')->disableOriginalConstructor() + ->getMock(); + $eventMock = $this->getMockBuilder('Magento\Framework\Event')->disableOriginalConstructor() + ->setMethods(['getProduct'])->getMock(); + $productMock = $this->getMockBuilder('Magento\Catalog\Model\Product')->disableOriginalConstructor() + ->getMock(); + + $productMock->expects($this->any()) + ->method('getId') + ->willReturn($productId); + $eventMock->expects($this->any()) + ->method('getProduct') + ->willReturn($productMock); + $eventObserverMock->expects($this->any()) + ->method('getEvent') + ->willReturn($eventMock); + + return $eventObserverMock; + } +} diff --git a/dev/tests/unit/testsuite/Magento/Rss/App/Action/Plugin/BackendAuthenticationTest.php b/dev/tests/unit/testsuite/Magento/Rss/App/Action/Plugin/BackendAuthenticationTest.php new file mode 100644 index 0000000000000..93d29e8173414 --- /dev/null +++ b/dev/tests/unit/testsuite/Magento/Rss/App/Action/Plugin/BackendAuthenticationTest.php @@ -0,0 +1,74 @@ +getMock('Magento\Backend\App\AbstractAction', [], [], '', false); + + /** @var \Magento\Framework\App\ResponseInterface|\PHPUnit_Framework_MockObject_MockObject $response */ + $response = $this->getMock('Magento\Framework\App\ResponseInterface', [], [], '', false); + + $proceed = function () use ($response) { + return $response; + }; + + /** @var \Magento\Framework\App\Request\Http|\PHPUnit_Framework_MockObject_MockObject $request */ + $request = $this->getMock('Magento\Framework\App\Request\Http', [], [], '', false); + $request->expects($this->atLeastOnce())->method('getControllerName')->will($this->returnValue('feed')); + $request->expects($this->atLeastOnce())->method('getActionName')->will($this->returnValue('index')); + $request->expects($this->once())->method('getParam')->with('type')->will($this->returnValue('notifystock')); + + /** @var \Magento\Backend\Model\Auth\StorageInterface|\PHPUnit_Framework_MockObject_MockObject $session */ + $session = $this->getMock('Magento\Backend\Model\Auth\StorageInterface', [], [], '', false); + $session->expects($this->at(0))->method('isLoggedIn')->will($this->returnValue(false)); + $session->expects($this->at(1))->method('isLoggedIn')->will($this->returnValue(true)); + + $username = 'admin'; + $password = '123123qa'; + $auth = $this->getMock('Magento\Backend\Model\Auth', [], [], '', false); + $auth->expects($this->once())->method('getAuthStorage')->will($this->returnValue($session)); + $auth->expects($this->once())->method('login')->with($username, $password); + + /** @var \Magento\Framework\HTTP\Authentication|\PHPUnit_Framework_MockObject_MockObject $httpAuthentication */ + $httpAuthentication = $this->getMock('Magento\Framework\HTTP\Authentication', [], [], '', false); + $httpAuthentication->expects($this->once())->method('getCredentials') + ->will($this->returnValue([$username, $password])); + $httpAuthentication->expects($this->once())->method('setAuthenticationFailed')->with('RSS Feeds'); + + $authorization = $this->getMock('Magento\Framework\AuthorizationInterface', [], [], '', false); + $authorization->expects($this->at(0))->method('isAllowed')->with('Magento_Rss::rss') + ->will($this->returnValue(true)); + $authorization->expects($this->at(1))->method('isAllowed')->with('Magento_Catalog::catalog_inventory') + ->will($this->returnValue(false)); + + $aclResources = [ + 'feed' => 'Magento_Rss::rss', + 'notifystock' => 'Magento_Catalog::catalog_inventory', + 'new_order' => 'Magento_Sales::actions_view', + 'review' => 'Magento_Reports::review_product' + ]; + + /** @var \Magento\Rss\App\Action\Plugin\BackendAuthentication $plugin */ + $plugin = (new \Magento\TestFramework\Helper\ObjectManager($this)) + ->getObject( + 'Magento\Rss\App\Action\Plugin\BackendAuthentication', + [ + 'auth' => $auth, + 'httpAuthentication' => $httpAuthentication, + 'response' => $response, + 'authorization' => $authorization, + 'aclResources' => $aclResources + ] + ); + $this->assertSame( + $response, + $plugin->aroundDispatch($subject, $proceed, $request) + ); + } +} diff --git a/dev/tests/unit/testsuite/Magento/Sales/Model/Order/CreditmemoTest.php b/dev/tests/unit/testsuite/Magento/Sales/Model/Order/CreditmemoTest.php index 5dfe0f258c31a..7e746c92e6900 100644 --- a/dev/tests/unit/testsuite/Magento/Sales/Model/Order/CreditmemoTest.php +++ b/dev/tests/unit/testsuite/Magento/Sales/Model/Order/CreditmemoTest.php @@ -6,6 +6,8 @@ use Magento\Sales\Model\Resource\OrderFactory; use Magento\TestFramework\Helper\ObjectManager as ObjectManagerHelper; +use Magento\Sales\Model\Resource\Order\Creditmemo\Item\CollectionFactory; +use Magento\Sales\Model\Resource\Order\Creditmemo\Item\Collection as ItemCollection; /** * Class CreditmemoTest @@ -22,6 +24,11 @@ class CreditmemoTest extends \PHPUnit_Framework_TestCase */ protected $creditmemo; + /** + * @var CollectionFactory|\PHPUnit_Framework_MockObject_MockObject + */ + protected $cmItemCollectionFactoryMock; + public function setUp() { $this->orderFactory = $this->getMock( @@ -33,6 +40,12 @@ public function setUp() ); $objectManagerHelper = new ObjectManagerHelper($this); + $this->cmItemCollectionFactoryMock = $this->getMockBuilder( + '\Magento\Sales\Model\Resource\Order\Creditmemo\Item\CollectionFactory' + )->disableOriginalConstructor() + ->setMethods(['create']) + ->getMock(); + $arguments = [ 'context' => $this->getMock('Magento\Framework\Model\Context', [], [], '', false), 'registry' => $this->getMock('Magento\Framework\Registry', [], [], '', false), @@ -40,13 +53,7 @@ public function setUp() 'dateTime' => $this->getMock('Magento\Framework\Stdlib\DateTime', [], [], '', false), 'creditmemoConfig' => $this->getMock('Magento\Sales\Model\Order\Creditmemo\Config', [], [], '', false), 'orderFactory' => $this->orderFactory, - 'cmItemCollectionFactory' => $this->getMock( - 'Magento\Sales\Model\Resource\Order\Creditmemo\Item\CollectionFactory', - [], - [], - '', - false - ), + 'cmItemCollectionFactory' => $this->cmItemCollectionFactoryMock, 'calculatorFactory' => $this->getMock('Magento\Framework\Math\CalculatorFactory', [], [], '', false), 'storeManager' => $this->getMock('Magento\Store\Model\StoreManagerInterface', [], [], '', false), 'commentFactory' => $this->getMock( @@ -128,4 +135,62 @@ public function testGetIncrementId() $this->creditmemo->setIncrementId('test_increment_id'); $this->assertEquals('test_increment_id', $this->creditmemo->getIncrementId()); } + + public function testGetItemsCollectionWithId() + { + $id = 1; + $this->creditmemo->setId($id); + + $items = []; + $itemMock = $this->getMockBuilder('\Magento\Sales\Model\Order\Creditmemo\Item') + ->disableOriginalConstructor() + ->getMock(); + $itemMock->expects($this->once()) + ->method('setCreditmemo') + ->with($this->creditmemo); + $items[] = $itemMock; + + /** @var ItemCollection|\PHPUnit_Framework_MockObject_MockObject $itemCollectionMock */ + $itemCollectionMock = $this->getMockBuilder('\Magento\Sales\Model\Resource\Order\Creditmemo\Item\Collection') + ->disableOriginalConstructor() + ->getMock(); + $itemCollectionMock->expects($this->once()) + ->method('setCreditmemoFilter') + ->with($id) + ->will($this->returnValue($items)); + + $this->cmItemCollectionFactoryMock->expects($this->any()) + ->method('create') + ->will($this->returnValue($itemCollectionMock)); + + $itemsCollection = $this->creditmemo->getItemsCollection(); + $this->assertEquals($items, $itemsCollection); + } + + public function testGetItemsCollectionWithoutId() + { + $items = []; + $itemMock = $this->getMockBuilder('\Magento\Sales\Model\Order\Creditmemo\Item') + ->disableOriginalConstructor() + ->getMock(); + $itemMock->expects($this->never()) + ->method('setCreditmemo'); + $items[] = $itemMock; + + /** @var ItemCollection|\PHPUnit_Framework_MockObject_MockObject $itemCollectionMock */ + $itemCollectionMock = $this->getMockBuilder('\Magento\Sales\Model\Resource\Order\Creditmemo\Item\Collection') + ->disableOriginalConstructor() + ->getMock(); + $itemCollectionMock->expects($this->once()) + ->method('setCreditmemoFilter') + ->with(null) + ->will($this->returnValue($items)); + + $this->cmItemCollectionFactoryMock->expects($this->any()) + ->method('create') + ->will($this->returnValue($itemCollectionMock)); + + $itemsCollection = $this->creditmemo->getItemsCollection(); + $this->assertEquals($items, $itemsCollection); + } } diff --git a/dev/tests/unit/testsuite/Magento/Sales/Model/QuoteTest.php b/dev/tests/unit/testsuite/Magento/Sales/Model/QuoteTest.php index 2548b7a342ed8..f99a191a3f16f 100644 --- a/dev/tests/unit/testsuite/Magento/Sales/Model/QuoteTest.php +++ b/dev/tests/unit/testsuite/Magento/Sales/Model/QuoteTest.php @@ -547,10 +547,6 @@ public function testSetCustomerAddressData() '', false ); - $customerMock->expects($this->any()) - ->method('getId') - ->will($this->returnValue($customerId)); - $this->customerRepositoryMock->expects($this->once()) ->method('getById') ->will($this->returnValue($customerMock)); diff --git a/dev/tests/unit/testsuite/Magento/Store/Model/StoreTest.php b/dev/tests/unit/testsuite/Magento/Store/Model/StoreTest.php index 976d7aaeaccf6..27915e5bd7a1e 100644 --- a/dev/tests/unit/testsuite/Magento/Store/Model/StoreTest.php +++ b/dev/tests/unit/testsuite/Magento/Store/Model/StoreTest.php @@ -50,7 +50,7 @@ public function setUp() $this->cookieManagerMock = $this->getMock('Magento\Framework\Stdlib\CookieManagerInterface'); $this->cookieMetadataFactoryMock = $this->getMock( 'Magento\Framework\Stdlib\Cookie\CookieMetadataFactory', - [], + ['createPublicCookieMetadata'], [], '', false @@ -448,13 +448,9 @@ public function testGetAllowedCurrencies() public function testSetCookie() { $storeCode = 'store code'; - $cookieMetadata = $this->getMock( - 'Magento\Framework\Stdlib\Cookie\PublicCookieMetadata', - [], - [], - '', - false - ); + $cookieMetadata = $this->getMockBuilder('Magento\Framework\Stdlib\Cookie\PublicCookieMetadata') + ->disableOriginalConstructor() + ->getMock(); $cookieMetadata->expects($this->once()) ->method('setHttpOnly') ->with(true) @@ -462,6 +458,9 @@ public function testSetCookie() $cookieMetadata->expects($this->once()) ->method('setDurationOneYear') ->willReturnSelf(); + $cookieMetadata->expects($this->once()) + ->method('setPath') + ->willReturnSelf(); $this->cookieMetadataFactoryMock->expects($this->once()) ->method('createPublicCookieMetadata') ->will($this->returnValue($cookieMetadata)); @@ -496,9 +495,18 @@ public function testGetStoreCodeFromCookie() public function testDeleteCookie() { + $cookieMetadata = $this->getMockBuilder('Magento\Framework\Stdlib\Cookie\PublicCookieMetadata') + ->disableOriginalConstructor() + ->getMock(); + $this->cookieMetadataFactoryMock->expects($this->once()) + ->method('createPublicCookieMetadata') + ->will($this->returnValue($cookieMetadata)); + $cookieMetadata->expects($this->once()) + ->method('setPath') + ->willReturnSelf(); $this->cookieManagerMock->expects($this->once()) ->method('deleteCookie') - ->with(Store::COOKIE_NAME); + ->with(Store::COOKIE_NAME, $cookieMetadata); /** @var \Magento\Store\Model\Store $model */ $model = $this->objectManagerHelper->getObject( 'Magento\Store\Model\Store', diff --git a/dev/tests/unit/testsuite/Magento/Tax/Helper/DataTest.php b/dev/tests/unit/testsuite/Magento/Tax/Helper/DataTest.php index 02534b33c9d4f..01af7e215929c 100644 --- a/dev/tests/unit/testsuite/Magento/Tax/Helper/DataTest.php +++ b/dev/tests/unit/testsuite/Magento/Tax/Helper/DataTest.php @@ -4,7 +4,8 @@ */ namespace Magento\Tax\Helper; -use Magento\Sales\Model\Quote\Address; +use Magento\Framework\Object as MagentoObject; +use Magento\TestFramework\Event\Magento; /** * Class DataTest @@ -32,6 +33,7 @@ public function setUp() $this->priceCurrencyMock = $this->getMockBuilder('Magento\Framework\Pricing\PriceCurrencyInterface') ->disableOriginalConstructor() ->getMock(); + $this->helper = $objectManager->getObject( 'Magento\Tax\Helper\Data', [ @@ -114,52 +116,79 @@ public function testGetCalculatedTaxesForOrder() $this->assertEquals($itemPercent, $result[0]['percent']); } - public function testGetCalculatedTaxesForOrderItems() + /** + * Creat OrderTaxDetails mock from array of data + * + * @param $inputArray + * @return \PHPUnit_Framework_MockObject_MockObject|\Magento\Tax\Api\Data\OrderTaxDetailsInterface + */ + protected function mapOrderTaxItemDetail($inputArray) { - $orderId = 1; - $itemShippingTaxAmount = 1; - $orderShippingTaxAmount = 1; - $itemCode = 'test_code'; - $itemAmount = 1; - $itemBaseAmount = 2; - $itemTitle = 'Test title'; - $itemPercent = 0.1; - $failedTaxAmount = "0.00000"; - - $expectedAmount = 2; - $expectedBaseAmount = 4; - - $orderDetailsItemNormal = $this->getMockBuilder('Magento\Tax\Api\Data\OrderTaxDetailsAppliedTaxInterface') - ->disableOriginalConstructor() + $orderTaxItemDetailsMock = $this->getMockBuilder('\Magento\Tax\Api\Data\OrderTaxDetailsInterface') ->getMock(); - $orderDetailsItemNormal->expects($this->once()) - ->method('getCode') - ->willReturn($itemCode); - $orderDetailsItemNormal->expects($this->once()) - ->method('getAmount') - ->willReturn($itemAmount); - $orderDetailsItemNormal->expects($this->once()) - ->method('getBaseAmount') - ->willReturn($itemBaseAmount); - $orderDetailsItemNormal->expects($this->once()) - ->method('getTitle') - ->willReturn($itemTitle); - $orderDetailsItemNormal->expects($this->once()) - ->method('getPercent') - ->willReturn($itemPercent); + $itemMocks = []; + foreach ($inputArray['items'] as $orderTaxDetailsItemData) { + $itemId = isset($orderTaxDetailsItemData['item_id']) ? $orderTaxDetailsItemData['item_id'] : null; + $associatedItemId = isset($orderTaxDetailsItemData['associated_item_id']) + ? $orderTaxDetailsItemData['associated_item_id'] + : null; + $itemType = isset($orderTaxDetailsItemData['type']) ? $orderTaxDetailsItemData['type'] : null; + $appliedTaxesData = $orderTaxDetailsItemData['applied_taxes']; + $appliedTaxesMocks = []; + foreach ($appliedTaxesData as $appliedTaxData) { + $appliedTaxesMock = $this->getMockBuilder('\Magento\Tax\Api\Data\OrderTaxDetailsAppliedTaxInterface') + ->getMock(); + $appliedTaxesMock->expects($this->any()) + ->method('getAmount') + ->will($this->returnValue($appliedTaxData['amount'])); + $appliedTaxesMock->expects($this->any()) + ->method('getBaseAmount') + ->will($this->returnValue($appliedTaxData['base_amount'])); + $appliedTaxesMock->expects($this->any()) + ->method('getCode') + ->will($this->returnValue($appliedTaxData['code'])); + $appliedTaxesMock->expects($this->any()) + ->method('getTitle') + ->will($this->returnValue($appliedTaxData['title'])); + $appliedTaxesMock->expects($this->any()) + ->method('getPercent') + ->will($this->returnValue($appliedTaxData['percent'])); + $appliedTaxesMocks[] = $appliedTaxesMock; + } + $orderTaxDetailsItemMock = $this->getMockBuilder('\Magento\Tax\Api\Data\OrderTaxDetailsItemInterface') + ->getMock(); + $orderTaxDetailsItemMock->expects($this->any()) + ->method('getItemId') + ->will($this->returnValue($itemId)); + $orderTaxDetailsItemMock->expects($this->any()) + ->method('getAssociatedItemId') + ->will($this->returnValue($associatedItemId)); + $orderTaxDetailsItemMock->expects($this->any()) + ->method('getType') + ->will($this->returnValue($itemType)); + $orderTaxDetailsItemMock->expects($this->any()) + ->method('getAppliedTaxes') + ->will($this->returnValue($appliedTaxesMocks)); - $orderDetailsItemZeroAmount = $this->getMockBuilder('Magento\Tax\Api\Data\OrderTaxDetailsAppliedTaxInterface') - ->disableOriginalConstructor() - ->getMock(); - $orderDetailsItemZeroAmount->expects($this->once()) - ->method('getAmount') - ->willReturn(0); - $orderDetailsItemZeroAmount->expects($this->once()) - ->method('getBaseAmount') - ->willReturn(0); + $itemMocks[] = $orderTaxDetailsItemMock; + } + $orderTaxItemDetailsMock->expects($this->any()) + ->method('getItems') + ->will($this->returnValue($itemMocks)); - $appliedTaxes = [$orderDetailsItemNormal, $orderDetailsItemZeroAmount]; + return $orderTaxItemDetailsMock; + } + /** + * @dataProvider getCalculatedTaxesForOrderItemsDataProvider + */ + public function testGetCalculatedTaxesForOrderItems($orderData, $invoiceData, $expectedResults) + { + $orderId = $orderData['order_id']; + $orderShippingTaxAmount = isset($orderData['shipping_tax_amount']) ? $orderData['shipping_tax_amount'] : 0; + $orderTaxDetails = $orderData['order_tax_details']; + + /** @var \PHPUnit_Framework_MockObject_MockObject|\Magento\Sales\Model\Order $orderMock */ $orderMock = $this->getMockBuilder('Magento\Sales\Model\Order') ->disableOriginalConstructor() ->getMock(); @@ -170,46 +199,17 @@ public function testGetCalculatedTaxesForOrderItems() ->method('getShippingTaxAmount') ->willReturn($orderShippingTaxAmount); - $taxDetailsData = $this->getMockBuilder('Magento\Tax\Api\Data\OrderTaxDetailsItemInterface') - ->disableOriginalConstructor() - ->getMock(); - $taxDetailsData->expects($this->once()) - ->method('getType') - ->willReturn(Address::TYPE_SHIPPING); - $taxDetailsData->expects($this->once()) - ->method('getAppliedTaxes') - ->willReturn($appliedTaxes); - - $orderDetails = $this->getMockBuilder('Magento\Tax\Api\Data\OrderTaxDetailsInterface') - ->disableOriginalConstructor() - ->getMock(); - $orderDetails->expects($this->once()) - ->method('getItems') - ->willReturn([$taxDetailsData]); - - $this->orderTaxManagementMock->expects($this->once()) + $orderTaxDetailsMock = $this->mapOrderTaxItemDetail($orderTaxDetails); + $this->orderTaxManagementMock->expects($this->any()) ->method('getOrderTaxDetails') ->with($orderId) - ->willReturn($orderDetails); + ->will($this->returnValue($orderTaxDetailsMock)); - $orderItemMock = $this->getMockBuilder('Magento\Sales\Model\Order\Item') - ->disableOriginalConstructor() - ->getMock(); - $orderItemMock->expects($this->once()) - ->method('getTaxAmount') - ->willReturn($failedTaxAmount); - - $invoiceItemFailed = $this->getMockBuilder('Magento\Sales\Model\Order\Invoice\Item') - ->disableOriginalConstructor() - ->getMock(); - $invoiceItemFailed->expects($this->once()) - ->method('getOrderItem') - ->willReturn($orderItemMock); - $invoiceItemFailed->expects($this->once()) - ->method('getTaxAmount') - ->willReturn(1); - - $source = $this->getMockBuilder('Magento\Sales\Model\Order\Creditmemo') + $invoiceShippingTaxAmount = + isset($invoiceData['shipping_tax_amount']) ? $invoiceData['shipping_tax_amount'] : 0; + $invoiceItems = $invoiceData['invoice_items']; + /** @var \PHPUnit_Framework_MockObject_MockObject|\Magento\Sales\Model\Order\Invoice $source */ + $source = $this->getMockBuilder('Magento\Sales\Model\Order\Invoice') ->disableOriginalConstructor() ->getMock(); $source->expects($this->once()) @@ -217,24 +217,156 @@ public function testGetCalculatedTaxesForOrderItems() ->willReturn($orderMock); $source->expects($this->once()) ->method('getShippingTaxAmount') - ->willReturn($itemShippingTaxAmount); + ->willReturn($invoiceShippingTaxAmount); $source->expects($this->once()) - ->method('getItemsCollection') - ->willReturn([$invoiceItemFailed]); + ->method('getItems') + ->willReturn($invoiceItems); - $roundValues = [ - [$itemAmount, $expectedAmount], - [$itemBaseAmount, $expectedBaseAmount], - ]; - $this->priceCurrencyMock->expects($this->exactly(2)) + $this->priceCurrencyMock->expects($this->any()) ->method('round') - ->will($this->returnValueMap($roundValues)); + ->will($this->returnCallback( + function ($arg) { + return round($arg, 2); + } + ) + ); $result = $this->helper->getCalculatedTaxes($source); - $this->assertCount(1, $result); - $this->assertEquals($expectedAmount, $result[0]['tax_amount']); - $this->assertEquals($expectedBaseAmount, $result[0]['base_tax_amount']); - $this->assertEquals($itemTitle, $result[0]['title']); - $this->assertEquals($itemPercent, $result[0]['percent']); + foreach ($result as $index => $appliedTax) { + $expectedTax = $expectedResults[$index]; + foreach ($appliedTax as $attr => $value) { + $this->assertEquals($expectedTax[$attr], $value, "The ".$attr." of tax does not match"); + } + } + } + + /** + * @SuppressWarnings(PHPMD.ExcessiveMethodLength) + * @return array + */ + public function getCalculatedTaxesForOrderItemsDataProvider() + { + $data = [ + //Scenario 1: two items, one item with 0 tax + 'two_items_with_one_zero_tax' => [ + 'order' => [ + 'order_id' => 1, + 'shipping_tax_amount' => 0, + 'order_tax_details' => [ + 'items' => [ + 'itemTax1' => [ + 'item_id' => 1, + 'applied_taxes' => [ + [ + 'amount' => 5.0, + 'base_amount' => 5.0, + 'code' => 'US-CA', + 'title' => 'US-CA-Sales-Tax', + 'percent' => 20.0, + ], + ], + ], + ], + ], + ], + 'invoice' => [ + 'invoice_items' => [ + 'item1' => new MagentoObject( + [ + 'order_item' => new MagentoObject( + [ + 'id' => 1, + 'tax_amount' => 5.00, + ] + ), + 'tax_amount' => 2.50, + ] + ), + 'item2' => new MagentoObject( + [ + 'order_item' => new MagentoObject( + [ + 'id' => 2, + 'tax_amount' => 0.0, + ] + ), + 'tax_amount' => 0.0, + ] + ), + ], + ], + 'expected_results' => [ + [ + 'title' => 'US-CA-Sales-Tax', + 'percent' => 20.0, + 'tax_amount' => 2.5, + 'base_tax_amount' => 2.5, + ], + ], + ], + //Scenario 2: one item with associated weee tax + 'item_with_weee_tax_partial_invoice' => [ + 'order' => [ + 'order_id' => 1, + 'shipping_tax_amount' => 0, + 'order_tax_details' => [ + 'items' => [ + 'itemTax1' => [ + 'item_id' => 1, + 'applied_taxes' => [ + [ + 'amount' => 5.0, + 'base_amount' => 5.0, + 'code' => 'US-CA', + 'title' => 'US-CA-Sales-Tax', + 'percent' => 20.0, + ], + ], + ], + 'weeeTax1' => [ + 'associated_item_id' => 1, + 'type' => 'weee', + 'applied_taxes' => [ + [ + 'amount' => 3.0, + 'base_amount' => 3.0, + 'code' => 'US-CA', + 'title' => 'US-CA-Sales-Tax', + 'percent' => 20.0, + ], + ], + ], + ], + ], + ], + 'invoice' => [ + 'invoice_items' => [ + 'item1' => new MagentoObject( + [ + 'order_item' => new MagentoObject( + [ + 'id' => 1, + 'tax_amount' => 5.00, + ] + ), + 'tax_amount' => 5.0, + //half of weee tax is invoiced + 'tax_ratio' => serialize(['weee' => 0.5]), + ] + ), + ], + ], + 'expected_results' => [ + [ + 'title' => 'US-CA-Sales-Tax', + 'percent' => 20.0, + 'tax_amount' => 6.5, + 'base_tax_amount' => 6.5, + ], + ], + ], + ]; + + return $data; } } diff --git a/dev/tests/unit/testsuite/Magento/Tax/Model/Calculation/RateRepositoryTest.php b/dev/tests/unit/testsuite/Magento/Tax/Model/Calculation/RateRepositoryTest.php index 47184c9f5b20d..387a864c25de2 100644 --- a/dev/tests/unit/testsuite/Magento/Tax/Model/Calculation/RateRepositoryTest.php +++ b/dev/tests/unit/testsuite/Magento/Tax/Model/Calculation/RateRepositoryTest.php @@ -5,6 +5,8 @@ namespace Magento\Tax\Model\Calculation; use Magento\TestFramework\Helper\ObjectManager; +use Magento\Framework\Model\Exception as ModelException; +use Magento\Framework\Api\SearchCriteria; class RateRepositoryTest extends \PHPUnit_Framework_TestCase { @@ -272,4 +274,166 @@ private function getTaxRateMock(array $taxRateData) return $taxRateMock; } + + /** + * @param ModelException $expectedException + * @param string $exceptionType + * @param string $exceptionMessage + * @throws ModelException + * @throws \Exception + * @throws \Magento\Framework\Exception\InputException + * @dataProvider saveThrowsExceptionIfCannotSaveTitlesDataProvider + */ + public function testSaveThrowsExceptionIfCannotSaveTitles($expectedException, $exceptionType, $exceptionMessage) + { + $countryCode = 'US'; + $countryMock = $this->getMock('Magento\Directory\Model\Country', [], [], '', false); + $countryMock->expects($this->any())->method('getId')->will($this->returnValue(1)); + $countryMock->expects($this->any())->method('loadByCode')->with($countryCode)->will($this->returnSelf()); + $this->countryFactoryMock->expects($this->once())->method('create')->will($this->returnValue($countryMock)); + + $regionId = 2; + $regionMock = $this->getMock('Magento\Directory\Model\Region', [], [], '', false); + $regionMock->expects($this->any())->method('getId')->will($this->returnValue($regionId)); + $regionMock->expects($this->any())->method('load')->with($regionId)->will($this->returnSelf()); + $this->regionFactoryMock->expects($this->once())->method('create')->will($this->returnValue($regionMock)); + + $rateTitles = ['Label 1', 'Label 2']; + $rateMock = $this->getTaxRateMock( + [ + 'id' => null, + 'tax_country_id' => $countryCode, + 'tax_region_id' => $regionId, + 'region_name' => null, + 'tax_postcode' => null, + 'zip_is_range' => true, + 'zip_from' => 90000, + 'zip_to' => 90005, + 'rate' => 7.5, + 'code' => 'Tax Rate Code', + 'titles' => $rateTitles, + ] + ); + $this->rateConverterMock->expects($this->once())->method('createTitleArrayFromServiceObject') + ->with($rateMock)->will($this->returnValue($rateTitles)); + $this->rateResourceMock->expects($this->once())->method('save')->with($rateMock); + $rateMock + ->expects($this->once()) + ->method('saveTitles') + ->with($rateTitles) + ->willThrowException($expectedException); + $this->rateRegistryMock->expects($this->never())->method('registerTaxRate')->with($rateMock); + $this->setExpectedException($exceptionType, $exceptionMessage); + $this->model->save($rateMock); + } + + public function saveThrowsExceptionIfCannotSaveTitlesDataProvider() + { + return [ + 'entity_already_exists' => [ + new ModelException( + 'Cannot save titles', + ModelException::ERROR_CODE_ENTITY_ALREADY_EXISTS + ), + 'Magento\Framework\Exception\InputException', + 'Cannot save titles' + ], + 'cannot_save_title' => [ + new ModelException( + 'Cannot save titles' + ), + 'Magento\Framework\Model\Exception', + 'Cannot save titles' + ] + ]; + } + + public function testGetListWhenFilterGroupExists() + { + $searchCriteriaMock = $this->getMock('Magento\Framework\Api\SearchCriteriaInterface'); + $filterGroupMock = $this->getMock('Magento\Framework\Api\Search\FilterGroup', [], [], '', false); + $searchCriteriaMock + ->expects($this->any()) + ->method('getFilterGroups') + ->will($this->returnValue([$filterGroupMock])); + $filterMock = $this->getMock('Magento\Framework\Api\Filter', [], [], '', false); + $filterGroupMock->expects($this->once())->method('getFilters')->willReturn([$filterMock]); + $filterMock->expects($this->exactly(2))->method('getConditionType')->willReturn('like'); + $filterMock->expects($this->once())->method('getField')->willReturn('region_name'); + $filterMock->expects($this->once())->method('getValue')->willReturn('condition_value'); + $objectManager = new ObjectManager($this); + $rateMock = $this->getTaxRateMock([]); + $items = [$rateMock]; + $collectionMock = $objectManager->getCollectionMock( + 'Magento\Tax\Model\Resource\Calculation\Rate\Collection', + $items + ); + $collectionMock + ->expects($this->once()) + ->method('addFieldToFilter') + ->with(['region_table.code'], [['like' => 'condition_value']]); + $sortOrderMock = $this->getMock('Magento\Framework\Api\SortOrder', [], [], '', false); + $searchCriteriaMock + ->expects($this->any()) + ->method('getSortOrders') + ->will($this->returnValue([$sortOrderMock])); + $sortOrderMock->expects($this->once())->method('getField')->willReturn('field_name'); + $sortOrderMock->expects($this->once())->method('getDirection')->willReturn(SearchCriteria::SORT_ASC); + $collectionMock->expects($this->once())->method('addOrder')->with('main_table.field_name', 'ASC'); + $currentPage = 1; + $pageSize = 100; + $searchCriteriaMock->expects($this->any())->method('getCurrentPage')->will($this->returnValue($currentPage)); + $searchCriteriaMock->expects($this->any())->method('getPageSize')->will($this->returnValue($pageSize)); + $rateMock = $this->getTaxRateMock([]); + + + $collectionMock->expects($this->once())->method('joinRegionTable'); + $collectionMock->expects($this->once())->method('setCurPage')->with($currentPage); + $collectionMock->expects($this->once())->method('setPageSize')->with($pageSize); + $collectionMock->expects($this->once())->method('getSize')->will($this->returnValue(count($items))); + + $this->rateFactoryMock->expects($this->once())->method('create')->will($this->returnValue($rateMock)); + $rateMock->expects($this->any())->method('getCollection')->will($this->returnValue($collectionMock)); + + + + $this->searchResultBuilder->expects($this->once())->method('setItems')->with($items)->willReturnSelf(); + $this->searchResultBuilder->expects($this->once())->method('setTotalCount')->with(count($items)) + ->willReturnSelf(); + $this->searchResultBuilder->expects($this->once())->method('setSearchCriteria')->with($searchCriteriaMock) + ->willReturnSelf(); + $this->searchResultBuilder->expects($this->once())->method('create'); + + $this->model->getList($searchCriteriaMock); + } + + /** + * @expectedException \Magento\Framework\Exception\InputException + * @expectedExceptionMessage One or more input exceptions have occurred. + */ + public function testValidate() + { + $regionId = 2; + $rateTitles = ['Label 1', 'Label 2']; + $regionMock = $this->getMock('Magento\Directory\Model\Region', [], [], '', false); + $regionMock->expects($this->any())->method('getId')->will($this->returnValue('')); + $regionMock->expects($this->any())->method('load')->with($regionId)->will($this->returnSelf()); + $this->regionFactoryMock->expects($this->once())->method('create')->will($this->returnValue($regionMock)); + $rateMock = $this->getTaxRateMock( + [ + 'id' => null, + 'tax_country_id' => '', + 'tax_region_id' => $regionId, + 'region_name' => null, + 'tax_postcode' => null, + 'zip_is_range' => true, + 'zip_from' => -90000, + 'zip_to' => '', + 'rate' => '', + 'code' => '', + 'titles' => $rateTitles, + ] + ); + $this->model->save($rateMock); + } } diff --git a/dev/tests/unit/testsuite/Magento/Tax/Model/TaxClass/RepositoryTest.php b/dev/tests/unit/testsuite/Magento/Tax/Model/TaxClass/RepositoryTest.php index b62310f41491b..493fed9d93a83 100644 --- a/dev/tests/unit/testsuite/Magento/Tax/Model/TaxClass/RepositoryTest.php +++ b/dev/tests/unit/testsuite/Magento/Tax/Model/TaxClass/RepositoryTest.php @@ -6,6 +6,8 @@ namespace Magento\Tax\Model\TaxClass; use Magento\Framework\Exception\CouldNotDeleteException; +use Magento\Framework\Model\Exception as ModelException; +use Magento\Framework\Api\SearchCriteria; class RepositoryTest extends \PHPUnit_Framework_TestCase { @@ -125,7 +127,7 @@ public function testGet() $this->assertEquals($taxClass, $this->model->get($classId)); } - + public function testDeleteById() { $taxClass = $this->getMock('\Magento\Tax\Model\ClassModel', [], [], '', false); @@ -148,15 +150,26 @@ public function testGetList() $taxClassOne = $this->getMock('\Magento\Tax\Api\Data\TaxClassInterface'); $taxClassTwo = $this->getMock('\Magento\Tax\Api\Data\TaxClassInterface'); $searchCriteria = $this->getMock('\Magento\Framework\Api\SearchCriteriaInterface'); - $searchCriteria->expects($this->once())->method('getFilterGroups')->willReturn([]); + $filterGroup = $this->getMock('\Magento\Framework\Api\Search\FilterGroup', [], [], '', false); + $filter = $this->getMock('\Magento\Framework\Api\Filter', [], [], '', false); + $collection = $this->getMock('\Magento\Tax\Model\Resource\TaxClass\Collection', [], [], '', false); + $sortOrder = $this->getMock('\Magento\Framework\Api\SortOrder', [], [], '', false); + + $searchCriteria->expects($this->once())->method('getFilterGroups')->willReturn([$filterGroup]); + $filterGroup->expects($this->once())->method('getFilters')->willReturn([$filter]); + $filter->expects($this->atLeastOnce())->method('getConditionType')->willReturn('eq'); + $filter->expects($this->once())->method('getField')->willReturn('field'); + $filter->expects($this->once())->method('getValue')->willReturn('value'); + $collection->expects($this->once())->method('addFieldToFilter')->with(['field'], [['eq' => 'value']]); + + $searchCriteria->expects($this->exactly(2))->method('getSortOrders')->willReturn([$sortOrder]); + $sortOrder->expects($this->once())->method('getField')->willReturn('field'); + $sortOrder->expects($this->once())->method('getDirection')->willReturn(SearchCriteria::SORT_ASC); + $collection->expects($this->once())->method('addOrder')->with('field', 'ASC'); $searchCriteria->expects($this->once())->method('getPageSize')->willReturn(20); $searchCriteria->expects($this->once())->method('getCurrentPage')->willReturn(0); $result = $this->getMock('\Magento\Tax\Api\Data\TaxRateSearchResultsInterface'); - $collection = $this->objectManager->getCollectionMock( - '\Magento\Tax\Model\Resource\TaxClass\Collection', - [$taxClassOne, $taxClassTwo] - ); $collection->expects($this->any())->method('getSize')->willReturn(2); $collection->expects($this->any())->method('setItems')->with([$taxClassOne, $taxClassTwo]); $collection->expects($this->once())->method('setCurPage')->with(0); @@ -190,4 +203,100 @@ public function testSave() $this->taxClassResourceMock->expects($this->once())->method('save')->with($taxClass); $this->assertEquals(10, $this->model->save($taxClass)); } + + /** + * @expectedException \Magento\Framework\Exception\InputException + * @expectedExceptionMessage Updating classType is not allowed. + */ + public function testSaveWithInputException() + { + $taxClass = $this->getMock('\Magento\Tax\Model\ClassModel', [], [], '', false); + $originalTax = $this->getMock('\Magento\Tax\Model\ClassModel', [], [], '', false); + $taxClass->expects($this->exactly(2))->method('getClassId')->willReturn(10); + $this->classModelRegistryMock->expects($this->once())->method('retrieve')->with(10)->willReturn($originalTax); + $originalTax->expects($this->once())->method('getClassType')->willReturn('PRODUCT'); + $taxClass->expects($this->once())->method('getClassType')->willReturn('PRODUCT2'); + $this->model->save($taxClass); + } + + /** + * @expectedException \Magento\Framework\Model\Exception + * @expectedExceptionMessage Something went wrong + */ + public function testSaveWithModelException() + { + $taxClass = $this->getMock('\Magento\Tax\Model\ClassModel', [], [], '', false); + $taxClass->expects($this->any())->method('getClassName')->willReturn('Class Name'); + $taxClass->expects($this->atLeastOnce())->method('getClassType')->willReturn('PRODUCT'); + $taxClass->expects($this->any())->method('getClassId')->willReturn(10); + + $originTaxClass = $this->getMock('\Magento\Tax\Model\ClassModel', [], [], '', false); + $originTaxClass->expects($this->once())->method('getClassType')->willReturn('PRODUCT'); + + $this->classModelRegistryMock + ->expects($this->once()) + ->method('retrieve') + ->with(10) + ->willReturn($originTaxClass); + + $this->taxClassResourceMock->expects($this->once())->method('save')->with($taxClass) + ->willThrowException(new ModelException("Something went wrong")); + $this->model->save($taxClass); + } + + /** + * @expectedException \Magento\Framework\Exception\InputException + * @expectedExceptionMessage A class with the same name already exists for ClassType PRODUCT. + */ + public function testSaveWithSameClassException() + { + $taxClass = $this->getMock('\Magento\Tax\Model\ClassModel', [], [], '', false); + $taxClass->expects($this->any())->method('getClassName')->willReturn('Class Name'); + $taxClass->expects($this->atLeastOnce())->method('getClassType')->willReturn('PRODUCT'); + $taxClass->expects($this->any())->method('getClassId')->willReturn(10); + + $originTaxClass = $this->getMock('\Magento\Tax\Model\ClassModel', [], [], '', false); + $originTaxClass->expects($this->once())->method('getClassType')->willReturn('PRODUCT'); + + $this->classModelRegistryMock + ->expects($this->once()) + ->method('retrieve') + ->with(10) + ->willReturn($originTaxClass); + + $this->taxClassResourceMock->expects($this->once())->method('save')->with($taxClass) + ->willThrowException(new ModelException(\Magento\Tax\Model\Resource\TaxClass::UNIQUE_TAX_CLASS_MSG)); + $this->model->save($taxClass); + } + + /** + * @dataProvider validateTaxClassDataProvider + * @expectedException \Magento\Framework\Exception\InputException + * @expectedExceptionMessage One or more input exceptions have occurred. + */ + public function testSaveWithValidateTaxClassDataException($classType) + { + $taxClass = $this->getMock('\Magento\Tax\Model\ClassModel', [], [], '', false); + $taxClass->expects($this->any())->method('getClassName')->willReturn(''); + $taxClass->expects($this->atLeastOnce())->method('getClassType')->willReturn($classType); + $taxClass->expects($this->any())->method('getClassId')->willReturn(10); + + $originTaxClass = $this->getMock('\Magento\Tax\Model\ClassModel', [], [], '', false); + $originTaxClass->expects($this->once())->method('getClassType')->willReturn($classType); + + $this->classModelRegistryMock + ->expects($this->once()) + ->method('retrieve') + ->with(10) + ->willReturn($originTaxClass); + $this->model->save($taxClass); + } + + public function validateTaxClassDataProvider() + { + return [ + [''], + ['ERROR'] + ]; + } } diff --git a/dev/tests/unit/testsuite/Magento/Tax/Model/TaxRateCollectionTest.php b/dev/tests/unit/testsuite/Magento/Tax/Model/TaxRateCollectionTest.php new file mode 100644 index 0000000000000..5d1ecef858b10 --- /dev/null +++ b/dev/tests/unit/testsuite/Magento/Tax/Model/TaxRateCollectionTest.php @@ -0,0 +1,169 @@ +entityFactoryMock = $this->getMock('Magento\Core\Model\EntityFactory', [], [], '', false); + $this->filterBuilderMock = $this->getMock('Magento\Framework\Api\FilterBuilder', [], [], '', false); + $this->searchCriteriaBuilderMock = + $this->getMock('Magento\Framework\Api\SearchCriteriaBuilder', [], [], '', false); + $this->sortOrderBuilderMock = $this->getMock('Magento\Framework\Api\SortOrderBuilder', [], [], '', false); + $this->rateServiceMock = $this->getMock( + 'Magento\Tax\Api\TaxRateRepositoryInterface', + [ + 'save', + 'get', + 'deleteById', + 'getList', + 'delete', + '__wakeup' + ], + [], + '', + false + ); + $this->rateConverterMock = $this->getMock( + 'Magento\Tax\Model\Calculation\Rate\Converter', + [], + [], + '', + false + ); + $this->searchCriteriaMock = $this->getMock( + 'Magento\Framework\Api\SearchCriteriaInterface', + [], + [], + '', + false + ); + $this->searchResultsMock = $this->getMock( + 'Magento\Tax\Api\Data\TaxRateSearchResultsInterface', + [], + [], + '', + false + ); + $this->taxRateMock = $this->getMock('Magento\Tax\Model\Calculation\Rate', [], [], '', false); + + $this->searchCriteriaBuilderMock->expects($this->any()) + ->method('create') + ->willReturn($this->searchCriteriaMock); + + $this->model = new TaxRateCollection( + $this->entityFactoryMock, + $this->filterBuilderMock, + $this->searchCriteriaBuilderMock, + $this->sortOrderBuilderMock, + $this->rateServiceMock, + $this->rateConverterMock + ); + } + + public function testLoadData() + { + $this->rateServiceMock->expects($this->once()) + ->method('getList') + ->with($this->searchCriteriaMock) + ->willReturn($this->searchResultsMock); + + $this->searchResultsMock->expects($this->once())->method('getTotalCount')->willReturn(123); + + $this->searchResultsMock->expects($this->once())->method('getItems')->willReturn([$this->taxRateMock]); + $this->taxRateMock->expects($this->once())->method('getId')->willReturn(33); + $this->taxRateMock->expects($this->once())->method('getCode')->willReturn(44); + $this->taxRateMock->expects($this->once())->method('getTaxCountryId')->willReturn('CountryId'); + $this->taxRateMock->expects($this->once())->method('getTaxRegionId')->willReturn(55); + $this->taxRateMock->expects($this->once())->method('getRegionName')->willReturn('Region Name'); + $this->taxRateMock->expects($this->once())->method('getTaxPostcode')->willReturn('Post Code'); + $this->taxRateMock->expects($this->once())->method('getRate')->willReturn(1.85); + $this->rateConverterMock->expects($this->once()) + ->method('createTitleArrayFromServiceObject') + ->with($this->taxRateMock) + ->willReturn([]); + $this->taxRateMock->expects($this->once())->method('getZipTo')->willReturn(null); + $this->taxRateMock->expects($this->never())->method('getZipFrom'); + + $this->model->loadData(); + } + + public function testCreateTaxRateCollectionItem() + { + $this->rateServiceMock->expects($this->once()) + ->method('getList') + ->with($this->searchCriteriaMock) + ->willReturn($this->searchResultsMock); + + $this->searchResultsMock->expects($this->once())->method('getTotalCount')->willReturn(123); + $this->searchResultsMock->expects($this->once())->method('getItems')->willReturn([$this->taxRateMock]); + $this->taxRateMock->expects($this->once())->method('getId')->willReturn(33); + $this->taxRateMock->expects($this->once())->method('getCode')->willReturn(44); + $this->taxRateMock->expects($this->once())->method('getTaxCountryId')->willReturn('CountryId'); + $this->taxRateMock->expects($this->once())->method('getTaxRegionId')->willReturn(55); + $this->taxRateMock->expects($this->once())->method('getRegionName')->willReturn('Region Name'); + $this->taxRateMock->expects($this->once())->method('getTaxPostcode')->willReturn('Post Code'); + $this->taxRateMock->expects($this->once())->method('getRate')->willReturn(1.85); + $this->rateConverterMock->expects($this->once()) + ->method('createTitleArrayFromServiceObject') + ->with($this->taxRateMock) + ->willReturn([]); + $this->taxRateMock->expects($this->exactly(2))->method('getZipTo')->willReturn(1); + $this->taxRateMock->expects($this->exactly(2))->method('getZipFrom')->willReturn(200); + + $this->model->loadData(); + } +} diff --git a/dev/tests/unit/testsuite/Magento/Tax/Model/TaxRateManagementTest.php b/dev/tests/unit/testsuite/Magento/Tax/Model/TaxRateManagementTest.php new file mode 100644 index 0000000000000..5d573a75d72ce --- /dev/null +++ b/dev/tests/unit/testsuite/Magento/Tax/Model/TaxRateManagementTest.php @@ -0,0 +1,94 @@ +filterBuilderMock = $this->getMock('\Magento\Framework\Api\FilterBuilder', [], [], '', false); + $this->taxRuleRepositoryMock = $this->getMock('\Magento\Tax\Api\TaxRuleRepositoryInterface', [], [], '', false); + $this->taxRateRepositoryMock = $this->getMock('\Magento\Tax\Api\TaxRateRepositoryInterface', [], [], '', false); + $this->searchCriteriaBuilderMock = $this->getMock( + '\Magento\Framework\Api\SearchCriteriaBuilder', + [], + [], + '', + false + ); + $this->model = new \Magento\Tax\Model\TaxRateManagement( + $this->taxRuleRepositoryMock, + $this->taxRateRepositoryMock, + $this->filterBuilderMock, + $this->searchCriteriaBuilderMock + ); + } + + public function testGetRatesByCustomerAndProductTaxClassId() + { + $customerTaxClassId = 4; + $productTaxClassId = 42; + $rateIds = [10]; + $productFilterMock = $this->getMock('\Magento\Framework\Api\Filter', [], [], '', false); + $customerFilterMock = $this->getMock('\Magento\Framework\Api\Filter', [], [], '', false); + $searchCriteriaMock = $this->getMock('\Magento\Framework\Api\SearchCriteria', [], [], '', false); + $searchResultsMock = $this->getMock('\Magento\Tax\Api\Data\TaxRuleSearchResultsInterface', [], [], '', false); + $taxRuleMock = $this->getMock('\Magento\Tax\Api\Data\TaxRuleInterface', [], [], '', false); + $taxRateMock = $this->getMock('\Magento\Tax\Api\Data\TaxRateInterface', [], [], '', false); + + $this->filterBuilderMock->expects($this->exactly(2))->method('setField')->withConsecutive( + ['customer_tax_class_ids'], + ['product_tax_class_ids'] + )->willReturnSelf(); + $this->filterBuilderMock->expects($this->exactly(2))->method('setValue')->withConsecutive( + [$this->equalTo([$customerTaxClassId])], + [$this->equalTo([$productTaxClassId])] + )->willReturnSelf(); + $this->filterBuilderMock->expects($this->exactly(2))->method('create')->willReturnOnConsecutiveCalls( + $customerFilterMock, + $productFilterMock + ); + $this->searchCriteriaBuilderMock->expects($this->exactly(2))->method('addFilter')->withConsecutive( + [[$customerFilterMock]], + [[$productFilterMock]] + ); + $this->searchCriteriaBuilderMock->expects($this->once())->method('create')->willReturn($searchCriteriaMock); + $this->taxRuleRepositoryMock->expects($this->once())->method('getList')->with($searchCriteriaMock) + ->willReturn($searchResultsMock); + $searchResultsMock->expects($this->once())->method('getItems')->willReturn([$taxRuleMock]); + $taxRuleMock->expects($this->once())->method('getTaxRateIds')->willReturn($rateIds); + $this->taxRateRepositoryMock->expects($this->once())->method('get')->with($rateIds[0]) + ->willReturn($taxRateMock); + $this->assertEquals( + [$taxRateMock], + $this->model->getRatesByCustomerAndProductTaxClassId($customerTaxClassId, $productTaxClassId) + ); + } +} diff --git a/dev/tests/unit/testsuite/Magento/Tax/Model/TaxRuleCollectionTest.php b/dev/tests/unit/testsuite/Magento/Tax/Model/TaxRuleCollectionTest.php new file mode 100644 index 0000000000000..4dbdc586e4cfa --- /dev/null +++ b/dev/tests/unit/testsuite/Magento/Tax/Model/TaxRuleCollectionTest.php @@ -0,0 +1,111 @@ +entityFactoryMock = $this->getMock('Magento\Core\Model\EntityFactory', [], [], '', false); + $this->filterBuilderMock = $this->getMock('Magento\Framework\Api\FilterBuilder', [], [], '', false); + $this->searchCriteriaBuilderMock = + $this->getMock('Magento\Framework\Api\SearchCriteriaBuilder', [], [], '', false); + $this->sortOrderBuilderMock = $this->getMock('Magento\Framework\Api\SortOrderBuilder', [], [], '', false); + $this->ruleServiceMock = $this->getMock('Magento\Tax\Api\TaxRuleRepositoryInterface', [], [], '', false); + $this->searchCriteriaMock = $this->getMock( + 'Magento\Framework\Api\SearchCriteria', + [], + [], + '', + false + ); + $this->searchResultsMock = $this->getMock( + 'Magento\Tax\Api\Data\TaxRateSearchResultsInterface', + [], + [], + '', + false + ); + + $this->taxRuleMock = $this->getMock('Magento\Tax\Model\Calculation\Rule', [], [], '', false); + $this->searchCriteriaBuilderMock->expects($this->any()) + ->method('create') + ->willReturn($this->searchCriteriaMock); + + $this->model = new TaxRuleCollection( + $this->entityFactoryMock, + $this->filterBuilderMock, + $this->searchCriteriaBuilderMock, + $this->sortOrderBuilderMock, + $this->ruleServiceMock + ); + } + + public function testLoadData() + { + $this->ruleServiceMock->expects($this->once()) + ->method('getList') + ->with($this->searchCriteriaMock) + ->willReturn($this->searchResultsMock); + + $this->searchResultsMock->expects($this->once())->method('getTotalCount')->willReturn(568); + $this->searchResultsMock->expects($this->once())->method('getItems')->willReturn([$this->taxRuleMock]); + $this->taxRuleMock->expects($this->once())->method('getId')->willReturn(33); + $this->taxRuleMock->expects($this->once())->method('getCode')->willReturn(44); + $this->taxRuleMock->expects($this->once())->method('getPriority')->willReturn('some priority'); + $this->taxRuleMock->expects($this->once())->method('getPosition')->willReturn('position'); + $this->taxRuleMock->expects($this->once())->method('getCalculateSubtotal')->willReturn(null); + $this->taxRuleMock->expects($this->once())->method('getCustomerTaxClassIds')->willReturn('Post Code'); + $this->taxRuleMock->expects($this->once())->method('getProductTaxClassIds')->willReturn([12]); + $this->taxRuleMock->expects($this->once())->method('getTaxRateIds')->willReturn([66]); + + $this->model->loadData(); + } +} diff --git a/dev/tests/unit/testsuite/Magento/Tax/Model/TaxRuleRepositoryTest.php b/dev/tests/unit/testsuite/Magento/Tax/Model/TaxRuleRepositoryTest.php index 45fc2740e9c10..8f778bd7fef04 100644 --- a/dev/tests/unit/testsuite/Magento/Tax/Model/TaxRuleRepositoryTest.php +++ b/dev/tests/unit/testsuite/Magento/Tax/Model/TaxRuleRepositoryTest.php @@ -4,6 +4,9 @@ */ namespace Magento\Tax\Model; +use Magento\Framework\Model\Exception as ModelException; +use Magento\Framework\Api\SearchCriteria as SearchCriteria; + class TaxRuleRepositoryTest extends \PHPUnit_Framework_TestCase { /** @@ -54,7 +57,11 @@ protected function setUp() ); $this->ruleFactory = $this->getMock('\Magento\Tax\Model\Calculation\RuleFactory', [], [], '', false); $this->collectionFactory = $this->getMock( - '\Magento\Tax\Model\Resource\Calculation\Rule\CollectionFactory', ['create'], [], '', false + '\Magento\Tax\Model\Resource\Calculation\Rule\CollectionFactory', + ['create'], + [], + '', + false ); $this->resource = $this->getMock('\Magento\Tax\Model\Resource\Calculation\Rule', [], [], '', false); @@ -105,30 +112,83 @@ public function testSave() $this->assertEquals($rule, $this->model->save($rule)); } - public function testGetList() + /** + * @dataProvider saveExceptionsDataProvider + * @param $exceptionObject + * @param $exceptionName + * @param $exceptionMessage + */ + public function testSaveWithExceptions($exceptionObject, $exceptionName, $exceptionMessage) { - $taxRuleOne = $this->getMock('\Magento\Tax\Api\Data\TaxRuleInterface'); - $taxRuleTwo = $this->getMock('\Magento\Tax\Api\Data\TaxRuleInterface'); - $searchCriteria = $this->getMock('\Magento\Framework\Api\SearchCriteria', [], [], '', false); - $searchCriteria->expects($this->once())->method('getFilterGroups')->willReturn([]); - $searchCriteria->expects($this->once())->method('getPageSize')->willReturn(20); - $searchCriteria->expects($this->once())->method('getCurrentPage')->willReturn(0); - - $result = $this->getMock('\Magento\Tax\Api\Data\TaxRuleSearchResultsInterface'); - $collection = $this->objectManager->getCollectionMock( - '\Magento\Tax\Model\Resource\TaxClass\Collection', - [$taxRuleOne, $taxRuleTwo] - ); - $collection->expects($this->any())->method('getSize')->willReturn(2); - $collection->expects($this->any())->method('setItems')->with([$taxRuleOne, $taxRuleTwo]); - $collection->expects($this->once())->method('setCurPage')->with(0); - $collection->expects($this->once())->method('setPageSize')->with(20); + $rule = $this->getMock('\Magento\Tax\Model\Calculation\Rule', [], [], '', false); + $rule->expects($this->once())->method('getId')->willReturn(10); - $this->searchResultBuilder->expects($this->once())->method('setSearchCriteria')->with($searchCriteria); - $this->searchResultBuilder->expects($this->once())->method('setTotalCount')->with(2); - $this->searchResultBuilder->expects($this->once())->method('create')->willReturn($result); - $this->collectionFactory->expects($this->once())->method('create')->willReturn($collection); + $this->taxRuleRegistry->expects($this->once())->method('retrieveTaxRule')->with(10)->willReturn($rule); + $this->resource->expects($this->once())->method('save')->with($rule) + ->willThrowException($exceptionObject); + $this->taxRuleRegistry->expects($this->never())->method('registerTaxRule'); + + $this->setExpectedException($exceptionName, $exceptionMessage); + $this->model->save($rule); + } - $this->assertEquals($result, $this->model->getList($searchCriteria)); + public function saveExceptionsDataProvider() + { + return [ + [ + new \Magento\Framework\Model\Exception('Could not save'), + '\Magento\Framework\Exception\CouldNotSaveException', + 'Could not save' + ], [ + new \Magento\Framework\Model\Exception('InputError', ModelException::ERROR_CODE_ENTITY_ALREADY_EXISTS), + '\Magento\Framework\Exception\InputException', + 'InputError' + ], [ + new \Magento\Framework\Exception\NoSuchEntityException('No such entity'), + '\Magento\Framework\Exception\NoSuchEntityException', + 'No such entity' + ] + ]; + } + + public function testGetList() + { + $collectionSize = 1; + $currentPage = 42; + $pageSize = 4; + + $searchCriteriaMock = $this->getMock('\Magento\Framework\Api\SearchCriteria', [], [], '', false); + $collectionMock = $this->getMock('Magento\Tax\Model\Resource\Calculation\Rule\Collection', [], [], '', false); + $filterGroupMock = $this->getMock('\Magento\Framework\Api\Search\FilterGroup', [], [], '', false); + $filterMock = $this->getMock('\Magento\Framework\Api\Filter', [], [], '', false); + $sortOrderMock = $this->getMock('\Magento\Framework\Api\SortOrder', [], [], '', false); + + $this->searchResultBuilder->expects($this->once())->method('setSearchCriteria')->with($searchCriteriaMock); + $this->collectionFactory->expects($this->once())->method('create')->willReturn($collectionMock); + $searchCriteriaMock->expects($this->once())->method('getFilterGroups')->willReturn([$filterGroupMock]); + $filterGroupMock->expects($this->exactly(2))->method('getFilters')->willReturn([$filterMock]); + $filterMock->expects($this->exactly(2))->method('getConditionType')->willReturn('eq'); + $filterMock->expects($this->exactly(2))->method('getField')->willReturnOnConsecutiveCalls( + 'rate.tax_calculation_rate_id', + 'cd.customer_tax_class_id' + ); + $filterMock->expects($this->once())->method('getValue')->willReturn('value'); + $collectionMock->expects($this->exactly(2))->method('joinCalculationData')->withConsecutive(['rate'], ['cd']); + $collectionMock->expects($this->once())->method('addFieldToFilter') + ->with([0 => 'rate.tax_calculation_rate_id'], [0 => ['eq' => 'value']]); + $collectionMock->expects($this->once())->method('getSize')->willReturn($collectionSize); + $this->searchResultBuilder->expects($this->once())->method('setTotalCount')->with($collectionSize); + $searchCriteriaMock->expects($this->once())->method('getSortOrders')->willReturn([$sortOrderMock]); + $sortOrderMock->expects($this->once())->method('getField')->willReturn('sort_order'); + $sortOrderMock->expects($this->once())->method('getDirection')->willReturn(SearchCriteria::SORT_ASC); + $collectionMock->expects($this->once())->method('addOrder')->with('position', 'ASC'); + $searchCriteriaMock->expects($this->once())->method('getCurrentPage')->willReturn($currentPage); + $collectionMock->expects($this->once())->method('setCurPage')->with($currentPage); + $searchCriteriaMock->expects($this->once())->method('getPageSize')->willReturn($pageSize); + $collectionMock->expects($this->once())->method('setPageSize')->with($pageSize); + $collectionMock->expects($this->once())->method('getItems')->willReturn([]); + $this->searchResultBuilder->expects($this->once())->method('setItems')->with([]); + $this->searchResultBuilder->expects($this->once())->method('create')->willReturnSelf(); + $this->assertEquals($this->searchResultBuilder, $this->model->getList($searchCriteriaMock)); } } diff --git a/dev/tests/unit/testsuite/Magento/Tools/View/Deployer/LogTest.php b/dev/tests/unit/testsuite/Magento/Tools/View/Deployer/LogTest.php index eadc24150ace7..46eecc68c7c9f 100644 --- a/dev/tests/unit/testsuite/Magento/Tools/View/Deployer/LogTest.php +++ b/dev/tests/unit/testsuite/Magento/Tools/View/Deployer/LogTest.php @@ -12,14 +12,14 @@ class LogTest extends \PHPUnit_Framework_TestCase /** * @param string $method * @param int $verbosity - * @param string $exepctedMsg + * @param string $expectedMsg * @dataProvider logDataProvider */ - public function testLog($method, $verbosity, $exepctedMsg) + public function testLog($method, $verbosity, $expectedMsg) { $object = new Log($verbosity); $object->$method('foo'); - $this->expectOutputString($exepctedMsg); + $this->expectOutputString($expectedMsg); } /** @@ -44,4 +44,29 @@ public function logDataProvider() ['logDebug', Log::ERROR | Log::DEBUG, $foo], ]; } + + /** + * @param int $verbosity + * @param string $expectedMsg + * + * @dataProvider logDebugAltDataProvider + */ + public function testLogDebugAlt($verbosity, $expectedMsg) + { + $object = new Log($verbosity); + $object->logDebug('foo', '[alt]'); + $this->expectOutputString($expectedMsg); + } + + /** + * @return array + */ + public function logDebugAltDataProvider() + { + return[ + 'debug mode' => [Log::DEBUG, "foo\n"], + 'default mode' => [Log::ERROR, '[alt]'], + 'silent mode' => [Log::SILENT, ''] + ]; + } } diff --git a/dev/tests/unit/testsuite/Magento/Webapi/Controller/Rest/Request/Deserializer/JsonTest.php b/dev/tests/unit/testsuite/Magento/Webapi/Controller/Rest/Request/Deserializer/JsonTest.php index c703b1139511e..f9fdc47e5845d 100644 --- a/dev/tests/unit/testsuite/Magento/Webapi/Controller/Rest/Request/Deserializer/JsonTest.php +++ b/dev/tests/unit/testsuite/Magento/Webapi/Controller/Rest/Request/Deserializer/JsonTest.php @@ -47,12 +47,6 @@ public function testDeserializerInvalidArgumentException() $this->_jsonDeserializer->deserialize(false); } - public function testDeserializerOauthInputException() - { - $this->setExpectedException('\Magento\Webapi\Exception', 'Request body should not be empty.'); - $this->_jsonDeserializer->deserialize(''); - } - public function testDeserialize() { /** Prepare mocks for SUT constructor. */ @@ -82,7 +76,7 @@ public function testDeserializeInvalidEncodedBodyExceptionDeveloperModeOff() /** Prepare mocks for SUT constructor. */ $this->_helperMock->expects($this->once()) ->method('jsonDecode') - ->will($this->throwException(new \Zend_Json_Exception())); + ->will($this->throwException(new \Zend_Json_Exception)); $this->_appStateMock->expects($this->once()) ->method('getMode') ->will($this->returnValue('production')); diff --git a/dev/tests/unit/testsuite/Magento/Webapi/Controller/Rest/Request/Deserializer/XmlTest.php b/dev/tests/unit/testsuite/Magento/Webapi/Controller/Rest/Request/Deserializer/XmlTest.php index 32ec03e00c4ae..005856df9e272 100644 --- a/dev/tests/unit/testsuite/Magento/Webapi/Controller/Rest/Request/Deserializer/XmlTest.php +++ b/dev/tests/unit/testsuite/Magento/Webapi/Controller/Rest/Request/Deserializer/XmlTest.php @@ -42,12 +42,6 @@ public function testDeserializeInvalidArgumentException() $this->_xmlDeserializer->deserialize(false); } - public function testDeserializerOauthInputException() - { - $this->setExpectedException('\Magento\Webapi\Exception', 'Request body is expected.'); - $this->_xmlDeserializer->deserialize(''); - } - public function testDeserialize() { /** Prepare mocks for SUT constructor. */ diff --git a/dev/tests/unit/testsuite/Magento/Weee/Model/Attribute/Backend/Weee/TaxTest.php b/dev/tests/unit/testsuite/Magento/Weee/Model/Attribute/Backend/Weee/TaxTest.php new file mode 100644 index 0000000000000..6a47ac0eea7f1 --- /dev/null +++ b/dev/tests/unit/testsuite/Magento/Weee/Model/Attribute/Backend/Weee/TaxTest.php @@ -0,0 +1,241 @@ +objectManager = new ObjectManager($this); + $this->model = $this->objectManager->getObject('Magento\Weee\Model\Attribute\Backend\Weee\Tax'); + } + + public function testGetBackendModelName() + { + $this->assertEquals('Magento\Weee\Model\Attribute\Backend\Weee\Tax', $this->model->getBackendModelName()); + } + + public function testValidate() + { + $attributeMock = $this->getMockBuilder('Magento\Eav\Model\Attribute') + ->setMethods(['getName']) + ->disableOriginalConstructor() + ->getMock(); + $attributeMock + ->expects($this->any()) + ->method('getName') + ->will($this->returnValue('weeeTax')); + + $modelMock = $this->getMockBuilder('Magento\Weee\Model\Attribute\Backend\Weee\Tax') + ->setMethods(['getAttribute']) + ->disableOriginalConstructor() + ->getMock(); + $modelMock + ->expects($this->any()) + ->method('getAttribute') + ->will($this->returnValue($attributeMock)); + + $taxes = [['state' => 'Texas', 'country' => 'US', 'website_id' => '1']]; + $productMock = $this->getMockBuilder('Magento\Catalog\Model\Product') + ->setMethods(['getData']) + ->disableOriginalConstructor() + ->getMock(); + $productMock + ->expects($this->any()) + ->method('getData') + ->will($this->returnValue($taxes)); + + // No exception + $modelMock->validate($productMock); + + $taxes = [['state' => 'Texas', 'country' => 'US', 'website_id' => '1'], + ['state' => 'Texas', 'country' => 'US', 'website_id' => '1']]; + $productMock = $this->getMockBuilder('Magento\Catalog\Model\Product') + ->setMethods(['getData']) + ->disableOriginalConstructor() + ->getMock(); + $productMock + ->expects($this->any()) + ->method('getData') + ->will($this->returnValue($taxes)); + + // Exception caught + $this->setExpectedException('Exception', + 'We found a duplicate of website, country and state fields for a fixed product tax'); + $modelMock->validate($productMock); + } + + public function testAfterLoad() + { + $data = [['website_id' => 1, 'value' => 1]]; + + $attributeTaxMock = $this->getMockBuilder('Magento\Weee\Model\Resource\Attribute\Backend\Weee\Tax') + ->setMethods(['loadProductData']) + ->disableOriginalConstructor() + ->getMock(); + $attributeTaxMock + ->expects($this->any()) + ->method('loadProductData') + ->will($this->returnValue($data)); + + $attributeMock = $this->getMockBuilder('Magento\Eav\Model\Attribute') + ->setMethods(['getName']) + ->disableOriginalConstructor() + ->getMock(); + $attributeMock + ->expects($this->any()) + ->method('getName') + ->will($this->returnValue('weeeTax')); + + $model = $this->objectManager->getObject('Magento\Weee\Model\Attribute\Backend\Weee\Tax', + [ + 'attributeTax' => $attributeTaxMock, + '_attribute' => $attributeMock + ] + ); + + $model->setAttribute($attributeMock); + $productMock = $this->getMockBuilder('Magento\Catalog\Model\Product') + ->setMethods(['setData']) + ->disableOriginalConstructor() + ->getMock(); + + $model->afterLoad($productMock); + } + + /** + * Tests the specific method with various regions + * + * @param array $origData + * @param array $currentData + * @param array $expectedData + * @dataProvider dataProviderAfterSaveWithRegion + */ + public function testAfterSaveWithRegion($origData, $currentData, $expectedData) + { + $productMock = $this->getMockBuilder('Magento\Catalog\Model\Product') + ->setMethods(['getOrigData', 'getData']) + ->disableOriginalConstructor() + ->getMock(); + + $productMock + ->expects($this->once()) + ->method('getOrigData') + ->will($this->returnValue($origData)); + $productMock + ->expects($this->any()) + ->method('getData') + ->will($this->returnValue($currentData)); + + $attributeTaxMock = $this->getMockBuilder('Magento\Weee\Model\Resource\Attribute\Backend\Weee\Tax') + ->setMethods(['deleteProductData', 'insertProductData']) + ->disableOriginalConstructor() + ->getMock(); + $attributeTaxMock + ->expects($this->once()) + ->method('deleteProductData') + ->will($this->returnValue(null)); + $attributeTaxMock + ->expects($this->once()) + ->method('insertProductData') + ->with($productMock, $expectedData) + ->will($this->returnValue(null)); + + $attributeMock = $this->getMockBuilder('Magento\Eav\Model\Attribute') + ->setMethods(['getName', 'getId']) + ->disableOriginalConstructor() + ->getMock(); + $attributeMock + ->expects($this->any()) + ->method('getName') + ->will($this->returnValue('weeeTax')); + $attributeMock + ->expects($this->any()) + ->method('getId') + ->will($this->returnValue(1)); + + $model = $this->objectManager->getObject('Magento\Weee\Model\Attribute\Backend\Weee\Tax', + [ + 'attributeTax' => $attributeTaxMock, + '_attribute' => $attributeMock + ] + ); + + $model->setAttribute($attributeMock); + $model->afterSave($productMock); + } + + /** + * @return array + */ + public function dataProviderAfterSaveWithRegion() + { + return [ + 'withRegion' => [ + 'origData' => [['state' => 'TX', 'country' => 'US', 'website_id' => '1']], + 'currentData' => [['state' => 'TX', 'country' => 'US', 'website_id' => '2', 'price' => 100]], + 'expectedData' => ['state' => 'TX', 'country' => 'US', 'website_id' => '2', 'value' => 100, + 'attribute_id' => 1]], + 'withNoRegion' => [ + 'origData' => [['state' => '0', 'country' => 'US', 'website_id' => '1']], + 'currentData' => [['state' => '0', 'country' => 'US', 'website_id' => '2', 'price' => 100]], + 'expectedData' => ['state' => '0', 'country' => 'US', 'website_id' => '2', 'value' => 100, + 'attribute_id' => 1]] + ]; + } + + public function testAfterDelete() + { + $attributeTaxMock = $this->getMockBuilder('Magento\Weee\Model\Resource\Attribute\Backend\Weee\Tax') + ->setMethods(['deleteProductData']) + ->disableOriginalConstructor() + ->getMock(); + $attributeTaxMock + ->expects($this->once()) + ->method('deleteProductData') + ->with(null, null) + ->will($this->returnValue(null)); + + $model = $this->objectManager->getObject('Magento\Weee\Model\Attribute\Backend\Weee\Tax', + [ + 'attributeTax' => $attributeTaxMock, + ] + ); + + $model->afterDelete(null); + } + + public function testGetTable() + { + $attributeTaxMock = $this->getMockBuilder('Magento\Weee\Model\Resource\Attribute\Backend\Weee\Tax') + ->setMethods(['getTable']) + ->disableOriginalConstructor() + ->getMock(); + $attributeTaxMock + ->expects($this->once()) + ->method('getTable') + ->with('weee_tax') + ->will($this->returnValue(null)); + + $model = $this->objectManager->getObject('Magento\Weee\Model\Attribute\Backend\Weee\Tax', + [ + 'attributeTax' => $attributeTaxMock, + ] + ); + + $model->getTable(); + } +} diff --git a/dev/tests/unit/testsuite/Magento/Weee/Model/Total/Creditmemo/WeeeTest.php b/dev/tests/unit/testsuite/Magento/Weee/Model/Total/Creditmemo/WeeeTest.php index eee57aaca2407..789fbbe420c51 100644 --- a/dev/tests/unit/testsuite/Magento/Weee/Model/Total/Creditmemo/WeeeTest.php +++ b/dev/tests/unit/testsuite/Magento/Weee/Model/Total/Creditmemo/WeeeTest.php @@ -4,7 +4,6 @@ */ namespace Magento\Weee\Model\Total\Creditmemo; - class WeeeTest extends \PHPUnit_Framework_TestCase { /** @@ -128,6 +127,7 @@ function ($price, $type) use (&$roundingDelta) { } $roundedPrice = round($price + $roundingDelta[$type], 2); $roundingDelta[$type] = $price - $roundedPrice; + return $roundedPrice; } )); @@ -139,18 +139,24 @@ function ($price, $type) use (&$roundingDelta) { $this->assertEquals( $value, $this->creditmemo->getData($key), - 'Creditmemo data field ' . $key . ' is incorrect' + 'Creditmemo data field '.$key.' is incorrect' ); } //verify invoice item data foreach ($expectedResults['creditmemo_items'] as $itemKey => $itemData) { $creditmemoItem = $creditmemoItems[$itemKey]; foreach ($itemData as $key => $value) { - $this->assertEquals( - $value, - $creditmemoItem->getData($key), - 'Creditmemo item field ' . $key . ' is incorrect' - ); + if ($key == 'tax_ratio') { + $taxRatio = unserialize($creditmemoItem->getData($key)); + $expectedTaxRatio = unserialize($itemData[$key]); + $this->assertEquals($expectedTaxRatio['weee'], $taxRatio['weee'], "Tax ratio is incorrect"); + } else { + $this->assertEquals( + $value, + $creditmemoItem->getData($key), + 'Creditmemo item field '.$key.' is incorrect' + ); + } } } } @@ -226,6 +232,7 @@ public function collectDataProvider() 'row_amount_incl_tax' => 32.47, ], ], + 'tax_ratio' => serialize(['weee' => 1.0]), 'weee_tax_applied_row_amount' => 30, 'base_weee_tax_applied_row_amount' => 30, @@ -309,6 +316,7 @@ public function collectDataProvider() 'row_amount_incl_tax' => 21.65, ], ], + 'tax_ratio' => serialize(['weee' => 1.65 / 2.47]), 'weee_tax_applied_row_amount' => 20, 'base_weee_tax_applied_row_amount' => 20, @@ -392,6 +400,7 @@ public function collectDataProvider() 'row_amount_incl_tax' => 10.82, ], ], + 'tax_ratio' => serialize(['weee' => 0.83 / 2.47]), 'weee_tax_applied_row_amount' => 10, 'base_weee_tax_applied_row_amount' => 10, @@ -410,6 +419,7 @@ public function collectDataProvider() ], ], ]; + return $result; } diff --git a/dev/tests/unit/testsuite/Magento/Weee/Model/Total/Invoice/WeeeTest.php b/dev/tests/unit/testsuite/Magento/Weee/Model/Total/Invoice/WeeeTest.php index cc1c0ad19bc72..8325747574ad7 100644 --- a/dev/tests/unit/testsuite/Magento/Weee/Model/Total/Invoice/WeeeTest.php +++ b/dev/tests/unit/testsuite/Magento/Weee/Model/Total/Invoice/WeeeTest.php @@ -4,7 +4,6 @@ */ namespace Magento\Weee\Model\Total\Invoice; - class WeeeTest extends \PHPUnit_Framework_TestCase { /** @@ -135,6 +134,7 @@ function ($price, $type) use (&$roundingDelta) { } $roundedPrice = round($price + $roundingDelta[$type], 2); $roundingDelta[$type] = $price - $roundedPrice; + return $roundedPrice; } )); @@ -143,17 +143,23 @@ function ($price, $type) use (&$roundingDelta) { //verify invoice data foreach ($expectedResults['invoice_data'] as $key => $value) { - $this->assertEquals($value, $this->invoice->getData($key), 'Invoice data field ' . $key . ' is incorrect'); + $this->assertEquals($value, $this->invoice->getData($key), 'Invoice data field '.$key.' is incorrect'); } //verify invoice item data foreach ($expectedResults['invoice_items'] as $itemKey => $itemData) { $invoiceItem = $invoiceItems[$itemKey]; foreach ($itemData as $key => $value) { - $this->assertEquals( - $value, - $invoiceItem->getData($key), - 'Invoice item field ' . $key . ' is incorrect' - ); + if ($key == 'tax_ratio') { + $taxRatio = unserialize($invoiceItem->getData($key)); + $expectedTaxRatio = unserialize($itemData[$key]); + $this->assertEquals($expectedTaxRatio['weee'], $taxRatio['weee'], "Tax ratio is incorrect"); + } else { + $this->assertEquals( + $value, + $invoiceItem->getData($key), + 'Invoice item field '.$key.' is incorrect' + ); + } } } } @@ -250,7 +256,7 @@ public function collectDataProvider() ], 'weee_tax_applied_row_amount' => 30, 'base_weee_tax_applied_row_amount' => 30, - + 'tax_ratio' => serialize(['weee' => 1.0]), ], ], 'invoice_data' => [ @@ -350,6 +356,7 @@ public function collectDataProvider() 'row_amount_incl_tax' => 21.65, ], ], + 'tax_ratio' => serialize(['weee' => 1.65 / 2.47]), 'weee_tax_applied_row_amount' => 20, 'base_weee_tax_applied_row_amount' => 20, @@ -453,6 +460,7 @@ public function collectDataProvider() 'row_amount_incl_tax' => 10.82, ], ], + 'tax_ratio' => serialize(['weee' => 0.82 / 2.47]), 'weee_tax_applied_row_amount' => 10, 'base_weee_tax_applied_row_amount' => 10, @@ -556,6 +564,7 @@ public function collectDataProvider() 'row_amount_incl_tax' => 10.82, ], ], + 'tax_ratio' => serialize(['weee' => 0.83 / 2.47]), 'weee_tax_applied_row_amount' => 10, 'base_weee_tax_applied_row_amount' => 10, @@ -574,6 +583,7 @@ public function collectDataProvider() ], ], ]; + return $result; } diff --git a/dev/tests/unit/testsuite/Magento/Wishlist/Block/Adminhtml/Widget/Grid/Column/Filter/TextTest.php b/dev/tests/unit/testsuite/Magento/Wishlist/Block/Adminhtml/Widget/Grid/Column/Filter/TextTest.php new file mode 100644 index 0000000000000..0cbad71c8d661 --- /dev/null +++ b/dev/tests/unit/testsuite/Magento/Wishlist/Block/Adminhtml/Widget/Grid/Column/Filter/TextTest.php @@ -0,0 +1,26 @@ +textFilterBlock = (new \Magento\TestFramework\Helper\ObjectManager($this))->getObject( + 'Magento\Wishlist\Block\Adminhtml\Widget\Grid\Column\Filter\Text' + ); + } + + public function testGetCondition() + { + $value = "test"; + $this->textFilterBlock->setValue($value); + $this->assertSame(["like" => $value], $this->textFilterBlock->getCondition()); + } +} diff --git a/dev/tools/Magento/Tools/Di/compiler.php b/dev/tools/Magento/Tools/Di/compiler.php index c327ffaef1956..f838a21987b9a 100644 --- a/dev/tools/Magento/Tools/Di/compiler.php +++ b/dev/tools/Magento/Tools/Di/compiler.php @@ -42,7 +42,11 @@ $relationsFile = $diDir . '/relations.php'; $pluginDefFile = $diDir . '/plugins.php'; - $compilationDirs = [$rootDir . '/app/code', $rootDir . '/lib/internal/Magento']; + $compilationDirs = [ + $rootDir . '/app/code', + $rootDir . '/lib/internal/Magento', + $rootDir . '/dev/tools/Magento/Tools/View' + ]; /** @var Writer\WriterInterface $logWriter Writer model for success messages */ $logWriter = $opt->getOption('v') ? new Writer\Console() : new Writer\Quiet(); diff --git a/dev/tools/Magento/Tools/I18n/bootstrap.php b/dev/tools/Magento/Tools/I18n/bootstrap.php index 562a94b0e9e91..e66c2faf7d87d 100644 --- a/dev/tools/Magento/Tools/I18n/bootstrap.php +++ b/dev/tools/Magento/Tools/I18n/bootstrap.php @@ -2,5 +2,4 @@ /** * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) */ -define('BP', realpath(__DIR__) . '/'); -require realpath(BP . '/../../../../../app/autoload.php'); +require_once __DIR__ . '/../../../../../app/autoload.php'; diff --git a/dev/tools/Magento/Tools/Migration/factory_table_names/replace_ce.php b/dev/tools/Magento/Tools/Migration/factory_table_names/replace_ce.php index b76d8dbc92d8d..701a2fba5f047 100644 --- a/dev/tools/Magento/Tools/Migration/factory_table_names/replace_ce.php +++ b/dev/tools/Magento/Tools/Migration/factory_table_names/replace_ce.php @@ -123,7 +123,6 @@ 'cms/page_store' => 'cms_page_store', 'compiler/configuration' => 'compiler_configuration', 'core/cache' => 'core_cache', - 'core/cache_option' => 'core_cache_option', 'core/cache_tag' => 'core_cache_tag', 'core/config_data' => 'core_config_data', 'core/config_field' => 'core_config_field', diff --git a/dev/tools/Magento/Tools/View/Deployer.php b/dev/tools/Magento/Tools/View/Deployer.php index 4d81956c213cd..5a7572c707848 100644 --- a/dev/tools/Magento/Tools/View/Deployer.php +++ b/dev/tools/Magento/Tools/View/Deployer.php @@ -92,8 +92,8 @@ public function deploy(ObjectManagerFactory $omFactory, array $locales) $this->count = 0; $this->errorCount = 0; foreach ($appFiles as $info) { - list($fileArea, $fileThemePath, , $module, $filePath) = $info; - $this->deployAppFile($area, $fileArea, $themePath, $fileThemePath, $locale, $module, $filePath); + list(, , , $module, $filePath) = $info; + $this->deployFile($filePath, $area, $themePath, $locale, $module); } foreach ($libFiles as $filePath) { $this->deployFile($filePath, $area, $themePath, $locale, null); @@ -166,29 +166,6 @@ private function emulateApplicationArea($areaCode) $this->assetPublisher = $objectManager->get('Magento\Framework\App\View\Asset\Publisher'); } - /** - * Deploy a static view file that belongs to the application - * - * @param string $area - * @param string $fileArea - * @param string $themePath - * @param string $fileThemePath - * @param string $locale - * @param string $module - * @param string $filePath - * @return void - */ - private function deployAppFile($area, $fileArea, $themePath, $fileThemePath, $locale, $module, $filePath) - { - if ($fileArea && $fileArea != $area) { - return; - } - if ($fileThemePath && $fileThemePath != $themePath) { - return; - } - $this->deployFile($filePath, $area, $themePath, $locale, $module); - } - /** * Deploy a static view file * @@ -205,21 +182,36 @@ private function deployFile($filePath, $area, $themePath, $locale, $module) if (substr($filePath, -5) == '.less') { $requestedPath = preg_replace('/.less$/', '.css', $filePath); } - $logModule = $module ? "<{$module}>" : (null === $module ? '' : ''); + $logMessage = "Processing file '$filePath' for area '$area', theme '$themePath', locale '$locale'"; + if ($module) { + $logMessage .= ", module '$module'"; + } + $this->logger->logDebug($logMessage); try { $asset = $this->assetRepo->createAsset( $requestedPath, ['area' => $area, 'theme' => $themePath, 'locale' => $locale, 'module' => $module] ); - $this->logger->logDebug("{$logModule} {$filePath} -> {$asset->getPath()}"); + $this->logger->logDebug("\tDeploying the file to '{$asset->getPath()}'", '.'); if ($this->isDryRun) { $asset->getContent(); } else { $this->assetPublisher->publish($asset); } $this->count++; + } catch (\Magento\Framework\View\Asset\File\NotFoundException $e) { + // File was not found by Fallback (possibly because it's wrong context for it) - there is nothing to publish + $this->logger->logDebug( + "\tNotice: Could not find file '$filePath'. This file may not be relevant for the theme or area." + ); + } catch (\Less_Exception_Compiler $e) { + $this->logger->logDebug( + "\tNotice: Could not parse LESS file '$filePath'. " + . "This may indicate that the file is incomplete, but this is acceptable. " + . "The file '$filePath' will be combined with another LESS file." + ); } catch (\Exception $e) { - $this->logger->logError("{$logModule} {$filePath}"); + $this->logger->logError($e->getMessage() . " ($logMessage)"); $this->logger->logDebug((string)$e); $this->errorCount++; } diff --git a/dev/tools/Magento/Tools/View/Deployer/Log.php b/dev/tools/Magento/Tools/View/Deployer/Log.php index 438da0297dc4c..61b98343ff32f 100644 --- a/dev/tools/Magento/Tools/View/Deployer/Log.php +++ b/dev/tools/Magento/Tools/View/Deployer/Log.php @@ -23,6 +23,13 @@ class Log */ private $verbosity; + /** + * If last output printed inline + * + * @var bool + */ + private $isInline = false; + /** * @param int $verbosity */ @@ -40,6 +47,7 @@ public function __construct($verbosity) public function logMessage($msg) { if ($this->verbosity !== self::SILENT) { + $this->terminateLine(); echo "{$msg}\n"; } } @@ -53,6 +61,7 @@ public function logMessage($msg) public function logError($msg) { if ($this->verbosity & self::ERROR) { + $this->terminateLine(); echo "ERROR: {$msg}\n"; } } @@ -61,12 +70,30 @@ public function logError($msg) * Log a debug message * * @param string $msg + * @param string $altInline Alternative message for normal mode (printed inline) * @return void */ - public function logDebug($msg) + public function logDebug($msg, $altInline = '') { if ($this->verbosity & self::DEBUG) { + $this->terminateLine(); echo "{$msg}\n"; + } elseif ($altInline && $this->verbosity !== self::SILENT) { + echo $altInline; + $this->isInline = true; + } + } + + /** + * Ensures the next log message will be printed on new line + * + * @return void + */ + private function terminateLine() + { + if ($this->isInline) { + $this->isInline = false; + echo "\n"; } } } diff --git a/dev/tools/Magento/Tools/View/deploy.php b/dev/tools/Magento/Tools/View/deploy.php index 469efc6403b3b..1a156a7d64019 100644 --- a/dev/tools/Magento/Tools/View/deploy.php +++ b/dev/tools/Magento/Tools/View/deploy.php @@ -48,6 +48,14 @@ $objectManager = $omFactory->create( [\Magento\Framework\App\State::PARAM_MODE => \Magento\Framework\App\State::MODE_DEFAULT] ); + +/** @var \Magento\Framework\App\DeploymentConfig $deploymentConfig */ +$deploymentConfig = $objectManager->get('Magento\Framework\App\DeploymentConfig'); +$isAppInstalled = $deploymentConfig->isAvailable(); +if (!$isAppInstalled) { + throw new \Exception('Please install the Magento application before running this process.'); +} + $logger = new \Magento\Tools\View\Deployer\Log($verbosity); /** @var \Magento\Tools\View\Deployer $deployer */ $deployer = $objectManager->create( diff --git a/lib/internal/Magento/Framework/App/ObjectManager.php b/lib/internal/Magento/Framework/App/ObjectManager.php index 0b5c8eeff44de..ae1402a38a651 100644 --- a/lib/internal/Magento/Framework/App/ObjectManager.php +++ b/lib/internal/Magento/Framework/App/ObjectManager.php @@ -21,9 +21,6 @@ class ObjectManager extends \Magento\Framework\ObjectManager\ObjectManager /** * Retrieve object manager * - * TODO: Temporary solution for serialization, should be removed when Serialization problem is resolved - * - * @deprecated * @return ObjectManager * @throws \RuntimeException */ diff --git a/lib/internal/Magento/Framework/App/ObjectManagerFactory.php b/lib/internal/Magento/Framework/App/ObjectManagerFactory.php index 89348b66d7a6c..165a5f00e9fa2 100644 --- a/lib/internal/Magento/Framework/App/ObjectManagerFactory.php +++ b/lib/internal/Magento/Framework/App/ObjectManagerFactory.php @@ -41,7 +41,7 @@ class ObjectManagerFactory * * @var string */ - protected $_configClassName = 'Magento\Framework\Interception\ObjectManager\Config'; + protected $_configClassName = 'Magento\Framework\Interception\ObjectManager\ConfigInterface'; /** * Environment factory class name @@ -111,7 +111,7 @@ public function create(array $arguments, $useCompiled = true) /** @var EnvironmentInterface $env */ $env = $enFactory->createEnvironment(); - /** @var \Magento\Framework\Interception\ObjectManager\Config $diConfig */ + /** @var \Magento\Framework\Interception\ObjectManager\ConfigInterface $diConfig */ $diConfig = $env->getDiConfig(); $appMode = isset($arguments[State::PARAM_MODE]) ? $arguments[State::PARAM_MODE] : State::MODE_DEFAULT; @@ -136,7 +136,7 @@ public function create(array $arguments, $useCompiled = true) 'Magento\Framework\ObjectManager\RelationsInterface' => $relations, 'Magento\Framework\Interception\DefinitionInterface' => $definitionFactory->createPluginDefinition(), 'Magento\Framework\ObjectManager\ConfigInterface' => $diConfig, - 'Magento\Framework\Interception\ObjectManager\Config' => $diConfig, + 'Magento\Framework\Interception\ObjectManager\ConfigInterface' => $diConfig, 'Magento\Framework\ObjectManager\DefinitionInterface' => $definitions, 'Magento\Framework\Stdlib\BooleanUtils' => $booleanUtils, 'Magento\Framework\ObjectManager\Config\Mapper\Dom' => $argumentMapper, diff --git a/lib/internal/Magento/Framework/App/Request/Http.php b/lib/internal/Magento/Framework/App/Request/Http.php index 1eb3d868fc1e0..718377b52041e 100644 --- a/lib/internal/Magento/Framework/App/Request/Http.php +++ b/lib/internal/Magento/Framework/App/Request/Http.php @@ -90,15 +90,15 @@ class Http extends \Zend_Controller_Request_Http implements protected $cookieReader; /** - * @var \Magento\Framework\App\Config\ReinitableConfigInterface + * @var \Magento\Framework\ObjectManagerInterface */ - protected $_config; + protected $_objectManager; /** * @param \Magento\Framework\App\Route\ConfigInterface\Proxy $routeConfig * @param PathInfoProcessorInterface $pathInfoProcessor * @param \Magento\Framework\Stdlib\Cookie\CookieReaderInterface $cookieReader - * @param \Magento\Framework\App\Config\ReinitableConfigInterface $config + * @param \Magento\Framework\ObjectManagerInterface $objectManager, * @param string|null $uri * @param array $directFrontNames */ @@ -106,11 +106,11 @@ public function __construct( \Magento\Framework\App\Route\ConfigInterface\Proxy $routeConfig, PathInfoProcessorInterface $pathInfoProcessor, \Magento\Framework\Stdlib\Cookie\CookieReaderInterface $cookieReader, - \Magento\Framework\App\Config\ReinitableConfigInterface $config, + \Magento\Framework\ObjectManagerInterface $objectManager, $uri = null, $directFrontNames = [] ) { - $this->_config = $config; + $this->_objectManager = $objectManager; $this->_routeConfig = $routeConfig; $this->_directFrontNames = $directFrontNames; parent::__construct($uri); @@ -645,9 +645,12 @@ public function isSecure() if ($this->immediateRequestSecure()) { return true; } + /* TODO: Untangle Config dependence on Scope, so that this class can be instantiated even if app is not + installed MAGETWO-31756 */ // Check if a proxy sent a header indicating an initial secure request + $config = $this->_objectManager->get('Magento\Framework\App\Config'); $offLoaderHeader = trim( - (string)$this->_config->getValue( + (string)$config->getValue( self::XML_PATH_OFFLOADER_HEADER, \Magento\Framework\App\ScopeInterface::SCOPE_DEFAULT ) diff --git a/lib/internal/Magento/Framework/AppInterface.php b/lib/internal/Magento/Framework/AppInterface.php index 0d7eba988973a..2e3f2de0cc7d8 100644 --- a/lib/internal/Magento/Framework/AppInterface.php +++ b/lib/internal/Magento/Framework/AppInterface.php @@ -16,7 +16,7 @@ interface AppInterface /** * Magento version */ - const VERSION = '0.1.0-alpha108'; + const VERSION = '0.42.0-beta1'; /** * Launch application diff --git a/lib/internal/Magento/Framework/Css/PreProcessor/Less.php b/lib/internal/Magento/Framework/Css/PreProcessor/Less.php index 6ee1e44b8b93b..c67d0934bf558 100644 --- a/lib/internal/Magento/Framework/Css/PreProcessor/Less.php +++ b/lib/internal/Magento/Framework/Css/PreProcessor/Less.php @@ -42,7 +42,7 @@ public function process(\Magento\Framework\View\Asset\PreProcessor\Chain $chain) $cssTrimmedContent = trim($cssContent); if (!empty($cssTrimmedContent)) { $chain->setContent($cssContent); - $chain->setContentType('css'); } + $chain->setContentType('css'); } } diff --git a/lib/internal/Magento/Framework/Filter/Template/Tokenizer/AbstractTokenizer.php b/lib/internal/Magento/Framework/Filter/Template/Tokenizer/AbstractTokenizer.php index b950bdea2ebb3..5d60b8c8d2160 100644 --- a/lib/internal/Magento/Framework/Filter/Template/Tokenizer/AbstractTokenizer.php +++ b/lib/internal/Magento/Framework/Filter/Template/Tokenizer/AbstractTokenizer.php @@ -75,7 +75,7 @@ public function char() */ public function setString($value) { - $this->_string = $value; + $this->_string = urldecode($value); $this->reset(); } diff --git a/lib/internal/Magento/Framework/HTTP/Adapter/Curl.php b/lib/internal/Magento/Framework/HTTP/Adapter/Curl.php index 186134bbc3297..0f6a781312fb7 100644 --- a/lib/internal/Magento/Framework/HTTP/Adapter/Curl.php +++ b/lib/internal/Magento/Framework/HTTP/Adapter/Curl.php @@ -120,8 +120,7 @@ public function setConfig($config = []) * @param int $port * @param boolean $secure * @return $this - * - * @deprecated since 1.4.0.0-rc1 @TODO MAGETWO-31680 + * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ public function connect($host, $port = 80, $secure = false) { diff --git a/lib/internal/Magento/Framework/Interception/Config/Config.php b/lib/internal/Magento/Framework/Interception/Config/Config.php index d71940c08a5fa..360c8e8f45331 100644 --- a/lib/internal/Magento/Framework/Interception/Config/Config.php +++ b/lib/internal/Magento/Framework/Interception/Config/Config.php @@ -11,7 +11,7 @@ class Config implements \Magento\Framework\Interception\ConfigInterface /** * Type configuration * - * @var \Magento\Framework\ObjectManager\ConfigInterface + * @var \Magento\Framework\Interception\ObjectManager\ConfigInterface */ protected $_omConfig; @@ -74,7 +74,7 @@ class Config implements \Magento\Framework\Interception\ConfigInterface * @param \Magento\Framework\Config\ScopeListInterface $scopeList * @param \Magento\Framework\Cache\FrontendInterface $cache * @param \Magento\Framework\ObjectManager\RelationsInterface $relations - * @param \Magento\Framework\Interception\ObjectManager\Config $omConfig + * @param \Magento\Framework\Interception\ObjectManager\ConfigInterface $omConfig * @param \Magento\Framework\ObjectManager\DefinitionInterface $classDefinitions * @param string $cacheId */ @@ -83,7 +83,7 @@ public function __construct( \Magento\Framework\Config\ScopeListInterface $scopeList, \Magento\Framework\Cache\FrontendInterface $cache, \Magento\Framework\ObjectManager\RelationsInterface $relations, - \Magento\Framework\Interception\ObjectManager\Config $omConfig, + \Magento\Framework\Interception\ObjectManager\ConfigInterface $omConfig, \Magento\Framework\ObjectManager\DefinitionInterface $classDefinitions, $cacheId = 'interception' ) { @@ -166,6 +166,9 @@ protected function _inheritInterception($type) */ public function hasPlugins($type) { - return isset($this->_intercepted[$type]) ? $this->_intercepted[$type] : $this->_inheritInterception($type); + if (isset($this->_intercepted[$type])) { + return $this->_intercepted[$type]; + } + return $this->_inheritInterception($type); } } diff --git a/lib/internal/Magento/Framework/Interception/ObjectManager/Config.php b/lib/internal/Magento/Framework/Interception/ObjectManager/Config.php deleted file mode 100644 index 0b7dfb0098333..0000000000000 --- a/lib/internal/Magento/Framework/Interception/ObjectManager/Config.php +++ /dev/null @@ -1,52 +0,0 @@ -interceptionConfig = $interceptionConfig; - } - - /** - * Retrieve instance type with interception processing - * - * @param string $instanceName - * @return string - */ - public function getInstanceType($instanceName) - { - $type = parent::getInstanceType($instanceName); - if ($this->interceptionConfig && $this->interceptionConfig->hasPlugins($instanceName)) { - return $type . '\\Interceptor'; - } - return $type; - } - - /** - * Retrieve instance type without interception processing - * - * @param string $instanceName - * @return string - */ - public function getOriginalInstanceType($instanceName) - { - return parent::getInstanceType($instanceName); - } -} diff --git a/lib/internal/Magento/Framework/Interception/ObjectManager/Config/Compiled.php b/lib/internal/Magento/Framework/Interception/ObjectManager/Config/Compiled.php new file mode 100644 index 0000000000000..2818966423ff2 --- /dev/null +++ b/lib/internal/Magento/Framework/Interception/ObjectManager/Config/Compiled.php @@ -0,0 +1,54 @@ +interceptionConfig = $interceptionConfig; + } + + /** + * Retrieve instance type with interception processing + * + * @param string $instanceName + * @return string + */ + public function getInstanceType($instanceName) + { + $type = parent::getInstanceType($instanceName); + if ($this->interceptionConfig && $this->interceptionConfig->hasPlugins($instanceName)) { + return $type . '\\Interceptor'; + } + return $type; + } + + /** + * Retrieve instance type without interception processing + * + * @param string $instanceName + * @return string + */ + public function getOriginalInstanceType($instanceName) + { + return parent::getInstanceType($instanceName); + } +} diff --git a/lib/internal/Magento/Framework/Interception/ObjectManager/Config/Developer.php b/lib/internal/Magento/Framework/Interception/ObjectManager/Config/Developer.php new file mode 100644 index 0000000000000..ba008bd4821e8 --- /dev/null +++ b/lib/internal/Magento/Framework/Interception/ObjectManager/Config/Developer.php @@ -0,0 +1,54 @@ +interceptionConfig = $interceptionConfig; + } + + /** + * Retrieve instance type with interception processing + * + * @param string $instanceName + * @return string + */ + public function getInstanceType($instanceName) + { + $type = parent::getInstanceType($instanceName); + if ($this->interceptionConfig && $this->interceptionConfig->hasPlugins($instanceName)) { + return $type . '\\Interceptor'; + } + return $type; + } + + /** + * Retrieve instance type without interception processing + * + * @param string $instanceName + * @return string + */ + public function getOriginalInstanceType($instanceName) + { + return parent::getInstanceType($instanceName); + } +} diff --git a/lib/internal/Magento/Framework/Interception/ObjectManager/ConfigInterface.php b/lib/internal/Magento/Framework/Interception/ObjectManager/ConfigInterface.php new file mode 100644 index 0000000000000..40480e34b7942 --- /dev/null +++ b/lib/internal/Magento/Framework/Interception/ObjectManager/ConfigInterface.php @@ -0,0 +1,24 @@ +getTranslationList('windowstotimezone'); - ksort($zones); - foreach ($zones as $code => $name) { - $name = trim($name); - $options[] = ['label' => empty($name) ? $code : $name . ' (' . $code . ')', 'value' => $code]; + $zones = $this->getTranslationList('timezonetowindows'); + foreach ($zones as $windowsTimezones => $isoTimezones) { + $windowsTimezones = trim($windowsTimezones); + $options[] = ['label' => empty($windowsTimezones) ? $isoTimezones : $windowsTimezones . ' (' . $isoTimezones . ')', 'value' => $isoTimezones]; } return $this->_sortOptionArray($options); } diff --git a/lib/internal/Magento/Framework/Module/DbVersionInfo.php b/lib/internal/Magento/Framework/Module/DbVersionInfo.php new file mode 100644 index 0000000000000..30dabf861ad9d --- /dev/null +++ b/lib/internal/Magento/Framework/Module/DbVersionInfo.php @@ -0,0 +1,162 @@ +moduleList = $moduleList; + $this->moduleResource = $moduleResource; + $this->resourceResolver = $resourceResolver; + } + + /** + * Check if DB schema is up to date + * + * @param string $moduleName + * @param string $resourceName + * @return bool + */ + public function isSchemaUpToDate($moduleName, $resourceName) + { + $dbVer = $this->moduleResource->getDbVersion($resourceName); + return $this->isModuleVersionEqual($moduleName, $dbVer); + } + + /** + * @param string $moduleName + * @param string $resourceName + * @return bool + */ + public function isDataUpToDate($moduleName, $resourceName) + { + $dataVer = $this->moduleResource->getDataVersion($resourceName); + return $this->isModuleVersionEqual($moduleName, $dataVer); + } + + /** + * Get array of errors if DB is out of date, return [] if DB is current + * + * @return string[] Array of errors, each error contains module name, current version, required version, + * and type (schema or data). The array will be empty if all schema and data are current. + */ + public function getDbVersionErrors() + { + $errors = []; + foreach ($this->moduleList->getNames() as $moduleName) { + foreach ($this->resourceResolver->getResourceList($moduleName) as $resourceName) { + if (!$this->isSchemaUpToDate($moduleName, $resourceName)) { + $errors[] = $this->getSchemaInfo($moduleName, $resourceName); + } + + if (!$this->isDataUpToDate($moduleName, $resourceName)) { + $errors[] = $this->getDataInfo($moduleName, $resourceName); + } + } + } + return $errors; + } + + /** + * Check if DB schema is up to date, version info if it is not. + * + * @param string $moduleName + * @param string $resourceName + * @return string[] Contains current and needed version strings + */ + private function getSchemaInfo($moduleName, $resourceName) + { + $dbVer = $this->moduleResource->getDbVersion($resourceName); // version saved in DB + $module = $this->moduleList->getOne($moduleName); + $configVer = $module['schema_version']; + $dbVer = $dbVer ?: 'none'; + return [ + self::KEY_CURRENT => $dbVer, + self::KEY_REQUIRED => $configVer, + self::KEY_MODULE => $moduleName, + self::KEY_TYPE => 'schema' + ]; + } + + /** + * Get error data for an out-of-date schema or data. + * + * @param string $moduleName + * @param string $resourceName + * @return string[] + */ + private function getDataInfo($moduleName, $resourceName) + { + $dataVer = $this->moduleResource->getDataVersion($resourceName); + $module = $this->moduleList->getOne($moduleName); + $configVer = $module['schema_version']; + $dataVer = $dataVer ?: 'none'; + return [ + self::KEY_CURRENT => $dataVer, + self::KEY_REQUIRED => $configVer, + self::KEY_MODULE => $moduleName, + self::KEY_TYPE => 'data' + ]; + } + + /** + * Check if DB data is up to date + * + * @param string $moduleName + * @param string|bool $version + * @return bool + * @throws \UnexpectedValueException + */ + private function isModuleVersionEqual($moduleName, $version) + { + $module = $this->moduleList->getOne($moduleName); + if (empty($module['schema_version'])) { + throw new \UnexpectedValueException("Schema version for module '$moduleName' is not specified"); + } + $configVer = $module['schema_version']; + + return ($version !== false + && version_compare($configVer, $version) === SetupInterface::VERSION_COMPARE_EQUAL); + } +} diff --git a/lib/internal/Magento/Framework/Module/Manager.php b/lib/internal/Magento/Framework/Module/Manager.php index d35970146b2cf..e5613986fa9a6 100644 --- a/lib/internal/Magento/Framework/Module/Manager.php +++ b/lib/internal/Magento/Framework/Module/Manager.php @@ -8,6 +8,7 @@ */ namespace Magento\Framework\Module; +use Magento\Framework\Module\Plugin\DbStatusValidator; use Magento\Framework\Module\Updater\SetupInterface; class Manager @@ -27,27 +28,19 @@ class Manager */ private $_outputConfigPaths; - /** - * @var ResourceInterface - */ - private $_moduleResource; - /** * @param Output\ConfigInterface $outputConfig * @param ModuleListInterface $moduleList - * @param ResourceInterface $moduleResource * @param array $outputConfigPaths */ public function __construct( Output\ConfigInterface $outputConfig, ModuleListInterface $moduleList, - ResourceInterface $moduleResource, array $outputConfigPaths = [] ) { $this->_outputConfig = $outputConfig; $this->_moduleList = $moduleList; $this->_outputConfigPaths = $outputConfigPaths; - $this->_moduleResource = $moduleResource; } /** @@ -98,47 +91,4 @@ protected function _isCustomOutputConfigEnabled($moduleName) } return true; } - - /** - * Check if DB schema is up to date - * - * @param string $moduleName - * @param string $resourceName - * @return bool - */ - public function isDbSchemaUpToDate($moduleName, $resourceName) - { - $dbVer = $this->_moduleResource->getDbVersion($resourceName); - return $this->isModuleVersionEqual($moduleName, $dbVer); - } - - /** - * @param string $moduleName - * @param string $resourceName - * @return bool - */ - public function isDbDataUpToDate($moduleName, $resourceName) - { - $dataVer = $this->_moduleResource->getDataVersion($resourceName); - return $this->isModuleVersionEqual($moduleName, $dataVer); - } - - /** - * Check if DB data is up to date - * - * @param string $moduleName - * @param string|bool $version - * @return bool - * @throws \UnexpectedValueException - */ - private function isModuleVersionEqual($moduleName, $version) - { - $module = $this->_moduleList->getOne($moduleName); - if (empty($module['schema_version'])) { - throw new \UnexpectedValueException("Schema version for module '$moduleName' is not specified"); - } - $configVer = $module['schema_version']; - - return ($version !== false && version_compare($configVer, $version) === SetupInterface::VERSION_COMPARE_EQUAL); - } } diff --git a/lib/internal/Magento/Framework/Module/Plugin/DbStatusValidator.php b/lib/internal/Magento/Framework/Module/Plugin/DbStatusValidator.php index 3c629b0cb0496..d5b04050fd460 100644 --- a/lib/internal/Magento/Framework/Module/Plugin/DbStatusValidator.php +++ b/lib/internal/Magento/Framework/Module/Plugin/DbStatusValidator.php @@ -7,6 +7,7 @@ namespace Magento\Framework\Module\Plugin; use Magento\Framework\Cache\FrontendInterface; +use Magento\Framework\Module\DbVersionInfo; class DbStatusValidator { @@ -16,36 +17,20 @@ class DbStatusValidator private $cache; /** - * @var \Magento\Framework\Module\ModuleListInterface + * @var DbVersionInfo */ - private $moduleList; - - /** - * @var \Magento\Framework\Module\ResourceResolverInterface - */ - private $resourceResolver; - - /** - * @var \Magento\Framework\Module\Manager - */ - private $moduleManager; + private $dbVersionInfo; /** * @param FrontendInterface $cache - * @param \Magento\Framework\Module\ModuleListInterface $moduleList - * @param \Magento\Framework\Module\ResourceResolverInterface $resourceResolver - * @param \Magento\Framework\Module\Manager $moduleManager + * @param DbVersionInfo $dbVersionInfo */ public function __construct( FrontendInterface $cache, - \Magento\Framework\Module\ModuleListInterface $moduleList, - \Magento\Framework\Module\ResourceResolverInterface $resourceResolver, - \Magento\Framework\Module\Manager $moduleManager + DbVersionInfo $dbVersionInfo ) { $this->cache = $cache; - $this->moduleList = $moduleList; - $this->resourceResolver = $resourceResolver; - $this->moduleManager = $moduleManager; + $this->dbVersionInfo = $dbVersionInfo; } /** @@ -63,9 +48,12 @@ public function aroundDispatch( \Magento\Framework\App\RequestInterface $request ) { if (!$this->cache->load('db_is_up_to_date')) { - if (!$this->isDbUpToDate()) { + $errors = $this->dbVersionInfo->getDbVersionErrors(); + if ($errors) { + $formattedErrors = $this->formatErrors($errors); throw new \Magento\Framework\Module\Exception( - 'Looks like database is outdated. Please, use setup tool to perform update' + 'Please update your database: Run "php –f index.php update" from the Magento root/setup directory.' + . PHP_EOL . 'The following modules are outdated:' . PHP_EOL . implode(PHP_EOL, $formattedErrors) ); } else { $this->cache->save('true', 'db_is_up_to_date'); @@ -75,21 +63,20 @@ public function aroundDispatch( } /** - * Check if DB is up to date + * Format each error in the error data from getOutOfDataDbErrors into a single message * - * @return bool + * @param array $errorsData array of error data from getOutOfDateDbErrors + * @return array Messages that can be used to log the error */ - private function isDbUpToDate() + private function formatErrors($errorsData) { - foreach ($this->moduleList->getNames() as $moduleName) { - foreach ($this->resourceResolver->getResourceList($moduleName) as $resourceName) { - $isSchemaUpToDate = $this->moduleManager->isDbSchemaUpToDate($moduleName, $resourceName); - $isDataUpToDate = $this->moduleManager->isDbDataUpToDate($moduleName, $resourceName); - if (!$isSchemaUpToDate || !$isDataUpToDate) { - return false; - } - } + $formattedErrors = []; + foreach ($errorsData as $error) { + $formattedErrors[] = $error[DbVersionInfo::KEY_MODULE] . + ' ' . $error[DbVersionInfo::KEY_TYPE] . + ': current version - ' . $error[DbVersionInfo::KEY_CURRENT ] . + ', required version - ' . $error[DbVersionInfo::KEY_REQUIRED]; } - return true; + return $formattedErrors; } } diff --git a/lib/internal/Magento/Framework/Module/Updater.php b/lib/internal/Magento/Framework/Module/Updater.php index b150cf1879ad5..6716daf54329d 100644 --- a/lib/internal/Magento/Framework/Module/Updater.php +++ b/lib/internal/Magento/Framework/Module/Updater.php @@ -24,26 +24,26 @@ class Updater protected $_setupFactory; /** - * @var \Magento\Framework\Module\Manager + * @var DbVersionInfo */ - private $_moduleManager; + private $_dbVersionInfo; /** * @param Updater\SetupFactory $setupFactory * @param ModuleListInterface $moduleList * @param ResourceResolverInterface $resourceResolver - * @param Manager $moduleManager + * @param DbVersionInfo $dbVersionInfo */ public function __construct( Updater\SetupFactory $setupFactory, ModuleListInterface $moduleList, ResourceResolverInterface $resourceResolver, - \Magento\Framework\Module\Manager $moduleManager + DbVersionInfo $dbVersionInfo ) { $this->_moduleList = $moduleList; $this->_resourceResolver = $resourceResolver; $this->_setupFactory = $setupFactory; - $this->_moduleManager = $moduleManager; + $this->_dbVersionInfo = $dbVersionInfo; } /** @@ -55,7 +55,7 @@ public function updateData() { foreach ($this->_moduleList->getNames() as $moduleName) { foreach ($this->_resourceResolver->getResourceList($moduleName) as $resourceName) { - if (!$this->_moduleManager->isDbDataUpToDate($moduleName, $resourceName)) { + if (!$this->_dbVersionInfo->isDataUpToDate($moduleName, $resourceName)) { $this->_setupFactory->create($resourceName, $moduleName)->applyDataUpdates(); } } diff --git a/lib/internal/Magento/Framework/Object.php b/lib/internal/Magento/Framework/Object.php index c8abd7a173b5c..438cdad543fa3 100644 --- a/lib/internal/Magento/Framework/Object.php +++ b/lib/internal/Magento/Framework/Object.php @@ -167,7 +167,7 @@ public function addData(array $arr) */ public function setData($key, $value = null) { - if (is_array($key)) { + if ($key === (array)$key) { if ($this->_data !== $key) { $this->_hasDataChanges = true; } @@ -189,14 +189,14 @@ public function setData($key, $value = null) */ public function unsetData($key = null) { - if (is_null($key)) { + if ($key === null) { $this->setData([]); } elseif (is_string($key)) { - if (array_key_exists($key, $this->_data)) { + if (isset($this->_data[$key]) || array_key_exists($key, $this->_data)) { $this->_hasDataChanges = true; unset($this->_data[$key]); } - } elseif (is_array($key)) { + } elseif ($key === (array)$key) { foreach ($key as $element) { $this->unsetData($element); } @@ -219,6 +219,7 @@ public function unsetData($key = null) * @param string|int $index * @return mixed */ + public function getData($key = '', $index = null) { if ('' === $key) { @@ -229,14 +230,14 @@ public function getData($key = '', $index = null) if (strpos($key, '/')) { $data = $this->getDataByPath($key); } else { - $data = $this->getDataByKey($key); + $data = $this->_getData($key); } if ($index !== null) { - if (is_array($data)) { + if ($data === (array)$data) { $data = isset($data[$index]) ? $data[$index] : null; } elseif (is_string($data)) { - $data = explode("\n", $data); + $data = explode(PHP_EOL, $data); $data = isset($data[$index]) ? $data[$index] : null; } elseif ($data instanceof \Magento\Framework\Object) { $data = $data->getData($index); @@ -261,7 +262,7 @@ public function getDataByPath($path) $data = $this->_data; foreach ($keys as $key) { - if (is_array($data) && isset($data[$key])) { + if ((array)$data === $data && isset($data[$key])) { $data = $data[$key]; } elseif ($data instanceof \Magento\Framework\Object) { $data = $data->getDataByKey($key); @@ -291,7 +292,10 @@ public function getDataByKey($key) */ protected function _getData($key) { - return isset($this->_data[$key]) ? $this->_data[$key] : null; + if (isset($this->_data[$key])) { + return $this->_data[$key]; + } + return null; } /** @@ -583,7 +587,7 @@ public function serialize($keys = [], $valueSeparator = '=', $fieldSeparator = ' */ public function setOrigData($key = null, $data = null) { - if (is_null($key)) { + if ($key === null) { $this->_origData = $this->_data; } else { $this->_origData[$key] = $data; @@ -599,10 +603,13 @@ public function setOrigData($key = null, $data = null) */ public function getOrigData($key = null) { - if (is_null($key)) { + if ($key === null) { return $this->_origData; } - return isset($this->_origData[$key]) ? $this->_origData[$key] : null; + if (isset($this->_origData[$key])) { + return $this->_origData[$key]; + } + return null; } /** @@ -682,7 +689,7 @@ public function offsetSet($offset, $value) */ public function offsetExists($offset) { - return array_key_exists($offset, $this->_data); + return isset($this->_data[$offset]) || array_key_exists($offset, $this->_data); } /** @@ -706,6 +713,9 @@ public function offsetUnset($offset) */ public function offsetGet($offset) { - return isset($this->_data[$offset]) ? $this->_data[$offset] : null; + if (isset($this->_data[$offset])) { + return $this->_data[$offset]; + } + return null; } } diff --git a/lib/internal/Magento/Framework/ObjectManager/Config/Compiled.php b/lib/internal/Magento/Framework/ObjectManager/Config/Compiled.php index eb5d26b9ccf7c..46660989b8212 100644 --- a/lib/internal/Magento/Framework/ObjectManager/Config/Compiled.php +++ b/lib/internal/Magento/Framework/ObjectManager/Config/Compiled.php @@ -100,7 +100,10 @@ public function isShared($type) */ public function getInstanceType($instanceName) { - return isset($this->virtualTypes[$instanceName]) ? $this->virtualTypes[$instanceName] : $instanceName; + if (isset($this->virtualTypes[$instanceName])) { + return $this->virtualTypes[$instanceName]; + } + return $instanceName; } /** @@ -112,7 +115,10 @@ public function getInstanceType($instanceName) */ public function getPreference($type) { - return isset($this->preferences[$type]) ? $this->preferences[$type] : $type; + if (isset($this->preferences[$type])) { + return $this->preferences[$type]; + } + return $type; } /** diff --git a/lib/internal/Magento/Framework/ObjectManager/Config/Config.php b/lib/internal/Magento/Framework/ObjectManager/Config/Config.php index 7110ba1cef9ca..f3ce44d0d2800 100644 --- a/lib/internal/Magento/Framework/ObjectManager/Config/Config.php +++ b/lib/internal/Magento/Framework/ObjectManager/Config/Config.php @@ -113,9 +113,10 @@ public function setCache(ConfigCacheInterface $cache) */ public function getArguments($type) { - return isset($this->_mergedArguments[$type]) - ? $this->_mergedArguments[$type] - : $this->_collectConfiguration($type); + if (isset($this->_mergedArguments[$type])) { + return $this->_mergedArguments[$type]; + } + return $this->_collectConfiguration($type); } /** diff --git a/lib/internal/Magento/Framework/ObjectManager/Config/ProxyConfig.php b/lib/internal/Magento/Framework/ObjectManager/Config/ProxyConfig.php deleted file mode 100644 index 3516934f90f85..0000000000000 --- a/lib/internal/Magento/Framework/ObjectManager/Config/ProxyConfig.php +++ /dev/null @@ -1,120 +0,0 @@ -subjectConfig = $config; - } - - /** - * Set class relations - * - * @param RelationsInterface $relations - * - * @return void - */ - public function setRelations(RelationsInterface $relations) - { - $this->subjectConfig->setRelations($relations); - } - - /** - * Set configuration cache instance - * - * @param ConfigCacheInterface $cache - * - * @return void - */ - public function setCache(ConfigCacheInterface $cache) - { - $this->subjectConfig->setCache($cache); - } - - /** - * Retrieve list of arguments per type - * - * @param string $type - * - * @return array - */ - public function getArguments($type) - { - return $this->subjectConfig->getArguments($type); - } - - /** - * Check whether type is shared - * - * @param string $type - * - * @return bool - */ - public function isShared($type) - { - return $this->subjectConfig->isShared($type); - } - - /** - * Retrieve instance type - * - * @param string $instanceName - * - * @return mixed - */ - public function getInstanceType($instanceName) - { - return $this->subjectConfig->getInstanceType($instanceName); - } - - /** - * Retrieve preference for type - * - * @param string $type - * - * @return string - * @throws \LogicException - */ - public function getPreference($type) - { - return $this->subjectConfig->getPreference($type); - } - - /** - * Extend configuration - * - * @param array $configuration - * - * @return void - */ - public function extend(array $configuration) - { - $this->subjectConfig->extend($configuration); - } - - /** - * Returns list of virtual types - * - * @return array - */ - public function getVirtualTypes() - { - return $this->subjectConfig->getVirtualTypes(); - } -} diff --git a/lib/internal/Magento/Framework/ObjectManager/Environment/AbstractEnvironment.php b/lib/internal/Magento/Framework/ObjectManager/Environment/AbstractEnvironment.php index 70035ef5741ce..a738793e0af27 100644 --- a/lib/internal/Magento/Framework/ObjectManager/Environment/AbstractEnvironment.php +++ b/lib/internal/Magento/Framework/ObjectManager/Environment/AbstractEnvironment.php @@ -13,7 +13,7 @@ abstract class AbstractEnvironment implements EnvironmentInterface { /** - * @var \Magento\Framework\Interception\ObjectManager\Config + * @var \Magento\Framework\Interception\ObjectManager\ConfigInterface */ protected $config; diff --git a/lib/internal/Magento/Framework/ObjectManager/Environment/Compiled.php b/lib/internal/Magento/Framework/ObjectManager/Environment/Compiled.php index ffc4cec2c4077..a21852fd37657 100644 --- a/lib/internal/Magento/Framework/ObjectManager/Environment/Compiled.php +++ b/lib/internal/Magento/Framework/ObjectManager/Environment/Compiled.php @@ -41,13 +41,13 @@ class Compiled extends AbstractEnvironment implements EnvironmentInterface /** * Returns initialized compiled config * - * @return \Magento\Framework\Interception\ObjectManager\Config + * @return \Magento\Framework\Interception\ObjectManager\ConfigInterface */ public function getDiConfig() { if (!$this->config) { - $this->config = new \Magento\Framework\Interception\ObjectManager\Config( - new \Magento\Framework\ObjectManager\Config\Compiled($this->getConfigData()) + $this->config = new \Magento\Framework\Interception\ObjectManager\Config\Compiled( + $this->getConfigData() ); } diff --git a/lib/internal/Magento/Framework/ObjectManager/Environment/Developer.php b/lib/internal/Magento/Framework/ObjectManager/Environment/Developer.php index dfed5ece5126a..88c2ffeff0626 100644 --- a/lib/internal/Magento/Framework/ObjectManager/Environment/Developer.php +++ b/lib/internal/Magento/Framework/ObjectManager/Environment/Developer.php @@ -17,7 +17,7 @@ class Developer extends AbstractEnvironment implements EnvironmentInterface /**#@- */ /** - * @var \Magento\Framework\Interception\ObjectManager\Config + * @var \Magento\Framework\Interception\ObjectManager\ConfigInterface */ protected $config; @@ -29,16 +29,14 @@ class Developer extends AbstractEnvironment implements EnvironmentInterface /** * Returns initialized di config entity * - * @return \Magento\Framework\Interception\ObjectManager\Config + * @return \Magento\Framework\Interception\ObjectManager\ConfigInterface */ public function getDiConfig() { if (!$this->config) { - $this->config = new \Magento\Framework\Interception\ObjectManager\Config( - new \Magento\Framework\ObjectManager\Config\Config( - $this->envFactory->getRelations(), - $this->envFactory->getDefinitions() - ) + $this->config = new \Magento\Framework\Interception\ObjectManager\Config\Developer( + $this->envFactory->getRelations(), + $this->envFactory->getDefinitions() ); } diff --git a/lib/internal/Magento/Framework/ObjectManager/EnvironmentInterface.php b/lib/internal/Magento/Framework/ObjectManager/EnvironmentInterface.php index 6398ac2088a7b..adfe0b7173bb6 100644 --- a/lib/internal/Magento/Framework/ObjectManager/EnvironmentInterface.php +++ b/lib/internal/Magento/Framework/ObjectManager/EnvironmentInterface.php @@ -20,7 +20,7 @@ public function getMode(); /** * Return config object * - * @return \Magento\Framework\Interception\ObjectManager\Config + * @return \Magento\Framework\Interception\ObjectManager\ConfigInterface */ public function getDiConfig(); diff --git a/lib/internal/Magento/Framework/ObjectManager/Factory/AbstractFactory.php b/lib/internal/Magento/Framework/ObjectManager/Factory/AbstractFactory.php index 3ca4343cb00f4..788afb22868db 100644 --- a/lib/internal/Magento/Framework/ObjectManager/Factory/AbstractFactory.php +++ b/lib/internal/Magento/Framework/ObjectManager/Factory/AbstractFactory.php @@ -84,6 +84,7 @@ public function setArguments($arguments) * * @return object * @SuppressWarnings(PHPMD.CyclomaticComplexity) + * @SuppressWarnings(PHPMD.ExcessiveMethodLength) * */ protected function createObject($type, $args) @@ -142,6 +143,57 @@ protected function createObject($type, $args) $args[10], $args[11] ); + case 13: + return new $type( + $args[0], + $args[1], + $args[2], + $args[3], + $args[4], + $args[5], + $args[6], + $args[7], + $args[8], + $args[9], + $args[10], + $args[11], + $args[12] + ); + case 14: + return new $type( + $args[0], + $args[1], + $args[2], + $args[3], + $args[4], + $args[5], + $args[6], + $args[7], + $args[8], + $args[9], + $args[10], + $args[11], + $args[12], + $args[13] + ); + case 15: + return new $type( + $args[0], + $args[1], + $args[2], + $args[3], + $args[4], + $args[5], + $args[6], + $args[7], + $args[8], + $args[9], + $args[10], + $args[11], + $args[12], + $args[13], + $args[14] + ); default: $reflection = new \ReflectionClass($type); return $reflection->newInstanceArgs($args); @@ -164,22 +216,33 @@ protected function createObject($type, $args) protected function resolveArgument(&$argument, $paramType, $paramDefault, $paramName, $requestedType) { if ($paramType && $argument !== $paramDefault && !is_object($argument)) { - if (!isset($argument['instance']) || !is_array($argument)) { + $argumentType = $argument['instance']; + if (!isset($argument['instance']) || $argument !== (array)$argument) { throw new \UnexpectedValueException( 'Invalid parameter configuration provided for $' . $paramName . ' argument of ' . $requestedType ); } - $argumentType = $argument['instance']; - $isShared = (isset($argument['shared']) ? $argument['shared'] : $this->config->isShared($argumentType)); - $argument = $isShared - ? $this->objectManager->get($argumentType) - : $this->objectManager->create($argumentType); - } elseif (is_array($argument)) { + + if (isset($argument['shared'])) { + $isShared = $argument['shared']; + } else { + $isShared = $this->config->isShared($argumentType); + } + + if ($isShared) { + $argument = $this->objectManager->get($argumentType); + } else { + $argument = $this->objectManager->create($argumentType); + } + + } else if ($argument === (array)$argument) { if (isset($argument['argument'])) { - $argument = isset($this->globalArguments[$argument['argument']]) - ? $this->globalArguments[$argument['argument']] - : $paramDefault; - } elseif (!empty($argument)) { + if (isset($this->globalArguments[$argument['argument']])) { + $argument = $this->globalArguments[$argument['argument']]; + } else { + $argument = $paramDefault; + } + } else if (!empty($argument)) { $this->parseArray($argument); } } @@ -195,17 +258,26 @@ protected function resolveArgument(&$argument, $paramType, $paramDefault, $param protected function parseArray(&$array) { foreach ($array as $key => $item) { - if (is_array($item)) { + if ($item === (array)$item) { if (isset($item['instance'])) { - $itemType = $item['instance']; - $isShared = (isset($item['shared'])) ? $item['shared'] : $this->config->isShared($itemType); - $array[$key] = $isShared - ? $this->objectManager->get($itemType) - : $this->objectManager->create($itemType); + if (isset($item['shared'])) { + $isShared = $item['shared']; + } else { + $isShared = $this->config->isShared($item['instance']); + } + + if ($isShared) { + $array[$key] = $this->objectManager->get($item['instance']); + } else { + $array[$key] = $this->objectManager->create($item['instance']); + } + } elseif (isset($item['argument'])) { - $array[$key] = isset($this->globalArguments[$item['argument']]) - ? $this->globalArguments[$item['argument']] - : null; + if (isset($this->globalArguments[$item['argument']])) { + $array[$key] = $this->globalArguments[$item['argument']]; + } else { + $array[$key] = null; + } } else { $this->parseArray($array[$key]); } diff --git a/lib/internal/Magento/Framework/ObjectManager/Factory/Compiled.php b/lib/internal/Magento/Framework/ObjectManager/Factory/Compiled.php index 1aa8e3ce48db2..ebd47eba75659 100644 --- a/lib/internal/Magento/Framework/ObjectManager/Factory/Compiled.php +++ b/lib/internal/Magento/Framework/ObjectManager/Factory/Compiled.php @@ -29,18 +29,20 @@ public function create($requestedType, array $arguments = []) if (isset($arguments[$key])) { $argument = $arguments[$key]; } else { - if (is_array($argument)) { - if (array_key_exists('__val__', $argument)) { + if ($argument === (array)$argument) { + if (isset($argument['__val__']) || array_key_exists('__val__', $argument)) { $argument = $argument['__val__']; - if (is_array($argument)) { + if ($argument === (array)$argument) { $this->parseArray($argument); } } elseif (isset($argument['__non_shared__'])) { $argument = $this->objectManager->create($argument['__instance__']); } elseif (isset($argument['__arg__'])) { - $argument = isset($this->globalArguments[$argument['__arg__']]) - ? $this->globalArguments[$argument['__arg__']] - : $argument['__default__']; + if (isset($this->globalArguments[$argument['__arg__']])) { + $argument = $this->globalArguments[$argument['__arg__']]; + } else { + $argument = $argument['__default__']; + } } } else { $argument = $this->objectManager->get($argument); diff --git a/lib/internal/Magento/Framework/ObjectManager/Factory/Dynamic/Production.php b/lib/internal/Magento/Framework/ObjectManager/Factory/Dynamic/Production.php index 06cd6201c335a..039a0f238ae59 100644 --- a/lib/internal/Magento/Framework/ObjectManager/Factory/Dynamic/Production.php +++ b/lib/internal/Magento/Framework/ObjectManager/Factory/Dynamic/Production.php @@ -27,7 +27,7 @@ protected function _resolveArguments($requestedType, array $parameters, array $a foreach ($parameters as $parameter) { list($paramName, $paramType, $paramRequired, $paramDefault) = $parameter; $argument = null; - if (!empty($arguments) && array_key_exists($paramName, $arguments)) { + if (!empty($arguments) && (isset($arguments[$paramName]) || array_key_exists($paramName, $arguments))) { $argument = $arguments[$paramName]; } elseif ($paramRequired) { $argument = ['instance' => $paramType]; diff --git a/lib/internal/Magento/Framework/Search/Dynamic/Algorithm/Improved.php b/lib/internal/Magento/Framework/Search/Dynamic/Algorithm/Improved.php index fac0527210d55..0a1eb3ce1c0c7 100644 --- a/lib/internal/Magento/Framework/Search/Dynamic/Algorithm/Improved.php +++ b/lib/internal/Magento/Framework/Search/Dynamic/Algorithm/Improved.php @@ -50,7 +50,7 @@ public function getItems(BucketInterface $bucket, array $dimensions, array $enti $aggregations['count'] ); - $this->algorithm->setLimits($aggregations['min'], $aggregations['max']); + $this->algorithm->setLimits($aggregations['min'], $aggregations['max'] + 0.01); $interval = $this->dataProvider->getInterval($bucket, $dimensions, $entityIds); $data = $this->algorithm->calculateSeparators($interval); @@ -58,6 +58,12 @@ public function getItems(BucketInterface $bucket, array $dimensions, array $enti $data[0]['from'] = ''; // We should not calculate min and max value $data[count($data) - 1]['to'] = ''; + $dataSize = count($data); + for ($key = 0; $key < $dataSize; $key++) { + if (isset($data[$key + 1])) { + $data[$key]['to'] = $data[$key + 1]['from']; + } + } return $data; } } diff --git a/lib/internal/Magento/Framework/Search/Request/Aggregation/Status.php b/lib/internal/Magento/Framework/Search/Request/Aggregation/Status.php new file mode 100644 index 0000000000000..99f587a220936 --- /dev/null +++ b/lib/internal/Magento/Framework/Search/Request/Aggregation/Status.php @@ -0,0 +1,17 @@ +aggregationStatus = $aggregationStatus; + } + /** * Clean not binder queries and filters * @@ -34,6 +50,7 @@ public function clean(array $requestData) $this->clear(); $this->requestData = $requestData; $this->cleanQuery($requestData['query']); + $this->cleanAggregations(); $requestData = $this->requestData; $this->clear(); @@ -93,6 +110,18 @@ private function cleanQuery($queryName) } } + /** + * Clean aggregations if we don't need to process them + * + * @return void + */ + private function cleanAggregations() + { + if (!$this->aggregationStatus->isEnabled()) { + $this->requestData['aggregations'] = []; + } + } + /** * Clear don't bind filters * diff --git a/lib/internal/Magento/Framework/Session/Validator.php b/lib/internal/Magento/Framework/Session/Validator.php index 0d2edbe70f5a2..dd751deda02f5 100644 --- a/lib/internal/Magento/Framework/Session/Validator.php +++ b/lib/internal/Magento/Framework/Session/Validator.php @@ -77,10 +77,12 @@ public function validate(SessionManagerInterface $session) if (!isset($_SESSION[self::VALIDATOR_KEY])) { $_SESSION[self::VALIDATOR_KEY] = $this->_getSessionEnvironment(); } else { - if (!$this->_validate()) { + try { + $this->_validate(); + } catch (Exception $e) { $session->destroy(['clear_storage' => false]); // throw core session exception - throw new Exception(''); + throw $e; } } } @@ -89,7 +91,7 @@ public function validate(SessionManagerInterface $session) * Validate data * * @return bool - * + * @throws Exception * @SuppressWarnings(PHPMD.CyclomaticComplexity) */ protected function _validate() @@ -102,14 +104,14 @@ protected function _validate() $this->_scopeType ) && $sessionData[self::VALIDATOR_REMOTE_ADDR_KEY] != $validatorData[self::VALIDATOR_REMOTE_ADDR_KEY] ) { - return false; + throw new Exception('Invalid session ' . self::VALIDATOR_REMOTE_ADDR_KEY . ' value.'); } if ($this->_scopeConfig->getValue( self::XML_PATH_USE_HTTP_VIA, $this->_scopeType ) && $sessionData[self::VALIDATOR_HTTP_VIA_KEY] != $validatorData[self::VALIDATOR_HTTP_VIA_KEY] ) { - return false; + throw new Exception('Invalid session ' . self::VALIDATOR_HTTP_VIA_KEY . ' value.'); } $httpXForwardedKey = $sessionData[self::VALIDATOR_HTTP_X_FORWARDED_FOR_KEY]; @@ -119,7 +121,7 @@ protected function _validate() $this->_scopeType ) && $httpXForwardedKey != $validatorXForwarded ) { - return false; + throw new Exception('Invalid session ' . self::VALIDATOR_HTTP_X_FORWARDED_FOR_KEY . ' value.'); } if ($this->_scopeConfig->getValue( self::XML_PATH_USE_USER_AGENT, @@ -131,7 +133,7 @@ protected function _validate() return true; } } - return false; + throw new Exception('Invalid session ' . self::VALIDATOR_HTTP_USER_AGENT_KEY . ' value.'); } return true; diff --git a/lib/internal/Magento/Framework/View/Asset/File.php b/lib/internal/Magento/Framework/View/Asset/File.php index d61a8933f2be7..f0d43f7edd0ae 100644 --- a/lib/internal/Magento/Framework/View/Asset/File.php +++ b/lib/internal/Magento/Framework/View/Asset/File.php @@ -100,14 +100,14 @@ private function join($path, $item) /** * {@inheritdoc} - * @throws \LogicException if file cannot be resolved + * @throws File\NotFoundException if file cannot be resolved */ public function getSourceFile() { if (null === $this->resolvedFile) { $this->resolvedFile = $this->source->getFile($this); if (false === $this->resolvedFile) { - throw new \LogicException("Unable to resolve the source file for '{$this->getPath()}'"); + throw new File\NotFoundException("Unable to resolve the source file for '{$this->getPath()}'"); } } return $this->resolvedFile; diff --git a/lib/internal/Magento/Framework/View/Asset/File/NotFoundException.php b/lib/internal/Magento/Framework/View/Asset/File/NotFoundException.php new file mode 100644 index 0000000000000..617cf5580692c --- /dev/null +++ b/lib/internal/Magento/Framework/View/Asset/File/NotFoundException.php @@ -0,0 +1,10 @@ += $.mage.parseNumber(from)) && - (to === null || to === '' || value <= $.mage.parseNumber(to)); + return ($.mage.isEmpty(from) || value >= $.mage.parseNumber(from)) && + ($.mage.isEmpty(to) || value <= $.mage.parseNumber(to)); }, /** @@ -81,11 +81,13 @@ } }); - $.validator.addMethod = function (name, method, message) { + $.validator.addMethod = function (name, method, message, dontSkip) { $.validator.methods[name] = method; $.validator.messages[name] = message !== undefined ? message : $.validator.messages[name]; - $.validator.addClassRules(name, $.validator.normalizeRule(name)); + if (method.length < 3 || dontSkip) { + $.validator.addClassRules(name, $.validator.normalizeRule(name)); + } }; /** @@ -668,7 +670,8 @@ return result; }, - 'The value is not within the specified range.' + 'The value is not within the specified range.', + true ], "validate-digits": [ function(v) { @@ -714,7 +717,8 @@ return result; }, - 'The value is not within the specified range.' + 'The value is not within the specified range.', + true ], 'validate-range': [ function(v, elm) { diff --git a/lib/web/mage/zoom.js b/lib/web/mage/zoom.js index 095e03e8bd364..32d3c4909cd25 100644 --- a/lib/web/mage/zoom.js +++ b/lib/web/mage/zoom.js @@ -274,6 +274,9 @@ * @protected */ _onImageUpdated: function() { + // Stop loader in case previous active image has not been loaded yet + $(this.options.selectors.image).trigger('processStop'); + if (!this.image.is($(this.options.selectors.image))) { this._setZoomData(); if (this.largeImageSrc) { @@ -305,11 +308,17 @@ * @protected */ _refreshLargeImage: function() { + var oldSrc; + if (this.largeImage) { - $(this.options.selectors.image).trigger('processStart'); - this.largeImage - .prop('src', this.largeImageSrc) - .css({top: 0, left: 0}); + oldSrc = this.largeImage.attr('src'); + + if (oldSrc !== this.largeImageSrc) { + $(this.options.selectors.image).trigger('processStart'); + this.largeImage.attr('src', this.largeImageSrc); + } + + this.largeImage.css({top: 0, left: 0}); } }, @@ -319,7 +328,12 @@ */ _renderLargeImage: function() { var image = $(this.options.selectors.image); - image.trigger('processStart', [image]); + + // Start loader if 'load' event of image is expected to trigger later + if (this.largeImageSrc) { + image.trigger('processStart'); + } + // No need to create template just for img tag this.largeImage = $('', {src: this.largeImageSrc}); return this.largeImage; @@ -333,7 +347,8 @@ getZoomRatio: function() { if(this.ratio === null || typeof(this.ratio) === 'undefined') { var imageWidth = $(this.image).width() || $(this.image).prop('width'); - return this.largeImageSize.width / imageWidth; + + return this.largeImageSize ? this.largeImageSize.width / imageWidth : 1; } return this.ratio; }, diff --git a/lib/web/requirejs/domReady.js b/lib/web/requirejs/domReady.js new file mode 100644 index 0000000000000..31bd0d77697ca --- /dev/null +++ b/lib/web/requirejs/domReady.js @@ -0,0 +1,129 @@ +/** + * @license RequireJS domReady 2.0.1 Copyright (c) 2010-2012, The Dojo Foundation All Rights Reserved. + * Available via the MIT or new BSD license. + * see: http://github.com/requirejs/domReady for details + */ +/*jslint */ +/*global require: false, define: false, requirejs: false, + window: false, clearInterval: false, document: false, + self: false, setInterval: false */ + + +define(function () { + 'use strict'; + + var isTop, testDiv, scrollIntervalId, + isBrowser = typeof window !== "undefined" && window.document, + isPageLoaded = !isBrowser, + doc = isBrowser ? document : null, + readyCalls = []; + + function runCallbacks(callbacks) { + var i; + for (i = 0; i < callbacks.length; i += 1) { + callbacks[i](doc); + } + } + + function callReady() { + var callbacks = readyCalls; + + if (isPageLoaded) { + //Call the DOM ready callbacks + if (callbacks.length) { + readyCalls = []; + runCallbacks(callbacks); + } + } + } + + /** + * Sets the page as loaded. + */ + function pageLoaded() { + if (!isPageLoaded) { + isPageLoaded = true; + if (scrollIntervalId) { + clearInterval(scrollIntervalId); + } + + callReady(); + } + } + + if (isBrowser) { + if (document.addEventListener) { + //Standards. Hooray! Assumption here that if standards based, + //it knows about DOMContentLoaded. + document.addEventListener("DOMContentLoaded", pageLoaded, false); + window.addEventListener("load", pageLoaded, false); + } else if (window.attachEvent) { + window.attachEvent("onload", pageLoaded); + + testDiv = document.createElement('div'); + try { + isTop = window.frameElement === null; + } catch (e) {} + + //DOMContentLoaded approximation that uses a doScroll, as found by + //Diego Perini: http://javascript.nwbox.com/IEContentLoaded/, + //but modified by other contributors, including jdalton + if (testDiv.doScroll && isTop && window.external) { + scrollIntervalId = setInterval(function () { + try { + testDiv.doScroll(); + pageLoaded(); + } catch (e) {} + }, 30); + } + } + + //Check if document already complete, and if so, just trigger page load + //listeners. Latest webkit browsers also use "interactive", and + //will fire the onDOMContentLoaded before "interactive" but not after + //entering "interactive" or "complete". More details: + //http://dev.w3.org/html5/spec/the-end.html#the-end + //http://stackoverflow.com/questions/3665561/document-readystate-of-interactive-vs-ondomcontentloaded + //Hmm, this is more complicated on further use, see "firing too early" + //bug: https://github.com/requirejs/domReady/issues/1 + //so removing the || document.readyState === "interactive" test. + //There is still a window.onload binding that should get fired if + //DOMContentLoaded is missed. + if (document.readyState === "complete") { + pageLoaded(); + } + } + + /** START OF PUBLIC API **/ + + /** + * Registers a callback for DOM ready. If DOM is already ready, the + * callback is called immediately. + * @param {Function} callback + */ + function domReady(callback) { + if (isPageLoaded) { + callback(doc); + } else { + readyCalls.push(callback); + } + return domReady; + } + + domReady.version = '2.0.1'; + + /** + * Loader Plugin API method + */ + domReady.load = function (name, req, onLoad, config) { + if (config.isBuild) { + onLoad(null); + } else { + domReady(onLoad); + } + }; + + /** END OF PUBLIC API **/ + + return domReady; +}); \ No newline at end of file diff --git a/nginx.conf.sample b/nginx.conf.sample new file mode 100644 index 0000000000000..782aac48782c7 --- /dev/null +++ b/nginx.conf.sample @@ -0,0 +1,102 @@ +# Magento Vars +# set $MAGE_ROOT /path/to/magento/root; +# set $MAGE_MODE default; # or production or developer +# +# Example configuration: +# upstream fastcgi_backend { +# # use tcp connection +# # server 127.0.0.1:9000; +# # or socket +# server unix:/var/run/php5-fpm.sock; +# } +# server { +# listen 80; +# server_name mage.dev; +# set $MAGE_ROOT /var/www/magento2; +# set $MAGE_MODE develop; +# include /vagrant/magento2/nginx.conf.sample; +# } + +root $MAGE_ROOT; + + +index index.php; +autoindex off; +# disable_symlinks on; +charset off; + +location /setup/ { + rewrite / /setup/index.php; + + location /setup/pub/ {} + + location /setup/index.php { + fastcgi_pass fastcgi_backend; + + fastcgi_index index.php; + fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; + include fastcgi_params; + } +} + +location / { + root $MAGE_ROOT/pub; + + location / { + rewrite / /index.php ; + } + + + location /static/ { + if ($MAGE_MODE = "production") { + expires max; + } + if (!-f $request_filename) { + rewrite ^/static/(version\d*/)?(.*)$ /static.php?resource=$2 last; + } + } + + location /media/ { + if (!-f $request_filename) { + rewrite / /get.php; + } + } + + location /media/customer/ { + deny all; + } + + location /media/downloadable/ { + deny all; + } + + location ~ /media/theme_customization/.*\.xml$ { + deny all; + } + + location /errors/ { + try_files $uri =404; + } + + location ~ ^/errors/.*\.(xml|phtml)$ { + deny all; + } + + location ~ cron\.php { + deny all; + } + + location ~ (index|get|static|report|404|503)\.php$ { + fastcgi_pass fastcgi_backend; + + fastcgi_param PHP_FLAG "session.auto_start=off \n suhosin.session.cryptua=off"; + fastcgi_param PHP_VALUE "memory_limit=256M \n max_execution_time=600"; + fastcgi_read_timeout 600s; + fastcgi_connect_timeout 600s; + fastcgi_param MAGE_MODE $MAGE_MODE; + + fastcgi_index index.php; + fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; + include fastcgi_params; + } +} \ No newline at end of file diff --git a/setup/module/Magento/Setup/Module.php b/setup/module/Magento/Setup/Module.php index 482b5e8f1ea24..46c60e3dcaa89 100644 --- a/setup/module/Magento/Setup/Module.php +++ b/setup/module/Magento/Setup/Module.php @@ -5,23 +5,17 @@ namespace Magento\Setup; -use Magento\Setup\Controller\ConsoleController; use Magento\Setup\Mvc\Bootstrap\InitParamListener; use Magento\Setup\Mvc\View\Http\InjectTemplateListener; -use Zend\Console\Adapter\AdapterInterface; use Zend\EventManager\EventInterface; use Zend\ModuleManager\Feature\BootstrapListenerInterface; use Zend\ModuleManager\Feature\ConfigProviderInterface; -use Zend\ModuleManager\Feature\ConsoleBannerProviderInterface; -use Zend\ModuleManager\Feature\ConsoleUsageProviderInterface; use Zend\Mvc\ModuleRouteListener; use Zend\Mvc\MvcEvent; class Module implements BootstrapListenerInterface, - ConfigProviderInterface, - ConsoleBannerProviderInterface, - ConsoleUsageProviderInterface + ConfigProviderInterface { /** * {@inheritdoc} @@ -48,6 +42,15 @@ public function onBootstrap(EventInterface $e) [$injectTemplateListener, 'injectTemplate'], -89 ); + $response = $e->getResponse(); + if ($response instanceof \Zend\Http\Response) { + $headers = $response->getHeaders(); + if ($headers) { + $headers->addHeaderLine('Cache-Control', 'no-cache, no-store, must-revalidate'); + $headers->addHeaderLine('Pragma', 'no-cache'); + $headers->addHeaderLine('Expires', '1970-01-01'); + } + } } /** @@ -65,22 +68,4 @@ public function getConfig() $result = InitParamListener::attachToConsoleRoutes($result); return $result; } - - /** - * {@inheritdoc} - */ - public function getConsoleBanner(AdapterInterface $console) - { - return "==-------------------==\n" - . " Magento Setup CLI \n" - . "==-------------------==\n"; - } - - /** - * {@inheritdoc} - */ - public function getConsoleUsage(AdapterInterface $console) - { - return array_merge(ConsoleController::getConsoleUsage(), InitParamListener::getConsoleUsage()); - } } diff --git a/setup/module/Magento/Setup/config/di.config.php b/setup/module/Magento/Setup/config/di.config.php index 97d33e744c6f7..27696d1ae693e 100644 --- a/setup/module/Magento/Setup/config/di.config.php +++ b/setup/module/Magento/Setup/config/di.config.php @@ -26,6 +26,7 @@ 'Zend\EventManager\EventManagerInterface' => 'EventManager', 'Zend\ServiceManager\ServiceLocatorInterface' => 'ServiceManager', 'Magento\Framework\DB\LoggerInterface' => 'Magento\Framework\DB\Logger\Null', + 'Magento\Framework\Locale\ConfigInterface' => 'Magento\Framework\Locale\Config', ], ], ], diff --git a/setup/module/Magento/Setup/src/Controller/ConsoleController.php b/setup/module/Magento/Setup/src/Controller/ConsoleController.php index b9c36b4d7d178..2d74333e4c20e 100644 --- a/setup/module/Magento/Setup/src/Controller/ConsoleController.php +++ b/setup/module/Magento/Setup/src/Controller/ConsoleController.php @@ -13,10 +13,12 @@ use Magento\Setup\Model\InstallerFactory; use Magento\Setup\Model\Lists; use Magento\Setup\Model\UserConfigurationDataMapper as UserConfig; +use Magento\Setup\Mvc\Bootstrap\InitParamListener; use Zend\Console\Request as ConsoleRequest; use Zend\EventManager\EventManagerInterface; use Zend\Mvc\Controller\AbstractActionController; + /** * Controller that handles all setup commands via command line interface. * @@ -242,7 +244,7 @@ private static function getCliConfig() 'usage_desc' => 'Set maintenance mode, optionally for specified addresses', ], self::CMD_HELP => [ - 'route' => self::CMD_HELP . ' (' . implode('|', self::$helpOptions) . '):type', + 'route' => self::CMD_HELP . ' [' . implode('|', self::$helpOptions) . ']:type', 'usage' => '<' . implode('|', self::$helpOptions) . '>', 'usage_short' => self::CMD_HELP . ' ', 'usage_desc' => 'Help about particular command or topic:', @@ -307,7 +309,6 @@ public function onDispatch(\Zend\Mvc\MvcEvent $e) * Controller for Install Command * * @return void - * @throws \Exception */ public function installAction() { @@ -320,7 +321,6 @@ public function installAction() * Creates the config.php file * * @return void - * @throws \Exception */ public function installDeploymentConfigAction() { @@ -334,7 +334,6 @@ public function installDeploymentConfigAction() * Installs and updates database schema * * @return void - * @throws \Exception */ public function installSchemaAction() { @@ -345,11 +344,9 @@ public function installSchemaAction() * Installs and updates data fixtures * * @return void - * @throws \Exception */ public function installDataAction() { - $this->installer->checkInstallationFilePermissions(); $this->installer->installDataFixtures(); } @@ -357,11 +354,9 @@ public function installDataAction() * Updates database schema and data * * @return void - * @throws \Exception */ public function updateAction() { - $this->installer->checkInstallationFilePermissions(); $this->installer->installSchema(); $this->installer->installDataFixtures(); } @@ -394,7 +389,6 @@ public function installAdminUserAction() * Controller for Uninstall Command * * @return void - * @throws \Exception */ public function uninstallAction() { @@ -436,11 +430,17 @@ public function maintenanceAction() * Shows necessary information for installing Magento * * @return string - * @throws \Exception + * @throws \InvalidArgumentException */ public function helpAction() { $type = $this->getRequest()->getParam('type'); + if ($type === false) { + $usageInfo = $this->formatConsoleFullUsageInfo( + array_merge(self::getConsoleUsage(), InitParamListener::getConsoleUsage()) + ); + return $usageInfo; + } $usages = self::getCommandUsage(); switch($type) { case UserConfig::KEY_LANGUAGE: @@ -461,6 +461,35 @@ public function helpAction() } } + /** + * Formats full usage info for console when user inputs 'help' command with no type + * + * @param array $usageInfo + * @return string + */ + private function formatConsoleFullUsageInfo($usageInfo) + { + $result = "\n==-------------------==\n" + . " Magento Setup CLI \n" + . "==-------------------==\n"; + $mask = "%-50s %-30s\n"; + $script = 'index.php'; + foreach ($usageInfo as $key => $value) { + if ($key === 0) { + $result .= sprintf($mask, "\n$value", ''); + } elseif (is_numeric($key)) { + if (is_array($value)) { + $result .= sprintf($mask, " " . $value[0], $value[1]); + } else { + $result .= sprintf($mask, '', $value); + } + } else { + $result .= sprintf($mask, " $script " . $key, $value); + } + } + return $result; + } + /** * Formats output of "usage" into more readable format by grouping required/optional parameters and wordwrapping * diff --git a/setup/module/Magento/Setup/src/Controller/Environment.php b/setup/module/Magento/Setup/src/Controller/Environment.php index 36f0ba789a0c6..43ffefeedefaf 100644 --- a/setup/module/Magento/Setup/src/Controller/Environment.php +++ b/setup/module/Magento/Setup/src/Controller/Environment.php @@ -4,47 +4,76 @@ */ namespace Magento\Setup\Controller; +use Composer\Package\LinkConstraint\VersionConstraint; +use Composer\Package\Version\VersionParser; use Zend\Mvc\Controller\AbstractActionController; use Zend\View\Model\JsonModel; -use Magento\Setup\Model\PhpExtensions; +use Magento\Setup\Model\PhpInformation; use Magento\Setup\Model\FilePermissions; class Environment extends AbstractActionController { /** - * The minimum required version of PHP + * Model to determine PHP version, currently installed and required PHP extensions. + * + * @var \Magento\Setup\Model\PhpInformation */ - const PHP_VERSION_MIN = '5.4.0'; + protected $phpInformation; /** - * @var \Magento\Setup\Model\PhpExtensions + * Version parser + * + * @var VersionParser */ - protected $extensions; + protected $versionParser; /** - * @param PhpExtensions $extensions + * Constructor + * + * @param PhpInformation $phpInformation * @param FilePermissions $permissions + * @param VersionParser $versionParser */ - public function __construct(PhpExtensions $extensions, FilePermissions $permissions) - { - $this->extensions = $extensions; - $this->permissions = $permissions; + public function __construct( + PhpInformation $phpInformation, + FilePermissions $permissions, + VersionParser $versionParser + ) { + $this->phpInformation = $phpInformation; + $this->permissions = $permissions; + $this->versionParser = $versionParser; } /** + * Verifies php version + * * @return JsonModel */ public function phpVersionAction() { + try{ + $requiredVersion = $this->phpInformation->getRequiredPhpVersion(); + } catch (\Exception $e) { + return new JsonModel( + [ + 'responseType' => ResponseTypeInterface::RESPONSE_TYPE_ERROR, + 'data' => [ + 'error' => 'phpVersionError', + 'message' => 'Cannot determine required PHP version: ' . $e->getMessage() + ], + ] + ); + } + $multipleConstraints = $this->versionParser->parseConstraints($requiredVersion); + $currentPhpVersion = new VersionConstraint('=', PHP_VERSION); $responseType = ResponseTypeInterface::RESPONSE_TYPE_SUCCESS; - if (version_compare(PHP_VERSION, self::PHP_VERSION_MIN, '<') === true) { + if (!$multipleConstraints->matches($currentPhpVersion)) { $responseType = ResponseTypeInterface::RESPONSE_TYPE_ERROR; } - $data = [ 'responseType' => $responseType, 'data' => [ - 'required' => self::PHP_VERSION_MIN, + 'required' => $requiredVersion, 'current' => PHP_VERSION, ], ]; @@ -52,19 +81,32 @@ public function phpVersionAction() } /** + * Verifies php verifications + * * @return JsonModel */ public function phpExtensionsAction() { - $required = $this->extensions->getRequired(); - $current = $this->extensions->getCurrent(); + try{ + $required = $this->phpInformation->getRequired(); + $current = $this->phpInformation->getCurrent(); + } catch (\Exception $e) { + return new JsonModel( + [ + 'responseType' => ResponseTypeInterface::RESPONSE_TYPE_ERROR, + 'data' => [ + 'error' => 'phpExtensionError', + 'message' => 'Cannot determine required PHP extensions: ' . $e->getMessage() + ], + ] + ); + } $responseType = ResponseTypeInterface::RESPONSE_TYPE_SUCCESS; $missing = array_values(array_diff($required, $current)); if ($missing) { $responseType = ResponseTypeInterface::RESPONSE_TYPE_ERROR; } - $data = [ 'responseType' => $responseType, 'data' => [ @@ -77,6 +119,8 @@ public function phpExtensionsAction() } /** + * Verifies file permissions + * * @return JsonModel */ public function filePermissionsAction() diff --git a/setup/module/Magento/Setup/src/Model/Installer.php b/setup/module/Magento/Setup/src/Model/Installer.php index 3126e3cccaa64..dc215a7db0cd9 100644 --- a/setup/module/Magento/Setup/src/Model/Installer.php +++ b/setup/module/Magento/Setup/src/Model/Installer.php @@ -26,7 +26,6 @@ use Magento\Setup\Module\SetupFactory; use Magento\Setup\Mvc\Bootstrap\InitParamListener; use Magento\Store\Model\Store; -use Symfony\Component\Process\PhpExecutableFinder; use Zend\ServiceManager\ServiceLocatorInterface; /** @@ -66,6 +65,11 @@ class Installer const INFO_MESSAGE = 'message'; + /** + * The lowest supported MySQL verion + */ + const MYSQL_VERSION_REQUIRED = '5.6.0'; + /** * File permissions checker * @@ -521,6 +525,7 @@ public function checkApplicationFilePermissions() */ public function installDeploymentConfig($data) { + $this->checkInstallationFilePermissions(); $data[InstallConfig::KEY_DATE] = date('r'); $configs = [ @@ -543,6 +548,8 @@ public function installDeploymentConfig($data) public function installSchema() { $this->assertDeploymentConfigExists(); + $this->assertDbAccessible(); + $moduleNames = $this->moduleList->getNames(); $this->log->log('Schema creation/updates:'); @@ -569,6 +576,10 @@ public function installSchema() */ public function installDataFixtures() { + $this->checkInstallationFilePermissions(); + $this->assertDeploymentConfigExists(); + $this->assertDbAccessible(); + /** @var \Magento\Framework\Module\Updater $updater */ $updater = $this->getObjectManager()->create('Magento\Framework\Module\Updater'); $updater->updateData(); @@ -707,7 +718,7 @@ private function setMaintenanceMode($value) * @param string $dbUser * @param string $dbPass * @return boolean - * @throws \Exception + * @throws \Magento\Setup\Exception */ public function checkDatabaseConnection($dbName, $dbHost, $dbUser, $dbPass = '') { @@ -720,7 +731,20 @@ public function checkDatabaseConnection($dbName, $dbHost, $dbUser, $dbPass = '') ]); if (!$connection) { - throw new \Exception('Database connection failure.'); + throw new \Magento\Setup\Exception('Database connection failure.'); + } + + $mysqlVersion = $connection->fetchOne('SELECT version()'); + if ($mysqlVersion) { + if (preg_match('/^([0-9\.]+)/', $mysqlVersion, $matches)) { + if (isset($matches[1]) && !empty($matches[1])) { + if (version_compare($matches[1], self::MYSQL_VERSION_REQUIRED) < 0) { + throw new \Magento\Setup\Exception( + 'Sorry, but we support MySQL version '. self::MYSQL_VERSION_REQUIRED . ' or later.' + ); + } + } + } } return true; } @@ -842,6 +866,23 @@ private function assertDeploymentConfigExists() } } + /** + * Validates that MySQL is accessible and MySQL version is supported + * + * @return void + */ + private function assertDbAccessible() + { + $dbConfig = new DbConfig($this->deploymentConfig->getSegment(DbConfig::CONFIG_KEY)); + $config = $dbConfig->getConnection(\Magento\Framework\App\Resource\Config::DEFAULT_SETUP_CONNECTION); + $this->checkDatabaseConnection( + $config[DbConfig::KEY_NAME], + $config[DbConfig::KEY_HOST], + $config[DbConfig::KEY_USER], + $config[DbConfig::KEY_PASS] + ); + } + /** * Run installation process for Sample Data * diff --git a/setup/module/Magento/Setup/src/Model/Lists.php b/setup/module/Magento/Setup/src/Model/Lists.php index 214db7f94af04..6fed03c6b3af1 100644 --- a/setup/module/Magento/Setup/src/Model/Lists.php +++ b/setup/module/Magento/Setup/src/Model/Lists.php @@ -6,6 +6,7 @@ namespace Magento\Setup\Model; use Zend_Locale; +use Magento\Framework\Locale\ConfigInterface; class Lists { @@ -16,14 +17,23 @@ class Lists */ protected $zendLocale; + /** + * List of allowed locales + * + * @var array + */ + protected $allowedLocales; + /** * Constructor * * @param Zend_Locale $zendLocale + * @param ConfigInterface $localeConfig */ - public function __construct(Zend_Locale $zendLocale) + public function __construct(Zend_Locale $zendLocale, ConfigInterface $localeConfig) { $this->zendLocale = $zendLocale; + $this->allowedLocales = $localeConfig->getAllowedLocales(); } /** @@ -67,15 +77,24 @@ public function getLocaleList() { $languages = $this->zendLocale->getTranslationList('Language'); $countries = $this->zendLocale->getTranslationList('Territory'); - $locale = $this->zendLocale->getLocaleList(); + $locales = $this->zendLocale->getLocaleList(); + + $allowedAliases = []; + foreach ($this->allowedLocales as $code) { + $allowedAliases[$this->zendLocale->getAlias($code)] = $code; + } + $list = []; - foreach ($locale as $key => $value) { - if (strstr($key, '_')) { - $data = explode('_', $key); + foreach (array_keys($locales) as $code) { + if (array_key_exists($code, $allowedAliases)) { + $code = $allowedAliases[$code]; + } + if (strstr($code, '_')) { + $data = explode('_', $code); if (!isset($languages[$data[0]]) || !isset($countries[$data[1]])) { continue; } - $list[$key] = $languages[$data[0]] . ' (' . $countries[$data[1]] . ')'; + $list[$code] = $languages[$data[0]] . ' (' . $countries[$data[1]] . ')'; } } asort($list); diff --git a/setup/module/Magento/Setup/src/Model/PhpExtensions.php b/setup/module/Magento/Setup/src/Model/PhpExtensions.php deleted file mode 100644 index 6e83981b80e48..0000000000000 --- a/setup/module/Magento/Setup/src/Model/PhpExtensions.php +++ /dev/null @@ -1,94 +0,0 @@ -rootDir = $filesystem->getDirectoryRead(DirectoryList::ROOT); - } - - /** - * Retrieve list of required extensions - * - * Collect required extensions from composer.lock file - * - * @return array - */ - public function getRequired() - { - if (null === $this->required) { - if (!$this->rootDir->isExist('composer.lock')) { - $this->required = []; - return $this->required; - } - $composerInfo = json_decode($this->rootDir->readFile('composer.lock'), true); - $declaredDependencies = []; - - if (!empty($composerInfo['platform-dev'])) { - $declaredDependencies = array_merge($declaredDependencies, array_keys($composerInfo['platform-dev'])); - } - if (!empty($composerInfo['packages'])) { - foreach ($composerInfo['packages'] as $package) { - if (!empty($package['require'])) { - $declaredDependencies = array_merge($declaredDependencies, array_keys($package['require'])); - } - } - } - if ($declaredDependencies) { - $declaredDependencies = array_unique($declaredDependencies); - $phpDependencies = []; - foreach ($declaredDependencies as $dependency) { - if (stripos($dependency, 'ext-') === 0) { - $phpDependencies[] = substr($dependency, 4); - } - } - $this->required = array_unique($phpDependencies); - } - } - return $this->required; - } - - /** - * Retrieve list of currently installed extensions - * - * @return array - */ - public function getCurrent() - { - if (!$this->current) { - $this->current = array_map('strtolower', get_loaded_extensions()); - } - return $this->current; - } -} diff --git a/setup/module/Magento/Setup/src/Model/PhpInformation.php b/setup/module/Magento/Setup/src/Model/PhpInformation.php new file mode 100644 index 0000000000000..497734cc1e90f --- /dev/null +++ b/setup/module/Magento/Setup/src/Model/PhpInformation.php @@ -0,0 +1,129 @@ +rootDir = $filesystem->getDirectoryRead(DirectoryList::ROOT); + } + + /** + * Retrieves required php version + * + * @return string + * @throws \Exception If attributes are missing in composer.lock file. + */ + public function getRequiredPhpVersion() + { + $composerInfo = $this->getComposerInfo(); + if (!empty($composerInfo['platform']['php'])) { + return $composerInfo['platform']['php']; + } else { + throw new \Exception('Missing key \'platform=>php\' in \'composer.lock\' file'); + } + } + + /** + * Retrieve list of required extensions + * + * Collect required extensions from composer.lock file + * + * @return array + * @throws \Exception If attributes are missing in composer.lock file. + */ + public function getRequired() + { + if (null === $this->required) { + $composerInfo = $this->getComposerInfo(); + $declaredDependencies = []; + + if (!empty($composerInfo['platform-dev'])) { + $declaredDependencies = array_merge($declaredDependencies, array_keys($composerInfo['platform-dev'])); + } else { + throw new \Exception('Missing key \'platform-dev\' in \'composer.lock\' file'); + } + if (!empty($composerInfo['packages'])) { + foreach ($composerInfo['packages'] as $package) { + if (!empty($package['require'])) { + $declaredDependencies = array_merge($declaredDependencies, array_keys($package['require'])); + } + } + } else { + throw new \Exception('Missing key \'packages\' in \'composer.lock\' file'); + } + if ($declaredDependencies) { + $declaredDependencies = array_unique($declaredDependencies); + $phpDependencies = []; + foreach ($declaredDependencies as $dependency) { + if (stripos($dependency, 'ext-') === 0) { + $phpDependencies[] = substr($dependency, 4); + } + } + $this->required = array_unique($phpDependencies); + } + } + return $this->required; + } + + /** + * Checks existence of composer.lock and returns its contents + * + * @return array + * @throws \Exception + */ + private function getComposerInfo() + { + if (!$this->rootDir->isExist('composer.lock')) { + throw new \Exception('Cannot read \'composer.lock\' file'); + } + return json_decode($this->rootDir->readFile('composer.lock'), true); + } + + /** + * Retrieve list of currently installed extensions + * + * @return array + */ + public function getCurrent() + { + if (!$this->current) { + $this->current = array_map('strtolower', get_loaded_extensions()); + } + return $this->current; + } +} diff --git a/setup/module/Magento/Setup/src/Mvc/Console/VerboseValidator.php b/setup/module/Magento/Setup/src/Mvc/Console/VerboseValidator.php index 8bbf4c4633635..92989dd23b3ce 100644 --- a/setup/module/Magento/Setup/src/Mvc/Console/VerboseValidator.php +++ b/setup/module/Magento/Setup/src/Mvc/Console/VerboseValidator.php @@ -22,15 +22,12 @@ class VerboseValidator public function validate(array $data, array $config) { $validationMessages = ''; + $userAction = null; if (!empty($data)) { $userAction = $data[0]; array_shift($data); - } else { - // user did not provide any action or parameters, treat as default action - return ''; } - - if (isset($config[$userAction])) { + if (isset($userAction) && isset($config[$userAction])) { // parse the expected parameters of the action $matcher = new RouteMatcher($config[$userAction]['options']['route']); $parts = $matcher->getParts(); @@ -87,8 +84,12 @@ public function validate(array $data, array $config) $validationMessages .= 'Usage:' . PHP_EOL . "{$userAction} "; $validationMessages .= $usages[$userAction] . PHP_EOL . PHP_EOL; - } else if (!is_null($userAction)) { - $validationMessages .= PHP_EOL . "Unknown action name '{$userAction}'." . PHP_EOL . PHP_EOL; + } else { + if (!is_null($userAction)) { + $validationMessages .= PHP_EOL . "Unknown action name '{$userAction}'." . PHP_EOL . PHP_EOL; + } else { + $validationMessages .= PHP_EOL . "No action is given in the command." . PHP_EOL . PHP_EOL; + } $validationMessages .= 'Available options: ' . PHP_EOL; foreach (array_keys($config) as $action) { $validationMessages .= $action . PHP_EOL; diff --git a/setup/module/Magento/Setup/view/magento/setup/landing.phtml b/setup/module/Magento/Setup/view/magento/setup/landing.phtml index e043893eefd45..ed3b126c7e7dc 100644 --- a/setup/module/Magento/Setup/view/magento/setup/landing.phtml +++ b/setup/module/Magento/Setup/view/magento/setup/landing.phtml @@ -11,7 +11,7 @@

Welcome to Magento Admin, your online store headquarters. - Click 'Agree and Set Up Magento' or read Getting Started to learn more.

+ Click 'Agree and Set Up Magento' or read Getting Started to learn more.


+
+
+  {{version.data.message}}

+
+ +

Need Help?

PHP Documentation

@@ -43,10 +49,12 @@

-

Donwload and install PHP version {{version.data.required}} from www.php.net using this PHP Documentation.

+

Download and install PHP version {{version.data.required}} from www.php.net using this PHP Documentation.

If you need more help please call your hosting provider.

+
+
@@ -78,6 +86,12 @@
+
+
+  {{extensions.data.message}}
+
+
+

Need Help?

PHP Extension Help

@@ -92,7 +106,7 @@ Less detail

-

The best way to resolve this is to install the correct missing extensions. The exact fix depends on our server, your host, and other system variables.
Our PHP Extension Help can get you started.

+

The best way to resolve this is to install the correct missing extensions. The exact fix depends on your server, your host, and other system variables.
Our PHP Extension Help can get you started.

If you need more help, please call your hosting provider.

    @@ -104,9 +118,11 @@
+
+
diff --git a/setup/pub/magento/setup/create-admin-account.js b/setup/pub/magento/setup/create-admin-account.js index 4617a6892f141..e7169a92c5a89 100644 --- a/setup/pub/magento/setup/create-admin-account.js +++ b/setup/pub/magento/setup/create-admin-account.js @@ -11,7 +11,7 @@ angular.module('create-admin-account', ['ngStorage']) label: 'None' } }; - + $scope.passwordStatusChange = function () { if (angular.isUndefined($scope.admin.password)) { return; @@ -70,10 +70,14 @@ angular.module('create-admin-account', ['ngStorage']) require: "ngModel", link: function(scope, elm, attrs, ctrl){ var validator = function(value){ - var isValid = (value.length > 6) && (value.match(/[\d]+/) && value.match(/[a-zA-Z]+/)); + var minReg = /^(?=.*\d)(?=.*[a-zA-Z])[a-zA-Z0-9]{6,}$/, + isValid = typeof value === 'string' && minReg.test(value); + ctrl.$setValidity('checkPassword', isValid); + return value; }; + ctrl.$parsers.unshift(validator); ctrl.$formatters.unshift(validator); }