getInitialOrderTransactionStateId example

private function createTransaction(
        string $orderId,
        string $paymentMethodId,
        Context $context
    ): string {
        $id = Uuid::randomHex();
        $transaction = [
            'id' => $id,
            'orderId' => $orderId,
            'paymentMethodId' => $paymentMethodId,
            'stateId' => $this->getInitialOrderTransactionStateId(),
            'amount' => new CalculatedPrice(100, 100, new CalculatedTaxCollection()new TaxRuleCollection(), 1),
            'payload' => '{}',
        ];

        $this->orderTransactionRepository->upsert([$transaction]$context);

        return $id;
    }

    private function createOrder(
        string $customerId,
        
Home | Imprint | This part of the site doesn't use cookies.