diff --git a/src/app/[locale]/checkout/page.tsx b/src/app/[locale]/checkout/page.tsx index 6d37ed6..c371993 100644 --- a/src/app/[locale]/checkout/page.tsx +++ b/src/app/[locale]/checkout/page.tsx @@ -19,7 +19,6 @@ import { CHECKOUT_METADATA_UPDATE, CHECKOUT_SHIPPING_METHOD_UPDATE, } from "@/lib/saleor/mutations/Checkout"; -import { CREATE_TRANSACTION_MUTATION } from "@/lib/saleor/payments/cod"; import { PaymentSection } from "./components/PaymentSection"; import { DEFAULT_PAYMENT_METHOD } from "@/lib/config/paymentMethods"; import { GET_CHECKOUT_BY_ID } from "@/lib/saleor/queries/Checkout"; @@ -386,37 +385,6 @@ export default function CheckoutPage() { const order = completeResult.data?.checkoutComplete?.order; if (order) { setOrderNumber(order.number); - - // Create COD transaction for the order - if (selectedPaymentMethod === 'cod') { - console.log("Step 6: Creating COD transaction..."); - try { - await saleorClient.mutate({ - mutation: CREATE_TRANSACTION_MUTATION, - variables: { - id: order.id, - transaction: { - name: "Cash on Delivery", - pspReference: `COD-${order.number}-${Date.now()}`, - availableActions: ["CHARGE"], - amountAuthorized: { - amount: 0, - currency: "RSD" - }, - amountCharged: { - amount: 0, - currency: "RSD" - } - } - } - }); - console.log("Step 6: COD transaction created successfully"); - } catch (txError) { - console.error("Failed to create COD transaction:", txError); - // Don't fail the order if transaction creation fails - } - } - setOrderComplete(true); // Track order completion