-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Http Cart type payment_collection field is not a list #9738
Comments
I'm just dumb and wrote bad code |
Turns out not entirely my fault. Seems that sometimes cart.payment_collection is an object, and other times it is an array. It has seems to become an array if you hit a "Could not delete all payment sessions" error, at which point it will stay an array. Not sure how to reproduce as yet, but will keep trying to investigate |
Seems to be the case if you create two payment collections in quick succession (So still bad code that you shouldn't write) |
@vethan, do you mean you send two requests using the JS-SDK method |
I was calling |
Bug report
Describe the bug
Line 76 medusa/packages/core/types/src/http/cart/common.ts reads:
payment_collection?: BasePaymentCollection
However a list of payment collections is passed when requests are made from the backend. Should either the medusa backend should send single objects, or this type should be
BasePaymentCollection[]
System information
Medusa version (including plugins): 2.0.0
Node.js version: N/A
Database:N/A
Operating system:N/A
Browser (if relevant):
Steps to reproduce the behavior
Expected behavior
Either cart.payment_collection.payment_sessions should contain payment sessions, or the type should be a list
Screenshots
If applicable, add screenshots to help explain your problem
N/A
Code snippets
If applicable, add code samples to help explain your problem
N/A
Additional context
Add any other context about the problem here
N/A
The text was updated successfully, but these errors were encountered: