Граф коммитов

67 Коммитов

Автор SHA1 Сообщение Дата
Reino Muhl ab8ae37229
feat(next): update payments-next build and restart
Because:

- Starting and restarting payments-next takes a long time due to always
  building the app first, which isn't necessary during development.
- When changes are made to NestApp or its dependencies, these are not
  hot reloaded by Next.js, requiring a full Next.js restart.

This commit:

- Adopt Nx plugin for Next.js which more closely aligns with Next.js
  standard dev commands.
- Retained Nx Next.js executors for build, since it more closely fits
  into the current FxA build and deploy CI logic.
- Added a watcher to NestApp which calls a NestApp restart api, only
  available in development, to restart the NestApp on any changes.
- Adds a function to get the NestApp, instead of a const, thus ensuring,
  in dev mode, the latest NestApp is always returned.

Closes #FXA-9706
2024-06-18 10:45:04 -04:00
Lisa Chan 18e5d172b0
Merge pull request #17056 from mozilla/FXA-9708
fix(payments-next): Implement a11y improvements
2024-06-05 11:57:22 -04:00
Lisa Chan f9f670fb2e
fix(payments-next): Implement a11y improvements 2024-06-05 10:55:43 -04:00
Reino Muhl 05d7265292
feat(many): add partial stack startup scripts
Because:

- During development it could be useful to start only parts of the stack
  needed for development on specific domains.

This commit:

- Provides additional stack startup options to only start specific parts
  of the stack, by using nx projects and tags.

Closes #FXA-9771
2024-06-04 11:41:51 -04:00
Reino Muhl a9d84adcf6
feat(next): set email and display name
Because:

* Populate the customer display name from the Payments Next frontend
* Temporarily provide a way to easily set email on the cart
* Subscription creation on Payments Next was failing due to missing
  priceId.

This commit:

* Includes displayName in stripe checkout server action
* Adds temporary input and server action to update cart.email
* Adds the missing priceId to subscription creation

Closes #
2024-05-28 13:32:12 -04:00
Reino Muhl 154d2b3154
feat(next): move localization provider
Because:

* Fluent LocalizationProvider is currently initialized on the client
  causing noticable load times for client components.

This commit:

* Initialize ReactLocalization on the server
* Wrap near root layout with LocalizationProvider as suggested by
  Nextjs docs.

Closes #
2024-05-22 11:10:50 -04:00
Meghan Sardesai 6dbc8950e9
feat(checkoutService): update CheckoutService prePaySteps
Because:

* We want to validate cart and customer have matching credentials.

This commit:

* Completes the TODO list:
  * Validates stripeCustomerId on the cart.
  * Revalidates total amount against upcoming invoice.
  * Validates customer eligibility for target plan.
  * Validates customer address, tax eligibility, and promo code (if applicable).
  * Cancels incomplete subscriptions.
* Updates tests where applicable.

Closes FXA-8951
2024-05-22 10:31:11 -04:00
Lisa Chan ab0022a450
fix(apps,libs): Revise discountAmount and temporary page on payments-next 2024-05-17 10:36:12 -04:00
Reino Muhl 954b17071c
feat(next): cleanup tasks
Because:

* During development some console errors and warnings were introduced
* Improve developer experience and code quality of payments next

This commit:

* Update imports in Payments Next from root project directory
* Resolve browser console errors
  * Added missing CSP content items
  * Removed Layout image width to remove next/image warning
* Resolved server console error related to nest-typed-config
* Extract CheckoutForm button into PrimaryButton component
* Added Stripe Public API key config variable
* Updated checkout page headings
* Updated Stripe Payment Element to use accordion
* Added ConfigProvider for client components

Closes #FXA-9625
2024-05-16 15:37:23 -04:00
Lisa Chan b0bdf9f861
feat(libs): Add InvoicePreview to getCart Action 2024-05-16 14:37:46 -04:00
Reino Muhl 4ac4a6fd79
Merge pull request #16818 from mozilla/fxa-7806-next-checkbox
feat(next): add consent checkbox
2024-05-14 13:06:09 -04:00
Reino Muhl 6409c5e422
feat(next): add consent checkbox
Because:

