reorganize payments files (#10235)
This commit is contained in:
@@ -21,9 +21,9 @@ import { encrypt } from '../../libs/encryption';
|
||||
import { sendNotification as sendPushNotification } from '../../libs/pushNotifications';
|
||||
import pusher from '../../libs/pusher';
|
||||
import common from '../../../common';
|
||||
import payments from '../../libs/payments';
|
||||
import stripePayments from '../../libs/stripePayments';
|
||||
import amzLib from '../../libs/amazonPayments';
|
||||
import payments from '../../libs/payments/payments';
|
||||
import stripePayments from '../../libs/payments/stripe';
|
||||
import amzLib from '../../libs/payments/amazon';
|
||||
import shared from '../../../common';
|
||||
import apiMessages from '../../libs/apiMessages';
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import {
|
||||
BadRequest,
|
||||
} from '../../../libs/errors';
|
||||
import amzLib from '../../../libs/amazonPayments';
|
||||
import amzLib from '../../../libs/payments/amazon';
|
||||
import {
|
||||
authWithHeaders,
|
||||
authWithUrl,
|
||||
|
||||
@@ -5,8 +5,8 @@ import {
|
||||
import {
|
||||
BadRequest,
|
||||
} from '../../../libs/errors';
|
||||
import googlePayments from '../../../libs/googlePayments';
|
||||
import applePayments from '../../../libs/applePayments';
|
||||
import googlePayments from '../../../libs/payments/google';
|
||||
import applePayments from '../../../libs/payments/apple';
|
||||
|
||||
let api = {};
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* eslint-disable camelcase */
|
||||
import paypalPayments from '../../../libs/paypalPayments';
|
||||
import paypalPayments from '../../../libs/payments/paypal';
|
||||
import shared from '../../../../common';
|
||||
import {
|
||||
authWithUrl,
|
||||
|
||||
@@ -3,7 +3,7 @@ import {
|
||||
authWithHeaders,
|
||||
authWithUrl,
|
||||
} from '../../../middlewares/auth';
|
||||
import stripePayments from '../../../libs/stripePayments';
|
||||
import stripePayments from '../../../libs/payments/stripe';
|
||||
|
||||
let api = {};
|
||||
|
||||
|
||||
@@ -5,19 +5,19 @@ import cc from 'coupon-code';
|
||||
import uuid from 'uuid';
|
||||
import util from 'util';
|
||||
|
||||
import common from '../../common';
|
||||
import common from '../../../common';
|
||||
import {
|
||||
BadRequest,
|
||||
NotAuthorized,
|
||||
NotFound,
|
||||
} from './errors';
|
||||
} from '../errors';
|
||||
import payments from './payments';
|
||||
import { model as User } from '../models/user';
|
||||
import { model as User } from '../../models/user';
|
||||
import {
|
||||
model as Group,
|
||||
basicFields as basicGroupFields,
|
||||
} from '../models/group';
|
||||
import { model as Coupon } from '../models/coupon';
|
||||
} from '../../models/group';
|
||||
import { model as Coupon } from '../../models/coupon';
|
||||
|
||||
// TODO better handling of errors
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
import shared from '../../common';
|
||||
import iap from './inAppPurchases';
|
||||
import shared from '../../../common';
|
||||
import iap from '../inAppPurchases';
|
||||
import payments from './payments';
|
||||
import {
|
||||
NotAuthorized,
|
||||
BadRequest,
|
||||
} from './errors';
|
||||
import { model as IapPurchaseReceipt } from '../models/iapPurchaseReceipt';
|
||||
import {model as User } from '../models/user';
|
||||
} from '../errors';
|
||||
import { model as IapPurchaseReceipt } from '../../models/iapPurchaseReceipt';
|
||||
import {model as User } from '../../models/user';
|
||||
import moment from 'moment';
|
||||
|
||||
let api = {};
|
||||
@@ -1,12 +1,12 @@
|
||||
import shared from '../../common';
|
||||
import iap from './inAppPurchases';
|
||||
import shared from '../../../common';
|
||||
import iap from '../inAppPurchases';
|
||||
import payments from './payments';
|
||||
import {
|
||||
NotAuthorized,
|
||||
BadRequest,
|
||||
} from './errors';
|
||||
import { model as IapPurchaseReceipt } from '../models/iapPurchaseReceipt';
|
||||
import {model as User } from '../models/user';
|
||||
} from '../errors';
|
||||
import { model as IapPurchaseReceipt } from '../../models/iapPurchaseReceipt';
|
||||
import {model as User } from '../../models/user';
|
||||
import moment from 'moment';
|
||||
|
||||
let api = {};
|
||||
@@ -1,23 +1,23 @@
|
||||
import _ from 'lodash';
|
||||
import nconf from 'nconf';
|
||||
import analytics from './analyticsService';
|
||||
import analytics from '../analyticsService';
|
||||
import {
|
||||
getUserInfo,
|
||||
sendTxn as txnEmail,
|
||||
} from './email';
|
||||
} from '../email';
|
||||
import moment from 'moment';
|
||||
import { sendNotification as sendPushNotification } from './pushNotifications';
|
||||
import shared from '../../common';
|
||||
import { sendNotification as sendPushNotification } from '../pushNotifications';
|
||||
import shared from '../../../common';
|
||||
import {
|
||||
model as Group,
|
||||
basicFields as basicGroupFields,
|
||||
} from '../models/group';
|
||||
import { model as User } from '../models/user';
|
||||
} from '../../models/group';
|
||||
import { model as User } from '../../models/user';
|
||||
import {
|
||||
NotAuthorized,
|
||||
NotFound,
|
||||
} from './errors';
|
||||
import slack from './slack';
|
||||
} from '../errors';
|
||||
import slack from '../slack';
|
||||
|
||||
const TECH_ASSISTANCE_EMAIL = nconf.get('EMAILS:TECH_ASSISTANCE_EMAIL');
|
||||
const JOINED_GROUP_PLAN = 'joined group plan';
|
||||
@@ -6,19 +6,19 @@ import _ from 'lodash';
|
||||
import payments from './payments';
|
||||
import ipn from 'paypal-ipn';
|
||||
import paypal from 'paypal-rest-sdk';
|
||||
import shared from '../../common';
|
||||
import shared from '../../../common';
|
||||
import cc from 'coupon-code';
|
||||
import { model as Coupon } from '../models/coupon';
|
||||
import { model as User } from '../models/user';
|
||||
import { model as Coupon } from '../../models/coupon';
|
||||
import { model as User } from '../../models/user';
|
||||
import {
|
||||
model as Group,
|
||||
basicFields as basicGroupFields,
|
||||
} from '../models/group';
|
||||
} from '../../models/group';
|
||||
import {
|
||||
BadRequest,
|
||||
NotAuthorized,
|
||||
NotFound,
|
||||
} from './errors';
|
||||
} from '../errors';
|
||||
|
||||
|
||||
const BASE_URL = nconf.get('BASE_URL');
|
||||
@@ -2,20 +2,20 @@ import stripeModule from 'stripe';
|
||||
import nconf from 'nconf';
|
||||
import cc from 'coupon-code';
|
||||
import moment from 'moment';
|
||||
import logger from './logger';
|
||||
import logger from '../logger';
|
||||
import {
|
||||
BadRequest,
|
||||
NotAuthorized,
|
||||
NotFound,
|
||||
} from './errors';
|
||||
} from '../errors';
|
||||
import payments from './payments';
|
||||
import { model as User } from '../models/user';
|
||||
import { model as Coupon } from '../models/coupon';
|
||||
import { model as User } from '../../models/user';
|
||||
import { model as Coupon } from '../../models/coupon';
|
||||
import {
|
||||
model as Group,
|
||||
basicFields as basicGroupFields,
|
||||
} from '../models/group';
|
||||
import shared from '../../common';
|
||||
} from '../../models/group';
|
||||
import shared from '../../../common';
|
||||
|
||||
let stripe = stripeModule(nconf.get('STRIPE_API_KEY'));
|
||||
const i18n = shared.i18n;
|
||||
@@ -10,7 +10,7 @@ import { model as Challenge} from './challenge';
|
||||
import * as Tasks from './task';
|
||||
import validator from 'validator';
|
||||
import { removeFromArray } from '../libs/collectionManipulators';
|
||||
import payments from '../libs/payments';
|
||||
import payments from '../libs/payments/payments';
|
||||
import { groupChatReceivedWebhook } from '../libs/webhook';
|
||||
import {
|
||||
InternalServerError,
|
||||
@@ -28,8 +28,8 @@ import {
|
||||
import {
|
||||
schema as SubscriptionPlanSchema,
|
||||
} from './subscriptionPlan';
|
||||
import amazonPayments from '../libs/amazonPayments';
|
||||
import stripePayments from '../libs/stripePayments';
|
||||
import amazonPayments from '../libs/payments/amazon';
|
||||
import stripePayments from '../libs/payments/stripe';
|
||||
import { model as UserNotification } from './userNotification';
|
||||
|
||||
const questScrolls = shared.content.quests;
|
||||
|
||||
@@ -10,10 +10,10 @@ import {
|
||||
import { defaults, map, flatten, flow, compact, uniq, partialRight } from 'lodash';
|
||||
import { model as UserNotification } from '../userNotification';
|
||||
import schema from './schema';
|
||||
import payments from '../../libs/payments';
|
||||
import amazonPayments from '../../libs/amazonPayments';
|
||||
import stripePayments from '../../libs/stripePayments';
|
||||
import paypalPayments from '../../libs/paypalPayments';
|
||||
import payments from '../../libs/payments/payments';
|
||||
import amazonPayments from '../../libs/payments/amazon';
|
||||
import stripePayments from '../../libs/payments/stripe';
|
||||
import paypalPayments from '../../libs/payments/paypal';
|
||||
|
||||
const daysSince = common.daysSince;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user