Skip to content

Commit

Permalink
Merge pull request #6 from michielgerritsen/release
Browse files Browse the repository at this point in the history
Release
  • Loading branch information
Marvin-Magmodules authored Feb 23, 2023
2 parents 1984223 + 51d3e86 commit 52e76ed
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/setup-di-compile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
6 changes: 3 additions & 3 deletions PlaceOrder.php
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ private function getTotalAmount(array $orderList)
}

/**
* @param array $orderList
* @param OrderInterface[] $orderList
* @param $storeId
* @throws \Magento\Framework\Exception\NoSuchEntityException
* @return array
Expand All @@ -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),
Expand Down
5 changes: 4 additions & 1 deletion Test/Integration/PlaceOrderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 2 additions & 0 deletions etc/frontend/di.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,14 @@
<item name="mollie_methods_bancontact" xsi:type="string">Mollie\Multishipping\PlaceOrder</item>
<item name="mollie_methods_banktransfer" xsi:type="string">Mollie\Multishipping\PlaceOrder</item>
<item name="mollie_methods_belfius" xsi:type="string">Mollie\Multishipping\PlaceOrder</item>
<item name="mollie_methods_billie" xsi:type="string">Mollie\Multishipping\PlaceOrder</item>
<item name="mollie_methods_creditcard" xsi:type="string">Mollie\Multishipping\PlaceOrder</item>
<item name="mollie_methods_directdebit" xsi:type="string">Mollie\Multishipping\PlaceOrder</item>
<item name="mollie_methods_eps" xsi:type="string">Mollie\Multishipping\PlaceOrder</item>
<item name="mollie_methods_giftcard" xsi:type="string">Mollie\Multishipping\PlaceOrder</item>
<item name="mollie_methods_giropay" xsi:type="string">Mollie\Multishipping\PlaceOrder</item>
<item name="mollie_methods_ideal" xsi:type="string">Mollie\Multishipping\PlaceOrder</item>
<item name="mollie_methods_in3" xsi:type="string">Mollie\Multishipping\PlaceOrder</item>
<item name="mollie_methods_kbc" xsi:type="string">Mollie\Multishipping\PlaceOrder</item>
<item name="mollie_methods_klarnapaylater" xsi:type="string">Mollie\Multishipping\PlaceOrder</item>
<item name="mollie_methods_klarnasliceit" xsi:type="string">Mollie\Multishipping\PlaceOrder</item>
Expand Down

0 comments on commit 52e76ed

Please sign in to comment.