* Add consent checkbox, reminder error tooltip and payment section with
  default disabled state.

This commit:

* Adds a new client component for the consent checkbox and implements
  a Radix holdover component for the error tooltip.
* Adds PaymentSection client component.

Closes: #FXA-7806
2024-05-14 08:52:06 -04:00
Lisa Chan 9c03da39fc
feat(payments,shared): Add ContentfulService to Nest.js AppSingleton 2024-05-13 16:37:17 -04:00
Reino Muhl 2fb70a6886
feat(next): add payment element and submit
Because:

* Add the Stripe Payment Element to the checkout page
* Be able to checkout and successfully add a new payment method and
  new subscription.

This commit:

* Adds the PaymentElement to the StripeWrapper
* Adds the Subscribe Now button
* Adds the Full Name field
* Updates the NestApp with Firestore and StatsD provider factories

Closes #FXA-8850 and #FXA-7810
2024-05-08 10:37:14 -04:00
Reino Muhl 2dac8fe114
chore(next): update next-auth beta to latest
Because:

* Stay up to date with latest next-auth/authjs beta releases

This commit:

* Updates to latest beta version
* Removes env vars no longer needed

Closes #FXA-9543
2024-05-07 08:45:05 -04:00
Reino Muhl 4b1d485fc6
Merge pull request #16803 from mozilla/fxa-7523-finalize-landing-page
feat(next): attempt no prompt auth on landing
2024-04-30 13:12:43 -04:00
Reino Muhl 888ccaad90
feat(next): attempt no prompt auth on landing
Because:

* Attempt to perform a no prompt authentication request to FxA when
  customer is first navigated to Payment Next

This commit:

* Adds a landing route to initiate the no prompt signin
* If user is authenticated, add FxA uid to cart
* Add signin error page to handle FxA error for unauthenticated users
* Add placeholder generic error page.

Closes #FXA-7523
2024-04-30 12:37:09 -04:00
Lisa Chan dee638a359
feat(payments-next): Add SignIn button 2024-04-30 11:19:40 -04:00
Reino Muhl aefba713ed
feat(next): add stripe sdk and csp
Because:

* We want to start adding Stripe client elements to the checkout page.

This commit:

* Adds Stripe SDK to a client component, which is added to Checkout.
* Adds middleware to add CSP to page requests.

Closes #FXA-8847
2024-04-26 09:33:53 -04:00
Reino Muhl cbd8ddd861
fix(next): add missing deps to nestapp
Because:

* Payments Next errors on start up since NestApp had missing modules.

This commit:

* Adds missing modules and config to NestApp.

Closes #
2024-04-24 16:54:11 -04:00
Julian Poyourow bccfb27e38
feat(checkout): add checkout service with stripe and paypal
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
2024-04-23 17:02:47 -07:00
Reino Muhl 8c41fdb351
feat(cart): add get cart action to pages
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
2024-04-23 17:10:39 -04:00
Reino Muhl cb41181b4d
feat(next): add typesafe config
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
2024-04-23 12:47:18 -04:00
Reino Muhl 7f3d030e8b
feat(next): add handle stripe error action
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
2024-04-18 16:16:58 -04:00
Reino Muhl 787345239d
Updated dot env example 2024-04-15 13:03:31 -04:00
Reino Muhl 061f09864a
Rebase and refactor to nestjsActionsService 2024-04-15 12:49:36 -04:00
Reino Muhl c595afe4f3
feat(next): create setupCart server action
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
2024-04-15 12:48:35 -04:00
Reino Muhl c1c1d7dddb
feat(next): use next 14.2 instrumentation
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>
2024-04-11 17:46:56 -04:00
Lisa Chan de58e99bc1
feat(payments-ui): Component - SubscriptionTitle 2024-04-10 10:11:49 -04:00
Reino Muhl 652c09ab50
feat(next): add l10n to localizer for next rsc
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
2024-04-08 14:58:17 -04:00
Lisa Chan 98d473ea3d
fix(payments-next): Page - revise Checkout layout 2024-03-28 15:44:20 -04:00
Lisa Chan bcbb9e7a72
fix(payments-next): Move searchParams to params 2024-03-28 11:02:31 -04:00
Reino Muhl 407c7e3cdb
Merge pull request #16586 from mozilla/fxa-8821-l10n-bundle-load
feat(l10n): add localizer class for payments next
2024-03-22 09:25:27 -04:00
Reino Muhl 695d791b15
feat(l10n): add localizer class for payments next
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
2024-03-22 08:58:53 -04:00
Lisa Chan ee8a93f92f
Merge pull request #16605 from mozilla/FXA-8820
feat(l10n): Add localization scripts/targets to payments-next
2024-03-21 21:10:51 -04:00
Lisa Chan ad714efd00
feat(l10n): Add localization scripts/targets to payments-next 2024-03-21 20:42:55 -04:00
Lisa Chan 25bcf355ed
feat(shared-assets): Create library for shared assets 2024-03-20 18:54:49 -04:00
Reino Muhl f80ba7ff45
feat(l10n): update l10n ftl scripts for nx apps v2
Because:

