diff --git a/composer.json b/composer.json index 07bc7f4..2797798 100644 --- a/composer.json +++ b/composer.json @@ -1,7 +1,7 @@ { "name": "mondu/shopware6-payment", "description": "Mondu payment for Shopware 6", - "version": "1.4.0", + "version": "1.4.1", "type": "shopware-platform-plugin", "license": "proprietary", "authors": [ diff --git a/src/Components/MonduApi/Service/MonduClient.php b/src/Components/MonduApi/Service/MonduClient.php index 4b19535..9f0642c 100644 --- a/src/Components/MonduApi/Service/MonduClient.php +++ b/src/Components/MonduApi/Service/MonduClient.php @@ -75,9 +75,9 @@ public function cancelOrder($orderUid): ?string return $response['order']['state'] ?? null; } - public function confirmOrder($orderUuid): ?string + public function confirmOrder($orderUuid, $data): ?string { - $response = $this->sendRequest('orders/'. $orderUuid .'/confirm', 'POST'); + $response = $this->sendRequest('orders/'. $orderUuid .'/confirm', 'POST', $data); return $response['order']['state'] ?? null; } diff --git a/src/Components/PaymentMethod/PaymentHandler/MonduHandler.php b/src/Components/PaymentMethod/PaymentHandler/MonduHandler.php index 8c3be02..e721def 100644 --- a/src/Components/PaymentMethod/PaymentHandler/MonduHandler.php +++ b/src/Components/PaymentMethod/PaymentHandler/MonduHandler.php @@ -64,7 +64,12 @@ public function finalize(AsyncPaymentTransactionStruct $transaction, Request $re if ($paymentState === self::PAYMENT_STATE_SUCCESS) { $paymentOrderUuid = $request->query->get('order_uuid'); - $confirmResponseState = $this->monduClient->setSalesChannelId($salesChannelContext->getSalesChannelId())->confirmOrder($paymentOrderUuid); + $confirmResponseState = $this->monduClient->setSalesChannelId( + $salesChannelContext->getSalesChannelId() + )->confirmOrder( + $paymentOrderUuid, + ['external_reference_id' => $transaction->getOrder()->getOrderNumber()] + ); if (!$this->isOrderConfirmed($confirmResponseState)) { throw new CustomerCanceledAsyncPaymentException(