Skip to content

Commit

Permalink
Merge branches '2.3-develop' and 'GraphQl-812-testAddVariationFromAno…
Browse files Browse the repository at this point in the history
…therConfigurableProductToCart' of github.com:magento/graphql-ce into GraphQl-812-testAddVariationFromAnotherConfigurableProductToCart

# Conflicts:
#	dev/tests/api-functional/testsuite/Magento/GraphQl/ConfigurableProduct/AddConfigurableProductToCartTest.php
  • Loading branch information
Vitaliy Boyko committed Aug 31, 2019
2 parents 2f7b1d9 + ebee07a commit 45ec553
Show file tree
Hide file tree
Showing 168 changed files with 3,691 additions and 599 deletions.
10 changes: 8 additions & 2 deletions app/code/Magento/AmqpStore/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# Amqp Store
# Magento_AmqpStore module

**AmqpStore** provides ability to specify store before publish messages with Amqp.
The Magento_AmqpStore module provides the ability to specify a store before publishing messages with the Advanced Message Queuing Protocol (AMQP).

## Extensibility

Extension developers can interact with the Magento_AmqpStore module using plugins. For more information about the Magento extension mechanism, see [Magento plug-ins](https://devdocs.magento.com/guides/v2.3/extension-dev-guide/plugins.html).

[The Magento dependency injection mechanism](https://devdocs.magento.com/guides/v2.3/extension-dev-guide/depend-inj.html) enables you to override the functionality of the Magento_AmqpStore module.
49 changes: 48 additions & 1 deletion app/code/Magento/AsynchronousOperations/README.md
Original file line number Diff line number Diff line change
@@ -1 +1,48 @@
This component is designed to provide response for client who launched the bulk operation as soon as possible and postpone handling of operations moving them to background handler.
# Magento_AsynchronousOperations module

This component is designed to provide a response for a client that launched the bulk operation as soon as possible and postpone handling of operations moving them to the background handler.

## Installation details

The Magento_AsynchronousOperations module creates the following tables in the database:

- `magento_bulk`
- `magento_operation`
- `magento_acknowledged_bulk`

Before disabling or uninstalling this module, note that the following modules depends on this module:

- Magento_WebapiAsync

For information about module installation in Magento 2, see [Enable or disable modules](https://devdocs.magento.com/guides/v2.3/install-gde/install/cli/install-cli-subcommands-enable.html).

## Extensibility

Extension developers can interact with the Magento_AsynchronousOperations module. For more information about the Magento extension mechanism, see [Magento plug-ins](https://devdocs.magento.com/guides/v2.3/extension-dev-guide/plugins.html).

[The Magento dependency injection mechanism](https://devdocs.magento.com/guides/v2.3/extension-dev-guide/depend-inj.html) enables you to override the functionality of the Magento_AsynchronousOperations module.

### Layouts

This module introduces the following layouts and layout handles in the `view/adminhtml/layout` directory:

- `bulk_bulk_details`
- `bulk_bulk_details_modal`
- `bulk_index_index`

For more information about layouts in Magento 2, see the [Layout documentation](https://devdocs.magento.com/guides/v2.3/frontend-dev-guide/layouts/layout-overview.html).

### UI components

You can extend Magento_AsynchronousOperations module using the following configuration files in the `view/adminhtml/ui_component/` directory:

- `bulk_details_form`
- `bulk_details_form_modal`
- `bulk_listing`
- `failed_operation_listing`
- `failed_operation_modal_listing`
- `notification_area`
- `retriable_operation_listing`
- `retriable_operation_modal_listing`

For information about UI components in Magento 2, see [Overview of UI components](https://devdocs.magento.com/guides/v2.3/ui_comp_guide/bk-ui_comps.html).
Original file line number Diff line number Diff line change
Expand Up @@ -59,19 +59,45 @@ public function execute(array $commandSubject): void
* @param array $commandSubject
* @return string
* @throws CommandException
* @throws \Magento\Framework\Exception\NotFoundException
*/
private function getCommand(array $commandSubject): string
{
$details = $this->commandPool->get('get_transaction_details')
->execute($commandSubject)
->get();

if ($details['transaction']['transactionStatus'] === 'capturedPendingSettlement') {
if ($this->canVoid($details, $commandSubject)) {
return self::VOID;
} elseif ($details['transaction']['transactionStatus'] !== 'settledSuccessfully') {
}

if ($details['transaction']['transactionStatus'] !== 'settledSuccessfully') {
throw new CommandException(__('This transaction cannot be refunded with its current status.'));
}

return self::REFUND;
}

/**
* Checks if void command can be performed.
*
* @param array $details
* @param array $commandSubject
* @return bool
* @throws CommandException
*/
private function canVoid(array $details, array $commandSubject) :bool
{
if ($details['transaction']['transactionStatus'] === 'capturedPendingSettlement') {
if ((float) $details['transaction']['authAmount'] !== (float) $commandSubject['amount']) {
throw new CommandException(
__('The transaction has not been settled, a partial refund is not yet available.')
);
}

return true;
}

return false;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
declare(strict_types=1);

namespace Magento\AuthorizenetAcceptjs\Gateway\Response;

use Magento\Sales\Model\Order\Payment;

/**
* Determines that parent transaction should be close for partial refund operation.
*/
class ClosePartialTransactionHandler extends CloseTransactionHandler
{
/**
* Whether parent transaction should be closed.
*
* @param Payment $payment
* @return bool
*/
public function shouldCloseParentTransaction(Payment $payment)
{
return !(bool)$payment->getCreditmemo()->getInvoice()->canRefund();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,19 @@ public function handle(array $handlingSubject, array $response): void

if ($payment instanceof Payment) {
$payment->setIsTransactionClosed($this->closeTransaction);
$payment->setShouldCloseParentTransaction(true);
$payment->setShouldCloseParentTransaction($this->shouldCloseParentTransaction($payment));
}
}

/**
* Whether parent transaction should be closed.
*
* @param Payment $payment
* @return bool
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
*/
public function shouldCloseParentTransaction(Payment $payment)
{
return true;
}
}
28 changes: 28 additions & 0 deletions app/code/Magento/AuthorizenetAcceptjs/README.md
Original file line number Diff line number Diff line change
@@ -1 +1,29 @@
# Magento_AuthorizenetAcceptjs module

The Magento_AuthorizenetAcceptjs module implements the integration with the Authorize.Net payment gateway and makes the latter available as a payment method in Magento.

## Installation details

Before disabling or uninstalling this module, note that the `Magento_AuthorizenetCardinal` module depends on this module.

For information about module installation in Magento 2, see [Enable or disable modules](https://devdocs.magento.com/guides/v2.3/install-gde/install/cli/install-cli-subcommands-enable.html).

## Structure

`Gateway/` - the directory that contains payment gateway command interfaces and service classes.

For information about typical file structure of a module in Magento 2, see [Module file structure](http://devdocs.magento.com/guides/v2.3/extension-dev-guide/build/module-file-structure.html#module-file-structure).

## Extensibility

Extension developers can interact with the Magento_AuthorizenetAcceptjs module. For more information about the Magento extension mechanism, see [Magento plug-ins](https://devdocs.magento.com/guides/v2.3/extension-dev-guide/plugins.html).

[The Magento dependency injection mechanism](https://devdocs.magento.com/guides/v2.3/extension-dev-guide/depend-inj.html) enables you to override the functionality of the Magento_AuthorizenetAcceptjs module.

### Events

This module observes the following events:

- `payment_method_assign_data_authorizenet_acceptjs` event in the `Magento\AuthorizenetAcceptjs\Observer\DataAssignObserver` file.

For information about an event in Magento 2, see [Events and observers](https://devdocs.magento.com/guides/v2.3/extension-dev-guide/events-and-observers.html#events).
Original file line number Diff line number Diff line change
Expand Up @@ -62,20 +62,75 @@ public function testCommandWillVoidWhenTransactionIsPendingSettlement()
->method('execute');

$this->commandPoolMock->method('get')
->willReturnMap([
['get_transaction_details', $this->transactionDetailsCommandMock],
['void', $this->commandMock]
]);
->willReturnMap(
[
[
'get_transaction_details',
$this->transactionDetailsCommandMock
],
[
'void',
$this->commandMock
]
]
);

$this->transactionResultMock->method('get')
->willReturn([
'transaction' => [
'transactionStatus' => 'capturedPendingSettlement'
->willReturn(
[
'transaction' => [
'transactionStatus' => 'capturedPendingSettlement',
'authAmount' => '20.19',
]
]
]);
);

$buildSubject = [
'foo' => '123'
'foo' => '123',
'amount' => '20.19',
];

$this->transactionDetailsCommandMock->expects($this->once())
->method('execute')
->with($buildSubject)
->willReturn($this->transactionResultMock);

$this->command->execute($buildSubject);
}

/**
* @expectedException \Magento\Payment\Gateway\Command\CommandException
* @expectedExceptionMessage The transaction has not been settled, a partial refund is not yet available.
*/
public function testCommandWillThrowExceptionWhenVoidTransactionIsPartial()
{
// Assert command is executed
$this->commandMock->expects($this->never())
->method('execute');

$this->commandPoolMock->method('get')
->willReturnMap(
[
[
'get_transaction_details',
$this->transactionDetailsCommandMock
],
]
);

$this->transactionResultMock->method('get')
->willReturn(
[
'transaction' => [
'transactionStatus' => 'capturedPendingSettlement',
'authAmount' => '20.19',
]
]
);

$buildSubject = [
'foo' => '123',
'amount' => '10.19',
];

$this->transactionDetailsCommandMock->expects($this->once())
Expand All @@ -93,17 +148,27 @@ public function testCommandWillRefundWhenTransactionIsSettled()
->method('execute');

$this->commandPoolMock->method('get')
->willReturnMap([
['get_transaction_details', $this->transactionDetailsCommandMock],
['refund_settled', $this->commandMock]
]);
->willReturnMap(
[
[
'get_transaction_details',
$this->transactionDetailsCommandMock
],
[
'refund_settled',
$this->commandMock
]
]
);

$this->transactionResultMock->method('get')
->willReturn([
'transaction' => [
'transactionStatus' => 'settledSuccessfully'
->willReturn(
[
'transaction' => [
'transactionStatus' => 'settledSuccessfully'
]
]
]);
);

$buildSubject = [
'foo' => '123'
Expand All @@ -128,16 +193,23 @@ public function testCommandWillThrowExceptionWhenTransactionIsInInvalidState()
->method('execute');

$this->commandPoolMock->method('get')
->willReturnMap([
['get_transaction_details', $this->transactionDetailsCommandMock],
]);
->willReturnMap(
[
[
'get_transaction_details',
$this->transactionDetailsCommandMock
],
]
);

$this->transactionResultMock->method('get')
->willReturn([
'transaction' => [
'transactionStatus' => 'somethingIsWrong'
->willReturn(
[
'transaction' => [
'transactionStatus' => 'somethingIsWrong'
]
]
]);
);

$buildSubject = [
'foo' => '123'
Expand Down
1 change: 1 addition & 0 deletions app/code/Magento/AuthorizenetAcceptjs/etc/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
<can_capture_partial>0</can_capture_partial>
<can_authorize>1</can_authorize>
<can_refund>1</can_refund>
<can_refund_partial_per_invoice>1</can_refund_partial_per_invoice>
<can_capture>1</can_capture>
<can_void>1</can_void>
<can_accept_payment>1</can_accept_payment>
Expand Down
3 changes: 1 addition & 2 deletions app/code/Magento/AuthorizenetAcceptjs/etc/di.xml
Original file line number Diff line number Diff line change
Expand Up @@ -206,8 +206,7 @@
<arguments>
<argument name="handlers" xsi:type="array">
<item name="transaction_id" xsi:type="string">Magento\AuthorizenetAcceptjs\Gateway\Response\TransactionIdHandler</item>
<item name="close_parent_transaction" xsi:type="string">Magento\AuthorizenetAcceptjs\Gateway\Response\CloseParentTransactionHandler</item>
<item name="close_transaction" xsi:type="string">Magento\AuthorizenetAcceptjs\Gateway\Response\CloseTransactionHandler</item>
<item name="close_transaction" xsi:type="string">Magento\AuthorizenetAcceptjs\Gateway\Response\ClosePartialTransactionHandler</item>
</argument>
</arguments>
</virtualType>
Expand Down
1 change: 1 addition & 0 deletions app/code/Magento/AuthorizenetAcceptjs/i18n/en_US.csv
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,4 @@ Authorize.net,Authorize.net
"ccLast4","Last 4 Digits of Card"
"There was an error while trying to process the refund.","There was an error while trying to process the refund."
"This transaction cannot be refunded with its current status.","This transaction cannot be refunded with its current status."
"The transaction has not been settled, a partial refund is not yet available.","The transaction has not been settled, a partial refund is not yet available."
24 changes: 23 additions & 1 deletion app/code/Magento/AuthorizenetCardinal/README.md
Original file line number Diff line number Diff line change
@@ -1 +1,23 @@
The AuthorizenetCardinal module provides a possibility to enable 3-D Secure 2.0 support for AuthorizenetAcceptjs payment integration.
# Magento_AuthorizenetCardinal module

Use the Magento_AuthorizenetCardinal module to enable 3D Secure 2.0 support for AuthorizenetAcceptjs payment integrations.

## Structure

`Gateway/` - the directory that contains payment gateway command interfaces and service classes.

For information about typical file structure of a module in Magento 2, see [Module file structure](https://devdocs.magento.com/guides/v2.3/extension-dev-guide/build/module-file-structure.html#module-file-structure).

## Extensibility

Extension developers can interact with the Magento_AuthorizenetCardinal module. For more information about the Magento extension mechanism, see [Magento plug-ins](https://devdocs.magento.com/guides/v2.3/extension-dev-guide/plugins.html).

[The Magento dependency injection mechanism](https://devdocs.magento.com/guides/v2.3/extension-dev-guide/depend-inj.html) enables you to override the functionality of the Magento_AuthorizenetCardinal module.

### Events

This module observes the following events:

- `payment_method_assign_data_authorizenet_acceptjs` event in the `Magento\AuthorizenetCardinal\Observer\DataAssignObserver` file.

For information about an event in Magento 2, see [Events and observers](https://devdocs.magento.com/guides/v2.3/extension-dev-guide/events-and-observers.html#events).
Loading

0 comments on commit 45ec553

Please sign in to comment.