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();