* Fluent ftl files need to be added to apps in the nx apps/ directory.

This commit:

* Updates bundle and prime scripts to support the apps/ directory, without affecting existing packages apps.

Closes #FXA-8823
2024-03-14 10:41:02 -04:00
Reino Muhl a11256cb50
feat(next): add l10n grunt scripts
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
2024-03-08 10:53:25 -05:00
dependabot[bot] 2eb94047e7
chore(deps): bump next from 14.0.2 to 14.1.0
Bumps [next](https://github.com/vercel/next.js) from 14.0.2 to 14.1.0.
- [Release notes](https://github.com/vercel/next.js/releases)
- [Changelog](https://github.com/vercel/next.js/blob/canary/release.js)
- [Commits](https://github.com/vercel/next.js/compare/v14.0.2...v14.1.0)

---
updated-dependencies:
- dependency-name: next
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-02-23 09:34:08 -05:00
Reino Muhl 275ecdb0b8
feat(next): reorg checkout pages
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
2024-02-22 13:06:09 -05:00
Reino Muhl 36230779b6
Merge pull request #16449 from mozilla/fxa-7522-next-auth-setup
feat(next): add NextAuth
2024-02-22 10:26:43 -05:00
Reino Muhl 3ab897e629
feat(next): add NextAuth
Because:

* Need to be able to authenticate with FxA

This commit:

* Add NextAuth to facilitate promp and no prompt signin with FxA.

Closes #FXA-7522
2024-02-21 16:59:05 -05:00
Reino Muhl 7ebc865705
feat(auth): allow prompt=none without hint
Because:

* Allow prompt=none signin even if login_hint or id_token_hint is not
  provided, as the current spec has these as optional parameters.

This commit:

* For prompt=none signin, if login_hint or id_token_hint is not provided
  it allows successful signin.
* For prompt=none signin, if login_hint or id_token_hint are provided
  it keeps the current checks as is.

Closes #FXA-9035
2024-02-15 13:28:09 -05:00
Lisa Chan de80c7f1bc
Merge pull request #16271 from mozilla/hackathon_bonus
chore(next): Hackathon bonus tasks
2024-02-12 14:06:24 -05:00
Reino Muhl 2df7ca494a
chore(nx): upgrade to nx 18
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
2024-02-12 09:01:00 -05:00
Lisa Chan c830f10f0e
chore(next): Bonus tasks - update Error page to include error mapping, update pages to include l10n 2024-02-08 10:23:54 -05:00
Meghan Sardesai 317f5eb7fc
feat(next): Hackathon error page
Because:

* We want to start building out pages in preparation for M3.

This commit:

* Introduces a fully accessible desktop version for the error page.
* Hackathon demo.
2024-01-24 00:39:31 -05:00
Lisa Chan cd5bac1a35
chore(payments): Success Page 2024-01-19 11:18:03 -05:00
Meghan Sardesai 5b1862ef2d
chore(payments-next): reference Mozilla logo in `fxa-react`
Because:

* `payments-server` and `payments-next` can reference the svg in
`fxa-react` and remove image duplication.

This commit:

* References Mozilla logo in `fxa-react`.
* Removes duplicate media.
* Removes legacy code.

Closes FXA-6309
2023-12-04 11:28:52 -05:00