Skip to content

🐛 AttributeError: module 'stripe' has no attribute 'StripeError' #10

@glind

Description

@glind

Error Details

Error Type: AttributeError
Error Message: module 'stripe' has no attribute 'StripeError'

Occurrence Details

URL: /marketplace/api/purchases/create_checkout/
Method: POST
User: admin
Timestamp: 2025-12-18T17:30:50.692421

Traceback

Traceback (most recent call last):
  File "/app/forge/views.py", line 278, in create_checkout
    checkout_session = stripe.checkout.Session.create(
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/stripe/api_resources/abstract/createable_api_resource.py", line 16, in create
    return cls._static_request(
           ^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/stripe/api_resources/abstract/api_resource.py", line 139, in _static_request
    response, api_key = requestor.request(method_, url_, params, headers)
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/stripe/api_requestor.py", line 122, in request
    resp = self.interpret_response(rbody, rcode, rheaders)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/stripe/api_requestor.py", line 399, in interpret_response
    self.handle_error_response(rbody, rcode, resp.data, rheaders)
  File "/usr/local/lib/python3.11/site-packages/stripe/api_requestor.py", line 159, in handle_error_response
    raise err
stripe.error.InvalidRequestError: Request req_2IdPzcAOpy4T4M: The Checkout Session's total amount due cannot be zero in `payment` mode. Please see https://stripe.com/docs/currencies#minimum-and-maximum-charge-amounts

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/django/core/handlers/base.py", line 181, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/django/views/decorators/csrf.py", line 54, in wrapped_view
    return view_func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/rest_framework/viewsets.py", line 125, in view
    return self.dispatch(request, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/rest_framework/views.py", line 509, in dispatch
    response = self.handle_exception(exc)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/rest_framework/views.py", line 469, in handle_exception
    self.raise_uncaught_exception(exc)
  File "/usr/local/lib/python3.11/site-packages/rest_framework/views.py", line 480, in raise_uncaught_exception
    raise exc
  File "/usr/local/lib/python3.11/site-packages/rest_framework/views.py", line 506, in dispatch
    response = handler(request, *args, **kwargs)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/forge/views.py", line 325, in create_checkout
    except stripe.StripeError as e:
           ^^^^^^^^^^^^^^^^^^
AttributeError: module 'stripe' has no attribute 'StripeError'

This issue was automatically created by the error handler middleware.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions