|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
/** |
|
4
|
|
|
* Apache OSL-2 |
|
5
|
|
|
* Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file. |
|
6
|
|
|
*/ |
|
7
|
|
|
|
|
8
|
|
|
namespace SprykerEco\Zed\AmazonPay\Communication\Plugin\Oms\Command; |
|
9
|
|
|
|
|
10
|
|
|
use Generated\Shared\Transfer\AmazonpayCallTransfer; |
|
|
|
|
|
|
11
|
|
|
use Orm\Zed\Sales\Persistence\SpySalesOrder; |
|
|
|
|
|
|
12
|
|
|
use Spryker\Zed\Oms\Business\Util\ReadOnlyArrayObject; |
|
13
|
|
|
use SprykerEco\Shared\AmazonPay\AmazonPayConfig; |
|
14
|
|
|
|
|
15
|
|
|
/** |
|
16
|
|
|
* @method \SprykerEco\Zed\AmazonPay\Business\AmazonPayFacadeInterface getFacade() |
|
17
|
|
|
* @method \SprykerEco\Zed\AmazonPay\Business\AmazonPayBusinessFactory getFactory() |
|
18
|
|
|
*/ |
|
19
|
|
|
class CancelOrderCommandPlugin extends AbstractAmazonpayCommandPlugin |
|
20
|
|
|
{ |
|
21
|
|
|
/** |
|
22
|
|
|
* @param array $salesOrderItems |
|
23
|
|
|
* @param \Orm\Zed\Sales\Persistence\SpySalesOrder $orderEntity |
|
24
|
|
|
* @param \Spryker\Zed\Oms\Business\Util\ReadOnlyArrayObject $data |
|
25
|
|
|
* |
|
26
|
|
|
* @return array |
|
27
|
|
|
*/ |
|
28
|
|
|
public function run(array $salesOrderItems, SpySalesOrder $orderEntity, ReadOnlyArrayObject $data) |
|
29
|
|
|
{ |
|
30
|
|
|
$amazonpayCallTransfer = $this->createAmazonpayCallTransfer( |
|
31
|
|
|
$this->getPayment($salesOrderItems) |
|
32
|
|
|
); |
|
33
|
|
|
|
|
34
|
|
|
$this->getFacade()->cancelOrder($amazonpayCallTransfer); |
|
35
|
|
|
|
|
36
|
|
|
$this->populateItems($amazonpayCallTransfer, $salesOrderItems); |
|
37
|
|
|
$this->cancelSalesOrder($amazonpayCallTransfer, $data); |
|
38
|
|
|
|
|
39
|
|
|
return []; |
|
40
|
|
|
} |
|
41
|
|
|
|
|
42
|
|
|
/** |
|
43
|
|
|
* @param \Generated\Shared\Transfer\AmazonpayCallTransfer $amazonpayCallTransfer |
|
44
|
|
|
* @param \Spryker\Zed\Oms\Business\Util\ReadOnlyArrayObject $data |
|
45
|
|
|
* |
|
46
|
|
|
* @return void |
|
47
|
|
|
*/ |
|
48
|
|
|
protected function cancelSalesOrder(AmazonpayCallTransfer $amazonpayCallTransfer, ReadOnlyArrayObject $data) |
|
49
|
|
|
{ |
|
50
|
|
|
$this->getFacade()->triggerEventForRelatedItems( |
|
51
|
|
|
$amazonpayCallTransfer, |
|
52
|
|
|
$data->getArrayCopy(), |
|
53
|
|
|
AmazonPayConfig::OMS_EVENT_CANCEL |
|
54
|
|
|
); |
|
55
|
|
|
} |
|
56
|
|
|
} |
|
57
|
|
|
|
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:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths