Skip to content
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

Feature/add input validation #6

Open
wants to merge 5 commits into
base: dev
Choose a base branch
from

Conversation

arunabahmukherjee-zz
Copy link
Collaborator

Added validation for API Input parameters. Please validate the impact to Stripe functionality.

ApiError error = new ApiError();
error.code = 500;
error.status = HttpStatus.INTERNAL_SERVER_ERROR.toString();
error.message = "Uh oh! something went wrong processing your request. Please try again or advise the administrator.";
error.message = exp.getMessage();
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I dont think we should show the customer intneral message. The previous approach was better. Also i added some code to log this exception since we are overriding it

error.status = HttpStatus.BAD_REQUEST.toString();
error.message = "Business has already been claimed. Please contact administrator for assistance.";
error.status = HttpStatus.CONFLICT.toString();
error.message = exp.getMessage();
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment lets not show user internal message.

private String businessId;
@NotNull
@NotEmpty
@Email
private String email;
private String phone;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we validate phone number?

Copy link
Owner

@debajyotimahanta debajyotimahanta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please review the suggested changes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants