Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PISHPS-286: add stateMashineState #757

Merged
merged 1 commit into from
Jun 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/Controller/Storefront/Webhook/NotificationFacade.php
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,7 @@ private function getTransaction(string $transactionId, Context $context): ?Order
$criteria->addAssociation('order.transactions');
$criteria->addAssociation('order.stateMachineState');
$criteria->addAssociation('paymentMethod');
$criteria->addAssociation('stateMachineState');

return $this->repoOrderTransactions->search($criteria, $context)->first();
}
Expand Down
3 changes: 2 additions & 1 deletion src/Facade/MolliePaymentFinalize.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,8 @@ public function __construct(OrderStatusConverter $orderStatusConverter, OrderSta
*/
public function finalize(AsyncPaymentTransactionStruct $transactionStruct, SalesChannelContext $salesChannelContext): void
{
$order = $transactionStruct->getOrder();
$order = $this->orderService->getOrder($transactionStruct->getOrder()->getId(), $salesChannelContext->getContext());

$customFields = $order->getCustomFields() ?? [];
$customFieldsStruct = new OrderAttributes($order);
$mollieOrderId = $customFieldsStruct->getMollieOrderId();
Expand Down
2 changes: 1 addition & 1 deletion src/Service/Order/OrderStatusUpdater.php
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ public function updateOrderStatus(OrderEntity $order, string $statusTo, MollieSe
# let's check if we have configured a final order state.
# if so, we need to verify, if a transition is even allowed
if (! empty($settings->getOrderStateFinalState())) {
$currentId = ($stateMachine instanceof StateMachineStateEntity) ? $stateMachine->getId() : '';
$currentId = ($stateMachine instanceof StateMachineStateEntity) ? $stateMachine->getId() : $order->getStateId();

# test if our current order does already have
# our configured final order state
Expand Down
1 change: 1 addition & 0 deletions src/Service/OrderService.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ public function getOrder(string $orderId, Context $context): OrderEntity
$criteria->addAssociation('billingAddress'); # important for subscription creation
$criteria->addAssociation('billingAddress.country');
$criteria->addAssociation('orderCustomer');
$criteria->addAssociation('stateMachineState');
$criteria->addAssociation('orderCustomer.customer');
$criteria->addAssociation('orderCustomer.salutation');
$criteria->addAssociation('language');
Expand Down
Loading