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

272 Коммитов

Автор SHA1 Сообщение Дата
Reino Muhl 4e611b12e1
Merge pull request #17094 from mozilla/fxa-9706-next-hot-reload
feat(next): update payments-next build and restart
2024-06-18 11:18:33 -04:00
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 fc3e40888c
refactor(payments-stripe, auth): Update Coupon API endpoint 2024-06-17 12:03:21 -04:00
Lisa Chan f05d73021b
fix(libs): Refactor Stripe Plan usage to Stripe Price 2024-06-13 14:23:35 -04:00
Julian Poyourow 1f9be8cdf0
Merge pull request #17072 from mozilla/FXA-9705
chore(libs): restructure stripe lib into responsibility-driven structure
2024-06-05 11:17:05 -07:00
Reino Muhl 4dc167db78
Merge pull request #17075 from mozilla/fix-payments-cart-date-test
fix(cart): remove updateAt on createAccountCustomer
2024-06-05 12:16:41 -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
Reino Muhl 7573630585
fix(cart): remove updateAt on createAccountCustomer
Because:

- AccountCustomerManager.createAccountCustomer included updateAt as a
  parameter even though it wasn't used.

This commit:

- Remove updateAt from createAccountCustomer and update related files.

Closes #
2024-06-05 11:21:21 -04:00
Lisa Chan f9f670fb2e
fix(payments-next): Implement a11y improvements 2024-06-05 10:55:43 -04:00
Vijay Budhram 9c65c93c34
feat(crypto): Update webpack config to use vendored crypto relier 2024-06-04 17:52:36 -04:00
julianpoyourow de2ad977c9
chore(libs): restructure stripe lib into responsibility-driven structure 2024-06-04 16:53:26 +00:00
Ben Bangert 8771178ee3
feat: vendor fxa-crypto-relier as crypto-relier
Because:

* We want to incorporate the fxa-crypto-relier library into the Firefox
  Accounts codebase and deprecated its webextension functionality.

This commit:

* Adds the fxa-crypto-relier library to the Firefox Accounts codebase.

Closes FXA-9741
2024-06-03 14:03:11 -07:00
Reino Muhl 8d3c84a253
Merge pull request #16992 from mozilla/next-temp-email-and-fixes
feat(next): set email and display name
2024-05-30 16:51:53 -04:00
Reino Muhl 5bf3e097fa
fix(next): readd readOnly to payment element
Because:

- Stripe Payment Element is missing readOnly config value

This commit:

- Readds readOnly config value to Payment Element

Closes #
2024-05-30 13:42:18 -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
dschom 40615780f1
task(auth, graphql-api, admin-server): Update event-broker's profileDataChange data schema and remove the metrics-change event
Because:
- In a previous PR, a new event type was created, but we should have repurposed the profileDataChange event type
- During the previous deployment it was noted that there are different ways to configure sns, and that a topic arn and/or topic endpoint might not be required

This Commit:
- Relaxes requirements for notifier service.
  - Makes snsTopicEndpoint optional
  - Makes snsTopicArn optional
- Removes the `metricsChange` event type
- Augments the `profileDataChange` type schema to support, locale, metricsEnabled, totpEnabled, accountDisabled, and accountLocked states.
- Emmits the `profileDataChange` whenever corresponding account data is mutated.
2024-05-23 18:39:15 -07:00
Meghan Sardesai 2a0fb52594
feat(stripe): polish pr to update `prePaySteps` and `createPlainCustomer`
Because:

* We want to clean up our code and make sure our methods are created and updated appropriately.

This commit:

* Is a follow up to https://github.com/mozilla/fxa/pull/16924 comments and Slack messages between the SubPlat SWEs.
* Updates `StripeManager.createPlainCustomer`.
* Updates `CheckoutService.prePaySteps` to add `AccountCustomerManager.createAccountCustomer`.
* Updates all applicable tests.
2024-05-22 15:49:29 -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 caf3126e54
fix(payments): Revise formatting of upcoming invoice tax and discounts 2024-05-21 11:02:18 -04:00
Meghan Sardesai 32a8f3af01
Merge pull request #16941 from mozilla/FXA-8896
feat(cartService): update total in `CartService.setupCart`
2024-05-21 06:42:02 -04:00
Ben Bangert fae80ae7e3
chore: vendor typesafe-node-firestore
Because:

* We don't want to maintain small external libs instead of using our
  monorepo.

This commit:

* Vendors in the typesafe-node-firestore typings.
2024-05-20 19:10:19 -07:00
Meghan Sardesai 0d11e8a23c
feat(cartService): update setupCart to call StripeClient invoicesRetrieveUpcoming
Because:

* We want to remove skeleton placeholders and replace with actual values.

This commit:

* Calls stripeClient.invoicesRetrieveUpcoming and replaces the amount placeholder with the total.

Closes FXA-8896
2024-05-20 16:31:51 -04:00
Lisa Chan ab0022a450
fix(apps,libs): Revise discountAmount and temporary page on payments-next 2024-05-17 10:36:12 -04:00
Meghan Sardesai 1a4fd0c3ba
Merge pull request #16927 from mozilla/FXA-9537
feat(cart): add util function for cart handleEligibilityStatus
2024-05-16 16:34:50 -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
Meghan Sardesai 6aff7187ff
feat(cart): add util function for cart handleEligibilityStatus
Because:

