You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Traceback (most recent call last):
File "/Users/magedhelmy/Desktop/VS_Code/licensingDemo4/.venv/lib/python3.10/site-packages/drf_stripe/stripe_webhooks/handler.py", line 53, in handle_webhook_event
e = StripeEvent(event=event)
File "pydantic/main.py", line 341, in pydantic.main.BaseModel.__init__
pydantic.error_wrappers.ValidationError: 1 validation error for StripeEvent
event
No match for discriminator 'type' and value 'customer.created' (allowed values: <EventType.CUSTOMER_SUBSCRIPTION_DELETED: 'customer.subscription.deleted'>, <EventType.CUSTOMER_SUBSCRIPTION_UPDATED: 'customer.subscription.updated'>, <EventType.CUSTOMER_SUBSCRIPTION_CREATED: 'customer.subscription.created'>, <EventType.INVOICE_PAID: 'invoice.paid'>, <EventType.INVOICE_CREATED: 'invoice.created'>, <EventType.INVOICE_PAYMENT_FAILED: 'invoice.payment_failed'>, <EventType.PRODUCT_UPDATED: 'product.updated'>, <EventType.PRODUCT_CREATED: 'product.created'>, <EventType.PRODUCT_DELETED: 'product.deleted'>, <EventType.PRICE_CREATED: 'price.created'>, <EventType.PRICE_UPDATED: 'price.updated'>, <EventType.PRICE_DELETED: 'price.deleted'>, <class 'str'>) (type=value_error.discriminated_union.invalid_discriminator; discriminator_key=type; discriminator_value=customer.created; allowed_values=<EventType.CUSTOMER_SUBSCRIPTION_DELETED: 'customer.subscription.deleted'>, <EventType.CUSTOMER_SUBSCRIPTION_UPDATED: 'customer.subscription.updated'>, <EventType.CUSTOMER_SUBSCRIPTION_CREATED: 'customer.subscription.created'>, <EventType.INVOICE_PAID: 'invoice.paid'>, <EventType.INVOICE_CREATED: 'invoice.created'>, <EventType.INVOICE_PAYMENT_FAILED: 'invoice.payment_failed'>, <EventType.PRODUCT_UPDATED: 'product.updated'>, <EventType.PRODUCT_CREATED: 'product.created'>, <EventType.PRODUCT_DELETED: 'product.deleted'>, <EventType.PRICE_CREATED: 'price.created'>, <EventType.PRICE_UPDATED: 'price.updated'>, <EventType.PRICE_DELETED: 'price.deleted'>, <class 'str'>)
During the handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/magedhelmy/Desktop/VS_Code/licensingDemo4/.venv/lib/python3.10/site-packages/django/core/handlers/exception.py", line 47, in inner
response = get_response(request)
File "/Users/magedhelmy/Desktop/VS_Code/licensingDemo4/.venv/lib/python3.10/site-packages/django/core/handlers/base.py", line 181, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/Users/magedhelmy/Desktop/VS_Code/licensingDemo4/.venv/lib/python3.10/site-packages/django/views/decorators/csrf.py", line 54, in wrapped_view
return view_func(*args, **kwargs)
File "/Users/magedhelmy/Desktop/VS_Code/licensingDemo4/.venv/lib/python3.10/site-packages/django/views/generic/base.py", line 70, in view
return self.dispatch(request, *args, **kwargs)
File "/Users/magedhelmy/Desktop/VS_Code/licensingDemo4/.venv/lib/python3.10/site-packages/rest_framework/views.py", line 509, in dispatch
response = self.handle_exception(exc)
File "/Users/magedhelmy/Desktop/VS_Code/licensingDemo4/.venv/lib/python3.10/site-packages/rest_framework/views.py", line 469, in handle_exception
self.raise_uncaught_exception(exc)
File "/Users/magedhelmy/Desktop/VS_Code/licensingDemo4/.venv/lib/python3.10/site-packages/rest_framework/views.py", line 480, in raise_uncaught_exception
raise exc
File "/Users/magedhelmy/Desktop/VS_Code/licensingDemo4/.venv/lib/python3.10/site-packages/rest_framework/views.py", line 506, in dispatch
response = handler(request, *args, **kwargs)
File "/Users/magedhelmy/Desktop/VS_Code/licensingDemo4/.venv/lib/python3.10/site-packages/drf_stripe/views.py", line 69, in post
handle_stripe_webhook_request(request)
File "/Users/magedhelmy/Desktop/VS_Code/licensingDemo4/.venv/lib/python3.10/site-packages/drf_stripe/stripe_webhooks/handler.py", line 15, in handle_stripe_webhook_request
handle_webhook_event(event)
File "/Users/magedhelmy/Desktop/VS_Code/licensingDemo4/.venv/lib/python3.10/site-packages/drf_stripe/stripe_webhooks/handler.py", line 55, in handle_webhook_event
_handle_event_type_validation_error(err)
File "/Users/magedhelmy/Desktop/VS_Code/licensingDemo4/.venv/lib/python3.10/site-packages/drf_stripe/stripe_webhooks/handler.py", line 41, in _handle_event_type_validation_error
if error_loc[0] == 'event' and error_loc[1] == 'type':
IndexError: tuple index out of range
I do not understand the error and I am not sure how to proceed from here.
The text was updated successfully, but these errors were encountered:
Essentially, your Stripe account is sending an event customer.created to your Django server, but this package currently only deals with the following events as outlined in the README:
Customer will be created and associated with a Django user whenever any of these events above references a customer that Django has not seen before, you do not need to explicitly send the web hook event from your Stripe account just for customer creation.
When I create a user on the Django admin panel the following way, I get the following error
The error occurs when the following is running
stripe listen --forward-to 127.0.0.1:8000/stripe/webhook/
Here is the error I get
I do not understand the error and I am not sure how to proceed from here.
The text was updated successfully, but these errors were encountered: