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

(fix): 3392 - remove shopId check on payment methods for merchent orders #3393

Merged
merged 2 commits into from
Dec 12, 2017

Conversation

kieckhafer
Copy link
Member

@kieckhafer kieckhafer commented Dec 11, 2017

Fixes #3392

An error was occurring when trying to process orders as a merchant shop, using a payment method that belonged to the marketplace owner shop.

The package was checking for a packageId && a shop ID, however the shop ID was the active shop, and the packageId belongs to the marketplace shop, so if you were a merchant processing an order, there would never be a match here, causing an error.

the packageIds are specific enough where we don't need this extra shopId check.

@kieckhafer kieckhafer changed the title remove shopId check on payment methods for merchent orders (fix): 3392 - remove shopId check on payment methods for merchent orders Dec 12, 2017
Copy link
Contributor

@spencern spencern left a comment

Choose a reason for hiding this comment

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

These shopId checks seem redundant and can only really cause errors.

For Package.find.. we should either be looking for a package name + shopId or a package _id.

Looking for a package _id + shopId means that for all shopIds other than the shopId associated with the package _id that is used will fail to find a package.

@spencern
Copy link
Contributor

@zenweasel will you look at this PR as well. I think you reviewed the PR that these lines came in from and I want to be sure that I'm not missing anything important.

@spencern spencern changed the base branch from master to release-1.6.1 December 12, 2017 00:29
@brent-hoover
Copy link
Collaborator

Yes, there's absolutely no reason to check for shopId if you are grabbing the package by packageId (like @spencern said). I feel pretty confident it was probably a copy and paste artifact.

Copy link
Collaborator

@brent-hoover brent-hoover left a comment

Choose a reason for hiding this comment

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

lgtm 👍

@spencern spencern merged commit 0f50b1c into release-1.6.1 Dec 12, 2017
@spencern spencern deleted the fix-kieckhafer-removeUnneededShopIdCheck branch December 12, 2017 02:25
@spencern spencern mentioned this pull request Dec 12, 2017
Akarshit pushed a commit that referenced this pull request Jan 7, 2018
…nneededShopIdCheck

(fix): 3392 - remove shopId check on payment methods for merchent orders
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

Successfully merging this pull request may close these issues.

3 participants