From d8d94258ddf35cef738707b5eb47c817f01622e0 Mon Sep 17 00:00:00 2001 From: Volodymyr Kublytskyi Date: Thu, 23 Mar 2017 14:46:35 +0200 Subject: [PATCH 01/10] MAGETWO-65690: Cover Payment module with @api annotation --- .../Payment/Block/Adminhtml/Transparent/Form.php | 3 +++ app/code/Magento/Payment/Block/Form.php | 2 ++ app/code/Magento/Payment/Block/Form/Cc.php | 3 +++ app/code/Magento/Payment/Block/Form/Container.php | 2 +- app/code/Magento/Payment/Block/Info.php | 2 ++ .../Magento/Payment/Block/Info/AbstractContainer.php | 2 +- app/code/Magento/Payment/Block/Info/Cc.php | 2 ++ app/code/Magento/Payment/Block/Info/Instructions.php | 2 ++ app/code/Magento/Payment/Block/Transparent/Form.php | 2 +- app/code/Magento/Payment/Block/Transparent/Iframe.php | 2 +- app/code/Magento/Payment/Block/Transparent/Info.php | 3 ++- .../Magento/Payment/Gateway/Command/NullCommand.php | 10 +++++++++- .../Payment/Gateway/Command/Result/ArrayResult.php | 5 +++++ .../Payment/Gateway/Command/Result/BoolResult.php | 4 +++- app/code/Magento/Payment/Gateway/Config/Config.php | 10 ++++++++++ .../Payment/Gateway/Config/ConfigValueHandler.php | 7 +++++++ .../Payment/Gateway/Config/ValueHandlerPool.php | 8 ++++++++ .../Data/PaymentDataObjectFactoryInterface.php | 5 +++++ .../Magento/Payment/Gateway/Helper/ContextHelper.php | 6 ++++++ .../Magento/Payment/Gateway/Helper/SubjectReader.php | 6 ++++++ app/code/Magento/Payment/Helper/Data.php | 4 +++- app/code/Magento/Payment/Model/Cart.php | 2 ++ app/code/Magento/Payment/Model/CcConfig.php | 5 +++++ app/code/Magento/Payment/Model/CcConfigProvider.php | 1 + .../Magento/Payment/Model/CcGenericConfigProvider.php | 7 +++++++ .../Magento/Payment/Model/Checks/CanUseCheckout.php | 5 +++++ .../Magento/Payment/Model/Checks/CanUseForCountry.php | 5 +++++ .../Model/Checks/CanUseForCountry/CountryProvider.php | 7 +++++++ .../Payment/Model/Checks/CanUseForCurrency.php | 5 +++++ .../Magento/Payment/Model/Checks/CanUseInternal.php | 5 +++++ app/code/Magento/Payment/Model/Checks/Composite.php | 6 ++++++ .../Payment/Model/Checks/SpecificationFactory.php | 6 +++++- .../Payment/Model/Checks/SpecificationInterface.php | 2 ++ app/code/Magento/Payment/Model/Checks/TotalMinMax.php | 5 +++++ app/code/Magento/Payment/Model/Checks/ZeroTotal.php | 5 +++++ app/code/Magento/Payment/Model/Config.php | 2 ++ .../Model/Config/Source/Allspecificcountries.php | 3 +++ .../Magento/Payment/Model/IframeConfigProvider.php | 6 ++++++ app/code/Magento/Payment/Model/Info.php | 2 ++ .../Magento/Payment/Model/Method/AbstractMethod.php | 2 ++ app/code/Magento/Payment/Model/Method/Adapter.php | 2 ++ .../Magento/Payment/Model/Method/ConfigInterface.php | 2 +- app/code/Magento/Payment/Model/Method/Free.php | 6 ++++++ app/code/Magento/Payment/Model/Method/Logger.php | 2 ++ .../Method/Specification/AbstractSpecification.php | 2 ++ .../Payment/Model/Method/Specification/Composite.php | 4 ++++ .../Payment/Model/Method/SpecificationInterface.php | 2 ++ app/code/Magento/Payment/Model/MethodList.php | 11 +++++++---- app/code/Magento/Payment/Model/Source/Cctype.php | 4 ++++ app/code/Magento/Payment/Model/Source/Invoice.php | 4 +++- .../Magento/Payment/view/adminhtml/web/transparent.js | 3 +++ .../model/credit-card-validation/credit-card-data.js | 3 +++ .../credit-card-number-validator.js | 3 +++ .../credit-card-number-validator/credit-card-type.js | 3 +++ .../js/model/credit-card-validation/cvv-validator.js | 3 +++ .../expiration-date-validator.js | 3 +++ .../web/js/model/credit-card-validation/validator.js | 3 +++ app/code/Magento/Payment/view/frontend/web/cc-type.js | 3 +++ .../view/frontend/web/js/view/payment/cc-form.js | 3 +++ .../view/frontend/web/js/view/payment/iframe.js | 3 +++ .../js/view/payment/method-renderer/free-method.js | 3 +++ .../view/frontend/web/js/view/payment/payments.js | 3 +++ .../Magento/Payment/view/frontend/web/transparent.js | 3 +++ 63 files changed, 234 insertions(+), 15 deletions(-) diff --git a/app/code/Magento/Payment/Block/Adminhtml/Transparent/Form.php b/app/code/Magento/Payment/Block/Adminhtml/Transparent/Form.php index af596603e69cb..1cc004d67eeee 100644 --- a/app/code/Magento/Payment/Block/Adminhtml/Transparent/Form.php +++ b/app/code/Magento/Payment/Block/Adminhtml/Transparent/Form.php @@ -5,6 +5,9 @@ */ namespace Magento\Payment\Block\Adminhtml\Transparent; +/** + * @api + */ class Form extends \Magento\Payment\Block\Transparent\Form { /** diff --git a/app/code/Magento/Payment/Block/Form.php b/app/code/Magento/Payment/Block/Form.php index 78a4e0922dad7..043937f72aeb6 100644 --- a/app/code/Magento/Payment/Block/Form.php +++ b/app/code/Magento/Payment/Block/Form.php @@ -9,6 +9,8 @@ /** * Payment method form base block + * + * @api */ class Form extends \Magento\Framework\View\Element\Template { diff --git a/app/code/Magento/Payment/Block/Form/Cc.php b/app/code/Magento/Payment/Block/Form/Cc.php index 990c936840067..8c4e86ec69e5e 100644 --- a/app/code/Magento/Payment/Block/Form/Cc.php +++ b/app/code/Magento/Payment/Block/Form/Cc.php @@ -5,6 +5,9 @@ */ namespace Magento\Payment\Block\Form; +/** + * @api + */ class Cc extends \Magento\Payment\Block\Form { /** diff --git a/app/code/Magento/Payment/Block/Form/Container.php b/app/code/Magento/Payment/Block/Form/Container.php index 77144aca994da..f9c84d5f29037 100644 --- a/app/code/Magento/Payment/Block/Form/Container.php +++ b/app/code/Magento/Payment/Block/Form/Container.php @@ -13,7 +13,7 @@ * * @method \Magento\Quote\Model\Quote getQuote() * - * @author Magento Core Team + * @api */ class Container extends \Magento\Framework\View\Element\Template { diff --git a/app/code/Magento/Payment/Block/Info.php b/app/code/Magento/Payment/Block/Info.php index 77de654818fc0..6c877460ebf73 100644 --- a/app/code/Magento/Payment/Block/Info.php +++ b/app/code/Magento/Payment/Block/Info.php @@ -7,6 +7,8 @@ /** * Base payment iformation block + * + * @api */ class Info extends \Magento\Framework\View\Element\Template { diff --git a/app/code/Magento/Payment/Block/Info/AbstractContainer.php b/app/code/Magento/Payment/Block/Info/AbstractContainer.php index e3ffda02de499..cefef5945e53f 100644 --- a/app/code/Magento/Payment/Block/Info/AbstractContainer.php +++ b/app/code/Magento/Payment/Block/Info/AbstractContainer.php @@ -8,7 +8,7 @@ /** * Payment information container block * - * @author Magento Core Team + * @api */ abstract class AbstractContainer extends \Magento\Framework\View\Element\Template { diff --git a/app/code/Magento/Payment/Block/Info/Cc.php b/app/code/Magento/Payment/Block/Info/Cc.php index 834027a8cd880..063cbab800efb 100644 --- a/app/code/Magento/Payment/Block/Info/Cc.php +++ b/app/code/Magento/Payment/Block/Info/Cc.php @@ -7,6 +7,8 @@ /** * Credit card generic payment info + * + * @api */ class Cc extends \Magento\Payment\Block\Info { diff --git a/app/code/Magento/Payment/Block/Info/Instructions.php b/app/code/Magento/Payment/Block/Info/Instructions.php index 6802405e18fd0..a19e06e2bb60b 100644 --- a/app/code/Magento/Payment/Block/Info/Instructions.php +++ b/app/code/Magento/Payment/Block/Info/Instructions.php @@ -7,6 +7,8 @@ /** * Block for Bank Transfer payment generic info + * + * @api */ class Instructions extends \Magento\Payment\Block\Info { diff --git a/app/code/Magento/Payment/Block/Transparent/Form.php b/app/code/Magento/Payment/Block/Transparent/Form.php index 9116296080ec4..a569f6105d987 100644 --- a/app/code/Magento/Payment/Block/Transparent/Form.php +++ b/app/code/Magento/Payment/Block/Transparent/Form.php @@ -15,7 +15,7 @@ /** * Transparent form block * - * @author Magento Core Team + * @api */ class Form extends \Magento\Payment\Block\Form\Cc { diff --git a/app/code/Magento/Payment/Block/Transparent/Iframe.php b/app/code/Magento/Payment/Block/Transparent/Iframe.php index 5a544674b1552..ce556cf345ed4 100644 --- a/app/code/Magento/Payment/Block/Transparent/Iframe.php +++ b/app/code/Magento/Payment/Block/Transparent/Iframe.php @@ -8,7 +8,7 @@ /** * Iframe block for register specific params in layout * - * @author Magento Core Team + * @api */ class Iframe extends \Magento\Framework\View\Element\Template { diff --git a/app/code/Magento/Payment/Block/Transparent/Info.php b/app/code/Magento/Payment/Block/Transparent/Info.php index 009c2e9e36b68..26869e436690a 100644 --- a/app/code/Magento/Payment/Block/Transparent/Info.php +++ b/app/code/Magento/Payment/Block/Transparent/Info.php @@ -7,7 +7,8 @@ /** * Class Info. Payment Information block used for transparent redirect feature - * @package Magento\Payment\Block\Transparent + * + * @api */ class Info extends \Magento\Framework\View\Element\Template { diff --git a/app/code/Magento/Payment/Gateway/Command/NullCommand.php b/app/code/Magento/Payment/Gateway/Command/NullCommand.php index 71f62ba07992f..b2c9a3071d6cb 100644 --- a/app/code/Magento/Payment/Gateway/Command/NullCommand.php +++ b/app/code/Magento/Payment/Gateway/Command/NullCommand.php @@ -8,10 +8,18 @@ use Magento\Payment\Gateway\Command; use Magento\Payment\Gateway\CommandInterface; +/** + * Null command. Does nothing. + * + * Use this class as an implementation of CommandInterface to ignore some action + * or in case if command invoked by Magento has no sense for payment method. + * + * @api + */ class NullCommand implements CommandInterface { /** - * Null command. Does nothing. Stable. + * Process command without any side effect. * * @param array $commandSubject * diff --git a/app/code/Magento/Payment/Gateway/Command/Result/ArrayResult.php b/app/code/Magento/Payment/Gateway/Command/Result/ArrayResult.php index 6df16513ed746..499e80ca8a24f 100644 --- a/app/code/Magento/Payment/Gateway/Command/Result/ArrayResult.php +++ b/app/code/Magento/Payment/Gateway/Command/Result/ArrayResult.php @@ -7,6 +7,11 @@ use Magento\Payment\Gateway\Command\ResultInterface; +/** + * Container for array that should be returned as command result. + * + * @api + */ class ArrayResult implements ResultInterface { /** diff --git a/app/code/Magento/Payment/Gateway/Command/Result/BoolResult.php b/app/code/Magento/Payment/Gateway/Command/Result/BoolResult.php index 2b3f237023e0b..4fc03879eabb7 100644 --- a/app/code/Magento/Payment/Gateway/Command/Result/BoolResult.php +++ b/app/code/Magento/Payment/Gateway/Command/Result/BoolResult.php @@ -8,7 +8,9 @@ use Magento\Payment\Gateway\Command\ResultInterface; /** - * Class BoolResult + * Container for boolean value that should be returned as command result. + * + * @api */ class BoolResult implements ResultInterface { diff --git a/app/code/Magento/Payment/Gateway/Config/Config.php b/app/code/Magento/Payment/Gateway/Config/Config.php index b509a6c98da37..08f2ee01055c0 100644 --- a/app/code/Magento/Payment/Gateway/Config/Config.php +++ b/app/code/Magento/Payment/Gateway/Config/Config.php @@ -9,6 +9,16 @@ use Magento\Payment\Gateway\ConfigInterface; use Magento\Store\Model\ScopeInterface; +/** + * Default implementation of Payment Gateway Config. + * + * This class should not be extended or directly injected in to other classes as a dependency. + * Use \Magento\Payment\Gateway\ConfigInterface instead. + * + * To process value retrieved from config implementation of \Magento\Payment\Gateway\Config\ValueHandlerInterface + * should be used (inheritance and overriding of getValue method or introduction of new public methods + * is not recommended). + */ class Config implements ConfigInterface { const DEFAULT_PATH_PATTERN = 'payment/%s/%s'; diff --git a/app/code/Magento/Payment/Gateway/Config/ConfigValueHandler.php b/app/code/Magento/Payment/Gateway/Config/ConfigValueHandler.php index 63abc6d36aa0e..26955e5ea0baf 100644 --- a/app/code/Magento/Payment/Gateway/Config/ConfigValueHandler.php +++ b/app/code/Magento/Payment/Gateway/Config/ConfigValueHandler.php @@ -8,6 +8,13 @@ use Magento\Payment\Gateway\ConfigInterface; use Magento\Payment\Gateway\Helper\SubjectReader; +/** + * Default implementation of config value handler. + * + * This class is designed to be injected into other classes. Inheritance in not recommended. + * + * @api + */ class ConfigValueHandler implements ValueHandlerInterface { /** diff --git a/app/code/Magento/Payment/Gateway/Config/ValueHandlerPool.php b/app/code/Magento/Payment/Gateway/Config/ValueHandlerPool.php index 5ff17bfeb43c3..fa5e0b13c6c4e 100644 --- a/app/code/Magento/Payment/Gateway/Config/ValueHandlerPool.php +++ b/app/code/Magento/Payment/Gateway/Config/ValueHandlerPool.php @@ -8,6 +8,14 @@ use Magento\Framework\ObjectManager\TMap; use Magento\Framework\ObjectManager\TMapFactory; +/** + * Default implementation of config value handlers pool. + * This class designed to be base for virtual types. + * Direct injection of this class is not recommended (inject ValueHandlerPoolInterface instead). + * Inheritance from this class is not recommended (declare virtual type or implement ValueHandlerPoolInterface instead). + * + * @api + */ class ValueHandlerPool implements \Magento\Payment\Gateway\Config\ValueHandlerPoolInterface { /** diff --git a/app/code/Magento/Payment/Gateway/Data/PaymentDataObjectFactoryInterface.php b/app/code/Magento/Payment/Gateway/Data/PaymentDataObjectFactoryInterface.php index a01cdb00a6606..11bf61ce03539 100644 --- a/app/code/Magento/Payment/Gateway/Data/PaymentDataObjectFactoryInterface.php +++ b/app/code/Magento/Payment/Gateway/Data/PaymentDataObjectFactoryInterface.php @@ -7,6 +7,11 @@ use Magento\Payment\Model\InfoInterface; +/** + * Service for creation transferable payment object from model + * + * @api + */ interface PaymentDataObjectFactoryInterface { /** diff --git a/app/code/Magento/Payment/Gateway/Helper/ContextHelper.php b/app/code/Magento/Payment/Gateway/Helper/ContextHelper.php index 2157331f5230b..a0b95ba3c0061 100644 --- a/app/code/Magento/Payment/Gateway/Helper/ContextHelper.php +++ b/app/code/Magento/Payment/Gateway/Helper/ContextHelper.php @@ -7,6 +7,12 @@ use Magento\Payment\Model\InfoInterface; +/** + * Shortcut for methods that can be used to verify payment context. + * Usage of this class should be avoided. This class introduced for supporting backward compatibility. + * + * @api + */ class ContextHelper { /** diff --git a/app/code/Magento/Payment/Gateway/Helper/SubjectReader.php b/app/code/Magento/Payment/Gateway/Helper/SubjectReader.php index e5aaae0c2faf8..456782ed334d7 100644 --- a/app/code/Magento/Payment/Gateway/Helper/SubjectReader.php +++ b/app/code/Magento/Payment/Gateway/Helper/SubjectReader.php @@ -8,6 +8,12 @@ use Magento\Payment\Gateway\Data\PaymentDataObjectInterface; use Magento\Framework\DataObject; +/** + * This class encapsulates implicit interfaces (array structures) used in payments implementation. + * This class was introduced for backward compatibility with legacy implementation. + * + * @api + */ class SubjectReader { /** diff --git a/app/code/Magento/Payment/Helper/Data.php b/app/code/Magento/Payment/Helper/Data.php index 99d226d37beb8..bbfb90384404f 100644 --- a/app/code/Magento/Payment/Helper/Data.php +++ b/app/code/Magento/Payment/Helper/Data.php @@ -5,7 +5,6 @@ */ namespace Magento\Payment\Helper; -use Magento\Payment\Model\Method\Substitution; use Magento\Quote\Model\Quote; use Magento\Store\Model\Store; use Magento\Payment\Block\Form; @@ -19,6 +18,8 @@ /** * Payment module base helper * @SuppressWarnings(PHPMD.CouplingBetweenObjects) + * + * @api */ class Data extends \Magento\Framework\App\Helper\AbstractHelper { @@ -119,6 +120,7 @@ public function getMethodInstance($code) * @param Quote|null $quote * @return AbstractMethod[] * @deprecated + * @see \Magento\Payment\Api\PaymentMethodListInterface */ public function getStoreMethods($store = null, $quote = null) { diff --git a/app/code/Magento/Payment/Model/Cart.php b/app/code/Magento/Payment/Model/Cart.php index 8fa4972f2c3cc..79955a4ffc298 100644 --- a/app/code/Magento/Payment/Model/Cart.php +++ b/app/code/Magento/Payment/Model/Cart.php @@ -7,6 +7,8 @@ /** * Provide methods for collecting cart items information of specific sales model entity + * + * @api */ class Cart { diff --git a/app/code/Magento/Payment/Model/CcConfig.php b/app/code/Magento/Payment/Model/CcConfig.php index 247b45abcb512..123499929ab3e 100644 --- a/app/code/Magento/Payment/Model/CcConfig.php +++ b/app/code/Magento/Payment/Model/CcConfig.php @@ -12,6 +12,11 @@ use Psr\Log\LoggerInterface; use Magento\Payment\Model\Config as PaymentConfig; +/** + * Credit card configuration model + * + * @api + */ class CcConfig { /** @var PaymentConfig */ diff --git a/app/code/Magento/Payment/Model/CcConfigProvider.php b/app/code/Magento/Payment/Model/CcConfigProvider.php index 3fd69fe29a5dc..9aac3e8ef7df1 100644 --- a/app/code/Magento/Payment/Model/CcConfigProvider.php +++ b/app/code/Magento/Payment/Model/CcConfigProvider.php @@ -10,6 +10,7 @@ /** * Class CcConfigProvider + * * @api */ class CcConfigProvider implements ConfigProviderInterface diff --git a/app/code/Magento/Payment/Model/CcGenericConfigProvider.php b/app/code/Magento/Payment/Model/CcGenericConfigProvider.php index 7dc4f10a6b649..23ac16a9fc30b 100644 --- a/app/code/Magento/Payment/Model/CcGenericConfigProvider.php +++ b/app/code/Magento/Payment/Model/CcGenericConfigProvider.php @@ -8,6 +8,13 @@ use Magento\Checkout\Model\ConfigProviderInterface; use Magento\Payment\Helper\Data as PaymentHelper; +/** + * Default implementation of credits card configuration provider. + * Use this class to register payment method that supports credit cards. + * Direct injection as a dependency or extending of this class is not recommended. + * + * @api + */ class CcGenericConfigProvider implements ConfigProviderInterface { /** diff --git a/app/code/Magento/Payment/Model/Checks/CanUseCheckout.php b/app/code/Magento/Payment/Model/Checks/CanUseCheckout.php index d575fac3f7126..0dbbe89cffaca 100644 --- a/app/code/Magento/Payment/Model/Checks/CanUseCheckout.php +++ b/app/code/Magento/Payment/Model/Checks/CanUseCheckout.php @@ -8,6 +8,11 @@ use Magento\Payment\Model\MethodInterface; use Magento\Quote\Model\Quote; +/** + * Checks possibility of payment method to be used in storefront + * + * @api + */ class CanUseCheckout implements SpecificationInterface { /** diff --git a/app/code/Magento/Payment/Model/Checks/CanUseForCountry.php b/app/code/Magento/Payment/Model/Checks/CanUseForCountry.php index 83e7455f878e7..56937bd5a6f3e 100644 --- a/app/code/Magento/Payment/Model/Checks/CanUseForCountry.php +++ b/app/code/Magento/Payment/Model/Checks/CanUseForCountry.php @@ -9,6 +9,11 @@ use Magento\Quote\Model\Quote; use Magento\Payment\Model\Checks\CanUseForCountry\CountryProvider; +/** + * Checks possibility to use payment method at particular currency + * + * @api + */ class CanUseForCountry implements SpecificationInterface { /** diff --git a/app/code/Magento/Payment/Model/Checks/CanUseForCountry/CountryProvider.php b/app/code/Magento/Payment/Model/Checks/CanUseForCountry/CountryProvider.php index b75357bb64cc0..7db45dd80e903 100644 --- a/app/code/Magento/Payment/Model/Checks/CanUseForCountry/CountryProvider.php +++ b/app/code/Magento/Payment/Model/Checks/CanUseForCountry/CountryProvider.php @@ -8,6 +8,13 @@ use Magento\Quote\Model\Quote; use Magento\Directory\Helper\Data as DirectoryHelper; +/** + * Select country which will be used for payment. + * + * This class may be extended if logic fo country selection should be modified. + * + * @api + */ class CountryProvider { /** diff --git a/app/code/Magento/Payment/Model/Checks/CanUseForCurrency.php b/app/code/Magento/Payment/Model/Checks/CanUseForCurrency.php index 4a46bb8e43374..24b3630294f02 100644 --- a/app/code/Magento/Payment/Model/Checks/CanUseForCurrency.php +++ b/app/code/Magento/Payment/Model/Checks/CanUseForCurrency.php @@ -8,6 +8,11 @@ use Magento\Payment\Model\MethodInterface; use Magento\Quote\Model\Quote; +/** + * Checks possibility to use payment method with particular currency + * + * @api + */ class CanUseForCurrency implements SpecificationInterface { /** diff --git a/app/code/Magento/Payment/Model/Checks/CanUseInternal.php b/app/code/Magento/Payment/Model/Checks/CanUseInternal.php index 6346e0df308a6..23c750843a389 100644 --- a/app/code/Magento/Payment/Model/Checks/CanUseInternal.php +++ b/app/code/Magento/Payment/Model/Checks/CanUseInternal.php @@ -8,6 +8,11 @@ use Magento\Payment\Model\MethodInterface; use Magento\Quote\Model\Quote; +/** + * Checks possibility of payment method to be used in admin area + * + * @api + */ class CanUseInternal implements SpecificationInterface { /** diff --git a/app/code/Magento/Payment/Model/Checks/Composite.php b/app/code/Magento/Payment/Model/Checks/Composite.php index a75a4a98d5536..8ba9bcd724215 100644 --- a/app/code/Magento/Payment/Model/Checks/Composite.php +++ b/app/code/Magento/Payment/Model/Checks/Composite.php @@ -8,6 +8,12 @@ use Magento\Payment\Model\MethodInterface; use Magento\Quote\Model\Quote; +/** + * Combines several checks with logic "AND" operation. + * Use this class to register own specifications. + * + * @api + */ class Composite implements SpecificationInterface { /** @var SpecificationInterface[] */ diff --git a/app/code/Magento/Payment/Model/Checks/SpecificationFactory.php b/app/code/Magento/Payment/Model/Checks/SpecificationFactory.php index bdb6ef8985e05..d5ef8d4fc7a11 100644 --- a/app/code/Magento/Payment/Model/Checks/SpecificationFactory.php +++ b/app/code/Magento/Payment/Model/Checks/SpecificationFactory.php @@ -6,7 +6,11 @@ namespace Magento\Payment\Model\Checks; /** - * Class \Magento\Payment\Model\Methods\SpecificationFactory + * Creates complex specification. + * + * Use this class to register predefined list of specifications that should be added to any complex specification. + * + * @api */ class SpecificationFactory { diff --git a/app/code/Magento/Payment/Model/Checks/SpecificationInterface.php b/app/code/Magento/Payment/Model/Checks/SpecificationInterface.php index 19ef04071cad4..6a10268ad2715 100644 --- a/app/code/Magento/Payment/Model/Checks/SpecificationInterface.php +++ b/app/code/Magento/Payment/Model/Checks/SpecificationInterface.php @@ -10,6 +10,8 @@ /** * Specification checks interface + * + * @api */ interface SpecificationInterface { diff --git a/app/code/Magento/Payment/Model/Checks/TotalMinMax.php b/app/code/Magento/Payment/Model/Checks/TotalMinMax.php index 82aad971e6df2..b93cabb6bafa3 100644 --- a/app/code/Magento/Payment/Model/Checks/TotalMinMax.php +++ b/app/code/Magento/Payment/Model/Checks/TotalMinMax.php @@ -8,6 +8,11 @@ use Magento\Payment\Model\MethodInterface; use Magento\Quote\Model\Quote; +/** + * Checks is order total in allowed range or not + * + * @api + */ class TotalMinMax implements SpecificationInterface { /** diff --git a/app/code/Magento/Payment/Model/Checks/ZeroTotal.php b/app/code/Magento/Payment/Model/Checks/ZeroTotal.php index 2a0523c5a62da..101c14d1d4763 100644 --- a/app/code/Magento/Payment/Model/Checks/ZeroTotal.php +++ b/app/code/Magento/Payment/Model/Checks/ZeroTotal.php @@ -8,6 +8,11 @@ use Magento\Payment\Model\MethodInterface; use Magento\Quote\Model\Quote; +/** + * Checks that order total is meaningful + * + * @api + */ class ZeroTotal implements SpecificationInterface { /** diff --git a/app/code/Magento/Payment/Model/Config.php b/app/code/Magento/Payment/Model/Config.php index 8e47b7fb3cf18..3b28aa3727105 100644 --- a/app/code/Magento/Payment/Model/Config.php +++ b/app/code/Magento/Payment/Model/Config.php @@ -13,6 +13,8 @@ * Payment configuration model * * Used for retrieving configuration data by payment models + * + * @api */ class Config { diff --git a/app/code/Magento/Payment/Model/Config/Source/Allspecificcountries.php b/app/code/Magento/Payment/Model/Config/Source/Allspecificcountries.php index e76908c6b23a6..e756e019e42f2 100644 --- a/app/code/Magento/Payment/Model/Config/Source/Allspecificcountries.php +++ b/app/code/Magento/Payment/Model/Config/Source/Allspecificcountries.php @@ -5,6 +5,9 @@ */ namespace Magento\Payment\Model\Config\Source; +/** + * @api + */ class Allspecificcountries implements \Magento\Framework\Option\ArrayInterface { /** diff --git a/app/code/Magento/Payment/Model/IframeConfigProvider.php b/app/code/Magento/Payment/Model/IframeConfigProvider.php index 5b944ab5faa27..31719a8b46f74 100644 --- a/app/code/Magento/Payment/Model/IframeConfigProvider.php +++ b/app/code/Magento/Payment/Model/IframeConfigProvider.php @@ -18,6 +18,12 @@ * Class IframeConfigProvider * @package Magento\Payment\Model * @SuppressWarnings(PHPMD.CouplingBetweenObjects) + * + * Default implementation of config provider for iframe integrations. + * Use this class for virtual types declaration. + * Extends from this class only in case of urgency. + * + * @api */ class IframeConfigProvider implements ConfigProviderInterface { diff --git a/app/code/Magento/Payment/Model/Info.php b/app/code/Magento/Payment/Model/Info.php index e2743aa653f39..dae4efd749bb1 100644 --- a/app/code/Magento/Payment/Model/Info.php +++ b/app/code/Magento/Payment/Model/Info.php @@ -9,6 +9,8 @@ /** * Payment information model + * + * @api */ class Info extends AbstractExtensibleModel implements InfoInterface { diff --git a/app/code/Magento/Payment/Model/Method/AbstractMethod.php b/app/code/Magento/Payment/Model/Method/AbstractMethod.php index 5a879c868b69b..87ebddc638495 100644 --- a/app/code/Magento/Payment/Model/Method/AbstractMethod.php +++ b/app/code/Magento/Payment/Model/Method/AbstractMethod.php @@ -22,6 +22,8 @@ * @SuppressWarnings(PHPMD.TooManyFields) * @SuppressWarnings(PHPMD.CouplingBetweenObjects) * @deprecated + * @see \Magento\Payment\Model\Method\Adapter + * @see http://devdocs.magento.com/guides/v2.1/payments-integrations/payment-gateway/payment-gateway-intro.html */ abstract class AbstractMethod extends \Magento\Framework\Model\AbstractExtensibleModel implements MethodInterface, diff --git a/app/code/Magento/Payment/Model/Method/Adapter.php b/app/code/Magento/Payment/Model/Method/Adapter.php index bab803f6ef73e..f5eb9455372ae 100644 --- a/app/code/Magento/Payment/Model/Method/Adapter.php +++ b/app/code/Magento/Payment/Model/Method/Adapter.php @@ -25,6 +25,8 @@ * * @SuppressWarnings(PHPMD.ExcessivePublicCount) * @SuppressWarnings(PHPMD.CouplingBetweenObjects) + * + * @api Use this class as a base for virtual types declaration */ class Adapter implements MethodInterface { diff --git a/app/code/Magento/Payment/Model/Method/ConfigInterface.php b/app/code/Magento/Payment/Model/Method/ConfigInterface.php index c4fbb4fe4dacf..5ac8ab14c366b 100644 --- a/app/code/Magento/Payment/Model/Method/ConfigInterface.php +++ b/app/code/Magento/Payment/Model/Method/ConfigInterface.php @@ -8,7 +8,7 @@ /** * Interface for payment methods config * - * @author Magento Core Team + * @deprectated This interface has no semantic meaning and all it implementations has no joint points. */ interface ConfigInterface extends \Magento\Payment\Gateway\ConfigInterface { diff --git a/app/code/Magento/Payment/Model/Method/Free.php b/app/code/Magento/Payment/Model/Method/Free.php index 86ad586cfe185..30de389fe1e28 100644 --- a/app/code/Magento/Payment/Model/Method/Free.php +++ b/app/code/Magento/Payment/Model/Method/Free.php @@ -10,6 +10,12 @@ /** * Free payment method * @method \Magento\Quote\Api\Data\PaymentMethodExtensionInterface getExtensionAttributes() + * + * This is an implementation of payment method that allows order for free. + * Magento contains special flow for handling this payment method. + * Inheritance is allowed to modify it behavior. + * + * @api */ class Free extends \Magento\Payment\Model\Method\AbstractMethod { diff --git a/app/code/Magento/Payment/Model/Method/Logger.php b/app/code/Magento/Payment/Model/Method/Logger.php index ebf29016bfea0..6f4af1abb21bd 100644 --- a/app/code/Magento/Payment/Model/Method/Logger.php +++ b/app/code/Magento/Payment/Model/Method/Logger.php @@ -11,6 +11,8 @@ * Class Logger for payment related information (request, response, etc.) which is used for debug * * @author Magento Core Team + * + * @api */ class Logger { diff --git a/app/code/Magento/Payment/Model/Method/Specification/AbstractSpecification.php b/app/code/Magento/Payment/Model/Method/Specification/AbstractSpecification.php index 1e89fe8d1b07b..ecb5347fe0808 100644 --- a/app/code/Magento/Payment/Model/Method/Specification/AbstractSpecification.php +++ b/app/code/Magento/Payment/Model/Method/Specification/AbstractSpecification.php @@ -10,6 +10,8 @@ /** * Abstract specification + * + * @api */ abstract class AbstractSpecification implements SpecificationInterface { diff --git a/app/code/Magento/Payment/Model/Method/Specification/Composite.php b/app/code/Magento/Payment/Model/Method/Specification/Composite.php index d8a72377247a0..187871ea996de 100644 --- a/app/code/Magento/Payment/Model/Method/Specification/Composite.php +++ b/app/code/Magento/Payment/Model/Method/Specification/Composite.php @@ -9,6 +9,10 @@ /** * Composite specification + * + * Use this class for virtual types declaration. + * + * @api */ class Composite implements SpecificationInterface { diff --git a/app/code/Magento/Payment/Model/Method/SpecificationInterface.php b/app/code/Magento/Payment/Model/Method/SpecificationInterface.php index d8ec0e0f4db07..03156ee8a95de 100644 --- a/app/code/Magento/Payment/Model/Method/SpecificationInterface.php +++ b/app/code/Magento/Payment/Model/Method/SpecificationInterface.php @@ -7,6 +7,8 @@ /** * Interface SpecificationInterface + * + * @api */ interface SpecificationInterface { diff --git a/app/code/Magento/Payment/Model/MethodList.php b/app/code/Magento/Payment/Model/MethodList.php index a2426098c0eef..99e7165db1bb8 100644 --- a/app/code/Magento/Payment/Model/MethodList.php +++ b/app/code/Magento/Payment/Model/MethodList.php @@ -9,16 +9,22 @@ use Magento\Framework\App\ObjectManager; use Magento\Payment\Model\Method\AbstractMethod; +/** + * Methods List service class. + * + * @api + */ class MethodList { /** * @var \Magento\Payment\Helper\Data - * @deprecated + * @deprecated Do not use this property in case of inheritance. */ protected $paymentHelper; /** * @var \Magento\Payment\Model\Checks\SpecificationFactory + * @deprecated Do not use this property in case of inheritance. */ protected $methodSpecificationFactory; @@ -47,7 +53,6 @@ public function __construct( /** * @param \Magento\Quote\Api\Data\CartInterface $quote * @return \Magento\Payment\Model\MethodInterface[] - * @api */ public function getAvailableMethods(\Magento\Quote\Api\Data\CartInterface $quote = null) { @@ -90,7 +95,6 @@ protected function _canUseMethod($method, \Magento\Quote\Api\Data\CartInterface * Get payment method list. * * @return \Magento\Payment\Api\PaymentMethodListInterface - * @deprecated */ private function getPaymentMethodList() { @@ -106,7 +110,6 @@ private function getPaymentMethodList() * Get payment method instance factory. * * @return \Magento\Payment\Model\Method\InstanceFactory - * @deprecated */ private function getPaymentMethodInstanceFactory() { diff --git a/app/code/Magento/Payment/Model/Source/Cctype.php b/app/code/Magento/Payment/Model/Source/Cctype.php index 6138cdd54f2db..0814b232788e8 100644 --- a/app/code/Magento/Payment/Model/Source/Cctype.php +++ b/app/code/Magento/Payment/Model/Source/Cctype.php @@ -7,6 +7,10 @@ /** * Payment CC Types Source Model + * + * Inheritance of this class allowed as is a part of legacy implementation. + * + * @api */ class Cctype implements \Magento\Framework\Option\ArrayInterface { diff --git a/app/code/Magento/Payment/Model/Source/Invoice.php b/app/code/Magento/Payment/Model/Source/Invoice.php index 956cc1b33f325..789e146cd85f7 100644 --- a/app/code/Magento/Payment/Model/Source/Invoice.php +++ b/app/code/Magento/Payment/Model/Source/Invoice.php @@ -8,7 +8,9 @@ /** * Automatic invoice create source model * - * @author Magento Core Team + * Inheritance of this class allowed as is a part of legacy implementation. + * + * @api */ class Invoice implements \Magento\Framework\Option\ArrayInterface { diff --git a/app/code/Magento/Payment/view/adminhtml/web/transparent.js b/app/code/Magento/Payment/view/adminhtml/web/transparent.js index 9c833ef66027d..3e50cffb51ba0 100644 --- a/app/code/Magento/Payment/view/adminhtml/web/transparent.js +++ b/app/code/Magento/Payment/view/adminhtml/web/transparent.js @@ -4,6 +4,9 @@ */ /* global FORM_KEY */ +/** + * @api + */ define([ 'jquery', 'mage/template', diff --git a/app/code/Magento/Payment/view/base/web/js/model/credit-card-validation/credit-card-data.js b/app/code/Magento/Payment/view/base/web/js/model/credit-card-validation/credit-card-data.js index fc1293d5e05ea..817cd91b97dae 100644 --- a/app/code/Magento/Payment/view/base/web/js/model/credit-card-validation/credit-card-data.js +++ b/app/code/Magento/Payment/view/base/web/js/model/credit-card-validation/credit-card-data.js @@ -3,6 +3,9 @@ * See COPYING.txt for license details. */ +/** + * @api + */ define([], function () { 'use strict'; diff --git a/app/code/Magento/Payment/view/base/web/js/model/credit-card-validation/credit-card-number-validator.js b/app/code/Magento/Payment/view/base/web/js/model/credit-card-validation/credit-card-number-validator.js index d9461cbbbb64d..fc0a61f1537b8 100644 --- a/app/code/Magento/Payment/view/base/web/js/model/credit-card-validation/credit-card-number-validator.js +++ b/app/code/Magento/Payment/view/base/web/js/model/credit-card-validation/credit-card-number-validator.js @@ -3,6 +3,9 @@ * See COPYING.txt for license details. */ +/** + * @api + */ define([ 'mageUtils', 'Magento_Payment/js/model/credit-card-validation/credit-card-number-validator/luhn10-validator', diff --git a/app/code/Magento/Payment/view/base/web/js/model/credit-card-validation/credit-card-number-validator/credit-card-type.js b/app/code/Magento/Payment/view/base/web/js/model/credit-card-validation/credit-card-number-validator/credit-card-type.js index 20d393db96e73..4933ac417070f 100644 --- a/app/code/Magento/Payment/view/base/web/js/model/credit-card-validation/credit-card-number-validator/credit-card-type.js +++ b/app/code/Magento/Payment/view/base/web/js/model/credit-card-validation/credit-card-number-validator/credit-card-type.js @@ -3,6 +3,9 @@ * See COPYING.txt for license details. */ +/** + * @api + */ define([ 'jquery', 'mageUtils' diff --git a/app/code/Magento/Payment/view/base/web/js/model/credit-card-validation/cvv-validator.js b/app/code/Magento/Payment/view/base/web/js/model/credit-card-validation/cvv-validator.js index 4ce2a7994b7df..dd63907bdec40 100644 --- a/app/code/Magento/Payment/view/base/web/js/model/credit-card-validation/cvv-validator.js +++ b/app/code/Magento/Payment/view/base/web/js/model/credit-card-validation/cvv-validator.js @@ -3,6 +3,9 @@ * See COPYING.txt for license details. */ +/** + * @api + */ define([], function () { 'use strict'; diff --git a/app/code/Magento/Payment/view/base/web/js/model/credit-card-validation/expiration-date-validator.js b/app/code/Magento/Payment/view/base/web/js/model/credit-card-validation/expiration-date-validator.js index 29202bc55257d..8b4dcd8764d2a 100644 --- a/app/code/Magento/Payment/view/base/web/js/model/credit-card-validation/expiration-date-validator.js +++ b/app/code/Magento/Payment/view/base/web/js/model/credit-card-validation/expiration-date-validator.js @@ -3,6 +3,9 @@ * See COPYING.txt for license details. */ +/** + * @api + */ define([ 'mageUtils', 'Magento_Payment/js/model/credit-card-validation/expiration-date-validator/parse-date', diff --git a/app/code/Magento/Payment/view/base/web/js/model/credit-card-validation/validator.js b/app/code/Magento/Payment/view/base/web/js/model/credit-card-validation/validator.js index 289735ec71be4..37ff173c45d17 100644 --- a/app/code/Magento/Payment/view/base/web/js/model/credit-card-validation/validator.js +++ b/app/code/Magento/Payment/view/base/web/js/model/credit-card-validation/validator.js @@ -3,6 +3,9 @@ * See COPYING.txt for license details. */ +/** + * @api + */ (function (factory) { 'use strict'; diff --git a/app/code/Magento/Payment/view/frontend/web/cc-type.js b/app/code/Magento/Payment/view/frontend/web/cc-type.js index acba0d0a2e0ab..1bce719e6e913 100644 --- a/app/code/Magento/Payment/view/frontend/web/cc-type.js +++ b/app/code/Magento/Payment/view/frontend/web/cc-type.js @@ -3,6 +3,9 @@ * See COPYING.txt for license details. */ +/** + * @api + */ define([ 'jquery', 'jquery/ui' diff --git a/app/code/Magento/Payment/view/frontend/web/js/view/payment/cc-form.js b/app/code/Magento/Payment/view/frontend/web/js/view/payment/cc-form.js index 8bdeab5e99d54..7773a3c52f695 100644 --- a/app/code/Magento/Payment/view/frontend/web/js/view/payment/cc-form.js +++ b/app/code/Magento/Payment/view/frontend/web/js/view/payment/cc-form.js @@ -3,6 +3,9 @@ * See COPYING.txt for license details. */ +/** + * @api + */ define([ 'underscore', 'Magento_Checkout/js/view/payment/default', diff --git a/app/code/Magento/Payment/view/frontend/web/js/view/payment/iframe.js b/app/code/Magento/Payment/view/frontend/web/js/view/payment/iframe.js index f31c7b153a5ae..e26cedee96734 100644 --- a/app/code/Magento/Payment/view/frontend/web/js/view/payment/iframe.js +++ b/app/code/Magento/Payment/view/frontend/web/js/view/payment/iframe.js @@ -3,6 +3,9 @@ * See COPYING.txt for license details. */ +/** + * @api + */ define([ 'jquery', 'Magento_Payment/js/view/payment/cc-form', diff --git a/app/code/Magento/Payment/view/frontend/web/js/view/payment/method-renderer/free-method.js b/app/code/Magento/Payment/view/frontend/web/js/view/payment/method-renderer/free-method.js index 7d468399ac9a7..addf436fcf5ee 100644 --- a/app/code/Magento/Payment/view/frontend/web/js/view/payment/method-renderer/free-method.js +++ b/app/code/Magento/Payment/view/frontend/web/js/view/payment/method-renderer/free-method.js @@ -3,6 +3,9 @@ * See COPYING.txt for license details. */ +/** + * @api + */ define([ 'Magento_Checkout/js/view/payment/default', 'Magento_Checkout/js/model/quote' diff --git a/app/code/Magento/Payment/view/frontend/web/js/view/payment/payments.js b/app/code/Magento/Payment/view/frontend/web/js/view/payment/payments.js index 21f4db41a3bf8..450e3510e9169 100644 --- a/app/code/Magento/Payment/view/frontend/web/js/view/payment/payments.js +++ b/app/code/Magento/Payment/view/frontend/web/js/view/payment/payments.js @@ -3,6 +3,9 @@ * See COPYING.txt for license details. */ +/** + * @api + */ define([ 'uiComponent', 'Magento_Checkout/js/model/payment/renderer-list' diff --git a/app/code/Magento/Payment/view/frontend/web/transparent.js b/app/code/Magento/Payment/view/frontend/web/transparent.js index edde84df6c056..734d6ecea3687 100644 --- a/app/code/Magento/Payment/view/frontend/web/transparent.js +++ b/app/code/Magento/Payment/view/frontend/web/transparent.js @@ -3,6 +3,9 @@ * See COPYING.txt for license details. */ +/** + * @api + */ define([ 'jquery', 'mage/template', From 2552ab27f2260fd27d03d2f06db129c784b62d6b Mon Sep 17 00:00:00 2001 From: Volodymyr Kublytskyi Date: Thu, 23 Mar 2017 14:48:18 +0200 Subject: [PATCH 02/10] MAGETWO-66607: Cover OfflinePayments module with @api annotation --- app/code/Magento/OfflinePayments/Model/Banktransfer.php | 2 ++ app/code/Magento/OfflinePayments/Model/Cashondelivery.php | 2 ++ app/code/Magento/OfflinePayments/Model/Checkmo.php | 2 ++ app/code/Magento/OfflinePayments/Model/Purchaseorder.php | 2 ++ .../web/js/view/payment/method-renderer/banktransfer-method.js | 3 +++ .../js/view/payment/method-renderer/cashondelivery-method.js | 3 +++ .../web/js/view/payment/method-renderer/checkmo-method.js | 3 +++ .../js/view/payment/method-renderer/purchaseorder-method.js | 3 +++ .../view/frontend/web/js/view/payment/offline-payments.js | 3 +++ 9 files changed, 23 insertions(+) diff --git a/app/code/Magento/OfflinePayments/Model/Banktransfer.php b/app/code/Magento/OfflinePayments/Model/Banktransfer.php index 7e20135b0b0a9..c64d36ababe48 100644 --- a/app/code/Magento/OfflinePayments/Model/Banktransfer.php +++ b/app/code/Magento/OfflinePayments/Model/Banktransfer.php @@ -9,6 +9,8 @@ * Bank Transfer payment method model * * @method \Magento\Quote\Api\Data\PaymentMethodExtensionInterface getExtensionAttributes() + * + * @api */ class Banktransfer extends \Magento\Payment\Model\Method\AbstractMethod { diff --git a/app/code/Magento/OfflinePayments/Model/Cashondelivery.php b/app/code/Magento/OfflinePayments/Model/Cashondelivery.php index e381e2d4942c6..a5ad8cbe9ec42 100644 --- a/app/code/Magento/OfflinePayments/Model/Cashondelivery.php +++ b/app/code/Magento/OfflinePayments/Model/Cashondelivery.php @@ -9,6 +9,8 @@ * Cash on delivery payment method model * * @method \Magento\Quote\Api\Data\PaymentMethodExtensionInterface getExtensionAttributes() + * + * @api */ class Cashondelivery extends \Magento\Payment\Model\Method\AbstractMethod { diff --git a/app/code/Magento/OfflinePayments/Model/Checkmo.php b/app/code/Magento/OfflinePayments/Model/Checkmo.php index 6f34b3265acd2..d51515ec1d77c 100644 --- a/app/code/Magento/OfflinePayments/Model/Checkmo.php +++ b/app/code/Magento/OfflinePayments/Model/Checkmo.php @@ -9,6 +9,8 @@ * Class Checkmo * * @method \Magento\Quote\Api\Data\PaymentMethodExtensionInterface getExtensionAttributes() + * + * @api */ class Checkmo extends \Magento\Payment\Model\Method\AbstractMethod { diff --git a/app/code/Magento/OfflinePayments/Model/Purchaseorder.php b/app/code/Magento/OfflinePayments/Model/Purchaseorder.php index d1f1e31d3a4d2..28e4247851bf0 100644 --- a/app/code/Magento/OfflinePayments/Model/Purchaseorder.php +++ b/app/code/Magento/OfflinePayments/Model/Purchaseorder.php @@ -9,6 +9,8 @@ * Class Purchaseorder * * @method \Magento\Quote\Api\Data\PaymentMethodExtensionInterface getExtensionAttributes() + * + * @api */ class Purchaseorder extends \Magento\Payment\Model\Method\AbstractMethod { diff --git a/app/code/Magento/OfflinePayments/view/frontend/web/js/view/payment/method-renderer/banktransfer-method.js b/app/code/Magento/OfflinePayments/view/frontend/web/js/view/payment/method-renderer/banktransfer-method.js index 2876a2f771002..5ade9f29283a0 100644 --- a/app/code/Magento/OfflinePayments/view/frontend/web/js/view/payment/method-renderer/banktransfer-method.js +++ b/app/code/Magento/OfflinePayments/view/frontend/web/js/view/payment/method-renderer/banktransfer-method.js @@ -3,6 +3,9 @@ * See COPYING.txt for license details. */ +/** + * @api + */ define([ 'ko', 'Magento_Checkout/js/view/payment/default' diff --git a/app/code/Magento/OfflinePayments/view/frontend/web/js/view/payment/method-renderer/cashondelivery-method.js b/app/code/Magento/OfflinePayments/view/frontend/web/js/view/payment/method-renderer/cashondelivery-method.js index 413feae98e85b..37cde75ec34fd 100644 --- a/app/code/Magento/OfflinePayments/view/frontend/web/js/view/payment/method-renderer/cashondelivery-method.js +++ b/app/code/Magento/OfflinePayments/view/frontend/web/js/view/payment/method-renderer/cashondelivery-method.js @@ -3,6 +3,9 @@ * See COPYING.txt for license details. */ +/** + * @api + */ define([ 'Magento_Checkout/js/view/payment/default' ], function (Component) { diff --git a/app/code/Magento/OfflinePayments/view/frontend/web/js/view/payment/method-renderer/checkmo-method.js b/app/code/Magento/OfflinePayments/view/frontend/web/js/view/payment/method-renderer/checkmo-method.js index 59b945640f6ce..a1e995b94fdb3 100644 --- a/app/code/Magento/OfflinePayments/view/frontend/web/js/view/payment/method-renderer/checkmo-method.js +++ b/app/code/Magento/OfflinePayments/view/frontend/web/js/view/payment/method-renderer/checkmo-method.js @@ -3,6 +3,9 @@ * See COPYING.txt for license details. */ +/** + * @api + */ define([ 'Magento_Checkout/js/view/payment/default' ], function (Component) { diff --git a/app/code/Magento/OfflinePayments/view/frontend/web/js/view/payment/method-renderer/purchaseorder-method.js b/app/code/Magento/OfflinePayments/view/frontend/web/js/view/payment/method-renderer/purchaseorder-method.js index 25a0f2da7b5e4..12194bba5bc38 100644 --- a/app/code/Magento/OfflinePayments/view/frontend/web/js/view/payment/method-renderer/purchaseorder-method.js +++ b/app/code/Magento/OfflinePayments/view/frontend/web/js/view/payment/method-renderer/purchaseorder-method.js @@ -3,6 +3,9 @@ * See COPYING.txt for license details. */ +/** + * @api + */ define([ 'Magento_Checkout/js/view/payment/default', 'jquery', diff --git a/app/code/Magento/OfflinePayments/view/frontend/web/js/view/payment/offline-payments.js b/app/code/Magento/OfflinePayments/view/frontend/web/js/view/payment/offline-payments.js index fec7d3b946df0..96b526f3e9e7e 100644 --- a/app/code/Magento/OfflinePayments/view/frontend/web/js/view/payment/offline-payments.js +++ b/app/code/Magento/OfflinePayments/view/frontend/web/js/view/payment/offline-payments.js @@ -3,6 +3,9 @@ * See COPYING.txt for license details. */ +/** + * @api + */ define([ 'uiComponent', 'Magento_Checkout/js/model/payment/renderer-list' From 3054f51a14138c469ac19c5d62cb4e070977fc4c Mon Sep 17 00:00:00 2001 From: Volodymyr Kublytskyi Date: Thu, 23 Mar 2017 14:50:01 +0200 Subject: [PATCH 03/10] MAGETWO-66608: Cover OfflineShipping module with @api annotation --- app/code/Magento/OfflineShipping/Model/Carrier/Flatrate.php | 2 ++ .../Magento/OfflineShipping/Model/Carrier/Freeshipping.php | 5 +++++ app/code/Magento/OfflineShipping/Model/Carrier/Pickup.php | 5 +++++ app/code/Magento/OfflineShipping/Model/Carrier/Tablerate.php | 5 +++++ .../Magento/OfflineShipping/Model/Config/Source/Flatrate.php | 3 +++ .../OfflineShipping/Model/Config/Source/Tablerate.php | 3 +++ .../Model/ResourceModel/Carrier/Tablerate.php | 2 ++ .../Model/ResourceModel/Carrier/Tablerate/Collection.php | 2 +- .../Magento/OfflineShipping/Model/SalesRule/Calculator.php | 3 +++ app/code/Magento/OfflineShipping/Model/SalesRule/Rule.php | 3 +++ .../Model/Source/SalesRule/FreeShippingOptions.php | 3 +++ app/code/Magento/Quote/Model/Quote/Address/RateRequest.php | 2 ++ 12 files changed, 37 insertions(+), 1 deletion(-) diff --git a/app/code/Magento/OfflineShipping/Model/Carrier/Flatrate.php b/app/code/Magento/OfflineShipping/Model/Carrier/Flatrate.php index 4feedeb203941..bea9fd0534d3a 100644 --- a/app/code/Magento/OfflineShipping/Model/Carrier/Flatrate.php +++ b/app/code/Magento/OfflineShipping/Model/Carrier/Flatrate.php @@ -13,6 +13,8 @@ /** * Flat rate shipping model + * + * @api */ class Flatrate extends AbstractCarrier implements CarrierInterface { diff --git a/app/code/Magento/OfflineShipping/Model/Carrier/Freeshipping.php b/app/code/Magento/OfflineShipping/Model/Carrier/Freeshipping.php index ea2077e4d0e88..d32553058b113 100644 --- a/app/code/Magento/OfflineShipping/Model/Carrier/Freeshipping.php +++ b/app/code/Magento/OfflineShipping/Model/Carrier/Freeshipping.php @@ -13,6 +13,11 @@ use Magento\Quote\Model\Quote\Address\RateRequest; +/** + * Free shipping model + * + * @api + */ class Freeshipping extends \Magento\Shipping\Model\Carrier\AbstractCarrier implements \Magento\Shipping\Model\Carrier\CarrierInterface { diff --git a/app/code/Magento/OfflineShipping/Model/Carrier/Pickup.php b/app/code/Magento/OfflineShipping/Model/Carrier/Pickup.php index b9bf664511502..e9d3a35431b61 100644 --- a/app/code/Magento/OfflineShipping/Model/Carrier/Pickup.php +++ b/app/code/Magento/OfflineShipping/Model/Carrier/Pickup.php @@ -7,6 +7,11 @@ use Magento\Quote\Model\Quote\Address\RateRequest; +/** + * Pickup shipping model + * + * @api + */ class Pickup extends \Magento\Shipping\Model\Carrier\AbstractCarrier implements \Magento\Shipping\Model\Carrier\CarrierInterface { diff --git a/app/code/Magento/OfflineShipping/Model/Carrier/Tablerate.php b/app/code/Magento/OfflineShipping/Model/Carrier/Tablerate.php index 5a074dabb53a9..aed400d381b4a 100644 --- a/app/code/Magento/OfflineShipping/Model/Carrier/Tablerate.php +++ b/app/code/Magento/OfflineShipping/Model/Carrier/Tablerate.php @@ -8,6 +8,11 @@ use Magento\Framework\Exception\LocalizedException; use Magento\Quote\Model\Quote\Address\RateRequest; +/** + * Table rate shipping model + * + * @api + */ class Tablerate extends \Magento\Shipping\Model\Carrier\AbstractCarrier implements \Magento\Shipping\Model\Carrier\CarrierInterface { diff --git a/app/code/Magento/OfflineShipping/Model/Config/Source/Flatrate.php b/app/code/Magento/OfflineShipping/Model/Config/Source/Flatrate.php index fc718f4bae7cb..f5bd159825499 100644 --- a/app/code/Magento/OfflineShipping/Model/Config/Source/Flatrate.php +++ b/app/code/Magento/OfflineShipping/Model/Config/Source/Flatrate.php @@ -5,6 +5,9 @@ */ namespace Magento\OfflineShipping\Model\Config\Source; +/** + * @api + */ class Flatrate implements \Magento\Framework\Option\ArrayInterface { /** diff --git a/app/code/Magento/OfflineShipping/Model/Config/Source/Tablerate.php b/app/code/Magento/OfflineShipping/Model/Config/Source/Tablerate.php index a88fa13b0d8b9..a3858053f43c6 100644 --- a/app/code/Magento/OfflineShipping/Model/Config/Source/Tablerate.php +++ b/app/code/Magento/OfflineShipping/Model/Config/Source/Tablerate.php @@ -5,6 +5,9 @@ */ namespace Magento\OfflineShipping\Model\Config\Source; +/** + * @api + */ class Tablerate implements \Magento\Framework\Option\ArrayInterface { /** diff --git a/app/code/Magento/OfflineShipping/Model/ResourceModel/Carrier/Tablerate.php b/app/code/Magento/OfflineShipping/Model/ResourceModel/Carrier/Tablerate.php index c19882293a79a..42992d079270c 100644 --- a/app/code/Magento/OfflineShipping/Model/ResourceModel/Carrier/Tablerate.php +++ b/app/code/Magento/OfflineShipping/Model/ResourceModel/Carrier/Tablerate.php @@ -20,6 +20,8 @@ /** * @SuppressWarnings(PHPMD.TooManyFields) * @SuppressWarnings(PHPMD.CouplingBetweenObjects) + * + * @api */ class Tablerate extends \Magento\Framework\Model\ResourceModel\Db\AbstractDb { diff --git a/app/code/Magento/OfflineShipping/Model/ResourceModel/Carrier/Tablerate/Collection.php b/app/code/Magento/OfflineShipping/Model/ResourceModel/Carrier/Tablerate/Collection.php index cec0dba58cda2..0ffd74ae6f814 100644 --- a/app/code/Magento/OfflineShipping/Model/ResourceModel/Carrier/Tablerate/Collection.php +++ b/app/code/Magento/OfflineShipping/Model/ResourceModel/Carrier/Tablerate/Collection.php @@ -8,7 +8,7 @@ /** * Shipping table rates collection * - * @author Magento Core Team + * @api */ class Collection extends \Magento\Framework\Model\ResourceModel\Db\Collection\AbstractCollection { diff --git a/app/code/Magento/OfflineShipping/Model/SalesRule/Calculator.php b/app/code/Magento/OfflineShipping/Model/SalesRule/Calculator.php index 08e8454869ca9..fe9b9e3e55355 100644 --- a/app/code/Magento/OfflineShipping/Model/SalesRule/Calculator.php +++ b/app/code/Magento/OfflineShipping/Model/SalesRule/Calculator.php @@ -13,6 +13,9 @@ use Magento\SalesRule\Model\Validator; +/** + * @api + */ class Calculator extends Validator { /** diff --git a/app/code/Magento/OfflineShipping/Model/SalesRule/Rule.php b/app/code/Magento/OfflineShipping/Model/SalesRule/Rule.php index c9d92a5c28a35..6a0dbf271a29b 100644 --- a/app/code/Magento/OfflineShipping/Model/SalesRule/Rule.php +++ b/app/code/Magento/OfflineShipping/Model/SalesRule/Rule.php @@ -11,6 +11,9 @@ */ namespace Magento\OfflineShipping\Model\SalesRule; +/** + * @api + */ class Rule { /** diff --git a/app/code/Magento/OfflineShipping/Model/Source/SalesRule/FreeShippingOptions.php b/app/code/Magento/OfflineShipping/Model/Source/SalesRule/FreeShippingOptions.php index e44594f3581dc..6b5e868114218 100644 --- a/app/code/Magento/OfflineShipping/Model/Source/SalesRule/FreeShippingOptions.php +++ b/app/code/Magento/OfflineShipping/Model/Source/SalesRule/FreeShippingOptions.php @@ -8,6 +8,9 @@ use Magento\Framework\Data\OptionSourceInterface; use Magento\OfflineShipping\Model\SalesRule\Rule; +/** + * @api + */ class FreeShippingOptions implements OptionSourceInterface { /** diff --git a/app/code/Magento/Quote/Model/Quote/Address/RateRequest.php b/app/code/Magento/Quote/Model/Quote/Address/RateRequest.php index 3997029da5472..f670de1925f35 100644 --- a/app/code/Magento/Quote/Model/Quote/Address/RateRequest.php +++ b/app/code/Magento/Quote/Model/Quote/Address/RateRequest.php @@ -108,6 +108,8 @@ * @method string getLimitCarrier() * @method \Magento\Quote\Model\Quote\Address\RateRequest setLimitMethod(string $value) * @method string getLimitMethod() + * + * @api */ class RateRequest extends \Magento\Framework\DataObject { From fba8de1c98fe041f9bea4e129fdf615aea160cff Mon Sep 17 00:00:00 2001 From: Volodymyr Kublytskyi Date: Thu, 23 Mar 2017 14:51:12 +0200 Subject: [PATCH 04/10] MAGETWO-66609: Cover Vault module with @api annotation --- app/code/Magento/Vault/Model/Method/Vault.php | 2 ++ .../Vault/Model/Ui/Adminhtml/TokensConfigProvider.php | 2 ++ app/code/Magento/Vault/Model/Ui/VaultConfigProvider.php | 5 +++++ app/code/Magento/Vault/etc/di.xml | 2 ++ app/code/Magento/Vault/view/adminhtml/web/js/vault.js | 3 +++ .../Vault/view/frontend/web/js/view/payment/vault-enabler.js | 3 +++ .../Magento/Vault/view/frontend/web/js/view/payment/vault.js | 3 +++ 7 files changed, 20 insertions(+) diff --git a/app/code/Magento/Vault/Model/Method/Vault.php b/app/code/Magento/Vault/Model/Method/Vault.php index 5618185578ed2..c5fc46a3bbb86 100644 --- a/app/code/Magento/Vault/Model/Method/Vault.php +++ b/app/code/Magento/Vault/Model/Method/Vault.php @@ -27,6 +27,8 @@ * * @SuppressWarnings(PHPMD.ExcessivePublicCount) * @SuppressWarnings(PHPMD.CouplingBetweenObjects) + * + * @api */ class Vault implements VaultPaymentInterface { diff --git a/app/code/Magento/Vault/Model/Ui/Adminhtml/TokensConfigProvider.php b/app/code/Magento/Vault/Model/Ui/Adminhtml/TokensConfigProvider.php index fc72ed9f5afbc..6d47a609c4dcb 100644 --- a/app/code/Magento/Vault/Model/Ui/Adminhtml/TokensConfigProvider.php +++ b/app/code/Magento/Vault/Model/Ui/Adminhtml/TokensConfigProvider.php @@ -26,6 +26,8 @@ * Class ConfigProvider * @api * @SuppressWarnings(PHPMD.CouplingBetweenObjects) + * + * @api */ class TokensConfigProvider { diff --git a/app/code/Magento/Vault/Model/Ui/VaultConfigProvider.php b/app/code/Magento/Vault/Model/Ui/VaultConfigProvider.php index 26596fe8eb181..557a129c41b67 100644 --- a/app/code/Magento/Vault/Model/Ui/VaultConfigProvider.php +++ b/app/code/Magento/Vault/Model/Ui/VaultConfigProvider.php @@ -11,6 +11,11 @@ use Magento\Store\Model\StoreManagerInterface; use Magento\Vault\Api\PaymentMethodListInterface; +/** + * Provides information about vault payemnt methods availability on storefront + * + * @api + */ class VaultConfigProvider implements ConfigProviderInterface { const IS_ACTIVE_CODE = 'is_active_payment_token_enabler'; diff --git a/app/code/Magento/Vault/etc/di.xml b/app/code/Magento/Vault/etc/di.xml index 843fd1881c31e..4b497b3394e7a 100644 --- a/app/code/Magento/Vault/etc/di.xml +++ b/app/code/Magento/Vault/etc/di.xml @@ -29,11 +29,13 @@ + Magento\Payment\Gateway\Config\Config + diff --git a/app/code/Magento/Vault/view/adminhtml/web/js/vault.js b/app/code/Magento/Vault/view/adminhtml/web/js/vault.js index 0924925cf8950..18b80291a0dcf 100644 --- a/app/code/Magento/Vault/view/adminhtml/web/js/vault.js +++ b/app/code/Magento/Vault/view/adminhtml/web/js/vault.js @@ -4,6 +4,9 @@ */ /*browser:true*/ /*global define*/ +/** + * @api + */ define([ 'jquery', 'uiComponent' diff --git a/app/code/Magento/Vault/view/frontend/web/js/view/payment/vault-enabler.js b/app/code/Magento/Vault/view/frontend/web/js/view/payment/vault-enabler.js index 6cf29111d82bc..d3373c94cdd46 100644 --- a/app/code/Magento/Vault/view/frontend/web/js/view/payment/vault-enabler.js +++ b/app/code/Magento/Vault/view/frontend/web/js/view/payment/vault-enabler.js @@ -4,6 +4,9 @@ */ /*browser:true*/ /*global define*/ +/** + * @api + */ define( [ 'uiElement' diff --git a/app/code/Magento/Vault/view/frontend/web/js/view/payment/vault.js b/app/code/Magento/Vault/view/frontend/web/js/view/payment/vault.js index 3b1c77f6ea3d7..d9ac8f2fcc22e 100644 --- a/app/code/Magento/Vault/view/frontend/web/js/view/payment/vault.js +++ b/app/code/Magento/Vault/view/frontend/web/js/view/payment/vault.js @@ -4,6 +4,9 @@ */ /*browser:true*/ /*global define*/ +/** + * @api + */ define([ 'underscore', 'uiComponent', From 46fa328eb8e4f7d3e3ee1b18a4dc3f915903c452 Mon Sep 17 00:00:00 2001 From: Volodymyr Kublytskyi Date: Thu, 23 Mar 2017 16:57:58 +0200 Subject: [PATCH 05/10] MAGETWO-65690: Cover Payment module with @api annotation - fixed typos --- app/code/Magento/Payment/Gateway/Config/Config.php | 3 --- app/code/Magento/Payment/Model/Checks/CanUseForCountry.php | 2 +- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/app/code/Magento/Payment/Gateway/Config/Config.php b/app/code/Magento/Payment/Gateway/Config/Config.php index 08f2ee01055c0..047e8302bfdd5 100644 --- a/app/code/Magento/Payment/Gateway/Config/Config.php +++ b/app/code/Magento/Payment/Gateway/Config/Config.php @@ -12,9 +12,6 @@ /** * Default implementation of Payment Gateway Config. * - * This class should not be extended or directly injected in to other classes as a dependency. - * Use \Magento\Payment\Gateway\ConfigInterface instead. - * * To process value retrieved from config implementation of \Magento\Payment\Gateway\Config\ValueHandlerInterface * should be used (inheritance and overriding of getValue method or introduction of new public methods * is not recommended). diff --git a/app/code/Magento/Payment/Model/Checks/CanUseForCountry.php b/app/code/Magento/Payment/Model/Checks/CanUseForCountry.php index 56937bd5a6f3e..df6c161c8a33c 100644 --- a/app/code/Magento/Payment/Model/Checks/CanUseForCountry.php +++ b/app/code/Magento/Payment/Model/Checks/CanUseForCountry.php @@ -10,7 +10,7 @@ use Magento\Payment\Model\Checks\CanUseForCountry\CountryProvider; /** - * Checks possibility to use payment method at particular currency + * Checks possibility to use payment method at particular country * * @api */ From b18339d2d80997d7a2b4b464a64ac294f7897e4c Mon Sep 17 00:00:00 2001 From: Volodymyr Kublytskyi Date: Fri, 24 Mar 2017 14:05:15 +0200 Subject: [PATCH 06/10] MAGETWO-65690: Cover Payment module with @api annotation - fixed code style --- app/code/Magento/Payment/view/adminhtml/web/transparent.js | 4 +--- .../web/js/model/credit-card-validation/credit-card-data.js | 4 +--- .../credit-card-validation/credit-card-number-validator.js | 4 +--- .../credit-card-number-validator/credit-card-type.js | 4 +--- .../base/web/js/model/credit-card-validation/cvv-validator.js | 4 +--- .../model/credit-card-validation/expiration-date-validator.js | 4 +--- .../base/web/js/model/credit-card-validation/validator.js | 4 +--- app/code/Magento/Payment/view/frontend/web/cc-type.js | 4 +--- .../Payment/view/frontend/web/js/view/payment/cc-form.js | 4 +--- .../Payment/view/frontend/web/js/view/payment/iframe.js | 4 +--- .../web/js/view/payment/method-renderer/free-method.js | 4 +--- .../Payment/view/frontend/web/js/view/payment/payments.js | 4 +--- app/code/Magento/Payment/view/frontend/web/transparent.js | 4 +--- 13 files changed, 13 insertions(+), 39 deletions(-) diff --git a/app/code/Magento/Payment/view/adminhtml/web/transparent.js b/app/code/Magento/Payment/view/adminhtml/web/transparent.js index 3e50cffb51ba0..a0da848a747b7 100644 --- a/app/code/Magento/Payment/view/adminhtml/web/transparent.js +++ b/app/code/Magento/Payment/view/adminhtml/web/transparent.js @@ -4,9 +4,7 @@ */ /* global FORM_KEY */ -/** - * @api - */ +/* @api */ define([ 'jquery', 'mage/template', diff --git a/app/code/Magento/Payment/view/base/web/js/model/credit-card-validation/credit-card-data.js b/app/code/Magento/Payment/view/base/web/js/model/credit-card-validation/credit-card-data.js index 817cd91b97dae..634e793df829a 100644 --- a/app/code/Magento/Payment/view/base/web/js/model/credit-card-validation/credit-card-data.js +++ b/app/code/Magento/Payment/view/base/web/js/model/credit-card-validation/credit-card-data.js @@ -3,9 +3,7 @@ * See COPYING.txt for license details. */ -/** - * @api - */ +/* @api */ define([], function () { 'use strict'; diff --git a/app/code/Magento/Payment/view/base/web/js/model/credit-card-validation/credit-card-number-validator.js b/app/code/Magento/Payment/view/base/web/js/model/credit-card-validation/credit-card-number-validator.js index fc0a61f1537b8..670974018af0b 100644 --- a/app/code/Magento/Payment/view/base/web/js/model/credit-card-validation/credit-card-number-validator.js +++ b/app/code/Magento/Payment/view/base/web/js/model/credit-card-validation/credit-card-number-validator.js @@ -3,9 +3,7 @@ * See COPYING.txt for license details. */ -/** - * @api - */ +/* @api */ define([ 'mageUtils', 'Magento_Payment/js/model/credit-card-validation/credit-card-number-validator/luhn10-validator', diff --git a/app/code/Magento/Payment/view/base/web/js/model/credit-card-validation/credit-card-number-validator/credit-card-type.js b/app/code/Magento/Payment/view/base/web/js/model/credit-card-validation/credit-card-number-validator/credit-card-type.js index 4933ac417070f..94d8af44fe00a 100644 --- a/app/code/Magento/Payment/view/base/web/js/model/credit-card-validation/credit-card-number-validator/credit-card-type.js +++ b/app/code/Magento/Payment/view/base/web/js/model/credit-card-validation/credit-card-number-validator/credit-card-type.js @@ -3,9 +3,7 @@ * See COPYING.txt for license details. */ -/** - * @api - */ +/* @api */ define([ 'jquery', 'mageUtils' diff --git a/app/code/Magento/Payment/view/base/web/js/model/credit-card-validation/cvv-validator.js b/app/code/Magento/Payment/view/base/web/js/model/credit-card-validation/cvv-validator.js index dd63907bdec40..0cfba30533b59 100644 --- a/app/code/Magento/Payment/view/base/web/js/model/credit-card-validation/cvv-validator.js +++ b/app/code/Magento/Payment/view/base/web/js/model/credit-card-validation/cvv-validator.js @@ -3,9 +3,7 @@ * See COPYING.txt for license details. */ -/** - * @api - */ +/* @api */ define([], function () { 'use strict'; diff --git a/app/code/Magento/Payment/view/base/web/js/model/credit-card-validation/expiration-date-validator.js b/app/code/Magento/Payment/view/base/web/js/model/credit-card-validation/expiration-date-validator.js index 8b4dcd8764d2a..90787df1df9f0 100644 --- a/app/code/Magento/Payment/view/base/web/js/model/credit-card-validation/expiration-date-validator.js +++ b/app/code/Magento/Payment/view/base/web/js/model/credit-card-validation/expiration-date-validator.js @@ -3,9 +3,7 @@ * See COPYING.txt for license details. */ -/** - * @api - */ +/* @api */ define([ 'mageUtils', 'Magento_Payment/js/model/credit-card-validation/expiration-date-validator/parse-date', diff --git a/app/code/Magento/Payment/view/base/web/js/model/credit-card-validation/validator.js b/app/code/Magento/Payment/view/base/web/js/model/credit-card-validation/validator.js index 37ff173c45d17..837b3e34d9050 100644 --- a/app/code/Magento/Payment/view/base/web/js/model/credit-card-validation/validator.js +++ b/app/code/Magento/Payment/view/base/web/js/model/credit-card-validation/validator.js @@ -3,9 +3,7 @@ * See COPYING.txt for license details. */ -/** - * @api - */ +/* @api */ (function (factory) { 'use strict'; diff --git a/app/code/Magento/Payment/view/frontend/web/cc-type.js b/app/code/Magento/Payment/view/frontend/web/cc-type.js index 1bce719e6e913..0b58e177b6e78 100644 --- a/app/code/Magento/Payment/view/frontend/web/cc-type.js +++ b/app/code/Magento/Payment/view/frontend/web/cc-type.js @@ -3,9 +3,7 @@ * See COPYING.txt for license details. */ -/** - * @api - */ +/* @api */ define([ 'jquery', 'jquery/ui' diff --git a/app/code/Magento/Payment/view/frontend/web/js/view/payment/cc-form.js b/app/code/Magento/Payment/view/frontend/web/js/view/payment/cc-form.js index 7773a3c52f695..cbffa91ca3195 100644 --- a/app/code/Magento/Payment/view/frontend/web/js/view/payment/cc-form.js +++ b/app/code/Magento/Payment/view/frontend/web/js/view/payment/cc-form.js @@ -3,9 +3,7 @@ * See COPYING.txt for license details. */ -/** - * @api - */ +/* @api */ define([ 'underscore', 'Magento_Checkout/js/view/payment/default', diff --git a/app/code/Magento/Payment/view/frontend/web/js/view/payment/iframe.js b/app/code/Magento/Payment/view/frontend/web/js/view/payment/iframe.js index e26cedee96734..5279579b0e3af 100644 --- a/app/code/Magento/Payment/view/frontend/web/js/view/payment/iframe.js +++ b/app/code/Magento/Payment/view/frontend/web/js/view/payment/iframe.js @@ -3,9 +3,7 @@ * See COPYING.txt for license details. */ -/** - * @api - */ +/* @api */ define([ 'jquery', 'Magento_Payment/js/view/payment/cc-form', diff --git a/app/code/Magento/Payment/view/frontend/web/js/view/payment/method-renderer/free-method.js b/app/code/Magento/Payment/view/frontend/web/js/view/payment/method-renderer/free-method.js index addf436fcf5ee..52cce74ecc157 100644 --- a/app/code/Magento/Payment/view/frontend/web/js/view/payment/method-renderer/free-method.js +++ b/app/code/Magento/Payment/view/frontend/web/js/view/payment/method-renderer/free-method.js @@ -3,9 +3,7 @@ * See COPYING.txt for license details. */ -/** - * @api - */ +/* @api */ define([ 'Magento_Checkout/js/view/payment/default', 'Magento_Checkout/js/model/quote' diff --git a/app/code/Magento/Payment/view/frontend/web/js/view/payment/payments.js b/app/code/Magento/Payment/view/frontend/web/js/view/payment/payments.js index 450e3510e9169..76d828a0fdacd 100644 --- a/app/code/Magento/Payment/view/frontend/web/js/view/payment/payments.js +++ b/app/code/Magento/Payment/view/frontend/web/js/view/payment/payments.js @@ -3,9 +3,7 @@ * See COPYING.txt for license details. */ -/** - * @api - */ +/* @api */ define([ 'uiComponent', 'Magento_Checkout/js/model/payment/renderer-list' diff --git a/app/code/Magento/Payment/view/frontend/web/transparent.js b/app/code/Magento/Payment/view/frontend/web/transparent.js index 734d6ecea3687..468426b03ad3a 100644 --- a/app/code/Magento/Payment/view/frontend/web/transparent.js +++ b/app/code/Magento/Payment/view/frontend/web/transparent.js @@ -3,9 +3,7 @@ * See COPYING.txt for license details. */ -/** - * @api - */ +/* @api */ define([ 'jquery', 'mage/template', From f632cc08c6165a147cc2e5b60f6a62050e936fc3 Mon Sep 17 00:00:00 2001 From: Volodymyr Kublytskyi Date: Fri, 24 Mar 2017 14:05:52 +0200 Subject: [PATCH 07/10] MAGETWO-66609: Cover Vault module with @api annotation - fixed code style --- app/code/Magento/Vault/view/adminhtml/web/js/vault.js | 4 +--- .../Vault/view/frontend/web/js/view/payment/vault-enabler.js | 4 +--- .../Magento/Vault/view/frontend/web/js/view/payment/vault.js | 4 +--- 3 files changed, 3 insertions(+), 9 deletions(-) diff --git a/app/code/Magento/Vault/view/adminhtml/web/js/vault.js b/app/code/Magento/Vault/view/adminhtml/web/js/vault.js index 18b80291a0dcf..3429ea38ec5ae 100644 --- a/app/code/Magento/Vault/view/adminhtml/web/js/vault.js +++ b/app/code/Magento/Vault/view/adminhtml/web/js/vault.js @@ -4,9 +4,7 @@ */ /*browser:true*/ /*global define*/ -/** - * @api - */ +/* @api */ define([ 'jquery', 'uiComponent' diff --git a/app/code/Magento/Vault/view/frontend/web/js/view/payment/vault-enabler.js b/app/code/Magento/Vault/view/frontend/web/js/view/payment/vault-enabler.js index d3373c94cdd46..8fa5654b35a67 100644 --- a/app/code/Magento/Vault/view/frontend/web/js/view/payment/vault-enabler.js +++ b/app/code/Magento/Vault/view/frontend/web/js/view/payment/vault-enabler.js @@ -4,9 +4,7 @@ */ /*browser:true*/ /*global define*/ -/** - * @api - */ +/* @api */ define( [ 'uiElement' diff --git a/app/code/Magento/Vault/view/frontend/web/js/view/payment/vault.js b/app/code/Magento/Vault/view/frontend/web/js/view/payment/vault.js index d9ac8f2fcc22e..8fabddf9e4bb9 100644 --- a/app/code/Magento/Vault/view/frontend/web/js/view/payment/vault.js +++ b/app/code/Magento/Vault/view/frontend/web/js/view/payment/vault.js @@ -4,9 +4,7 @@ */ /*browser:true*/ /*global define*/ -/** - * @api - */ +/* @api */ define([ 'underscore', 'uiComponent', From 43472c5e38d1e20521106eb20dd58df27ecd0d5f Mon Sep 17 00:00:00 2001 From: Volodymyr Kublytskyi Date: Fri, 24 Mar 2017 14:08:13 +0200 Subject: [PATCH 08/10] MAGETWO-66608: Cover OfflineShipping module with @api annotation - fixed code style --- app/code/Magento/OfflineShipping/Model/Carrier/Pickup.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/OfflineShipping/Model/Carrier/Pickup.php b/app/code/Magento/OfflineShipping/Model/Carrier/Pickup.php index e9d3a35431b61..ccd64461f4e2d 100644 --- a/app/code/Magento/OfflineShipping/Model/Carrier/Pickup.php +++ b/app/code/Magento/OfflineShipping/Model/Carrier/Pickup.php @@ -59,7 +59,7 @@ public function __construct( /** * @param RateRequest $request * @return \Magento\Shipping\Model\Rate\Result - * @SuppressWarnings(PHPMD.UnusedLocalVariable) + * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ public function collectRates(RateRequest $request) { From 6faedcefb9555569095cd8c7bcca4aacc4d55f59 Mon Sep 17 00:00:00 2001 From: Volodymyr Kublytskyi Date: Fri, 24 Mar 2017 14:08:41 +0200 Subject: [PATCH 09/10] MAGETWO-66607: Cover OfflinePayments module with @api annotation - fixed code style --- .../js/view/payment/method-renderer/banktransfer-method.js | 4 +--- .../js/view/payment/method-renderer/cashondelivery-method.js | 4 +--- .../web/js/view/payment/method-renderer/checkmo-method.js | 4 +--- .../js/view/payment/method-renderer/purchaseorder-method.js | 4 +--- .../view/frontend/web/js/view/payment/offline-payments.js | 4 +--- 5 files changed, 5 insertions(+), 15 deletions(-) diff --git a/app/code/Magento/OfflinePayments/view/frontend/web/js/view/payment/method-renderer/banktransfer-method.js b/app/code/Magento/OfflinePayments/view/frontend/web/js/view/payment/method-renderer/banktransfer-method.js index 5ade9f29283a0..1e0fabb02833e 100644 --- a/app/code/Magento/OfflinePayments/view/frontend/web/js/view/payment/method-renderer/banktransfer-method.js +++ b/app/code/Magento/OfflinePayments/view/frontend/web/js/view/payment/method-renderer/banktransfer-method.js @@ -3,9 +3,7 @@ * See COPYING.txt for license details. */ -/** - * @api - */ +/* @api */ define([ 'ko', 'Magento_Checkout/js/view/payment/default' diff --git a/app/code/Magento/OfflinePayments/view/frontend/web/js/view/payment/method-renderer/cashondelivery-method.js b/app/code/Magento/OfflinePayments/view/frontend/web/js/view/payment/method-renderer/cashondelivery-method.js index 37cde75ec34fd..9c1e6b5ca933f 100644 --- a/app/code/Magento/OfflinePayments/view/frontend/web/js/view/payment/method-renderer/cashondelivery-method.js +++ b/app/code/Magento/OfflinePayments/view/frontend/web/js/view/payment/method-renderer/cashondelivery-method.js @@ -3,9 +3,7 @@ * See COPYING.txt for license details. */ -/** - * @api - */ +/* @api */ define([ 'Magento_Checkout/js/view/payment/default' ], function (Component) { diff --git a/app/code/Magento/OfflinePayments/view/frontend/web/js/view/payment/method-renderer/checkmo-method.js b/app/code/Magento/OfflinePayments/view/frontend/web/js/view/payment/method-renderer/checkmo-method.js index a1e995b94fdb3..4e80301057691 100644 --- a/app/code/Magento/OfflinePayments/view/frontend/web/js/view/payment/method-renderer/checkmo-method.js +++ b/app/code/Magento/OfflinePayments/view/frontend/web/js/view/payment/method-renderer/checkmo-method.js @@ -3,9 +3,7 @@ * See COPYING.txt for license details. */ -/** - * @api - */ +/* @api */ define([ 'Magento_Checkout/js/view/payment/default' ], function (Component) { diff --git a/app/code/Magento/OfflinePayments/view/frontend/web/js/view/payment/method-renderer/purchaseorder-method.js b/app/code/Magento/OfflinePayments/view/frontend/web/js/view/payment/method-renderer/purchaseorder-method.js index 12194bba5bc38..f1b7b28857d65 100644 --- a/app/code/Magento/OfflinePayments/view/frontend/web/js/view/payment/method-renderer/purchaseorder-method.js +++ b/app/code/Magento/OfflinePayments/view/frontend/web/js/view/payment/method-renderer/purchaseorder-method.js @@ -3,9 +3,7 @@ * See COPYING.txt for license details. */ -/** - * @api - */ +/* @api */ define([ 'Magento_Checkout/js/view/payment/default', 'jquery', diff --git a/app/code/Magento/OfflinePayments/view/frontend/web/js/view/payment/offline-payments.js b/app/code/Magento/OfflinePayments/view/frontend/web/js/view/payment/offline-payments.js index 96b526f3e9e7e..bbb40fa6442a7 100644 --- a/app/code/Magento/OfflinePayments/view/frontend/web/js/view/payment/offline-payments.js +++ b/app/code/Magento/OfflinePayments/view/frontend/web/js/view/payment/offline-payments.js @@ -3,9 +3,7 @@ * See COPYING.txt for license details. */ -/** - * @api - */ +/* @api */ define([ 'uiComponent', 'Magento_Checkout/js/model/payment/renderer-list' From 44e2de8911cc048eac29cce4091cc64351e2acb6 Mon Sep 17 00:00:00 2001 From: Volodymyr Kublytskyi Date: Fri, 24 Mar 2017 16:59:24 +0200 Subject: [PATCH 10/10] MAGETWO-66608: Cover OfflineShipping module with @api annotation - removed unused code --- .../OfflineShipping/Model/Carrier/Pickup.php | 26 ++----------------- 1 file changed, 2 insertions(+), 24 deletions(-) diff --git a/app/code/Magento/OfflineShipping/Model/Carrier/Pickup.php b/app/code/Magento/OfflineShipping/Model/Carrier/Pickup.php index ccd64461f4e2d..d7fcc156681bc 100644 --- a/app/code/Magento/OfflineShipping/Model/Carrier/Pickup.php +++ b/app/code/Magento/OfflineShipping/Model/Carrier/Pickup.php @@ -63,30 +63,8 @@ public function __construct( */ public function collectRates(RateRequest $request) { - if (!$this->getConfigFlag('active')) { - return false; - } - - /** @var \Magento\Shipping\Model\Rate\Result $result */ - $result = $this->_rateResultFactory->create(); - - if (!empty($rate)) { - /** @var \Magento\Quote\Model\Quote\Address\RateResult\Method $method */ - $method = $this->_rateMethodFactory->create(); - - $method->setCarrier('pickup'); - $method->setCarrierTitle($this->getConfigData('title')); - - $method->setMethod('store'); - $method->setMethodTitle(__('Store Pickup')); - - $method->setPrice(0); - $method->setCost(0); - - $result->append($method); - } - - return $result; + // Pickup shipping method is not supported in Magento2 yet. + return false; } /**