-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Updated Apps, payment packages #1592
Conversation
aaronjudd
commented
Nov 27, 2016
•
edited
Loading
edited
- single card payment layout
- updated / refactored Reaction.Apps
- normalization of client Packages moved to publication
- PayPal and PayFlow split out
- removes default payment method and collapse handling in checkout
- commented dashboard default method settings. TBD.
- resolves Group payment methods into single app card #1408
- adds object-curly-spacing lint rule
- adds significant i18n to payments, makes local
- adds translations to month helpers
Updated package registry handling, updates for payments.
Resolve `websocket because it does not appear in the connect-src directive of the Content Security Policy` error in safari when using —production build.
- removes name from some payment method registry entries - use name if separate settings and permissions are needed - applies permission checks in package publication for filtering enabled views - uses package name as default settings key, used when no name
- Cleanup handling in taxes, discounts, catalog package handling - Fix error where registry update was overwriting existing settings - use mergeDeep for registry updates
- remove excessive panels - add i18n - generic alerts - convert panel-title to alert info - show alert message only pre-setup
momentjs:moment upgraded from 2.16.0 to 2.17.0
- Process multiple matching entries in registry - adds i18n for PayPal client views - splits PayPal into two payment methods for settings/checkout - todo add migration for express_enabled to express.enabled - todo add migration for payflow_enabled to payflow.enabled - add browser policy akamai.mathtag.com - apply standard button style + i18n to all payment settings
- single card payment layout - removes default payment method and collapse handling in checkout - commented in dashboard payment settings. TBD. - resolves #1408
// Meteor.call("discounts/setRate", cartToCalc._id, discountRate); | ||
if (cartToCalc.discountMethods) { | ||
for (discountMethods of cartToCalc.discountMethods) { | ||
// get discount based on id in cartMethods. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So is this just a placeholder for a forthcoming implementation of the discount calculation?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, just wanted to double-check that this intentionally does nothing here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correct.. it's no harm, no foul at this point...
import { Reaction, i18next } from "/client/api"; | ||
import { Packages } from "/lib/collections"; | ||
|
||
import {Meteor} from "meteor/meteor"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't we keep the spaces around imports consistent?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apparently a beautifier rule that wasn't working before.
No, this should go ahead and be merged -> it does have the placeholders for rates, and codes, but it's not really related functionality at this point (although had to be done to add codes in the checkout the way I want) |
import _ from "lodash"; | ||
import {Reaction} from "/client/api"; | ||
import {Packages} from "/lib/collections"; | ||
import {Template} from "meteor/templating"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bracket spacing, import order.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we have a rule to enforce this? "space_in_paren": true
in the .jsbeautifyrc will add the spaces on save, but also adds in a bunch of other places. Eslint doesn't see anything wrong here.. which would leave me back to disabling .jsbeautify.. (nobody else using this I guess?).
@@ -9,6 +9,7 @@ import { Reaction } from "/client/api"; | |||
import { Shops, Translations } from "/lib/collections"; | |||
import * as Schemas from "/lib/collections/schemas"; | |||
import i18next, { packageNamespaces, getLabelsFor, getMessagesFor, i18nextDep } from "./main"; | |||
import {mergeDeep} from "/lib/api"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bracket spacing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like we need to add the space-in-brackets
rule (and make arrays an exception).
http://eslint.org/docs/rules/space-in-brackets
Probably something like...
"space-in-brackets": [2, "always", {
"arraysInArrays": false,
"arraysInObjects": false
}]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This rule was removed in ESLint v1.0 and replaced by the object-curly-spacing and array-bracket-spacing rules.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alrighty...
"object-curly-spacing": [2, "always"],
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"sort-imports": ["error", {
"ignoreCase": false,
"ignoreMemberSort": false,
"memberSyntaxSortOrder": ["none", "all", "multiple", "single"]
}],
"object-curly-spacing": ["error", "always", { "objectsInObjects": true }],
However, that's going to change 90 files, as --fix rightfully adds spacing to objects all over the place. I'm actually cool with that, but it's new...
Sorts rule isn't quite advanced enough to enforce our rules (I think this basically is just alphabetical).
Checking out with the Example payment method I see this error in the console. Order does complete however.
|
I wonder if we shouldn't throw up a warning in the settings panel if no Payment packages are enabled? |
Seeing this message (not an error) in the console when PayPal PayFlow is enabled:
|
I did update the way |
re: client side validation - no, there is not any validation to speak of other than autoform stuff. nothing new here. however, I've been talking about having a credit card / payment method component for a while, to replace this input form with a nice modern input validator, aka card.js etc. I was holding myself back, but if you are suggesting it's a must have.. |
@@ -16,7 +16,9 @@ | |||
}, | |||
"paymentSettings": { | |||
"authorizenetLabel": "Authorize.net", | |||
"authorizenetSettingsLabel": "Authorize.net" | |||
"authorizenetSettingsLabel": "Authorize.net", | |||
"authorizenetCredentials": "Don't have a AuthNet API Login ID and Transaction Key?", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should probably be "an Authnet"?
Approved - Except for the couple of minor things I think this is a nice step forward, especially on the consumer-side where I thought that part was probably confusing. |
It seems like Paypal Express is enabled by default? |
This checkbox looks a little odd (Paypal Express) |
the way it's setup now, you'll see all the payment methods if you are logged in as admin in checkout, the view restriction is permission based now (or at least partially) (see the transform in Packages publication). I'd like to see us narrow this down with an implementation of "audience" permissions checks. The consumer/client should only be seeing what's enabled. |
re: defaults, I set the initial to have "PayPal express" and "Example" enabled. |
- could have just used if in template, or alternate display - but this is clean and simple for now.
Fix error loading moment for template helpers.
- remove Authnet/dashboard - unused legacy settings?
@zenweasel All issues you reported should now be addressed. Ready to merge. |