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

feat: add check order receipt endpoint #2327

Merged
merged 8 commits into from
Feb 2, 2024

Conversation

pavelbrm
Copy link
Contributor

@pavelbrm pavelbrm commented Feb 1, 2024

Summary

This PR adds a new endpoint for checking if a receipt is valid, if there is an order for it, and if the order matches the given order id.

The endpoint is defined as follows:

  • It requires authentication (similar to set-trial);
  • PATCH at /v1/orders/{orderID}/receipt;
    • POST is reserved for moving submit-receipt here later on;
  • Success:
    • 200 OK with an empty body ({})
  • Failures:
    • various 400 Bad Request responses for validation errors;
    • 404 Not Found when the order was not found by the external ID;
    • Special 424 Failed Dependency when the supplied order id is different from the order found by the receipt;
      • 403 is not appropriate for this endpoint because it's authenticated, and this code might be needed in the future;
    • 500 Internal Server Error for the unclassified failures.

Type of Change

  • Product feature
  • Bug fix
  • Performance improvement
  • Refactor
  • Other

Tested Environments

  • Development
  • Staging
  • Production

Before Requesting Review

  • Does your code build cleanly without any errors or warnings?
  • Have you used auto closing keywords?
  • Have you added tests for new functionality?
  • Have validated query efficiency for new database queries?
  • Have documented new functionality in README or in comments?
  • Have you squashed all intermediate commits?
  • Is there a clear title that explains what the PR does?
  • Have you used intuitive function, variable and other naming?
  • Have you requested security and/or privacy review if needed
  • Have you performed a self review of this PR?

Manual Test Plan


@pavelbrm pavelbrm self-assigned this Feb 1, 2024
@pavelbrm pavelbrm requested review from husobee and clD11 February 1, 2024 08:26
@pavelbrm pavelbrm marked this pull request as ready for review February 1, 2024 08:26
@pavelbrm pavelbrm merged commit a32650a into master Feb 2, 2024
12 checks passed
@pavelbrm pavelbrm deleted the add-check-receipt-endpoint-01 branch February 2, 2024 09:47
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