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

Receive error in server console after placing an order for a single shop in multi-shop mode #3024

Closed
zenweasel opened this issue Oct 4, 2017 · 7 comments
Assignees

Comments

@zenweasel
Copy link
Collaborator

Expected behavior

No errors

Actual Behavior

Receive this error in console:

Exception while invoking method 'orders/refunds/list' TypeError: Cannot read property 'paymentMethod' of undefined
    at [object Object].ordersRefundsList (server/methods/core/orders.js:953:27)
    at packages/check.js:128:16
    at [object Object].EVp.withValue (packages/meteor.js:1134:15)
    at Object.exports.Match._failIfArgumentsAreNotAllChecked (packages/check.js:127:41)
    at maybeAuditArgumentChecks (packages/ddp-server/livedata_server.js:1765:18)
    at packages/ddp-server/livedata_server.js:719:19
    at [object Object].EVp.withValue (packages/meteor.js:1134:15)
    at packages/ddp-server/livedata_server.js:717:46
    at [object Object].EVp.withValue (packages/meteor.js:1134:15)
    at packages/ddp-server/livedata_server.js:715:46
    at [object Object]._.extend.protocol_handlers.method (packages/ddp-server/livedata_server.js:689:23)
    at packages/ddp-server/livedata_server.js:559:43

This seems to be because this function is returning the paymentMethod for the wrong shop (only the current shop)

export function orderCreditMethod(order) {

Steps to Reproduce the Behavior

  1. Create a marketplace shop and create a product for that shop
  2. Place only that product in the cart and checkout
  3. Observe the error

Versions

Node: 7.10.0
NPM: 5.3.0
Meteor Node: 4.8.4
Meteor NPM: 4.6.1
Reaction CLI: 0.13.1
Reaction: 1.5.0
Reaction branch: brent-fix-issue-2836
Docker: 17.09.0-ce
@kieha kieha self-assigned this Oct 4, 2017
@spencern
Copy link
Contributor

spencern commented Oct 6, 2017

What's the status on this?

@kieha
Copy link
Contributor

kieha commented Oct 6, 2017

Started looking into this but put it on hold to wrap up with #2832. I'll remove my assignment just so someone else not currently working on anything could pick it up, but I'll get back to it once done with my current task if it'll still be unassigned.

@kieha kieha assigned kieha and unassigned kieha Oct 6, 2017
@spencern
Copy link
Contributor

spencern commented Oct 6, 2017

@kieha how's this issue coming along?

@kieha
Copy link
Contributor

kieha commented Oct 6, 2017

Update:

-If you're in shop A, and you buy a product from shop B, and then complete the order in shop A, this function

export function orderCreditMethod(order) {

returns undefined as the shopId of that order's billing record is that of shop B, hence the error.

Solution:

  • returning an empty object if the function returns undefined, and build up variables that won't throw further errors were the function is used.

@spencern
Copy link
Contributor

spencern commented Oct 9, 2017

@kieha will you post an update here about what was decided with this issue? Based on this morning's conversation, it seems like we're ready to resolve it either now or with minimal changes.

@kieha
Copy link
Contributor

kieha commented Oct 9, 2017

@spencern this is being partially resolved with minimal changes, i.e. iterating over the billing and shipping records and getting the appropriate information from that to use in the email notification. However, a separate issue was opened here #3065 to make the notifications multi-shop aware.

@spencern
Copy link
Contributor

Resolved by #3064

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

3 participants