From 9c3d8b0d11eef9fbb9c28deb2b15c3e32e506b24 Mon Sep 17 00:00:00 2001 From: Unchained Date: Sun, 29 Mar 2026 19:17:06 +0200 Subject: [PATCH] fix: Remove COD transaction creation to fix checkout errors The transaction creation was failing due to HANDLE_PAYMENTS permission issues. Removed the code to get checkout working again. Will implement via order metadata or core-extensions webhook instead. --- src/app/[locale]/checkout/page.tsx | 22 ---------------------- 1 file changed, 22 deletions(-) diff --git a/src/app/[locale]/checkout/page.tsx b/src/app/[locale]/checkout/page.tsx index 4679429..05a2c12 100644 --- a/src/app/[locale]/checkout/page.tsx +++ b/src/app/[locale]/checkout/page.tsx @@ -13,7 +13,6 @@ import { saleorClient } from "@/lib/saleor/client"; import { useAnalytics } from "@/lib/analytics"; import { CHECKOUT_SHIPPING_ADDRESS_UPDATE, - TRANSACTION_CREATE, } from "@/lib/saleor/mutations/Checkout"; import { PaymentSection } from "./components/PaymentSection"; import { DEFAULT_PAYMENT_METHOD } from "@/lib/config/paymentMethods"; @@ -307,27 +306,6 @@ export default function CheckoutPage() { setOrderNumber(result.order.number); setOrderComplete(true); - // If COD payment, create a transaction on the order - if (selectedPaymentMethod === 'cod' && result.order.id) { - try { - console.log("Creating COD transaction for order:", result.order.id); - await saleorClient.mutate({ - mutation: TRANSACTION_CREATE, - variables: { - orderId: result.order.id, - transaction: { - name: "Cash on Delivery", - message: "COD - Payment pending on delivery" - } - } - }); - console.log("COD transaction created successfully"); - } catch (txError) { - console.error("Failed to create COD transaction:", txError); - // Don't fail the checkout if transaction creation fails - } - } - // Clear the checkout/cart from the store clearCheckout();