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

Error when make payments locally #424

Open
paulocoutinhox opened this issue Sep 20, 2024 · 2 comments
Open

Error when make payments locally #424

paulocoutinhox opened this issue Sep 20, 2024 · 2 comments

Comments

@paulocoutinhox
Copy link
Contributor

Hi,

Im trying test this library.

But when i listen locally with stripe cli and make a local payment it only give me error:

Stripe CLI:

2024-09-19 21:49:18   --> payment_intent.succeeded [evt_3Q0v28EUm7G1T8P41FYyqdPh]
2024-09-19 21:49:18   --> charge.succeeded [evt_3Q0v28EUm7G1T8P413Bt8fVq]
2024-09-19 21:49:18  <--  [500] POST http://localhost:8000/payments/process/stripe/ [evt_3Q0v28EUm7G1T8P41FYyqdPh]
2024-09-19 21:49:18  <--  [500] POST http://localhost:8000/payments/process/stripe/ [evt_3Q0v28EUm7G1T8P413Bt8fVq]
2024-09-19 21:49:18   --> payment_intent.created [evt_3Q0v28EUm7G1T8P41LTjOiDR]
2024-09-19 21:49:18  <--  [500] POST http://localhost:8000/payments/process/stripe/ [evt_3Q0v28EUm7G1T8P41LTjOiDR]
2024-09-19 21:49:20   --> charge.updated [evt_3Q0v28EUm7G1T8P4168kQUuC]
2024-09-19 21:49:20  <--  [500] POST http://localhost:8000/payments/process/stripe/ [evt_3Q0v28EUm7G1T8P4168kQUuC]
2024-09-19 21:49:24   --> checkout.session.completed [evt_1Q0v2FEUm7G1T8P44kb2hHhC]
2024-09-19 21:49:24  <--  [200] POST http://localhost:8000/payments/process/stripe/ [evt_1Q0v2FEUm7G1T8P44kb2hHhC]

App:

[20/Sep/2024 00:47:10] "POST /payments/process/stripe/ HTTP/1.1" 500 109937
[20/Sep/2024 00:48:54] "GET / HTTP/1.1" 200 3579
[20/Sep/2024 00:48:54] "GET /static/CACHE/js/output.c3aca029a680.js HTTP/1.1" 200 168231
[20/Sep/2024 00:48:54] "GET /static/CACHE/css/output.80b3f02238f7.css HTTP/1.1" 200 315578
[20/Sep/2024 00:48:54] "GET /static/CACHE/js/output.3bb50f9aa3d1.js HTTP/1.1" 200 28971
[20/Sep/2024 00:48:58] "GET /shop/buy/mensal HTTP/1.1" 302 0
Internal Server Error: /payments/process/stripe/
Traceback (most recent call last):
  File "/opt/homebrew/lib/python3.10/site-packages/payments/stripe/providers.py", line 233, in get_token_from_request
    return event["data"]["object"]["client_reference_id"]
