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(payment): payment and session methods #6138

Merged
merged 46 commits into from
Feb 6, 2024

Conversation

fPolic
Copy link
Contributor

@fPolic fPolic commented Jan 19, 2024

What

  • create PaymentSession
  • create/update Payment
  • refund/capture Payment
  • DTOs update
  • change signatures of some Payment module methods

Note

  • please ignore changes related to computing and decorating amount properties since the approach will change in the future so it's still TODO

Copy link

changeset-bot bot commented Jan 19, 2024

⚠️ No Changeset found

Latest commit: 11e60bf

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

Copy link

vercel bot commented Jan 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 Feb 5, 2024 6:52pm
3 Ignored Deployments
Name Status Preview Comments Updated (UTC)
api-reference ⬜️ Ignored (Inspect) Feb 5, 2024 6:52pm
docs-ui ⬜️ Ignored (Inspect) Visit Preview Feb 5, 2024 6:52pm
medusa-docs ⬜️ Ignored (Inspect) Visit Preview Feb 5, 2024 6:52pm

Base automatically changed from feat/payment-module-payment-collection-crud to develop January 22, 2024 10:04
# Conflicts:
#	packages/payment/integration-tests/__tests__/services/payment-module/index.spec.ts
#	packages/payment/src/loaders/container.ts
#	packages/payment/src/services/payment-module.ts
#	packages/types/src/payment/mutations.ts
# Conflicts:
#	packages/payment/integration-tests/__tests__/services/payment-module/index.spec.ts
# Conflicts:
#	packages/payment/integration-tests/__tests__/services/payment-module/index.spec.ts
packages/types/src/payment/mutations.ts Outdated Show resolved Hide resolved
packages/types/src/payment/mutations.ts Outdated Show resolved Hide resolved
packages/payment/src/services/payment-module.ts Outdated Show resolved Hide resolved
packages/payment/src/models/payment.ts Show resolved Hide resolved
packages/payment/src/services/payment.ts Outdated Show resolved Hide resolved
packages/payment/src/services/payment-module.ts Outdated Show resolved Hide resolved
# Conflicts:
#	packages/payment/integration-tests/__tests__/services/payment-module/index.spec.ts
#	packages/payment/src/services/index.ts
#	packages/payment/src/services/payment-module.ts
#	packages/payment/src/types/repositories.ts
@olivermrbl
Copy link
Contributor

@carlos-r-l-rodrigues, can I get you to give this a review? Would like your eyes on the bulk methods for payment collections. Think some of them can get a bit nasty, especially when we introduce several calls to a third party provider.

@carlos-r-l-rodrigues
Copy link
Contributor

carlos-r-l-rodrigues commented Feb 6, 2024

@carlos-r-l-rodrigues, can I get you to give this a review? Would like your eyes on the bulk methods for payment collections. Think some of them can get a bit nasty, especially when we introduce several calls to a third party provider.

This is tricky, I told @fPolic that we could have bulk operations for that, but in a second thought I think that when we involve the providers the methods have to be single operations.
We can create sessions in bulk tho, but authorizing, capturing and refunding are harder to manage when a partial error happens. We revert everything on our side but we can't revert from the provider.
Call them in parallel or not is decision to make when implementing it.

@olivermrbl
Copy link
Contributor

I agree this is a tricky case. Right now, I am also leaning toward single operations. Let's discuss and address it in your follow up PR @fPolic that contains the provider implementation.

@olivermrbl olivermrbl merged commit 2104843 into develop Feb 6, 2024
17 checks passed
@olivermrbl olivermrbl deleted the feat/payment-module-payment-and-session-crud branch February 6, 2024 12:40
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.

4 participants