Skip to content

to checkout a single item userid is required#10

Open
tailorsmit wants to merge 3 commits into
masterfrom
smit/buynow
Open

to checkout a single item userid is required#10
tailorsmit wants to merge 3 commits into
masterfrom
smit/buynow

Conversation

@tailorsmit
Copy link
Copy Markdown

to order a single item we need a user id so i added a another api that returns the user id

return new ResponseEntity<StripeResponse>(stripeResponse, HttpStatus.OK);
}

@PostMapping("/single-checkout")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

rename it checkout-single-product

public ResponseEntity<StripeResponse> singleitemcheckout(@RequestBody CheckoutItemDto checkoutItemDto, @RequestParam String token) throws StripeException {

try {
int id = authenticationService.getUser(token).getId();
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

throe Authentication exception in method instead of try catch

public SignInResponseDto Signup(@RequestBody SignInDto signInDto) throws CustomException {
return userService.signIn(signInDto);
}
@GetMapping("/getuserid")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

do you still need it?

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.

2 participants