Skip to content

Commit

Permalink
Merge pull request #179 from unchainedshop/stripe-intentions
Browse files Browse the repository at this point in the history
Stripe v2
  • Loading branch information
pozylon authored Jun 10, 2020
2 parents 2f4c8f8 + 7d1eee0 commit b88864c
Show file tree
Hide file tree
Showing 205 changed files with 1,324 additions and 772 deletions.
41 changes: 24 additions & 17 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,26 +1,33 @@
{
"parser": "babel-eslint",
"plugins": [
"prettier"
],
"extends": [
"airbnb-base",
"plugin:prettier/recommended"
],
"plugins": ["prettier"],
"extends": ["airbnb-base", "plugin:prettier/recommended"],
"env": {
"node": true,
"jest": true
},
"rules": {
"prettier/prettier": [ "error", {
"singleQuote": true
}],
"no-underscore-dangle": [ "error", { "allow": [
"_id",
"__MONGO_URI__",
"__MONGO_DB_NAME__",
"__SUBPROCESS_METEOR__",
"__MONGOD__"
] } ]
"prettier/prettier": [
"error",
{
"printWidth": 80,
"semi": true,
"trailingComma": "all",
"singleQuote": true,
"proseWrap": "always"
}
],
"no-underscore-dangle": [
"error",
{
"allow": [
"_id",
"__MONGO_URI__",
"__MONGO_DB_NAME__",
"__SUBPROCESS_METEOR__",
"__MONGOD__"
]
}
]
}
}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ node_modules
dockercfg
codeship.aes
.npm
/env
2 changes: 2 additions & 0 deletions codeship-services.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ ci:
context: .
dockerfile: Dockerfile
cached: true
encrypted_env_file:
- env.encrypted

