CapturePlugin   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 5
dl 0
loc 21
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A run() 0 8 1
1
<?php
2
3
/**
4
 * MIT License
5
 * For full license information, please view the LICENSE file that was distributed with this source code.
6
 */
7
8
namespace SprykerEco\Zed\Braintree\Communication\Plugin\Oms\Command;
9
10
use Generated\Shared\Transfer\TransactionMetaTransfer;
0 ignored issues
show
Bug introduced by
The type Generated\Shared\Transfer\TransactionMetaTransfer was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
11
use Orm\Zed\Sales\Persistence\SpySalesOrder;
0 ignored issues
show
Bug introduced by
The type Orm\Zed\Sales\Persistence\SpySalesOrder was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
12
use Spryker\Zed\Kernel\Communication\AbstractPlugin;
13
use Spryker\Zed\Oms\Business\Util\ReadOnlyArrayObject;
14
use Spryker\Zed\Oms\Dependency\Plugin\Command\CommandByOrderInterface;
15
16
/**
17
 * @deprecated Use `\SprykerEco\Zed\Braintree\Communication\Plugin\Oms\Command\OrderCapturePlugin` instead.
18
 *
19
 * @method \SprykerEco\Zed\Braintree\Business\BraintreeFacadeInterface getFacade()
20
 * @method \SprykerEco\Zed\Braintree\Communication\BraintreeCommunicationFactory getFactory()
21
 * @method \SprykerEco\Zed\Braintree\BraintreeConfig getConfig()
22
 * @method \SprykerEco\Zed\Braintree\Persistence\BraintreeQueryContainerInterface getQueryContainer()
23
 */
24
class CapturePlugin extends AbstractPlugin implements CommandByOrderInterface
25
{
26
    /**
27
     * {@inheritDoc}
28
     *
29
     * @api
30
     *
31
     * @param \Orm\Zed\Sales\Persistence\SpySalesOrderItem[] $orderItems
32
     * @param \Orm\Zed\Sales\Persistence\SpySalesOrder $orderEntity
33
     * @param \Spryker\Zed\Oms\Business\Util\ReadOnlyArrayObject $data
34
     *
35
     * @return array
36
     */
37
    public function run(array $orderItems, SpySalesOrder $orderEntity, ReadOnlyArrayObject $data)
38
    {
39
        $transactionMetaTransfer = new TransactionMetaTransfer();
40
        $transactionMetaTransfer->setIdSalesOrder($orderEntity->getIdSalesOrder());
41
42
        $this->getFacade()->capturePayment($transactionMetaTransfer);
0 ignored issues
show
Deprecated Code introduced by
The function SprykerEco\Zed\Braintree...rface::capturePayment() has been deprecated: Use `\SprykerEco\Zed\Braintree\Business\BraintreeFacadeInterface::captureOrderPayment()` instead. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-deprecated  annotation

42
        /** @scrutinizer ignore-deprecated */ $this->getFacade()->capturePayment($transactionMetaTransfer);

This function has been deprecated. The supplier of the function has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the function will be removed and what other function to use instead.

Loading history...
43
44
        return [];
45
    }
46
}
47