Skip to content

Commit

Permalink
PT-1842: Failed Webhook Attempts (#74)
Browse files Browse the repository at this point in the history
  • Loading branch information
ivan-pugach-mondu authored Aug 30, 2024
1 parent 213fbb5 commit 9e9ff8e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -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": [
Expand Down
4 changes: 2 additions & 2 deletions src/Components/MonduApi/Service/MonduClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
7 changes: 6 additions & 1 deletion src/Components/PaymentMethod/PaymentHandler/MonduHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 9e9ff8e

Please sign in to comment.