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

🐛 Improved Error Handling for Missing Billing Details #6418

Merged
merged 3 commits into from
Sep 21, 2024

Conversation

pcrespov
Copy link
Member

@pcrespov pcrespov commented Sep 20, 2024

What do these changes do?

Improved Error Handling for Missing Pre-registration and Billing Details**

Previously, when account setup was incomplete or pre-registration information (such as billing country) was missing, the payment process would fail raising an 500 that displayed confusing message in the front-end (should be address in #5487). This was due to the REST handlers not properly addressing the absence of required billing details.

image

With this update, the service now responds with HTTP_503_SERVICE_UNAVAILABLE and an explicit message indicating that the payment service is unavailable until the necessary billing details are provided. Currently, these details can only be supplied on the service side (filling the user_pre_registration table).

Additionally, errors related to missing billing information are now logged with an OEC code and relevant debug data, making them easier to trace in the logs or use as triggers for alerts.

Related issue/s

  • Occurred using misconfigured master deploy with @odeimaiz

How to test

cd services/web/server
pytest -vv tests/units/with_dbs -k test_billing_info_missing_error

Dev-ops checklist

@pcrespov pcrespov self-assigned this Sep 20, 2024
@pcrespov pcrespov added the a:webserver issue related to the webserver service label Sep 20, 2024
@pcrespov pcrespov added this to the MartinKippenberger milestone Sep 20, 2024
Copy link
Member

@sanderegg sanderegg left a comment

Choose a reason for hiding this comment

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

very nice! thanks!

Copy link

codecov bot commented Sep 20, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 90.2%. Comparing base (cafbf96) to head (7daf755).
Report is 565 commits behind head on master.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff            @@
##           master   #6418      +/-   ##
=========================================
+ Coverage    84.5%   90.2%    +5.6%     
=========================================
  Files          10    1178    +1168     
  Lines         214   51803   +51589     
  Branches       25     865     +840     
=========================================
+ Hits          181   46734   +46553     
- Misses         23    4938    +4915     
- Partials       10     131     +121     
Flag Coverage Δ
integrationtests 64.6% <44.4%> (?)
unittests 87.7% <100.0%> (+3.1%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...ackages/models-library/src/models_library/users.py 100.0% <100.0%> (ø)
...simcore_service_webserver/payments/_onetime_api.py 92.4% <ø> (ø)
.../server/src/simcore_service_webserver/users/_db.py 98.6% <100.0%> (ø)
.../src/simcore_service_webserver/users/exceptions.py 93.1% <100.0%> (ø)
...rc/simcore_service_webserver/wallets/_constants.py 100.0% <100.0%> (ø)
...src/simcore_service_webserver/wallets/_handlers.py 97.0% <100.0%> (ø)

... and 1159 files with indirect coverage changes

Copy link

@pcrespov pcrespov merged commit e880d71 into ITISFoundation:master Sep 21, 2024
57 checks passed
@pcrespov pcrespov deleted the fix/errors-payments branch September 23, 2024 15:24
mrnicegyu11 pushed a commit to mrnicegyu11/osparc-simcore that referenced this pull request Oct 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a:webserver issue related to the webserver service
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants