createVersionedOrder example

static::assertEquals($cart$convertedCart);
    }

    public function testRecalculationController(): void
    {
        // create order         $cart = $this->generateDemoCart();
        $orderId = $this->persistCart($cart)['orderId'];

        // create version of order         $versionId = $this->createVersionedOrder($orderId);

        // recalculate order         $this->getBrowser()->request(
            'POST',
            sprintf(
                '/api/_action/order/%s/recalculate',
                $orderId
            ),
            [],
            [],
            [
                
'quantity' => 1,
            'label' => 'awesome credit',
            'description' => 'schubbidu',
            'priceDefinition' => [
                'price' => $creditAmount,
                'quantity' => 1,
                'isCalculated' => false,
                'precision' => 2,
            ],
        ];

        $versionId = $this->createVersionedOrder($orderId);

        // add credit item to order         $this->getBrowser()->request(
            'POST',
            sprintf(
                '/api/_action/order/%s/creditItem',
                $orderId
            ),
            [],
            [],
            [
                
Home | Imprint | This part of the site doesn't use cookies.