-
Notifications
You must be signed in to change notification settings - Fork 87
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: payment max and min limit #5972
Merged
Merged
Changes from 19 commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
7e2f64f
feat: add paymentMaxLimit env var
tshuli bdc2d47
feat: paymentMaxLimit check on frontend
tshuli c45f0b4
chore: rename to maxPaymentAmount
tshuli 5c730ca
lint: magic string in MACRO_CASE
tshuli 7be7bb1
chore: create payment.errors file
tshuli e089d68
feat: add backend check for maxPaymentAmount
tshuli 3577bd3
chore: add tests
tshuli 8abadfc
chore: max payment amount in cents
tshuli 5688716
fix: frontend validation in dollars
tshuli 11cc661
feat: add minimum payment limit
tshuli 760ea45
chore: map error route for InvalidPaymentAmountError
tshuli fa5308e
chore: use spread operator for updatedPaymentSettings
tshuli 0bd5f0b
chore: combine min and max payment checks
tshuli 0493f2d
nit: dangling import in other file
tshuli e5d988d
chore: use centsToDollars
tshuli 243a664
chore: no need to convert env var values to string
tshuli 663724e
chore: keep reference amount in cents for comparator
tshuli 04a7165
Merge remote-tracking branch 'origin/feat/payment-max-limit' into fea…
tshuli 665d045
Merge remote-tracking branch 'origin/feat/payment-mvp' into feat/paym…
tshuli 3c0f0d1
Merge remote-tracking branch 'origin/feat/payment-mvp' into feat/paym…
tshuli 0a40704
chore: fix tests
tshuli 9b3d47f
Merge remote-tracking branch 'origin/feat/payment-mvp' into feat/paym…
tshuli File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { ApplicationError } from '../core/core.errors' | ||
|
||
export class PaymentNotFoundError extends ApplicationError { | ||
constructor(message = 'Payment not found') { | ||
super(message) | ||
} | ||
} | ||
|
||
export class InvalidPaymentAmountError extends ApplicationError { | ||
constructor(message = 'Invalid payment amount') { | ||
super(message) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
/justNoting (nothing to do): this defensive checks helps at release (new code hitting old server for env), but feels unnecessary at steady state thereafter 🤔 We should expect the client to be able to load valid env vars to operate, or things wouldn't work generally.