KeyError: 'client_reference_id'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/opt/homebrew/lib/python3.10/site-packages/django/core/handlers/exception.py", line 55, in inner
    response = get_response(request)
  File "/opt/homebrew/lib/python3.10/site-packages/django/core/handlers/base.py", line 197, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/opt/homebrew/lib/python3.10/site-packages/django/views/decorators/csrf.py", line 65, in _view_wrapper
    return view_func(request, *args, **kwargs)
  File "/opt/homebrew/Cellar/python@3.10/3.10.14_1/Frameworks/Python.framework/Versions/3.10/lib/python3.10/contextlib.py", line 79, in inner
    return func(*args, **kwds)
  File "/opt/homebrew/lib/python3.10/site-packages/payments/urls.py", line 45, in static_callback
    token = provider.get_token_from_request(request=request, payment=None)
  File "/opt/homebrew/lib/python3.10/site-packages/payments/stripe/providers.py", line 235, in get_token_from_request
    raise PaymentError(
payments.PaymentError: client_reference_id is not present, check Stripe Dashboard.
Internal Server Error: /payments/process/stripe/
Traceback (most recent call last):
  File "/opt/homebrew/lib/python3.10/site-packages/payments/stripe/providers.py", line 233, in get_token_from_request
    return event["data"]["object"]["client_reference_id"]
KeyError: 'client_reference_id'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/opt/homebrew/lib/python3.10/site-packages/django/core/handlers/exception.py", line 55, in inner
    response = get_response(request)
  File "/opt/homebrew/lib/python3.10/site-packages/django/core/handlers/base.py", line 197, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/opt/homebrew/lib/python3.10/site-packages/django/views/decorators/csrf.py", line 65, in _view_wrapper
    return view_func(request, *args, **kwargs)
  File "/opt/homebrew/Cellar/python@3.10/3.10.14_1/Frameworks/Python.framework/Versions/3.10/lib/python3.10/contextlib.py", line 79, in inner
    return func(*args, **kwds)
  File "/opt/homebrew/lib/python3.10/site-packages/payments/urls.py", line 45, in static_callback
    token = provider.get_token_from_request(request=request, payment=None)
  File "/opt/homebrew/lib/python3.10/site-packages/payments/stripe/providers.py", line 235, in get_token_from_request
    raise PaymentError(
payments.PaymentError: client_reference_id is not present, check Stripe Dashboard.
[20/Sep/2024 00:49:18] "POST /payments/process/stripe/ HTTP/1.1" 500 106133
[20/Sep/2024 00:49:18] "POST /payments/process/stripe/ HTTP/1.1" 500 109857
Internal Server Error: /payments/process/stripe/
Traceback (most recent call last):
  File "/opt/homebrew/lib/python3.10/site-packages/payments/stripe/providers.py", line 233, in get_token_from_request
    return event["data"]["object"]["client_reference_id"]
KeyError: 'client_reference_id'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/opt/homebrew/lib/python3.10/site-packages/django/core/handlers/exception.py", line 55, in inner
    response = get_response(request)
  File "/opt/homebrew/lib/python3.10/site-packages/django/core/handlers/base.py", line 197, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/opt/homebrew/lib/python3.10/site-packages/django/views/decorators/csrf.py", line 65, in _view_wrapper
    return view_func(request, *args, **kwargs)
  File "/opt/homebrew/Cellar/python@3.10/3.10.14_1/Frameworks/Python.framework/Versions/3.10/lib/python3.10/contextlib.py", line 79, in inner
    return func(*args, **kwds)
  File "/opt/homebrew/lib/python3.10/site-packages/payments/urls.py", line 45, in static_callback
    token = provider.get_token_from_request(request=request, payment=None)
  File "/opt/homebrew/lib/python3.10/site-packages/payments/stripe/providers.py", line 235, in get_token_from_request
    raise PaymentError(
payments.PaymentError: client_reference_id is not present, check Stripe Dashboard.
[20/Sep/2024 00:49:18] "POST /payments/process/stripe/ HTTP/1.1" 500 106013
Internal Server Error: /payments/process/stripe/
Traceback (most recent call last):
  File "/opt/homebrew/lib/python3.10/site-packages/payments/stripe/providers.py", line 233, in get_token_from_request
    return event["data"]["object"]["client_reference_id"]
KeyError: 'client_reference_id'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/opt/homebrew/lib/python3.10/site-packages/django/core/handlers/exception.py", line 55, in inner
    response = get_response(request)
  File "/opt/homebrew/lib/python3.10/site-packages/django/core/handlers/base.py", line 197, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/opt/homebrew/lib/python3.10/site-packages/django/views/decorators/csrf.py", line 65, in _view_wrapper
    return view_func(request, *args, **kwargs)
  File "/opt/homebrew/Cellar/python@3.10/3.10.14_1/Frameworks/Python.framework/Versions/3.10/lib/python3.10/contextlib.py", line 79, in inner
    return func(*args, **kwds)
  File "/opt/homebrew/lib/python3.10/site-packages/payments/urls.py", line 45, in static_callback
    token = provider.get_token_from_request(request=request, payment=None)
  File "/opt/homebrew/lib/python3.10/site-packages/payments/stripe/providers.py", line 235, in get_token_from_request
    raise PaymentError(
payments.PaymentError: client_reference_id is not present, check Stripe Dashboard.
[20/Sep/2024 00:49:20] "POST /payments/process/stripe/ HTTP/1.1" 500 109857

[20/Sep/2024 00:49:24] "POST /payments/process/stripe/ HTTP/1.1" 200 16

What can be wrong?

@mariofix
Copy link
Member

Do you have a GitHub repo to checkout and see your code?

@paulocoutinhox
Copy link
Contributor Author

paulocoutinhox commented Sep 20, 2024 via email

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

No branches or pull requests

2 participants