diff --git a/.github/workflows/setup-di-compile.yml b/.github/workflows/setup-di-compile.yml index 1908706..4b95ded 100644 --- a/.github/workflows/setup-di-compile.yml +++ b/.github/workflows/setup-di-compile.yml @@ -45,4 +45,4 @@ jobs: run: docker exec magento-project-community-edition composer require mollie/magento2:"dev-master as 2.99.99" mollie/magento2-multishipping:@dev - name: Run setup:di:compile - run: docker exec magento-project-community-edition php bin/magento setup:di:compile + run: docker exec magento-project-community-edition ./retry "php bin/magento setup:di:compile" diff --git a/PlaceOrder.php b/PlaceOrder.php index 1fdd885..b2edf4d 100644 --- a/PlaceOrder.php +++ b/PlaceOrder.php @@ -163,7 +163,7 @@ private function getTotalAmount(array $orderList) } /** - * @param array $orderList + * @param OrderInterface[] $orderList * @param $storeId * @throws \Magento\Framework\Exception\NoSuchEntityException * @return array @@ -173,14 +173,14 @@ private function buildPaymentData(array $orderList, $storeId): array $firstOrder = reset($orderList); $paymentToken = $this->paymentTokenForOrder->execute($firstOrder); $method = $this->mollieHelper->getMethodCode($firstOrder); - $orderIds = array_map(function (OrderInterface $order) { return $order->getIncrementId(); }, $orderList); + $orderIds = array_map(function (OrderInterface $order) { return $order->getEntityId(); }, $orderList); $paymentData = [ 'amount' => $this->getTotalAmount($orderList), 'description' => $this->transactionDescription->forMultishippingTransaction($storeId), 'billingAddress' => $this->molliePaymentsApi->getAddressLine($firstOrder->getBillingAddress()), 'redirectUrl' => $this->multishippingTransaction->getRedirectUrl($orderList, $paymentToken), - 'webhookUrl' => $this->transaction->getWebhookUrl($storeId), + 'webhookUrl' => $this->transaction->getWebhookUrl($orderList), 'method' => $method, 'metadata' => [ 'order_ids' => implode(', ', $orderIds), diff --git a/Test/Integration/PlaceOrderTest.php b/Test/Integration/PlaceOrderTest.php index 613b5c4..ce455b2 100644 --- a/Test/Integration/PlaceOrderTest.php +++ b/Test/Integration/PlaceOrderTest.php @@ -29,7 +29,10 @@ public function testPlacesTheOrders() /** @var OrderInterface $order */ foreach ($orders as $order) { - $order->setPayment($this->objectManager->create(OrderPaymentInterface::class)->setMethod('mollie_methods_ideal')); + $payment = $this->objectManager->create(OrderPaymentInterface::class); + $payment->setMethod('mollie_methods_ideal'); + + $order->setPayment($payment); } $orderManagementMock = $this->createMock(OrderManagementInterface::class); diff --git a/etc/frontend/di.xml b/etc/frontend/di.xml index 705dd39..7c3721d 100644 --- a/etc/frontend/di.xml +++ b/etc/frontend/di.xml @@ -11,12 +11,14 @@ Mollie\Multishipping\PlaceOrder Mollie\Multishipping\PlaceOrder Mollie\Multishipping\PlaceOrder + Mollie\Multishipping\PlaceOrder Mollie\Multishipping\PlaceOrder Mollie\Multishipping\PlaceOrder Mollie\Multishipping\PlaceOrder Mollie\Multishipping\PlaceOrder Mollie\Multishipping\PlaceOrder Mollie\Multishipping\PlaceOrder + Mollie\Multishipping\PlaceOrder Mollie\Multishipping\PlaceOrder Mollie\Multishipping\PlaceOrder Mollie\Multishipping\PlaceOrder