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 @@
[](https://travis-ci.org/magento/magento2)
-
+
-
-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
-
-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
-
-
Install Apache using the guidelines on the Ubuntu site.
Apache 2.4: The Apache 2.4 documentation.
-Note that in Apache 2.4, the server's default site configuration file is /etc/apache2/sites-available/000-default.conf
-For example, you can add the following to the bottom of 000-default.conf:
-
<Directory "/var/www">
-AllowOverride [value from Apache site]
-</Directory>
-Note: You must change the value of AllowOverride 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>.
-
-
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.
-
-
-
-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:
-
-
-
-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:
-
-
-
-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.
-
-
-
-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:
-
-
-
-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.
-
-
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:
-
-
The following table discusses the meanings of installation option names and values. An example is provided in Sample localhost installation.
-
-
-
-
-
Name
-
Value
-
Required?
-
-
-
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_frontname
-
Path 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_name
-
Name of the Magento database instance in which you want to install the Magento database tables.
-
Yes
-
-
-
db_user
-
User name of the Magento database instance owner.
-
Yes
-
-
-
db_pass
-
Magento 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_firstname
-
Magento administrator user's first name.
-
Yes
-
-
-
admin_lastname
-
Magento administrator user's last name.
-
Yes
-
-
-
admin_email
-
Magento administrator user's e-mail address.
-
Yes
-
-
-
admin_username
-
Magento administrator user name.
-
Yes
-
-
-
admin_password
-
Magento administrator user password.
-
Yes
-
-
-
language
-
Language 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
-
-
-
currency
-
Default 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
-
-
-
timezone
-
Default 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
-
-
-
key
-
If 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_database
-
To 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_statements
-
Advanced 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_prefix
-
Specify 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)
-
-
-
-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:
-
-
-
-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!
-
-
-
-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!
-
-
-
-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();
-?>
-
-
-
-
-
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.
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",
+ '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
+ 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 name
+
COOKIE Description
+
+
+
+
+
CART
+
The association with your shopping cart.
+
+
+
CATEGORY_INFO
+
Stores the category info on the page, that allows to display pages more quickly.
+
+
+
COMPARE
+
The items that you have in the Compare Products list.
+
+
+
CUSTOMER
+
An encrypted version of your customer id with the store.
+
+
+
CUSTOMER_AUTH
+
An indicator if you are currently logged into the store.
+
+
+
CUSTOMER_INFO
+
An encrypted version of the customer group you belong to.
+
+
+
CUSTOMER_SEGMENT_IDS
+
Stores the Customer Segment ID
+
+
+
EXTERNAL_NO_CACHE
+
A flag, which indicates whether caching is disabled or not.
+
+
+
FRONTEND
+
You sesssion ID on the server.
+
+
+
GUEST-VIEW
+
Allows guests to edit their orders.
+
+
+
LAST_CATEGORY
+
The last category you visited.
+
+
+
LAST_PRODUCT
+
The most recent product you have viewed.
+
+
+
NEWMESSAGE
+
Indicates whether a new message has been received.
+
+
+
NO_CACHE
+
Indicates whether it is allowed to use cache.
+
+
+
PERSISTENT_SHOPPING_CART
+
A link to information about your cart and viewing history if you have asked the site.
+
+
+
RECENTLYCOMPARED
+
The items that you have recently compared.
+
+
+
STF
+
Information on products you have emailed to friends.
+
+
+
STORE
+
The store view or language you have selected.
+
+
+
USER_ALLOWED_SAVE_COOKIE
+
Indicates whether a customer allowed to use cookies.
+
+
+
VIEWED_PRODUCT_IDS
+
The products that you have recently viewed.
+
+
+
WISHLIST
+
An encrypted list of products added to your Wishlist.
- 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
- 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 name
-
COOKIE Description
-
-
-
-
-
CART
-
The association with your shopping cart.
-
-
-
CATEGORY_INFO
-
Stores the category info on the page, that allows to display pages more quickly.
-
-
-
COMPARE
-
The items that you have in the Compare Products list.
-
-
-
CUSTOMER
-
An encrypted version of your customer id with the store.
-
-
-
CUSTOMER_AUTH
-
An indicator if you are currently logged into the store.
-
-
-
CUSTOMER_INFO
-
An encrypted version of the customer group you belong to.
-
-
-
CUSTOMER_SEGMENT_IDS
-
Stores the Customer Segment ID
-
-
-
EXTERNAL_NO_CACHE
-
A flag, which indicates whether caching is disabled or not.
-
-
-
FRONTEND
-
You sesssion ID on the server.
-
-
-
GUEST-VIEW
-
Allows guests to edit their orders.
-
-
-
LAST_CATEGORY
-
The last category you visited.
-
-
-
LAST_PRODUCT
-
The most recent product you have viewed.
-
-
-
NEWMESSAGE
-
Indicates whether a new message has been received.
-
-
-
NO_CACHE
-
Indicates whether it is allowed to use cache.
-
-
-
PERSISTENT_SHOPPING_CART
-
A link to information about your cart and viewing history if you have asked the site.
-
-
-
RECENTLYCOMPARED
-
The items that you have recently compared.
-
-
-
STF
-
Information on products you have emailed to friends.
-
-
-
STORE
-
The store view or language you have selected.
-
-
-
USER_ALLOWED_SAVE_COOKIE
-
Indicates whether a customer allowed to use cookies.
-
-
-
VIEWED_PRODUCT_IDS
-
The products that you have recently viewed.
-
-
-
WISHLIST
-
An encrypted list of products added to your Wishlist.