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

231 Коммитов

Автор SHA1 Сообщение Дата
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
Ben Bangert 477c091d36
Merge pull request #16848 from mozilla/feat/add-pem-jwk
feat: vendor and update pem-jwk library
2024-05-03 07:15:28 -07:00
Ben Bangert db8e62f7f7
feat: vendor and update pem-jwk library
Because:

* The pem-jwk library wasn't using the latest crypto library
  functionality and included older dependencies.

This commit:

* Pulls in pem-jwk functionality using the crypto library.
2024-05-02 21:49:24 -07:00
Lisa Chan 85c6a78abb
Merge pull request #16838 from mozilla/dep_stripe
chore(deps): Update Stripe dependency
2024-05-02 20:19:00 -04:00
Lisa Chan fefc48dd32
chore(deps): Update Stripe dependency 2024-05-02 17:32:13 -04:00
Ben Bangert 181d06927f
feat: vendor fxa-common-password-list and incremental-encoder
Because:

* We want to reduce external dependencies on orphaned code and
  consolidate libraries.

This commit:

* Adds the `common-password-list` and `incremental-encoder` libraries
  to the monorepo.
2024-05-02 12:21:52 -07:00
Meghan Sardesai 69bfc0153b
feat(libs): polish pr updating structure, names, and typings
Because:

* We want to improve code quality and consistency in libs.

This commit:

* Updates currency manager error class.
* Updates typings.
* Updates occurrences of `expect(length).toBe(0)` to `expect(length).toHaveLength(0)`.
* Removes 'mock' from test variable names that are not mocks.
2024-05-01 12:45:46 -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 c06042e709
Merge pull request #16792 from mozilla/FXA-9454
feat(payments-stripe): Add applyPromoCodeToSubscription to StripeService
2024-04-30 11:50:08 -04:00
Lisa Chan 4e46a8a01b
feat(payments-stripe): Add applyPromoCodeToSubscription to StripeService 2024-04-30 11:21:32 -04:00
Julian Poyourow 25aa9ca281
feat(payments-ui): add checkoutCartWithStripe action
Because:

* We want to be able to checkout with Stripe from payments-next

This commit:

* Adds a server action to do so

Closes FXA-8950
2024-04-29 09:55:05 -07:00
Julian Poyourow 2511f73d12
feat(payments-ui): add checkoutCartWithPaypal action
Because:

* We want to be able to checkout with Paypal from payments-next

This commit:

* Adds a server action to do so

Closes FXA-8940
2024-04-29 09:31:48 -07:00
Reino Muhl a17b822c48
Merge pull request #16797 from mozilla/fxa-8847-stripe-sdk
feat(next): add stripe sdk and csp
2024-04-26 10:17:48 -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
Ben Bangert 0f59d5f33a
Merge pull request #16795 from mozilla/chore/refactor-password-to-ts-async
chore: refactor password.js to password.ts and async
2024-04-25 12:38:44 -07:00
Ben Bangert d687c094e7
chore: refactor password.js to password.ts and async
Because:

* We want to use TypeScript and async/await.
* Otp Storage could have more precise TS definition.

This commit:

* Renames `password.js` to `password.ts`.
* Refactors promise chains in password.ts to async/await.
* Adds more precise types to `OtpStorage`.
2024-04-25 10:46:23 -07:00
Meghan Sardesai 5416c39e6e
feat(payments-ui): create getPayPalCheckoutToken action
Because:

* We need a server action to get PayPal Checkout token.

This commit:

* Adds server action to get PayPal Checkout token.

Closes FXA-8933
2024-04-25 00:02:15 -04:00
Reino Muhl 4562f41193
Merge pull request #16782 from mozilla/payments-next-fixes
fix(next): add missing deps to nestapp
2024-04-24 20:36:13 -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
Meghan Sardesai 0ddaf1b4d2
Merge pull request #16630 from mozilla/FXA-8935
feat(payments-paypal): create PaypalService createBillingAgreement method
2024-04-24 15:19:36 -04:00
Meghan Sardesai 5d5b8f05e0
feat(payments-paypal): create PaypalService createBillingAgreement method
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
2024-04-24 11:07:34 -07:00
Barry Chen d588eb23e8
feat(password): send OTP to start password reset flow
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
2024-04-24 12:11:14 -05:00
Lisa Chan 3689e4bb13
feat(payments-stripe): Add updateSubscription to stripe manager 2024-04-24 12:10:05 -04:00
Lisa Chan 9b4064ee36
Merge pull request #16775 from mozilla/FXA-9452
feat(payments-stripe): Add subscriptionsUpdate method to StripeClient
2024-04-24 11:45:31 -04:00
Dan Schomburg d4024a6c53
Merge pull request #16742 from mozilla/FXA-9412-send-metrics-opt-out 2024-04-24 08:44:09 -07:00
dschom 8b9051f881
task(graphql): Send notifications when users opt in/out of metrics collection
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
2024-04-24 08:10:14 -07:00
Lisa Chan bd52dba43d
fix(tests): Add expect.assertions for tests with `.rejects` 2024-04-24 10:56:53 -04:00
Lisa Chan 796b26b243
feat(payments-stripe): Add subscriptionsUpdate method to StripeClient 2024-04-23 20:20:01 -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
Lisa Chan 4fdd629fce
fix(payments-eligibility): Clean up tests 2024-04-23 18:39:57 -04:00
Lisa Chan 5a39a81604
Merge pull request #16721 from mozilla/FXA-8893
feat(libs): Update CartService setupCart to check eligibility
2024-04-23 18:32:25 -04: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
Lisa Chan 64f1c790b6
Revisions based on feedback 2024-04-23 16:57:05 -04:00
Lisa Chan 2692c78798
WIP Revisions based on feedback 2024-04-23 15:08:54 -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
Lisa Chan 911a4a4d4a
feat(libs): Update CartService setupCart to check eligibility 2024-04-21 15:47:12 -04:00
Reino Muhl 2455e4d5dc
feat(carts): add eligibilityStatus to cart db
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
2024-04-19 11:00:44 -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
dschom b150461189
bug(auth): Accounts aren't fully deleted
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.
2024-04-16 15:51:14 -07:00
Reino Muhl 9f909792e3
Merge pull request #16676 from mozilla/fxa-8892-sa-setupcart
feat(next): create setupCart server action
2024-04-15 14:52:49 -04:00
Reino Muhl 1af436e8fe
Rename geodb to GeoDB 2024-04-15 12:49:46 -04:00
Reino Muhl 061f09864a
Rebase and refactor to nestjsActionsService 2024-04-15 12:49:36 -04:00