-
Notifications
You must be signed in to change notification settings - Fork 212
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(payments): Do not allow duplicate subscriptions to the same offering and interval #18322
Conversation
9676c5f
to
eb1d061
Compare
@@ -6,6 +6,7 @@ import { headers } from 'next/headers'; | |||
import Image from 'next/image'; | |||
import Link from 'next/link'; | |||
|
|||
import { SUPPORT_URL } from '@fxa/payments/ui'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could the support url be read from config instead please?
It should be defined in apps/payments/next/config/index.ts
, similar to contentServerUrl
and can then be used by importing the config
object that's being exported.
@@ -35,7 +35,8 @@ export class EligibilityManager { | |||
*/ | |||
async getOfferingOverlap( | |||
priceIds: string[], | |||
targetPriceId: string | |||
targetPriceId: string, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit. Seems like this change makes targetPriceId
optional as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or rather I suppose either targetPriceId
or targetPriceId
should be provided. Could a check for this be added to this method?
state: CartState.FAIL, | ||
errorReasonId: CartErrorReasonId.CartEligibilityStatusInvalid, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the eligibility is INVALID, I'd expect the cart to be set to error state.
A cart in error state would have cart.state: CartState.FAIL
and errorReasonId: CartErrorReasonId.xxx
This current change only returns valid values for state
and errorReasonId
but doesn't update the underlying Cart DB record. Since our goal with SP3 is for the frontend to be a reflection of the Cart, its important for Cart in the DB to match what the frontend is showing.
9c29db2
to
2b602a9
Compare
7ae1284
to
0bdf13d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
r+. Thank you Lisa
A nit. but not for this PR, we should probably update the Title of the page to something more generic.Error confirming subscription…
doesn't quite fit here.
…ring and interval
This pull request
Issue that this pull request solves
Closes: FXA-10994
Checklist
Put an
x
in the boxes that applyScreenshots
Invalid eligibility status
Downgrade eligibility status
Example of Error page without Button