* We want to create a util function to handle the EligibilityStatus and ensure that the Cart is created with the correct CartEligibilityStatus, CartState and ErrorReasonId (if necessary).

This commit:

* Creates a util function in libs/payments/cart to handle the EligibilityStatus to ensure that the Cart is created with the correct CartEligibilityStatus, CartState and ErrorReasonId (if necessary).

Closes FXA-9537
2024-05-16 15:25:29 -04:00
Lisa Chan b0bdf9f861
feat(libs): Add InvoicePreview to getCart Action 2024-05-16 14:37:46 -04:00
Julian Poyourow 6aecb97cbb
Merge pull request #16935 from mozilla/FXA-9536
feat(payments-stripe): create doesPlanMatchSubplatInterval
2024-05-15 09:40:43 -07:00
Julian Poyourow 4b50e813e2
feat(payments-stripe): create doesPlanMatchSubplatInterval
Because:

* We need to actually check interval_count rather than just interval

This commit:

* Adds a handy util for doing so, and uses it within the stripe manager

Closes FXA-9536
2024-05-15 09:06:47 -07: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
Lisa Chan f9e3a36b4b
fix(shared-contentful): Update index to add page-content-for-offering 2024-05-14 12:26:44 -04:00
Lisa Chan d84c1e8260
Merge pull request #16936 from mozilla/FXA-7513
feat(payments,shared): Add ContentfulService to Nest.js AppSingleton
2024-05-14 09:15:32 -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
Reino Muhl cd6b386a06
fix(contentful): fix queries using apiIdentifier
Because:

* Queries should search for apiIdentifiers that equal input param

This commit:

* Queries using apiIdentifier updated to search for offering with
  apiIdentifier that matches the input parameter

Closes #
2024-05-14 08:12:58 -04:00
Lisa Chan 9c03da39fc
feat(payments,shared): Add ContentfulService to Nest.js AppSingleton 2024-05-13 16:37:17 -04:00
Lisa Chan 655adfa184
Merge pull request #16885 from mozilla/FXA-7511
feat(shared-contentful): Update ContentfulManager to return page content from API identifier
2024-05-10 11:16:54 -04:00
Lisa Chan fd7125b88b
feat(shared-contentful): Update ContentfulManager to return page content from API identifier 2024-05-10 10:42:46 -04:00
Reino Muhl 63ddd93dbf
Merge pull request #16904 from mozilla/fxa-7827-2
feat(next): add `Localization` wrapper client
2024-05-10 10:37:13 -04:00
Ben Bangert 429370de27
fix: match existing libs/ tsconfig.lib.json in vendored
Because:

* We want auth-server to load libs correctly.

This commit:

* Matches the tsconfig.lib.json of other working libraries in
  auth-server.
2024-05-09 08:14:25 -07:00
Meghan Sardesai 43a524b5b8
feat(next): add `Localization` wrapper client
Because:

* We want to localize client components using the Fluent/react library.

This commit:

* Adds component FluentLocalizationProvider that initializes and wraps
 `children` in Fluent `<LocalizationProvider>`.
* Adds a test string to `Checkout` page as a means to test the client
  component localization works as expected.

Closes FXA-7827
2024-05-08 17:23:15 -04:00
Reino Muhl cea7165f54
Merge pull request #16856 from mozilla/fxa-7810-add-payment-element
feat(next): add payment element and submit
2024-05-08 11:13:29 -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
Lisa Chan 741f3dfde5
feat(auth-server): Create subscription route and handler method that calls StripeService to apply coupon 2024-05-07 20:45:21 -04:00
Dan Schomburg 41ad4acd9a
Merge pull request #16884 from mozilla/FXA-9289
bug(graphql): Prevent reporting of known auth-server errors
2024-05-07 15:29:55 -07:00
dschom 74c32be9e3
bug(graphql): Prevent reporting of known auth-server errors
Because:
- We were reporting known error response states that come from auth-server and were intended for flow control to Sentry

This Commit:
- Adds an extra check so we do not report these states needlessly.
- Fixes some tests so they adhere to latest sentry types.
2024-05-07 13:27:13 -07: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
Julian Poyourow 458fe8e781
Merge pull request #16871 from mozilla/FXA-9540
chore(libs): restructure tests
2024-05-06 14:49:41 -07:00
Julian Poyourow dbd5c2756f
chore(libs): restructure tests
Because:

* Many of the tests did not use NestJS test harness
* Many of the tests had poor structure
* Many of the tests did not use jest.spyOn and were not typesafe in
  their mocks

This commit:

* Restructures tests within libs

Closes FXA-9540
2024-05-06 14:16:19 -07:00
Ben Bangert 9a649c6441
feat: vendor fxa-jwtool
Because:

* We want to reduce the dependencies in fxa-jwtool and bring more
  of the functionality into the monorepo.

This commit:

* Moves and updates the fxa-jwtool code to function the same
  except as TypeScript with classes and no additional dependencies.
2024-05-06 07:52:16 -07:00