controlpanel:
build:
Expand Down
2 changes: 2 additions & 0 deletions env.encrypted
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
codeship:v2
537wXcLX5UyHqPT6evSeSGFoIavxbj05FGGKnWZmUw0hTrb8glcO+MZLYBYPx/w2rZcIjiq3L3glS4nSujLksvPMKX7dt5uD3F7vyA8ZNRw1Te5NioQZP4zv6njkaaZBca0rw/kt8ezTwej2d0BEfTq8YIWWxdKlsxeXx0VqO/sGBfClQekOLyMQmtFOjo2JKeKtVuU3ECQwEm6jQknyUOqZWneq+OgZCzOfdTBF+cyui0TdNFcV6laFb0zgXZp2xKPYuUPdBOdnvm0dT/JJjbB8Ye6yAfxYamyn6t1Yr8SELWp1l08syObjLqgGzAcCgWhWjLEuJqHWFS0VNFLWU1mDfPqu0nV2iVdiadBV/shEWWLuZfHyca/hzY60dTayGPMZZ7wzHi7d5v+LSHXkUlJsH1C2vL8YME4mCLqAbmhCLrFkcVTLXqhBMkkFPmaUfcrHqOTubpVvPfq7enMtQfI7PnZFonqpmUTa0N/5/jBL0z8vvvB9QPa2BL43SDsT0fzdok4qx6Vk/13NZoOE5OFk2qMkEld99dTkFLEcV1DJCEmOzJY1PRtOi98DrGUGoQxVnj7ui/6UYZDrs6a3
27 changes: 14 additions & 13 deletions examples/minimal/.eslintrc
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
{
"parser": "babel-eslint",
"plugins": [
"meteor",
"prettier"
],
"plugins": ["meteor", "prettier"],
"extends": [
"airbnb-base",
"plugin:meteor/recommended",
Expand All @@ -18,18 +15,22 @@
"import/core-modules": ["meteor"],
"import/resolver": {
"meteor": {
"extensions": [
".jsx",
".js"
]
"extensions": [".jsx", ".js"]
}
}
},
"rules": {
"prettier/prettier": [ "error", {
"singleQuote": true
}],
"no-underscore-dangle": [ "error", { "allow": [ "_id" ] } ],
"import/no-unresolved": [ "error", { ignore: ['meteor/'] } ]
"prettier/prettier": [
"error",
{
"printWidth": 80,
"semi": true,
"trailingComma": "all",
"singleQuote": true,
"proseWrap": "always"
}
],
"no-underscore-dangle": ["error", { "allow": ["_id"] }],
"import/no-unresolved": ["error", { "ignore": ["meteor/"] }]
}
}
3 changes: 2 additions & 1 deletion examples/minimal/boot.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import 'meteor/unchained:core-documents/plugins/smallinvoice';
import 'meteor/unchained:core-payment/plugins/invoice';
import 'meteor/unchained:core-payment/plugins/invoice-prepaid';
import 'meteor/unchained:core-payment/plugins/datatrans';
import 'meteor/unchained:core-payment/plugins/stripe';
import 'meteor/unchained:core-payment/plugins/apple-iap';
import 'meteor/unchained:core-pricing/plugins/order-items';
import 'meteor/unchained:core-pricing/plugins/order-discount';
Expand Down Expand Up @@ -84,7 +85,7 @@ const initializeDatabase = () => {
\nlanguages: ${languages.join(',')}
\nuser: admin@localhost / password`);
} catch (e) {
console.log("ERROR: ", e)
console.log('ERROR: ', e);
logger.log('database was already initialized');
}
};
Expand Down
18 changes: 18 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"Marco Wettstein <[email protected]>",
"Simon Emanuel Schmid <[email protected]> (https://unchained.shop)"
],
"bugs": {
"bugs": {
"url": "https://github.com/unchainedshop/unchained/issues"
},
"scripts": {
Expand Down Expand Up @@ -58,10 +58,11 @@
"jest": "^26.0.1",
"mongodb": "^3.5.7",
"npm-run-all": "^4.1.5",
"prettier": "^2.0.5"
"prettier": "^2.0.5",
"stripe": "^8.60.0"
},
"eslintConfig": {
"extends": "@meteorjs/eslint-config-meteor"
},
"dependencies": {}
}
}
2 changes: 1 addition & 1 deletion packages/api/acl.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const checkAction = (
action,
userId,
args = emptyArray,
options = emptyObject
options = emptyObject,
) => {
const { key } = options || emptyObject;
const hasPermission = checkPermission(userId, action, ...args);
Expand Down
2 changes: 1 addition & 1 deletion packages/api/callMethod.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const filterContext = (graphqlContext) => {
Object.entries(graphqlContext).filter(([key]) => {
if (key.substr(0, 1) === '_') return false;
return true;
})
}),
);
};

Expand Down
66 changes: 33 additions & 33 deletions packages/api/errors.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,137 +9,137 @@ export const createError = (code, message) =>

export const PermissionSystemError = createError(
'PermissionSystemError',
'Permission System Error'
'Permission System Error',
);
export const NoPermissionError = createError(
'NoPermissionError',
'Not authorized'
'Not authorized',
);
export const ProductNotFoundError = createError(
'ProductNotFoundError',
'Product not found'
'Product not found',
);

export const ProductVariationNotFoundError = createError(
'ProductVariationNotFoundError',
'Product variation not found'
'Product variation not found',
);

export const ProductMediaNotFoundError = createError(
'ProductMediaNotFoundError',
'Product media not found'
'Product media not found',
);

export const ProductReviewNotFoundError = createError(
'ProductReviewNotFoundError',
'ProductReview not found'
'ProductReview not found',
);
export const ProductWrongStatusError = createError(
'ProductWrongStatusError',
'The current status of the product does not allow this operation'
'The current status of the product does not allow this operation',
);
export const AssortmentNotFoundError = createError(
'AssortmentNotFoundError',
'Assortment not found'
'Assortment not found',
);

export const FilterNotFoundError = createError(
'FilterNotFoundError',
'Filter not found'
'Filter not found',
);
export const UserNotFoundError = createError(
'UserNotFoundError',
'Product not found'
'Product not found',
);
export const UserNoCartError = createError(
'UserNoCartError',
'No open cart available to checkout'
'No open cart available to checkout',
);
export const OrderItemNotFoundError = createError(
'OrderItemNotFoundError',
'Order Item not found'
'Order Item not found',
);
export const OrderNotFoundError = createError(
'OrderNotFoundError',
'Order not found'
'Order not found',
);
export const OrderNumberAlreadyExistsError = createError(
'OrderNumberAlreadyExistsError',
'This orderNumber has already been used by another order'
'This orderNumber has already been used by another order',
);
export const OrderDiscountNotFoundError = createError(
'OrderDiscountNotFoundError',
'Order discount not found'
'Order discount not found',
);
export const OrderDeliveryNotFoundError = createError(
'OrderDeliveryNotFoundError',
'Order delivery not found'
'Order delivery not found',
);
export const OrderPaymentNotFoundError = createError(
'OrderDeliveryNotFoundError',
'Order delivery not found'
'Order delivery not found',
);
export const OrderQuantityTooLowError = createError(
'OrderQuantityTooLowError',
'Quantity cannot be lower than 1'
'Quantity cannot be lower than 1',
);
export const OrderWrongPaymentStatusError = createError(
'OrderWrongPaymentStatus',
'The current status of the payment does not allow this operation'
'The current status of the payment does not allow this operation',
);
export const OrderWrongDeliveryStatusError = createError(
'OrderWrongDeliveryStatus',
'The current status of the delivery does not allow this operation'
'The current status of the delivery does not allow this operation',
);
export const OrderWrongStatusError = createError(
'OrderWrongStatusError',
'The current status of the order does not allow this operation'
'The current status of the order does not allow this operation',
);
export const OrderCheckoutError = createError(
'OrderCheckoutError',
'A problem occured while processing the order'
'A problem occured while processing the order',
);
export const OrderPaymentConfigurationError = createError(
'OrderPaymentConfigurationError',
'Payment configuration invalid'
'Payment configuration invalid',
);
export const QuotationWrongStatusError = createError(
'QuotationWrongStatusError',
'The current status of the quotation does not allow this operation'
'The current status of the quotation does not allow this operation',
);
export const QuotationNotFoundError = createError(
'QuotationNotFoundError',
'Quotation not found'
'Quotation not found',
);
export const BookmarkAlreadyExistsError = createError(
'BookmarkAlreadyExistsError',
'Bookmark already exists'
'Bookmark already exists',
);
export const BookmarkNotFoundError = createError(
'BookmarkNotFoundError',
'Bookmark not found'
'Bookmark not found',
);
export const QueryStringRequiredError = createError(
'QueryStringRequiredError',
'Query string is required if no assortmentId is provided'
'Query string is required if no assortmentId is provided',
);
export const PaymentProviderNotFoundError = createError(
'PaymentProviderNotFoundError',
'Payment provider not found'
'Payment provider not found',
);
export const WorkNotFoundOrWrongStatus = createError(
'WorkNotFoundOrWrongStatus',
'Could not find work or no work with the correct status'
'Could not find work or no work with the correct status',
);
export const PaymentCredentialsNotFoundError = createError(
'PaymentCredentialsNotFoundError',
'Payment credentials not found'
'Payment credentials not found',
);
export const SubscriptionWrongStatusError = createError(
'SubscriptionWrongStatusError',
'The current status of the subscription does not allow this operation'
'The current status of the subscription does not allow this operation',
);
export const SubscriptionNotFoundError = createError(
'SubscriptionNotFoundError',
'Subscription not found'
'Subscription not found',
);
4 changes: 2 additions & 2 deletions packages/api/resolvers/mutations/accounts/changePassword.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export default async function (
newPassword: newHashedPassword,
newPlainPassword,
},
context
context,
) {
if (!newHashedPassword && !newPlainPassword) {
throw new Error('New password is required');
Expand All @@ -24,7 +24,7 @@ export default async function (
context,
'changePassword',
oldPassword,
newPassword
newPassword,
);
return {
success: passwordChanged,
Expand Down
Loading

0 comments on commit b88864c

Please sign in to comment.