medusajs / medusa

The world's most flexible commerce platform.
https://medusajs.com
MIT License
26.26k stars 2.67k forks source link

[Bug]: Cancelled Order does not have payments voided or outstanding amounts zeroed #10333

Closed roberttolton closed 5 days ago

roberttolton commented 5 days ago

Package.json file

{
    "name": "medusa-starter-default",
    "version": "0.0.1",
    "description": "A starter for Medusa projects.",
    "author": "Medusa (https://medusajs.com)",
    "license": "MIT",
    "keywords": [
        "sqlite",
        "postgres",
        "typescript",
        "ecommerce",
        "headless",
        "medusa"
    ],
    "scripts": {
        "build": "medusa build",
        "seed": "medusa exec ./src/scripts/seed.ts",
        "start": "medusa start",
        "dev": "medusa develop",
        "test:integration:http": "TEST_TYPE=integration:http NODE_OPTIONS=--experimental-vm-modules jest --silent=false --runInBand --forceExit",
        "test:integration:modules": "TEST_TYPE=integration:modules NODE_OPTIONS=--experimental-vm-modules jest --silent --runInBand --forceExit",
        "test:unit": "TEST_TYPE=unit NODE_OPTIONS=--experimental-vm-modules jest --silent --runInBand --forceExit"
    },
    "dependencies": {
        "@medusajs/admin-sdk": "^2.0.7",
        "@medusajs/cli": "^2.0.7",
        "@medusajs/framework": "^2.0.7",
        "@medusajs/medusa": "^2.0.7",
        "@mikro-orm/core": "5.9.7",
        "@mikro-orm/knex": "5.9.7",
        "@mikro-orm/migrations": "5.9.7",
        "@mikro-orm/postgresql": "5.9.7",
        "awilix": "^8.0.1",
        "pg": "^8.13.0"
    },
    "devDependencies": {
        "@medusajs/test-utils": "^2.0.7",
        "@mikro-orm/cli": "5.9.7",
        "@swc/core": "1.5.7",
        "@swc/jest": "^0.2.36",
        "@types/jest": "^29.5.13",
        "@types/node": "^20.0.0",
        "@types/react": "^18.3.2",
        "@types/react-dom": "^18.2.25",
        "jest": "^29.7.0",
        "prop-types": "^15.8.1",
        "react": "^18.2.0",
        "react-dom": "^18.2.0",
        "ts-node": "^10.9.2",
        "typescript": "^5.6.2",
        "vite": "^5.2.11"
    },
    "engines": {
        "node": ">=20"
    },
    "packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
}

Node.js version

v20.18.0

Database and its version

PostgreSQL 16

Operating system name and version

macOS 15.1.1

Browser name

Google Chrome

What happended?

Order page does not show correct outstanding amount or correct payment statuses.

localhost8502appordersorder_01JDR5DXS1C9Y7J4M87Y27CYCZ 2024-11-28 at 1 21 12 pm

Expected behavior

After cancelling an Order, payments should be shown as voided (and/or refunded if payment was captured) and any 'outstanding' amount should be zero.

Actual behavior

Payment is still shown as 'Pending' and Outstanding Amount on the Order is not zero.

Link to reproduction repo

n/a

fPolic commented 5 days ago

hey @roberttolton, I'll close this for now but we will create a discussion internally about improvements to the cancel order flow with the things you've mentioned.