Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
pcrespov committed Dec 4, 2024
1 parent f6c7e5d commit c2d3389
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -279,8 +279,6 @@ async def get_solver_pricing_plan(
pricing_plan_or_none = await webserver_api.get_service_pricing_plan(
solver_key=solver_key, version=version
)

# TODO: raise if None!! Check with MB
assert pricing_plan_or_none

# NOTE: pricing_plan_or_none https://github.com/ITISFoundation/osparc-simcore/issues/6901
assert pricing_plan_or_none # nosec
return pricing_plan_or_none
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
PaymentMethodNotFoundError,
PaymentNotFoundError,
)
from servicelib.logging_errors import create_troubleshotting_log_kwargs
from servicelib.logging_utils import log_context

from ..._constants import ACKED, PGDB
Expand Down Expand Up @@ -77,9 +78,22 @@ async def acknowledge_payment(
)

if ack.saved:
if ack.saved.payment_method_id is None:
_logger.error("Failed to ") # failed to save create-card
# TODO: notify failure to save !
if ack.saved.payment_method_id is None or not ack.saved.success:
_logger.error(
**create_troubleshotting_log_kwargs(
f"Got ack that {payment_id=} was completed but failed to save the payment-method used for the payment as requested.",
error=RuntimeError("Failed to save payment-method after payment"),
error_context={
"ack": ack,
"user_id": transaction.user_id,
"payment_id": payment_id,
"transaction": transaction,
},
tip="This issue is not critical. Since the payment-method could not be saved, "
"the user cannot use it in following payments and will have to re-introduce it manually"
"SEE https://github.com/ITISFoundation/osparc-simcore/issues/6902",
)
)
else:
inserted = await payments_methods.insert_payment_method(
repo=repo_methods,
Expand Down

0 comments on commit c2d3389

Please sign in to comment.