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

Add public key and secret key of Stripe in admin settings page #509

Open
wants to merge 5 commits into
base: development
Choose a base branch
from

Conversation

HungNgien
Copy link
Collaborator

@HungNgien HungNgien commented Jan 15, 2025

Description: add fields in the global settings to input Stripe keys, allowing the billing information of organizers to be saved when the fields are filled.

This PR resolves #485

Summary by Sourcery

New Features:

  • Allow organizers to input their Stripe keys in the global settings, enabling the platform to store their billing information.

@HungNgien HungNgien marked this pull request as ready for review January 16, 2025 07:33
Copy link

sourcery-ai bot commented Jan 16, 2025

Reviewer's Guide by Sourcery

This pull request adds fields for Stripe keys in the global settings admin page, enabling the storage of organizer billing information upon completion.

Class diagram for Stripe key validation and settings form

classDiagram
    class GlobalSettingsForm {
        +__init__(*args, **kwargs)
    }
    class StripeKeyValidator {
        -_prefixes: List[str]
        +__init__(prefix: Union[str, List[str]])
        +__call__(value: str)
    }
    class SecretKeySettingsField {
    }
    GlobalSettingsForm --> StripeKeyValidator : uses
    GlobalSettingsForm --> SecretKeySettingsField : uses
    note for GlobalSettingsForm "Added new Stripe Connect
key fields with validators"
    note for StripeKeyValidator "New validator class for
Stripe API key format"
Loading

File-Level Changes

Change Details Files
Added fields for Stripe Connect keys
  • Added fields for Stripe Connect secret key (live and test)
  • Added fields for Stripe Connect publishable key (live and test)
  • Added a validator to ensure the keys start with the correct prefixes
src/pretix/control/forms/global_settings.py

Assessment against linked issues

Issue Objective Addressed Explanation
#485 Ensure the system works without dependency on the Stripe module
#485 Add 2 new fields in global settings of admin for inputting Stripe keys
#485 Enable organizer billing to use Stripe keys from global settings

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time. You can also use
    this command to specify where the summary should be inserted.

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @HungNgien - I've reviewed your changes and they look great!

Here's what I looked at during the review
  • 🟡 General issues: 1 issue found
  • 🟡 Security: 1 issue found
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

src/pretix/control/forms/global_settings.py Show resolved Hide resolved
src/pretix/control/forms/global_settings.py Outdated Show resolved Hide resolved
@HungNgien HungNgien marked this pull request as draft January 16, 2025 07:50
@HungNgien HungNgien marked this pull request as ready for review January 16, 2025 08:18
Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @HungNgien - I've reviewed your changes and they look great!

Here's what I looked at during the review
  • 🟡 General issues: 1 issue found
  • 🟡 Security: 1 issue found
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

src/pretix/control/forms/global_settings.py Show resolved Hide resolved
src/pretix/control/forms/global_settings.py Outdated Show resolved Hide resolved
@mariobehling mariobehling requested a review from hongquan January 17, 2025 10:10
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

Successfully merging this pull request may close these issues.

Global settings - new form to input stripe key
1 participant