Because:
* Part of M3a.
* We want `createBillingAgreement` added to PaypalService.
This commit:
* Adds `createBillingAgreement` in `PaypalService`.
* Adds `CurrencyManager` library.
* Adds `status` to `createBillingAgreement` in `PaypalRepository`.
* Adds/updates all applicable tests.
Closes FXA-8935
Because:
- we want to use OTPs to improve the UX of the password reset flow
This commit:
- adds a lib for generating and validating random numeric OTPs
- adds a new auth-server endpoint for requesting the OTP in an email
- this endpoint does not send an email yet; To Be Implemented
Because:
- We want to let RPs know when users opt out of metrics collection
- We want to let RPs know when users opt in to metrics collection
This Commit:
- Ports the notifier code over to nx libs from auth server
- Ports other supporting libraries from fxa-shared to nx libs
- MozLoggerService
- Sentry
- Metrics (ie statsd)
- Updates graphql to emit a 'metricsChange' event when users toggle their 'Help improve Mozilla accounts' option in settings.
- Adds support for the metricsChanged event to the fxa-event-broker
Because:
* We want a service to manage checkout behaviors
This commit:
* Adds a checkout service
Closes FXA-9020
Closes FXA-8943
Closes FXA-9022
Closes FXA-8941
Because:
* Pages were still calling mock get cart
This commit:
* Adds getCartOrRedirect to all pages
* Redirects to appropriate page if cart.state does not much current page
Closes #FXA-9039
Because:
* Use Next.js standard environment variable procedure
* Provide typed config to be used throughout Payments Next.
This commit:
* Refactor config to use Next.js native environment loaders
* Remove .env.json and .env.production.json
* Add validator and transformer functions to provide
validated and typesafe config.
Closes #FXA-9436
Because:
* Cart needs eligibility status of current cart.
This commit:
* Add new field, eligibilityStatus, to cart db as Enum
* Add CartEligibilityStatus enum to kysely types
Closes #FXA-9472
Because:
* Need a server action to handle errors returned from Stripe elements
submit function.
This commit:
* Creates handleStripeError action and related Nextjs Action Service
* Adds checkoutErrorCart to Cart Service
* Add cart.utils
* Add tests for cart.utils and checkoutErrorCart
Closes #FXA-8851
Because:
- Accounts were not being fully deleted
- Since do not use a keyfile, the check on whether or not the queue was enabled did not pass, and the explicit check to run in stage/prod was lost in the refactor
This commit:
- Removes the queueEnabled flag check entirely. (Now that a local emulator is present we can assume the queue should always be available.)
- Adds back in the `fallback` option to the CloudTasksClient, which indicates the client should use https instead of grcp, which has proven to be a more reliable setting.
Because:
* Call CartService.setupCart from payments-next via server action.
This commit:
* Extracts fxa-geodb into libs/* library
* Updates CartService to include GeodbManager
* Call setupCart from payments-next
Closes #FXA-8892
Because:
* Want to use Next.js instrumentation featuer to start NestApp on
Next.js server startup.
This commit:
* Upgrades Next.js to version 14.2 which includes intrumentation fixes.
* Adds instrumentation logic.
Closes #
Co-authored-by: Ben Bangert <100193+bbangert@users.noreply.github.com>
Because:
* We need validation for the input to our actions. We also use
class-validator and class-transformer elsewhere, and although I'm not
the most fond of this syntax/setup vs something like zod, we don't
have zod as a dependency at the moment.
This commit:
* Adds class-validator and class-transformer as well as validations for
each for the getCart and updateCart actions
Because:
* We need a server action to be able to update the cart details
This commit:
* Adds a server action to be able to update the cart details
Closes FXA-8900
Because:
* On cart setup, add stripe customer id, if it exists, to the cart.
This commit:
* Adds method to AccountCustomerManager to get stripe customer id or
return null.
* Adds AccountCustomerManager to CartService and fetches stripe customer
id.
* Splits unit and integration tests for the payments-cart library
Closes #FXA-8898
Because:
* Ensure all localization strings can be localized in React Server
Components.
This commit:
* Removes LocalizerServer
* Adds LocalizerRSC to serve as a wrapper for ReactLocalization that can
be used by React Server Components, as well as a few other utility
methods.
* Adds LocalizerRscFactory that instantiates LocalizerRSC only with
bundles for a provided acceptLanguage string.
* Adds LocalizerRscFactoryProvider to be used with the NestApp to
instantiate and then intialize the LocalizerRscFactory. Initalization
will fetch all messages from disk and populate the bundles.
* Reorganize shared/l10n library to match Node style guide
* Removes demo l10n code
* Update purchase-details, terms-and-service components, and success and
error pages to use new LocalizerRSC class for localization.
* Adds temporary l10n-convert script to provide translation for existing
ftl strings.
Closes #FXA-8822
Because:
* Our naming in our client needlessly renamed Stripe methods making it a
little harder to understand what is going on
This commit:
* Updates our naming to match what Stripe has, so that it's easier to
look stuff up.
Closes FXA-9019
Because:
* We need to be able to fetch upcoming invoices via the typed Stripe
client
This commit:
* Adds retrieveUpcomingInvoice to the typed Stripe client
Closes FXA-8895
Because:
* Need a Localizer implementation that can be used in a react client
component.
This commit:
* Creates LocalizerClient which instantiates an instance of
ReactLocalization to be used by the LocalizationProvider.
Closes #
Because:
- We want to use the `cloud-tasks` nx lib that introduced last sprint
This commit
- Updates account end points to use the nx lib
- Updates CI to include cloud-task emulator
(cherry picked from commit 7c0c70d2a4)
Because:
- We want to use the `cloud-tasks` nx lib that introduced last sprint
This commit
- Updates account end points to use the nx lib
- Updates CI to include cloud-task emulator
Because:
* Part of M3a.
* We want `addTaxIdToCustomer` added to StripeManager.
This commit:
* Adds aforementioned method to `StripeManager` using existing implementation for reference.
* Updates customer metadata with `taxId` when customer `taxId` does not match incoming `taxId`.
Closes FXA-8944
Because:
* Create a localizer class that can be used by payments next react
server components.
* Only generate fluent bundles once on startup.
This commit:
* Moves logic from Localizer class, defined in
`fxa-auth-server/lib/l10n/index.ts`, to a LocalizerBase class.
* Adds LocalizerServer class to be used by payments next.
* Moves nestapp from payments-next app to a library
Closes #FXA-8821
Because:
* We want to be able to interact with the paypalCustomer table from the
new libs structure
This commit:
* Adds a paypalCustomer repository
Closes FXA-8888
Because:
* We want to update to Node 20 LTS.
* We want to target the JS output of Node 20.
* We want to use the latest TypeScript 5.4
This commit:
* Updates the Node version to 20 LTS.
* Updates the TypeScript version and related TS libs
to 5.4.
* Updates tsconfig for the new Node 20 target.
Because:
- We want to delete accounts from the admin panel
This Commit:
- Adds cloud task emulator pm2 service
- Creates cloud-task nx lib for interacting with cloud tasks
- Creates PageDeleteAccount in admin panel
- Adds ability to delete accounts to admin server's account resolver
- Fixes broken admin panel configuration
- Fixes broken admin server configuration
Because:
* We want a seamless cutover from Stripe metadata to Contentful.
This commit:
* Adds a boolean feature flag to use Contentful data directly.
Closes FXA-9062
Because:
* Add grunt script used to manage and update l10n ftl files used by
payments next
This commit:
* Adds grunt scripts copy:branding-ftl, concat:ftl and watch:ftl
Closes #FXA-8819
Because:
* Reorganize checkout pages to include intent and cartId in path, and
allow for landing page.
This commit:
* Reorganizes checkout pages
* Add checkout landing page
* Add getLocaleFromRequest and update l10n locale logic
Closes #FXA-7804
Because:
* Offering comparison in the eligibility manager incorrectly indicates
a downgrade if the difference between the target and source index
is greater than 1, which can happen for subgroups with multiple
offerings.
This commit:
* During offering comparison, if the difference between target and
source index is positive, return UPGRADE, for values that are the same
return SAME, and negative values return DOWNGRADE.
Closes #
Because:
* Want to track number of requests and timings of those requests made
to contentful.
This commit:
* Adds event emitter to Contentful Client, similar to PayPal Client.
* Add statsd to Contentful Manager to to track requests timings on
contentful client event.
Closes #FXA-9031
Because:
* Want to migrate Nx to latest
This commit:
* Migrate nx to 18 using nx cli migrate latest
* Readd a few dev dependancies back into packages/**/package.json
* Behavior of `npx nx...` commands seems to have changed, resulting in
multiple "command not found: <library>" errors, where <library>
refers to libaries used in packages/**/package.json scripts, such as
tailwindcss, tsc-alias, nx, etc.
* Updates nx cache location for Circle CI
Closes #FXA-8880
Because:
* Need to remove customers and related subcollections, from firestore,
for customers already deleted in FxA.
This commit:
* Adds a script that parses through all Firestore customer records, and
checks if the customer has a valid FxA account. If not, the uid is
added to the delete account cloud task queue, for deletion.
Closes #FXA-8969
Because:
* A mismatch was occurring between Stripe and Contentful capabilities due to the latter not being marked as required.
This commit:
* Updates Capability and Service to required to ensure items are populated before publishing.
Relates to FXA-9052
Because:
* Sentry is throwing an undefined error when `items` are missing.
This commit:
* Validates that `capabilitiesCollection` items and `servicesCollection` items are populated or returns an empty array.
* Adds additional tests to check that both collections are populated.
Closes FXA-9052
Because:
* Monitor is rebranding
This commit:
* Update all references and l10n strings and terms from Firefox Monitor to Mozilla Monitor
* Update link to monitor's site
Closes #FXA-9036
Because:
* Some RPs (currently only Moz Social) would like to know if users were at least 18 at time of account registration to prevent asking users a second time if we've already confirmed at COPPA check that they are at least 18
This commit:
* Adds a new atLeast18AtReg column in the account database, with default set to null for existing accounts
* At account registration via backbone or React, checks if the submitted age is at least 18 and store the response as a boolean value (we do not store the exact age)
* Makes this value available to RPs at the v1/profile endpoint via account/profile
Closes #FXA-8751
Because:
* Async function in render logic caused hydration error on page refresh
This commit:
* Remove async from `getFormatedMsg` wrapper function
Closes #FXA-8852
Because:
- We want to add support for up coming changes to key stretching in the auth server first
- We want to ensure all changes are backwards compatible
This Commit:
- Updates test to use approach for the client side stretch where:
- Stretch uses 650k iterations
- Client salt uses random value instead of user's original email
- Updates tests to run using both V1 and V2 credentials
- Updates database to support new columns for housing V2 credentials
- Updates account models accordingly
- Adds statsd metrics to track use of v2 credentials
- Updates CI tests to run remote integration tests for V2 credentials
Because:
* The Contentful content is fetched for only one locale, however the
comparison logic was comparing it against all plan's for all "locales"
configured for a product.
This commit:
* Updates the error reporting to only include 1 error message per ID.
Typically this will be a Stripe product ID.
* Adds the request acceptLanguage to Sentry context, so that it is
easier to identify which language the comparison was done for.
Closes #FXA-8856
Because:
* Update ContentfulManager method to account for zero results returned
by Contentful query.
This commit:
* Updates while loop condition
Closes #FXA-8865
Because:
* Queries were exceeding complexity and throwing errors in Sentry.
This commit:
* Reduces complexity of the affected query.
* Adds `total` and pagination.
Closes FXA-8747
Because:
* We want SP3 to have a soild foundation, consistency, and organization.
This commit:
* Moves `purchaseWithDetailsQuery` and 'offeringQuery' into their own directories.
* Moves related content into respective directories and updates paths.
* Updates types and factories where applicable.
Because:
* We want to use the latest graphql dependency
This commit:
* Updates GQL dep and all packages relying on it
* Moves some dependencies to root package.json
* Removes a couple of deps we aren't using
* Addresses breaking changes, updates related tests and mocks
* Fixes type errors
* Prettifies contentful autogenerated files
closes FXA-8489
Co-authored-by: Ben Bangert <100193+bbangert@users.noreply.github.com>
Co-authored-by: Julian Poyourow <julianpoyo@gmail.com>
Co-authored-by: Reino Muhl <reino.muhl@gmail.com>
Because:
* We've had numerous problems with Apollo Client server-side (it's intended as a frontend client, mostly for React).
This commit:
* Replaces Apollo Client with graphql-request for server-to-server graphql requests in the Contentful lib.
Closes FXA-8645
Because:
* The GET /plans API is used in multiple places to retrieve the relying
party configuration data currently configured in Stripe.metadata
This commit:
* Updates the logic used by the GET /plans API to retrieve the relying
party configuration data from Contentful, with Stripe.metadata as a
fallback
* Reports a Sentry error when the Contentful configuration data does not
match the Stripe.metadata
Closes #FXA-8538
Because:
* Branding should not have multiple translations and the same terms should be used across FxA and SubPlat.
This commit:
* This reduces clean up, potential translation duplication, and improves maintenance of branding.
Closes FXA-8403
Because:
* We want to use the new eligibilitymanager in the capability service
and compare its results to the existing check, reporting any
differences in the eligibility comparison.
This commit:
* Adds the eligibility manager to the capability service.
* Adds a wrapper to the results of the elgibility call to verify it
matches the existing comparison, and report to Sentry if it doesn't.
Closes FXA-8273
Because:
* The main factories file was getting a bit out of hand and separating them keeps everything more organized.
This commit:
* Moves eligibility and services factories into their own directories.
* Updates factories that include more than the single override parameter.
* Updates paths where applicable.
* Updates tests where applicable.
* Adds missing tests for planIdsToClientCapabilities
Closes FXA-8621
Because:
* We want to fetch the list of capabilities for the given plan ids.
This commit:
* Adds planIdsToClientCapabilities method to the capability manager.
Closes FXA-8240
Because:
* Need to query Purchase Details and Common Content for an array of
stripe plan ids.
This commit:
* Adds PurchaseWithDetailsOfferingContentUtil to retrieve the necessary
data from Contentful for a specific locale.
Closes #FXA-8537
Because:
* we want to employ the factory pattern for mocking testing data
This commit:
* adds factory functions for several stripe objects
Closes #FXA-8311
Because:
* Apollo client provides no means of setting a cache TTL
This commit:
* Sets up cache busting on a 5 minute interval by default, configurable via optional Nestjs config option.
Because:
* Settings and payments were not automatically displayed in RTL for languages such as Hebrew
This commit:
* Set lang and dir with react helmet
* Add method to determine locale dir, with unit tests
* Add list of rtl locales
Closes #FXA-6234
Because:
- We want to Mozilla branding in content server
This Commit:
- Activates the l10n strings fro Mozilla branding
- Updates css to be inline with branding
- Creates 'Old L10N' strings that will be removed. These are placeholders just in case we need to roll something back.
- Moves the mozilla logo out of the footer and to the top left
Because:
* Manual changes were needed to all nx libraries to ensure expected
TypeScript build and development intellisense behavior.
This commit:
* Removes the "rootDir" build option added to all libraries, to allow
for relative paths. This is no longer necessary since issues using
TypeScript path aliases have been resolved.
* Removes changes to "main" build option, which ensured the built
version of package.json had the correct path to the main index.js.
Closes #
Because:
* We want to determine whether a customer is eligible for a plan
offering, and if so, which offering they are eligible for.
This commit:
* Adds the getOfferingOverlap method to the eligibility manager.
Closes FXA-8241
Because:
* Nest app config loader needs to support uppercase env vars
This commit:
* Adds support for uppercase env vars to Nest app config loader
* Update MySQLConfig to handle normalization
* Fixes issue loading l10n ftl files
Closes #
Co-authored-by: Ben Bangert <ben@groovie.org>
Because:
* Need to determine a valid locale configured in Contentful.
This commit:
* Add getLocale method to ContentfulClient to determine locale using
locales available in Contentful and defaulting to 'en' as a fallback.
Closes #FXA-8225
Because:
* We want to use functions from fxa-shared/l10n in new libs/* libraries
including libs/shared/contentful.
This commit:
* Moves fxa-shared/l10n to libs/shared/l10n
* Updates all references in packages/*
Closes #FXA-8228
Because:
* We want to easily expose complete type-safe query methods to callers
of the contentful client.
This commit:
* Adds a contentful manager class that exposes an eleigibility helper
method along with appropriate types.
Closes FXA-8405
Co-authored-by: Julian Poyourow <7751154+julianpoy@users.noreply.github.com>
Because:
* Plan eligibility depends on a number of factors, including what plans the user is already subscribed to (in Stripe, Google IAP or Apple IAP) and available upgrade paths for those plans per product-specific config (in Stripe metadata currently but soon to live in Contentful).
* We want to break out eligibility checks and types into a separate library from the auth server's `CapabilityService.getPlanEligibility`, since it's not really capability-oriented.
This commit:
* Generates a new nx library in lib/payments/eligibility
Closes #FXA-7582
Because:
* We will be using the Contentful hCMS (specifically their GraphQL Content API) to replace Stripe metadata for RP-provided content in SubPlat 3.0.
This commit:
* Updates `CONTENTFUL_API_KEY` to `CONTENTFUL_GRAPHQL_API_KEY`.
* Adds additional properties — `CONTENTFUL_GRAPHQL_SPACE_ID` and `CONTENTFUL_GRAPHQL_ENVIRONMENT`.
* Updates `ContentfulClientConfig` to include `spaceId` and `environment` properties.
* Updates `ContentfulClient` to build the Contentful GraphQL URL from those properties.
* Updates GraphQL codegen after addition (2) and update (1) of aforementioned properties.
Closes FXA-8211
Because:
* With components split into libraries, we don't want to include styles
in components that are defined/provided by the application consuming
the components
* Split common JSX into smaller components where it makes sense
* Continue down the div reduction path
This commit:
* Removes non-global CSS files
* Where applicable, replace divs with landmarks that add more value
for example lists and sections.
* Added <ListLabelItem> to PurchaseDetails component
* Remove unused styles
* Replace non-reused tailwind utility classes with inline declerations
Closes #
Because:
* We want to load/cache the NestJS services on the first request to the
app, so that the first request is not slow.
* We should use proper NextJS project organization.
This commit:
* Adds a new route to the app that the loadbalancers utilize, to ensure
that the NestJS services are loaded before the first request to the
app.
* Moves internal implementation that shouldn't be routed to, behind the
underscore directory prefix.
Because:
* We want to be able to call server-side logic with our business classes
directly from the nextJS app before rendering on the server.
This pull request:
* Adds a NestJS application context to the NextJS app that can be used
to load services and call methods on them.
Because:
* Purchase was previously only queriable via `linkedFrom`, which
increased query complexity and was a little cumbersome.
This commit:
* Updates the Contentful typings for the schema change
* Uses the offering directly from the Purchase
* Renames a few things for standardization
Closes FXA-8314
Because:
* We need a starter for a cart service as described in FXA-8130
This commit:
* Adds a skeleton for a cart service with the methods described in
FXA-8130
Closes FXA-8130
Co-authored-by: Ben Bangert <100193+bbangert@users.noreply.github.com>
Because:
* Create the initial work for the Checkout page as a starting point and
example for the rest of the SP3 components and pages.
This commit:
* Adds the payments/next/ui Next.js library.
* Move Header JSX into layout.tsx and remove ExampleHeader component.
* Add RSC PurchaseDetails, using JSX from SP2.5 PlanDetails component.
* Add RSC TermsAndPrivacy component
* Add various stubs functions for illustration purposes. These will be
replaced with actual implementations in future tickets.
* Cart fetch
* Contentful fetch
* Translation using @fluent/bundle
Closes FXA-8133
Because:
* We need to be able to fetch a list of capability slugs and client IDs
based on a list of priceIds.
This commit:
* Adds a query to fetch that information from Contentful via a GraphQL
query, along with updated typings.
Closes FXA-8178
Because:
* We need to fetch purchase details with many other joined fields from
contentful.
This commit:
* Adds a query that joins in all dependent data.
Closes FXA-8179
Co-authored-by: Meghan Sardesai <104124653+sardesam@users.noreply.github.com>
Because:
* We want to include Storybook in 3.0.
This commit:
* Ensures Storybook component loads as expected.
* Ensures shared Tailwind styles can be used in payments-next and works with hot-reloading.
* Ensures the build script executes without any errors.
Closes FXA-7503
Because:
* We'd like to be able to use Nest-Typed-Config with a structured config file that can be validated at runtime if desired.
This commit:
* Adds a typed config class for the Contentful client.
* Reference PR: https://github.com/mozilla/fxa/pull/15724
Closes #No ticket
Because:
- Not all CI operations where taking advantage of NX caches
This Commit:
- Adjusts nx.json config to ensure correct caching behavior
- Adjusts nx.json config to ensure proper target chains. ie build is dependent on pre-build
- Uses nx to directly run integration tests
- Uses nx to directly run unit tests
- Phases out dependency on generated .list files
- Ensures 'start up' for services for functional tests is done with nx and uses nx caches.
- Creates nx tags to facilitate test commands
- Fixes linter errors encountered
- Updates docker images to nx for builds
- Updates nx ignore files
Because:
* The paypal client config is a basic interface, and we'd like to be
able to use Nest-Typed-Config with a structured config file.
This commit:
* Adds a typed config class for the paypal client.
Because:
* We want to easily be able to consume library classes within NestJS.
Adding the injectable decorator to all library classes means we can do
so with ease, but also doesn't prevent us from using the class outside
of the NestJS DI system.
* We want all dependencies (such as nest) centralized to the main
package.json
This commit:
* Adds the injectable decorator to every library class.
* Centralizes the NestJS dependency to the root package.json.
Closes: no relevant issue - polish PR.
Because:
* We want to have a single place to manage account related operations in
the database layer.
This commit:
* Adds a new AccountManager class and account package.
Closes #FXA-6623
Because
- We need a reusable client for accessing contentful
This Commit
- Adds a contentful client with automated codegen
- Creates a reusable query system
Closes FXA-7501
Because:
- Refactor the Cart Manager to serve as higher level logic for the
cart db model.
This commit:
- Removes service level logic.
- Adds common methods to be used by Cart Manager consumers.
- Adds checks for valid state by action and valid state transitions.
- Reverts playwright tests back to xlarge instance size
Closes FXA-8128
Because:
- Allow for optimistic locking for the carts table
This commit:
- Adds migrations to add version field to carts table.
- Updates patchById with version logic
- Updates cart model and test scripts
Closes FXA-8132
Because:
- we want to be able to use packagename based imports, defined in
tsconfig.base.json paths, throughout the repo.
This commit:
- Adds a workaround fix to libs/**/project.json > main properties to
ensure that the built dist/libs/**/.package.json has the correct
main property.
- Upgrades esbuild-register to latest version, which includes
tsconfig path resolution.
- Adds tsconfig-paths to auth-server mocha based tests.
- Adds various workarounds to fxa-graphql-api including the following
- Adds paths from `tsconfig.base.json` to `tsconfig.build.json`
excluding the extension.
- Add pathToModuleNameMapper to all jest*.config.js
- Add build step before tests are run
Because:
- The CI already targets test-unit
- We want to draw a distinction between unit and integration tests.
This Commit:
- Renames "test" to "test-unit" in lib packages.
- Sets up CI to run integration tests on 'libs' folder packages
- Adds tags to nx projects in libs folder
Because:
* Some items were identified not to meet code organization standards
the team is implementing with Nx.
* Nx identified some circular dependencies that need resolving.
This commit:
* Resolves circular dependencies.
* More to do
Because:
* We had some last minute tweaks to the error arrangement.
This commit:
* Moves the error class to the library using it and inherits from a
shared base error.
Because:
* We want an error library to generalize error handling across all new integrated libraries.
This commit:
* Generates a new JS library with nx called shared-error that exports a few error classes.
* Ports the PayPalClientError to the new library as an example error (renamed to PayPalNVPError with PayPalClientError becoming a MultiError composed of one or more PayPalNVPErrors), refactoring the multiple error handling logic to a new helper.
Closes #FXA-7656
Because:
* The circular dependency between account and core was causing
problems with the build.
This commit:
* Moves the setup function from core to account.
Because:
* Need a library to handle the cart db table and related functions
This commit:
* Add cart DB model
* Initializes the Cart library and creates factories and types
* Adds CartManager library
* Adds Cart related resolvers with basic Cart DB queries
Closes: #FXA-7508 #FXA-7505
Because:
* We want to use clean and well tested code for our new integrated
account database layer.
* We don't want to use stored procedures for new code.
This commit:
* Adds a new library that contains core mysql connection functionality.
* Duplicates core objection classes and setup from fxa-shared without
stored procedure functionality.
Closes FXA-6622