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

188 Коммитов

Автор SHA1 Сообщение Дата
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 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
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
Julian Poyourow 938c3dff58
chore(shared-db-mysql): add account db mock provider 2024-04-15 09:17:22 -07:00
Meghan Sardesai 8f00d29098
feat(payments-ui): add restartCart server action
Because:

* We need a server action to restart the cart.

This commit:

* Adds a simple server action to restart the cart.

Closes FXA-8899
2024-04-14 22:50:01 -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 8e54c402c7
Merge pull request #16687 from mozilla/FXA-8948
feat(payments-stripe): Create StripeManager cancelIncompleteSubscription
2024-04-11 13:04:00 -04:00
Lisa Chan bc5fe4015e
feat(payments-stripe): Create StripeManager cancelIncompleteSubscription 2024-04-11 12:33:12 -04:00
Lisa Chan a8c4f9a45a
Merge pull request #16690 from mozilla/FXA-7516
feat(payments-ui): Component - SubscriptionTitle
2024-04-10 18:15:45 -04:00
Julian Poyourow f619c142fb
feat(payments-stripe): add cancelSubscription to stripe manager
Because:

* We want to be able to cancel subscriptions from non-stripe lib

This commit:

* Adds a stripe manager method to do so

Closes FXA-9027
2024-04-10 09:26:58 -07:00
Lisa Chan de58e99bc1
feat(payments-ui): Component - SubscriptionTitle 2024-04-10 10:11:49 -04:00
Julian Poyourow 67f81ae927
feat(payments-ui): add class-validator and class-transformer to actions
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
2024-04-10 00:04:44 -07:00
Julian Poyourow e62224e759
feat(payments-ui): add updateCart server action
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
2024-04-10 00:04:43 -07:00
Julian Poyourow a9d97ffa05
feat(payments-ui): add getCart server action
Because:

* We need a server action to fetch the cart

This commit:

* Adds a simple server action to fetch the cart

Closes FXA-8902
2024-04-10 00:04:40 -07:00
Reino Muhl 5f27943192
Merge pull request #16669 from mozilla/fxa-8898-setupcart-retrieve-cuid
feat(cart): add stripe customer id on cart setup
2024-04-09 16:46:59 -04:00
Reino Muhl 268a9e357a
feat(cart): add stripe customer id on cart setup
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
2024-04-09 16:20:52 -04:00
Lisa Chan 82f7fc2609
fix(libs): Revise tests - test-unit and test-integration 2024-04-08 17:11:06 -04:00
Lisa Chan 3426a28f54
Merge pull request #16662 from mozilla/FXA-8889
feat(payments-stripe): Create AccountCustomer repository
2024-04-08 16:32:52 -04:00
Lisa Chan ebe1d4d267
feat(payments-stripe): Create AccountCustomer repository 2024-04-08 15:50:06 -04:00
Reino Muhl b30ab0345e
Merge pull request #16615 from mozilla/fxa-8822-l10n-localizer
feat(next): add l10n to localizer for next rsc
2024-04-08 15:37:22 -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
Julian Poyourow 4b1c2a838f
feat(payments-stripe): add methods to stripe client
Because:

* We need some additional methods in Stripe client

This commit:

* Adds those methods

Closes FXA-9025
2024-04-08 10:51:13 -07:00
Julian Poyourow 3c6b5b5a81
feat(payments-stripe): add new stripe methods and update naming
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
2024-04-04 11:19:18 -07:00
Julian Poyourow 089545272e
feat(payments-stripe): add retrieveUpcomingInvoice
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
2024-04-04 09:49:45 -07:00
Lisa Chan 3354f25b44
Merge pull request #16625 from mozilla/FXA-8946
feat(payments-stripe): Create StripeManager getTaxIdForCurrency
2024-04-03 13:49:31 -04:00
Lisa Chan ce1c451752
feat(payments-stripe): Create StripeManager getTaxIdForCurrency
Co-authored by: Julian Poyourow
2024-04-03 13:20:45 -04:00
Reino Muhl decc372da0
Merge pull request #16647 from mozilla/add-localizer-web
feat(l10n): add localizer client
2024-04-03 08:35:46 -04:00
Reino Muhl 5863d6c042
feat(l10n): add localizer client
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 #
2024-03-29 12:21:03 -04:00
Lisa Chan 98d473ea3d
fix(payments-next): Page - revise Checkout layout 2024-03-28 15:44:20 -04:00
Julian Poyourow 1e907e3b67
fix(stripe-client): fix updateCustomer tax expand 2024-03-28 11:30:57 -07:00
Lisa Chan acd9992ea4
Merge pull request #16638 from mozilla/FXA-9367
fix(payments-next): Move searchParams to params
2024-03-28 13:17:12 -04:00
Lisa Chan bcbb9e7a72
fix(payments-next): Move searchParams to params 2024-03-28 11:02:31 -04:00
dschom d7c703f2fa
task(auth): Have auth-server use cloud-tasks nx lib
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)
2024-03-27 16:16:18 -07:00
Valerie Pomerleau 9b820bde13
Revert "task(auth): Have auth-server use cloud-tasks nx lib " 2024-03-27 13:23:46 -07:00
Julian Poyourow be35da3a8f
Merge pull request #16634 from mozilla/FXA-8891
feat(stripe-client): add stripe typings utility type and base types
2024-03-27 09:11:29 -07:00
Dan Schomburg af1691928e
Merge pull request #16626 from mozilla/FXA-9270
task(auth): Have auth-server use cloud-tasks nx lib
2024-03-27 07:28:19 -07:00
Julian Poyourow 46c92b32b8
feat(stripe-client): add stripe typings utility type and base types 2024-03-26 23:53:19 -07:00
dschom 7c0c70d2a4
task(auth): Have auth-server use cloud-tasks nx lib
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
2024-03-26 15:43:57 -07:00
Lisa Chan 500b2a0b09
Merge pull request #16607 from mozilla/FXA-8939
feat(payments-paypal): Create PaypalManager getCustomerBillingAgreementId
2024-03-26 17:10:28 -04:00
Meghan Sardesai 152039c1de
feat(payments-stripe): Create StripeManager addTaxIdToCustomer
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
2024-03-26 16:40:23 -04:00
Lisa Chan 2a77b82c98
feat(payments-paypal): Create PaypalManager getCustomerBillingAgreementId 2024-03-26 16:34:39 -04:00
Lisa Chan 9487944698
Merge pull request #16616 from mozilla/FXA-8937
feat(payments-paypal): Create PayPalManager cancelBillingAgreement method
2024-03-25 15:38:18 -04:00
Lisa Chan 66cc0a9446
feat(payments-paypal): Create PayPalManager cancelBillingAgreement method 2024-03-25 15:00:12 -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 2e55eda99e
Merge pull request #16575 from mozilla/FXA-7518
feat(shared-assets): Create library for shared assets
2024-03-20 19:20:35 -04:00