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

Create a request callback method for dj-stripe #4333

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 12 additions & 0 deletions kobo/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -580,7 +580,19 @@ def __init__(self, *args, **kwargs):
if env.str('STRIPE_TEST_SECRET_KEY', None) or env.str('STRIPE_LIVE_SECRET_KEY', None):
STRIPE_ENABLED = True


def dj_stripe_request_callback_method():
# This method exists because dj-stripe's documentation doesn't reflect reality.
JacquelineMorrissette marked this conversation as resolved.
Show resolved Hide resolved
# It claims that DJSTRIPE_SUBSCRIBER_MODEL no longer needs a request callback but
# this error occurs without it: `DJSTRIPE_SUBSCRIBER_MODEL_REQUEST_CALLBACK must
# be implemented if a DJSTRIPE_SUBSCRIBER_MODEL is defined`
# It doesn't need to do anything other than exist
# https://github.com/dj-stripe/dj-stripe/issues/1900
pass


DJSTRIPE_SUBSCRIBER_MODEL = "organizations.Organization"
DJSTRIPE_SUBSCRIBER_MODEL_REQUEST_CALLBACK = dj_stripe_request_callback_method
DJSTRIPE_FOREIGN_KEY_TO_FIELD = 'id'
DJSTRIPE_USE_NATIVE_JSONFIELD = True
STRIPE_PRICING_TABLE_ID = env.str("STRIPE_PRICING_TABLE_ID", None)
Expand Down