diff --git a/packages/fxa-auth-server/bin/key_server.js b/packages/fxa-auth-server/bin/key_server.js index 6c696248b57..9568b745f2e 100755 --- a/packages/fxa-auth-server/bin/key_server.js +++ b/packages/fxa-auth-server/bin/key_server.js @@ -9,7 +9,7 @@ const jwtool = require('fxa-jwtool'); const { StatsD } = require('hot-shots'); const { Container } = require('typedi'); const { StripeHelper } = require('../lib/payments/stripe'); -const { PlayBilling } = require('../lib/payments/google-play'); +const { PlayBilling } = require('../lib/payments/iap/google-play'); const { CurrencyHelper } = require('../lib/payments/currencies'); const { AuthLogger, diff --git a/packages/fxa-auth-server/lib/payments/capability.ts b/packages/fxa-auth-server/lib/payments/capability.ts index 20189670295..1e7e01f57d7 100644 --- a/packages/fxa-auth-server/lib/payments/capability.ts +++ b/packages/fxa-auth-server/lib/payments/capability.ts @@ -11,9 +11,9 @@ import { commaSeparatedListToArray } from './utils'; import error from '../error'; import { authEvents } from '../events'; import { AuthLogger, AuthRequest, ProfileClient } from '../types'; -import { PlayBilling } from './google-play/play-billing'; -import { SubscriptionPurchase } from './google-play/subscription-purchase'; -import { PurchaseQueryError } from './google-play/types'; +import { PlayBilling } from './iap/google-play/play-billing'; +import { SubscriptionPurchase } from './iap/google-play/subscription-purchase'; +import { PurchaseQueryError } from './iap/google-play/types'; import { StripeHelper } from './stripe'; function hex(blob: Buffer | string): string { diff --git a/packages/fxa-auth-server/lib/payments/apple-app-store/apple-iap.ts b/packages/fxa-auth-server/lib/payments/iap/apple-app-store/apple-iap.ts similarity index 94% rename from packages/fxa-auth-server/lib/payments/apple-app-store/apple-iap.ts rename to packages/fxa-auth-server/lib/payments/iap/apple-app-store/apple-iap.ts index eab1fa4a50b..e387e881d72 100644 --- a/packages/fxa-auth-server/lib/payments/apple-app-store/apple-iap.ts +++ b/packages/fxa-auth-server/lib/payments/iap/apple-app-store/apple-iap.ts @@ -6,9 +6,8 @@ import { AppStoreServerAPI, Environment } from 'app-store-server-api'; import { Container } from 'typedi'; import { TypedCollectionReference } from 'typesafe-node-firestore'; -import { AppConfig, AuthFirestore, AuthLogger } from '../../types'; -// TODO: promote this to a shared dir -import { IapConfig } from '../google-play/types'; +import { AppConfig, AuthFirestore, AuthLogger } from '../../../types'; +import { IapConfig } from '../types'; import { PurchaseManager } from './purchase-manager'; export class AppleIAP { diff --git a/packages/fxa-auth-server/lib/payments/apple-app-store/errors.ts b/packages/fxa-auth-server/lib/payments/iap/apple-app-store/errors.ts similarity index 100% rename from packages/fxa-auth-server/lib/payments/apple-app-store/errors.ts rename to packages/fxa-auth-server/lib/payments/iap/apple-app-store/errors.ts diff --git a/packages/fxa-auth-server/lib/payments/apple-app-store/purchase-manager.ts b/packages/fxa-auth-server/lib/payments/iap/apple-app-store/purchase-manager.ts similarity index 100% rename from packages/fxa-auth-server/lib/payments/apple-app-store/purchase-manager.ts rename to packages/fxa-auth-server/lib/payments/iap/apple-app-store/purchase-manager.ts diff --git a/packages/fxa-auth-server/lib/payments/apple-app-store/subscription-purchase.ts b/packages/fxa-auth-server/lib/payments/iap/apple-app-store/subscription-purchase.ts similarity index 100% rename from packages/fxa-auth-server/lib/payments/apple-app-store/subscription-purchase.ts rename to packages/fxa-auth-server/lib/payments/iap/apple-app-store/subscription-purchase.ts diff --git a/packages/fxa-auth-server/lib/payments/apple-app-store/types/errors.ts b/packages/fxa-auth-server/lib/payments/iap/apple-app-store/types/errors.ts similarity index 100% rename from packages/fxa-auth-server/lib/payments/apple-app-store/types/errors.ts rename to packages/fxa-auth-server/lib/payments/iap/apple-app-store/types/errors.ts diff --git a/packages/fxa-auth-server/lib/payments/apple-app-store/types/index.ts b/packages/fxa-auth-server/lib/payments/iap/apple-app-store/types/index.ts similarity index 100% rename from packages/fxa-auth-server/lib/payments/apple-app-store/types/index.ts rename to packages/fxa-auth-server/lib/payments/iap/apple-app-store/types/index.ts diff --git a/packages/fxa-auth-server/lib/payments/google-play/index.ts b/packages/fxa-auth-server/lib/payments/iap/google-play/index.ts similarity index 100% rename from packages/fxa-auth-server/lib/payments/google-play/index.ts rename to packages/fxa-auth-server/lib/payments/iap/google-play/index.ts diff --git a/packages/fxa-auth-server/lib/payments/google-play/play-billing.ts b/packages/fxa-auth-server/lib/payments/iap/google-play/play-billing.ts similarity index 96% rename from packages/fxa-auth-server/lib/payments/google-play/play-billing.ts rename to packages/fxa-auth-server/lib/payments/iap/google-play/play-billing.ts index 0ce049e2ba1..9279de1ba5e 100644 --- a/packages/fxa-auth-server/lib/payments/google-play/play-billing.ts +++ b/packages/fxa-auth-server/lib/payments/iap/google-play/play-billing.ts @@ -6,9 +6,9 @@ import { Auth, google } from 'googleapis'; import { Container } from 'typedi'; import { TypedCollectionReference } from 'typesafe-node-firestore'; -import { AppConfig, AuthFirestore, AuthLogger } from '../../types'; +import { AppConfig, AuthFirestore, AuthLogger } from '../../../types'; import { PurchaseManager } from './purchase-manager'; -import { IapConfig } from './types'; +import { IapConfig } from '../types'; import { UserManager } from './user-manager'; export class PlayBilling { diff --git a/packages/fxa-auth-server/lib/payments/google-play/purchase-manager.ts b/packages/fxa-auth-server/lib/payments/iap/google-play/purchase-manager.ts similarity index 99% rename from packages/fxa-auth-server/lib/payments/google-play/purchase-manager.ts rename to packages/fxa-auth-server/lib/payments/iap/google-play/purchase-manager.ts index 0355692da27..68aaa6b52cb 100644 --- a/packages/fxa-auth-server/lib/payments/google-play/purchase-manager.ts +++ b/packages/fxa-auth-server/lib/payments/iap/google-play/purchase-manager.ts @@ -20,7 +20,7 @@ import { CollectionReference } from '@google-cloud/firestore'; import { androidpublisher_v3 } from 'googleapis'; import Container from 'typedi'; -import { AuthLogger } from '../../types'; +import { AuthLogger } from '../../../types'; import { mergePurchaseWithFirestorePurchaseRecord, SubscriptionPurchase, diff --git a/packages/fxa-auth-server/lib/payments/google-play/subscription-purchase.ts b/packages/fxa-auth-server/lib/payments/iap/google-play/subscription-purchase.ts similarity index 100% rename from packages/fxa-auth-server/lib/payments/google-play/subscription-purchase.ts rename to packages/fxa-auth-server/lib/payments/iap/google-play/subscription-purchase.ts diff --git a/packages/fxa-auth-server/lib/payments/google-play/subscriptions.ts b/packages/fxa-auth-server/lib/payments/iap/google-play/subscriptions.ts similarity index 94% rename from packages/fxa-auth-server/lib/payments/google-play/subscriptions.ts rename to packages/fxa-auth-server/lib/payments/iap/google-play/subscriptions.ts index 271813b1e47..f8d409bb1fc 100644 --- a/packages/fxa-auth-server/lib/payments/google-play/subscriptions.ts +++ b/packages/fxa-auth-server/lib/payments/iap/google-play/subscriptions.ts @@ -8,9 +8,9 @@ import { } from 'fxa-shared/subscriptions/types'; import Container from 'typedi'; -import { internalValidationError } from '../../../lib/error'; -import { AppConfig } from '../../types'; -import { StripeHelper } from '../stripe'; +import { internalValidationError } from '../../../../lib/error'; +import { AppConfig } from '../../../types'; +import { StripeHelper } from '../../stripe'; import { PlayBilling } from './play-billing'; import { SubscriptionPurchase } from './subscription-purchase'; diff --git a/packages/fxa-auth-server/lib/payments/google-play/types/errors.ts b/packages/fxa-auth-server/lib/payments/iap/google-play/types/errors.ts similarity index 100% rename from packages/fxa-auth-server/lib/payments/google-play/types/errors.ts rename to packages/fxa-auth-server/lib/payments/iap/google-play/types/errors.ts diff --git a/packages/fxa-auth-server/lib/payments/google-play/types/index.ts b/packages/fxa-auth-server/lib/payments/iap/google-play/types/index.ts similarity index 91% rename from packages/fxa-auth-server/lib/payments/google-play/types/index.ts rename to packages/fxa-auth-server/lib/payments/iap/google-play/types/index.ts index dc6540ed994..df11e828036 100644 --- a/packages/fxa-auth-server/lib/payments/google-play/types/index.ts +++ b/packages/fxa-auth-server/lib/payments/iap/google-play/types/index.ts @@ -2,7 +2,6 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ export { PurchaseQueryError, PurchaseUpdateError } from './errors'; -export { IapConfig } from './firestore'; export { DeveloperNotification, NotificationType, diff --git a/packages/fxa-auth-server/lib/payments/google-play/types/notifications.ts b/packages/fxa-auth-server/lib/payments/iap/google-play/types/notifications.ts similarity index 100% rename from packages/fxa-auth-server/lib/payments/google-play/types/notifications.ts rename to packages/fxa-auth-server/lib/payments/iap/google-play/types/notifications.ts diff --git a/packages/fxa-auth-server/lib/payments/google-play/types/purchases.ts b/packages/fxa-auth-server/lib/payments/iap/google-play/types/purchases.ts similarity index 100% rename from packages/fxa-auth-server/lib/payments/google-play/types/purchases.ts rename to packages/fxa-auth-server/lib/payments/iap/google-play/types/purchases.ts diff --git a/packages/fxa-auth-server/lib/payments/google-play/user-manager.ts b/packages/fxa-auth-server/lib/payments/iap/google-play/user-manager.ts similarity index 98% rename from packages/fxa-auth-server/lib/payments/google-play/user-manager.ts rename to packages/fxa-auth-server/lib/payments/iap/google-play/user-manager.ts index 060f50c03e4..d2c01ed362f 100644 --- a/packages/fxa-auth-server/lib/payments/google-play/user-manager.ts +++ b/packages/fxa-auth-server/lib/payments/iap/google-play/user-manager.ts @@ -19,7 +19,7 @@ import { CollectionReference } from '@google-cloud/firestore'; import Container from 'typedi'; -import { AuthLogger } from '../../types'; +import { AuthLogger } from '../../../types'; import { PurchaseManager } from './purchase-manager'; import { GOOGLE_PLAY_FORM_OF_PAYMENT, diff --git a/packages/fxa-auth-server/lib/payments/google-play/types/firestore.ts b/packages/fxa-auth-server/lib/payments/iap/types/firestore.ts similarity index 100% rename from packages/fxa-auth-server/lib/payments/google-play/types/firestore.ts rename to packages/fxa-auth-server/lib/payments/iap/types/firestore.ts diff --git a/packages/fxa-auth-server/lib/payments/iap/types/index.ts b/packages/fxa-auth-server/lib/payments/iap/types/index.ts new file mode 100644 index 00000000000..8622994a14f --- /dev/null +++ b/packages/fxa-auth-server/lib/payments/iap/types/index.ts @@ -0,0 +1,5 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +export { IapConfig } from './firestore'; diff --git a/packages/fxa-auth-server/lib/payments/stripe.ts b/packages/fxa-auth-server/lib/payments/stripe.ts index 4618d3152ca..46454188261 100644 --- a/packages/fxa-auth-server/lib/payments/stripe.ts +++ b/packages/fxa-auth-server/lib/payments/stripe.ts @@ -58,7 +58,7 @@ import { import { AppConfig, AuthFirestore, AuthLogger } from '../types'; import { PaymentConfigManager } from './configuration/manager'; import { CurrencyHelper } from './currencies'; -import { SubscriptionPurchase } from './google-play/subscription-purchase'; +import { SubscriptionPurchase } from './iap/google-play/subscription-purchase'; import { FirestoreStripeError, StripeFirestore } from './stripe-firestore'; // @ts-ignore diff --git a/packages/fxa-auth-server/lib/routes/account.ts b/packages/fxa-auth-server/lib/routes/account.ts index 902724f1151..6a550350d66 100644 --- a/packages/fxa-auth-server/lib/routes/account.ts +++ b/packages/fxa-auth-server/lib/routes/account.ts @@ -24,7 +24,7 @@ import { getClientById } from '../oauth/client'; import { generateAccessToken } from '../oauth/grant'; import jwt from '../oauth/jwt'; import { CapabilityService } from '../payments/capability'; -import { PlaySubscriptions } from '../payments/google-play/subscriptions'; +import { PlaySubscriptions } from '../payments/iap/google-play/subscriptions'; import { PayPalHelper } from '../payments/paypal/helper'; import { StripeHelper } from '../payments/stripe'; import { AuthLogger, AuthRequest } from '../types'; diff --git a/packages/fxa-auth-server/lib/routes/subscriptions/google.ts b/packages/fxa-auth-server/lib/routes/subscriptions/google.ts index e41c8a4d44f..f0cd151e63c 100644 --- a/packages/fxa-auth-server/lib/routes/subscriptions/google.ts +++ b/packages/fxa-auth-server/lib/routes/subscriptions/google.ts @@ -8,9 +8,9 @@ import { Container } from 'typedi'; import error from '../../error'; import { CapabilityService } from '../../payments/capability'; -import { PlayBilling } from '../../payments/google-play/play-billing'; -import { PurchaseUpdateError } from '../../payments/google-play/types/errors'; -import { SkuType } from '../../payments/google-play/types/purchases'; +import { PlayBilling } from '../../payments/iap/google-play/play-billing'; +import { PurchaseUpdateError } from '../../payments/iap/google-play/types/errors'; +import { SkuType } from '../../payments/iap/google-play/types/purchases'; import { AuthLogger, AuthRequest } from '../../types'; import { handleAuthScoped } from './utils'; diff --git a/packages/fxa-auth-server/lib/routes/subscriptions/mozilla.ts b/packages/fxa-auth-server/lib/routes/subscriptions/mozilla.ts index bf969df0d33..9d443f832ed 100644 --- a/packages/fxa-auth-server/lib/routes/subscriptions/mozilla.ts +++ b/packages/fxa-auth-server/lib/routes/subscriptions/mozilla.ts @@ -4,7 +4,7 @@ import { ServerRoute } from '@hapi/hapi'; import { MozillaSubscription } from 'fxa-shared/subscriptions/types'; import { Container } from 'typedi'; -import { PlaySubscriptions } from '../../../lib/payments/google-play/subscriptions'; +import { PlaySubscriptions } from '../../../lib/payments/iap/google-play/subscriptions'; import error from '../../error'; import { PaymentBillingDetails, StripeHelper } from '../../payments/stripe'; import { AuthLogger, AuthRequest } from '../../types'; diff --git a/packages/fxa-auth-server/lib/routes/subscriptions/play-pubsub.ts b/packages/fxa-auth-server/lib/routes/subscriptions/play-pubsub.ts index f9b7494af6f..4aac58e9b01 100644 --- a/packages/fxa-auth-server/lib/routes/subscriptions/play-pubsub.ts +++ b/packages/fxa-auth-server/lib/routes/subscriptions/play-pubsub.ts @@ -7,8 +7,8 @@ import { Container } from 'typedi'; import error from '../../error'; import { CapabilityService } from '../../payments/capability'; -import { PlayBilling } from '../../payments/google-play/play-billing'; -import { DeveloperNotification } from '../../payments/google-play/types'; +import { PlayBilling } from '../../payments/iap/google-play/play-billing'; +import { DeveloperNotification } from '../../payments/iap/google-play/types'; import { reportSentryError } from '../../sentry'; import { AuthLogger, AuthRequest } from '../../types'; diff --git a/packages/fxa-auth-server/lib/routes/support-panel.ts b/packages/fxa-auth-server/lib/routes/support-panel.ts index c00145fa9eb..e8044b17265 100644 --- a/packages/fxa-auth-server/lib/routes/support-panel.ts +++ b/packages/fxa-auth-server/lib/routes/support-panel.ts @@ -7,7 +7,7 @@ import isA from '@hapi/joi'; import { MozillaSubscriptionTypes } from 'fxa-shared/subscriptions/types'; import { Container } from 'typedi'; import { ConfigType } from '../../config'; -import { PlaySubscriptions } from '../../lib/payments/google-play/subscriptions'; +import { PlaySubscriptions } from '../../lib/payments/iap/google-play/subscriptions'; import { StripeHelper } from '../payments/stripe'; import { AuthLogger, AuthRequest } from '../types'; import validators from './validators'; diff --git a/packages/fxa-auth-server/test/local/payments/capability.js b/packages/fxa-auth-server/test/local/payments/capability.js index 0ab08447250..acbd9f3ff5c 100644 --- a/packages/fxa-auth-server/test/local/payments/capability.js +++ b/packages/fxa-auth-server/test/local/payments/capability.js @@ -11,7 +11,7 @@ const { Container } = require('typedi'); const { mockLog } = require('../../mocks'); const { AuthLogger } = require('../../../lib/types'); const { StripeHelper } = require('../../../lib/payments/stripe'); -const { PlayBilling } = require('../../../lib/payments/google-play'); +const { PlayBilling } = require('../../../lib/payments/iap/google-play'); const subscriptionCreated = require('./fixtures/stripe/subscription_created.json').data.object; @@ -19,13 +19,13 @@ const subscriptionCreated = const { ProfileClient } = require('../../../lib/types'); const { SubscriptionPurchase, -} = require('../../../lib/payments/google-play/subscription-purchase'); +} = require('../../../lib/payments/iap/google-play/subscription-purchase'); const proxyquire = require('proxyquire').noPreserveCache(); const authDbModule = require('fxa-shared/db/models/auth'); const { PurchaseQueryError, -} = require('../../../lib/payments/google-play/types'); +} = require('../../../lib/payments/iap/google-play/types'); const mockAuthEvents = {}; diff --git a/packages/fxa-auth-server/test/local/payments/google-play/play-billing.js b/packages/fxa-auth-server/test/local/payments/iap/google-play/play-billing.js similarity index 95% rename from packages/fxa-auth-server/test/local/payments/google-play/play-billing.js rename to packages/fxa-auth-server/test/local/payments/iap/google-play/play-billing.js index 5a6702c5588..2e4c5761bd4 100644 --- a/packages/fxa-auth-server/test/local/payments/google-play/play-billing.js +++ b/packages/fxa-auth-server/test/local/payments/iap/google-play/play-billing.js @@ -8,13 +8,13 @@ const sinon = require('sinon'); const { assert } = require('chai'); const { default: Container } = require('typedi'); -const { mockLog } = require('../../../mocks'); +const { mockLog } = require('../../../../mocks'); const { AuthFirestore, AuthLogger, AppConfig, -} = require('../../../../lib/types'); -const { PlayBilling } = require('../../../../lib/payments/google-play'); +} = require('../../../../../lib/types'); +const { PlayBilling } = require('../../../../../lib/payments/iap/google-play'); const mockConfig = { authFirestore: { diff --git a/packages/fxa-auth-server/test/local/payments/google-play/purchase-manager.js b/packages/fxa-auth-server/test/local/payments/iap/google-play/purchase-manager.js similarity index 98% rename from packages/fxa-auth-server/test/local/payments/google-play/purchase-manager.js rename to packages/fxa-auth-server/test/local/payments/iap/google-play/purchase-manager.js index 9ac19177226..c0fca26e705 100644 --- a/packages/fxa-auth-server/test/local/payments/google-play/purchase-manager.js +++ b/packages/fxa-auth-server/test/local/payments/iap/google-play/purchase-manager.js @@ -9,19 +9,19 @@ const { assert } = require('chai'); const { default: Container } = require('typedi'); const proxyquire = require('proxyquire').noPreserveCache(); -const { mockLog } = require('../../../mocks'); -const { AuthLogger } = require('../../../../lib/types'); +const { mockLog } = require('../../../../mocks'); +const { AuthLogger } = require('../../../../../lib/types'); const { PurchaseQueryError, SkuType, PurchaseUpdateError, NotificationType, -} = require('../../../../lib/payments/google-play/types'); +} = require('../../../../../lib/payments/iap/google-play/types'); const mockSubscriptionPurchase = {}; const mockMergePurchase = sinon.fake.returns({}); const { PurchaseManager } = proxyquire( - '../../../../lib/payments/google-play/purchase-manager', + '../../../../../lib/payments/iap/google-play/purchase-manager', { './subscription-purchase': { SubscriptionPurchase: mockSubscriptionPurchase, diff --git a/packages/fxa-auth-server/test/local/payments/google-play/subscription-purchase.js b/packages/fxa-auth-server/test/local/payments/iap/google-play/subscription-purchase.js similarity index 97% rename from packages/fxa-auth-server/test/local/payments/google-play/subscription-purchase.js rename to packages/fxa-auth-server/test/local/payments/iap/google-play/subscription-purchase.js index 9a0481e5cc9..7845ffb9349 100644 --- a/packages/fxa-auth-server/test/local/payments/google-play/subscription-purchase.js +++ b/packages/fxa-auth-server/test/local/payments/iap/google-play/subscription-purchase.js @@ -9,8 +9,10 @@ const { assert } = require('chai'); const { SubscriptionPurchase, GOOGLE_PLAY_FORM_OF_PAYMENT, -} = require('../../../../lib/payments/google-play/subscription-purchase'); -const { SkuType } = require('../../../../lib/payments/google-play/types'); +} = require('../../../../../lib/payments/iap/google-play/subscription-purchase'); +const { + SkuType, +} = require('../../../../../lib/payments/iap/google-play/types'); describe('SubscriptionPurchase', () => { beforeEach(() => {}); diff --git a/packages/fxa-auth-server/test/local/payments/google-play/subscriptions.js b/packages/fxa-auth-server/test/local/payments/iap/google-play/subscriptions.js similarity index 95% rename from packages/fxa-auth-server/test/local/payments/google-play/subscriptions.js rename to packages/fxa-auth-server/test/local/payments/iap/google-play/subscriptions.js index b70891d5218..025e59cae32 100644 --- a/packages/fxa-auth-server/test/local/payments/google-play/subscriptions.js +++ b/packages/fxa-auth-server/test/local/payments/iap/google-play/subscriptions.js @@ -5,14 +5,14 @@ const sinon = require('sinon'); const assert = { ...sinon.assert, ...require('chai').assert }; const { Container } = require('typedi'); -const { PlayBilling } = require('../../../../lib/payments/google-play'); +const { PlayBilling } = require('../../../../../lib/payments/iap/google-play'); const { PlaySubscriptions, abbrevPlayPurchaseFromSubscriptionPurchase, -} = require('../../../../lib/payments/google-play/subscriptions'); +} = require('../../../../../lib/payments/iap/google-play/subscriptions'); const { MozillaSubscriptionTypes } = require('fxa-shared/subscriptions/types'); -const { AppConfig } = require('../../../../lib/types'); -const { StripeHelper } = require('../../../../lib/payments/stripe'); +const { AppConfig } = require('../../../../../lib/types'); +const { StripeHelper } = require('../../../../../lib/payments/stripe'); describe('PlaySubscriptions', () => { const mockConfig = { subscriptions: { enabled: true } }; diff --git a/packages/fxa-auth-server/test/local/payments/google-play/user-manager.js b/packages/fxa-auth-server/test/local/payments/iap/google-play/user-manager.js similarity index 91% rename from packages/fxa-auth-server/test/local/payments/google-play/user-manager.js rename to packages/fxa-auth-server/test/local/payments/iap/google-play/user-manager.js index fa9e18746ae..47f01920504 100644 --- a/packages/fxa-auth-server/test/local/payments/google-play/user-manager.js +++ b/packages/fxa-auth-server/test/local/payments/iap/google-play/user-manager.js @@ -8,18 +8,18 @@ const sinon = require('sinon'); const { assert } = require('chai'); const { default: Container } = require('typedi'); -const { mockLog } = require('../../../mocks'); +const { mockLog } = require('../../../../mocks'); const { UserManager, -} = require('../../../../lib/payments/google-play/user-manager'); -const { AuthLogger } = require('../../../../lib/types'); +} = require('../../../../../lib/payments/iap/google-play/user-manager'); +const { AuthLogger } = require('../../../../../lib/types'); const { SubscriptionPurchase, -} = require('../../../../lib/payments/google-play/subscription-purchase'); +} = require('../../../../../lib/payments/iap/google-play/subscription-purchase'); const { PurchaseQueryError, -} = require('../../../../lib/payments/google-play/types'); +} = require('../../../../../lib/payments/iap/google-play/types'); const USER_ID = 'testUser'; const VALID_SUB_API_RESPONSE = { diff --git a/packages/fxa-auth-server/test/local/payments/stripe.js b/packages/fxa-auth-server/test/local/payments/stripe.js index df0ae149c21..4a6faeab041 100644 --- a/packages/fxa-auth-server/test/local/payments/stripe.js +++ b/packages/fxa-auth-server/test/local/payments/stripe.js @@ -83,7 +83,7 @@ const { } = require('fxa-shared/db/models/auth'); const { SubscriptionPurchase, -} = require('../../../lib/payments/google-play/subscription-purchase'); +} = require('../../../lib/payments/iap/google-play/subscription-purchase'); const { AuthFirestore, AuthLogger, AppConfig } = require('../../../lib/types'); const { INVOICES_RESOURCE, diff --git a/packages/fxa-auth-server/test/local/routes/account.js b/packages/fxa-auth-server/test/local/routes/account.js index e7d13911eba..1ba72f3b1a4 100644 --- a/packages/fxa-auth-server/test/local/routes/account.js +++ b/packages/fxa-auth-server/test/local/routes/account.js @@ -24,7 +24,7 @@ const { normalizeEmail } = require('fxa-shared').email.helpers; const { MozillaSubscriptionTypes } = require('fxa-shared/subscriptions/types'); const { PlaySubscriptions, -} = require('../../../lib/payments/google-play/subscriptions'); +} = require('../../../lib/payments/iap/google-play/subscriptions'); const { AccountHandler } = require('../../../lib/routes/account'); diff --git a/packages/fxa-auth-server/test/local/routes/subscriptions/google.js b/packages/fxa-auth-server/test/local/routes/subscriptions/google.js index 9e2138b2882..a73ce1cc0c3 100644 --- a/packages/fxa-auth-server/test/local/routes/subscriptions/google.js +++ b/packages/fxa-auth-server/test/local/routes/subscriptions/google.js @@ -15,10 +15,10 @@ const { } = require('../../../../lib/routes/subscriptions/google'); const { PurchaseUpdateError, -} = require('../../../../lib/payments/google-play/types/errors'); +} = require('../../../../lib/payments/iap/google-play/types/errors'); const error = require('../../../../lib/error'); const { AuthLogger } = require('../../../../lib/types'); -const { PlayBilling } = require('../../../../lib/payments/google-play'); +const { PlayBilling } = require('../../../../lib/payments/iap/google-play'); const { OAUTH_SCOPE_SUBSCRIPTIONS_IAP } = require('fxa-shared/oauth/constants'); const { CapabilityService } = require('../../../../lib/payments/capability'); diff --git a/packages/fxa-auth-server/test/local/routes/subscriptions/paypal.js b/packages/fxa-auth-server/test/local/routes/subscriptions/paypal.js index 5728690d5a4..eab15a21dc4 100644 --- a/packages/fxa-auth-server/test/local/routes/subscriptions/paypal.js +++ b/packages/fxa-auth-server/test/local/routes/subscriptions/paypal.js @@ -27,7 +27,7 @@ const buildRoutes = require('../../../../lib/routes/subscriptions'); const ACCOUNT_LOCALE = 'en-US'; const { OAUTH_SCOPE_SUBSCRIPTIONS } = require('fxa-shared/oauth/constants'); const { CapabilityService } = require('../../../../lib/payments/capability'); -const { PlayBilling } = require('../../../../lib/payments/google-play'); +const { PlayBilling } = require('../../../../lib/payments/iap/google-play'); const TEST_EMAIL = 'test@email.com'; const UID = uuid.v4({}, Buffer.alloc(16)).toString('hex'); const MOCK_SCOPES = ['profile:email', OAUTH_SCOPE_SUBSCRIPTIONS]; diff --git a/packages/fxa-auth-server/test/local/routes/subscriptions/play-pubsub.js b/packages/fxa-auth-server/test/local/routes/subscriptions/play-pubsub.js index a8e4cd86f39..3bdf438bb20 100644 --- a/packages/fxa-auth-server/test/local/routes/subscriptions/play-pubsub.js +++ b/packages/fxa-auth-server/test/local/routes/subscriptions/play-pubsub.js @@ -16,7 +16,7 @@ const { const { default: Container } = require('typedi'); const { mockLog } = require('../../../mocks'); const { AuthLogger } = require('../../../../lib/types'); -const { PlayBilling } = require('../../../../lib/payments/google-play'); +const { PlayBilling } = require('../../../../lib/payments/iap/google-play'); const { CapabilityService } = require('../../../../lib/payments/capability'); const ACCOUNT_LOCALE = 'en-US'; diff --git a/packages/fxa-auth-server/test/local/routes/subscriptions/stripe.js b/packages/fxa-auth-server/test/local/routes/subscriptions/stripe.js index f1783f6954b..7e5f4f33e34 100644 --- a/packages/fxa-auth-server/test/local/routes/subscriptions/stripe.js +++ b/packages/fxa-auth-server/test/local/routes/subscriptions/stripe.js @@ -34,7 +34,7 @@ const { StripeHandler: DirectStripeRoutes } = proxyquire( const { AuthLogger, AppConfig } = require('../../../../lib/types'); const { CapabilityService } = require('../../../../lib/payments/capability'); -const { PlayBilling } = require('../../../../lib/payments/google-play'); +const { PlayBilling } = require('../../../../lib/payments/iap/google-play'); const { stripeInvoiceToFirstInvoicePreviewDTO, stripeInvoicesToSubsequentInvoicePreviewsDTO, diff --git a/packages/fxa-auth-server/test/mocks.js b/packages/fxa-auth-server/test/mocks.js index 7361726a908..a4e7c70970a 100644 --- a/packages/fxa-auth-server/test/mocks.js +++ b/packages/fxa-auth-server/test/mocks.js @@ -852,6 +852,6 @@ function mockPayPalHelper(methods) { function mockPlaySubscriptions(methods) { return mockObject( methods, - require('../lib/payments/google-play/subscriptions').PlaySubscriptions + require('../lib/payments/iap/google-play/subscriptions').PlaySubscriptions ); } diff --git a/packages/fxa-auth-server/test/remote/subscription_tests.js b/packages/fxa-auth-server/test/remote/subscription_tests.js index 2fa22759b56..e24bb941eea 100644 --- a/packages/fxa-auth-server/test/remote/subscription_tests.js +++ b/packages/fxa-auth-server/test/remote/subscription_tests.js @@ -18,7 +18,7 @@ const { StripeHelper } = require('../../lib/payments/stripe'); const { AuthLogger } = require('../../lib/types'); const { PlaySubscriptions, -} = require('../../lib/payments/google-play/subscriptions'); +} = require('../../lib/payments/iap/google-play/subscriptions'); const validClients = config.oauthServer.clients.filter( (client) => client.trusted && client.canGrant && client.publicClient