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

Bug: Returning "capture" status from authorizePayment does not create order transactions. #9887

Closed
lukegreaves5 opened this issue Oct 31, 2024 · 4 comments

Comments

@lukegreaves5
Copy link

lukegreaves5 commented Oct 31, 2024

Bug report

Describe the bug

As a developer who has implemented a custom payment provider, I want to auto capture the payment. This is supported according to the docs by setting the status to "captured" instead of authorized.

when returning the status "captured" in the authorizePayment method, the capturePayment method is called immediately as expected, but the order transactions are not being created in the database, resulting in the order summary amounts being incorrect. For example, the paid_total amount on the order is still the full order amount. See screenshots below.

System information

Medusa V2
Node.js version: v20.11.1
Database: Supabase
Operating system: MacOS Sonoma 14.4.1

Steps to reproduce the behavior

  1. Using a custom payment provider, set the return status in the authorizePayment method to "captured"
  2. Set the return status in the capturePayment method to "captured"
  3. Place an order
  4. Got to your medusa admin and find the order - see the incorrect outstanding amount and order summary values not representing the captured amount.

Expected behavior

Order summary amounts should represent the captured amount and the order transactions should be created in the database

Screenshots

Screenshot 2024-10-31 at 7 07 11 PM

Screenshot 2024-10-31 at 7 05 34 PM

Screenshot 2024-10-31 at 7 19 51 PM

Screenshot 2024-10-31 at 7 20 18 PM

@lukegreaves5 lukegreaves5 changed the title Returning "capture" status from authorizePayment does not create order transactions. Bug: Returning "capture" status from authorizePayment does not create order transactions. Nov 1, 2024
@sradevski
Copy link
Member

Thanks for the ticket, we'll have a look into it and let you know what the next steps are.

@lukegreaves5
Copy link
Author

Thanks @sradevski. Let me know if you would like more information or even a live demo. This bug is blocking development for me and is affecting downstream operations like fulfillment and refunds.

@fPolic
Copy link
Contributor

fPolic commented Nov 12, 2024

hey @lukegreaves5, a PR that we merged today should fix your issue.
I'll close this for now but feel free to reopen if the issue is still present after we release a patch.

@fPolic fPolic closed this as completed Nov 12, 2024
@lukegreaves5
Copy link
Author

Excellent. Thank you so much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants