Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(dashboard,core-flows,types,utils,medusa): Order cancelations will refund payments #10667

Merged
merged 17 commits into from
Jan 7, 2025

Conversation

riqwan
Copy link
Contributor

@riqwan riqwan commented Dec 19, 2024

what:

  • allows orders to be canceled when payments have already been made
    • any payments made will then be refunded.

RESOLVES CMRC-797
RESOLVES CMRC-798
RESOLVES CMRC-799

Copy link

vercel bot commented Dec 19, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
medusa-dashboard ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 6, 2025 2:49pm
6 Skipped Deployments
Name Status Preview Comments Updated (UTC)
api-reference ⬜️ Ignored (Inspect) Jan 6, 2025 2:49pm
api-reference-v2 ⬜️ Ignored (Inspect) Visit Preview Jan 6, 2025 2:49pm
docs-ui ⬜️ Ignored (Inspect) Visit Preview Jan 6, 2025 2:49pm
docs-v2 ⬜️ Ignored (Inspect) Visit Preview Jan 6, 2025 2:49pm
medusa-docs ⬜️ Ignored (Inspect) Visit Preview Jan 6, 2025 2:49pm
resources-docs ⬜️ Ignored (Inspect) Visit Preview Jan 6, 2025 2:49pm

Copy link

changeset-bot bot commented Dec 19, 2024

🦋 Changeset detected

Latest commit: b226570

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 65 packages
Name Type
@medusajs/dashboard Patch
@medusajs/core-flows Patch
@medusajs/types Patch
@medusajs/utils Patch
@medusajs/medusa Patch
@medusajs/order Patch
@medusajs/admin-bundler Patch
integration-tests-http Patch
@medusajs/cli Patch
@medusajs/test-utils Patch
@medusajs/api-key Patch
@medusajs/auth Patch
@medusajs/cache-inmemory Patch
@medusajs/cache-redis Patch
@medusajs/cart Patch
@medusajs/currency Patch
@medusajs/customer Patch
@medusajs/event-bus-local Patch
@medusajs/event-bus-redis Patch
@medusajs/file Patch
@medusajs/fulfillment Patch
@medusajs/index Patch
@medusajs/inventory Patch
@medusajs/link-modules Patch
@medusajs/locking Patch
@medusajs/notification Patch
@medusajs/payment Patch
@medusajs/pricing Patch
@medusajs/product Patch
@medusajs/promotion Patch
@medusajs/region Patch
@medusajs/sales-channel Patch
@medusajs/stock-location Patch
@medusajs/store Patch
@medusajs/tax Patch
@medusajs/user Patch
@medusajs/workflow-engine-inmemory Patch
@medusajs/workflow-engine-redis Patch
@medusajs/auth-emailpass Patch
@medusajs/auth-github Patch
@medusajs/auth-google Patch
@medusajs/file-local Patch
@medusajs/file-s3 Patch
@medusajs/fulfillment-manual Patch
@medusajs/locking-postgres Patch
@medusajs/locking-redis Patch
@medusajs/notification-local Patch
@medusajs/notification-sendgrid Patch
@medusajs/payment-stripe Patch
@medusajs/framework Patch
@medusajs/js-sdk Patch
@medusajs/modules-sdk Patch
@medusajs/orchestration Patch
@medusajs/workflows-sdk Patch
@medusajs/medusa-oas-cli Patch
@medusajs/oas-github-ci Patch
@medusajs/telemetry Patch
@medusajs/admin-sdk Patch
@medusajs/admin-shared Patch
@medusajs/admin-vite-plugin Patch
@medusajs/icons Patch
@medusajs/toolbox Patch
@medusajs/ui-preset Patch
create-medusa-app Patch
medusa-dev-cli Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@riqwan riqwan changed the title [WIP]: Order cancelations will refund payments feat(dashboard,core-flows,types,utils,medusa): Order cancelations will refund payments Dec 27, 2024
@riqwan riqwan marked this pull request as ready for review December 27, 2024 16:03
@riqwan riqwan requested a review from a team as a code owner December 27, 2024 16:03
@riqwan
Copy link
Contributor Author

riqwan commented Jan 6, 2025

Hey @olivermrbl, shall we wrap this project up?

Copy link
Contributor

@olivermrbl olivermrbl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall LGTM, few comments and nits

packages/core/types/src/payment/mutations.ts Outdated Show resolved Hide resolved
difference_sum: 30,
current_order_total: 0,
pending_difference: 0,
difference_sum: 0,
paid_total: 0,
refunded_total: 0,
credit_line_total: 30,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

question: On line 98-104, we had another credit line manually to the order–why is that? Is it to assert that the totals are going into the negatives?

Copy link
Contributor Author

@riqwan riqwan Jan 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not necessarily negative. Its to test if existing credit lines from the order is being taken into account before adding more from the current action. between versions, the credit_lines array will change depending on actions.

@riqwan riqwan merged commit 4759419 into develop Jan 7, 2025
24 checks passed
@riqwan riqwan deleted the feat/order-refund branch January 7, 2025 06:57
@github-actions github-actions bot mentioned this pull request Jan 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants