8 use Magento\Mtf\TestStep\TestStepInterface;
36 $this->orderId = $orderId;
37 $this->webApi = $webApi;
45 $order = $this->getOrder($this->orderId);
46 $order[
'state'] =
'payment_review';
47 $order[
'status'] =
'fraud';
56 private function getOrder($incrementId)
58 $url = $_ENV[
'app_frontend_url'] .
'rest/V1/orders/';
59 $url .=
'?searchCriteria[filterGroups][0][filters][0][field]=increment_id';
60 $url .=
'&searchCriteria[filterGroups][0][filters][0][value]=' . $incrementId;
61 $this->webApi->write(
$url, [], WebapiDecorator::GET);
62 $response = json_decode($this->webApi->read(),
true);
63 $this->webApi->close();
72 private function saveOrder(array
$order)
74 $url = $_ENV[
'app_frontend_url'] .
'rest/V1/orders';
76 unset(
$order[
'payment'][
'additional_information']);
77 $this->webApi->write(
$url, [
'entity' =>
$order], WebapiDecorator::POST);
78 $response = json_decode($this->webApi->read(),
true);
79 $this->webApi->close();
81 throw new \Exception(
'Couldn\'t update order details');
__construct($orderId, WebapiDecorator $webApi)