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

Implement organizer onboarding process | Validate condition to public Event #429

Merged
merged 32 commits into from
Nov 20, 2024

Conversation

lcduong
Copy link
Contributor

@lcduong lcduong commented Nov 11, 2024

This PR partly resolves issue #379 Implement organizer onboarding process

This PR implement:

  • Add a condition in checking step when public Event: Not allow Event to be published if Credit card not fulfilled.

image

Note: Depend on this PR #411

Summary by Sourcery

Implement organizer onboarding process with a new billing settings form and Stripe integration for payment management. Prevent event publication if billing information is incomplete.

New Features:

  • Introduce a billing settings form for organizers to manage their billing information, including contact details, address, and tax ID.
  • Implement Stripe integration for handling payment methods and setup intents for organizers.

Enhancements:

  • Add a condition to prevent events from being published if the organizer's billing information is incomplete.

Build:

  • Add 'pyvat' as a new dependency in the project.

Summary by Sourcery

Implement organizer onboarding process with a new billing settings form and Stripe integration for payment management. Prevent event publication if billing information is incomplete.

New Features:

  • Introduce a billing settings form for organizers to manage their billing information, including contact details, address, and tax ID.
  • Implement Stripe integration for handling payment methods and setup intents for organizers.

Enhancements:

  • Add a condition to prevent events from being published if the organizer's billing information is incomplete.

Build:

  • Add 'pyvat' as a new dependency in the project.

Copy link

sourcery-ai bot commented Nov 11, 2024

Reviewer's Guide by Sourcery

This PR implements part of the organizer onboarding process by adding billing settings functionality and validation for event publication. The implementation includes a new billing settings form with Stripe integration for payment management, and prevents events from being published if the organizer's billing information and credit card details are not properly configured.

Class Diagram for Billing Settings and Stripe Integration

classDiagram
    class OrganizerBillingModel {
        +String primary_contact_name
        +String primary_contact_email
        +String company_or_organization_name
        +String address_line_1
        +String address_line_2
        +String city
        +String zip_code
        +String country
        +String preferred_language
        +String tax_id
        +String stripe_customer_id
        +String stripe_payment_method_id
        +String stripe_setup_intent_id
        +save()
        +delete()
    }
    class BillingSettingsForm {
        +CharField primary_contact_name
        +EmailField primary_contact_email
        +CharField company_or_organization_name
        +CharField address_line_1
        +CharField address_line_2
        +CharField zip_code
        +CharField city
        +ChoiceField country
        +ChoiceField preferred_language
        +CharField tax_id
        +set_initial_data()
        +save()
    }
    class StripeUtils {
        +create_stripe_customer(email, name)
        +update_customer_info(customer_id, email, name)
        +create_setup_intent(customer_id)
        +update_payment_info(setup_intent_id, customer_id)
        +get_payment_method_info(stripe_customer_id)
    }
    OrganizerBillingModel --> BillingSettingsForm
    BillingSettingsForm --> StripeUtils
Loading

File-Level Changes

Change Details Files
Added new billing settings form and model for organizers
  • Created BillingSettingsForm with fields for contact info, address, and tax ID
  • Implemented OrganizerBillingModel to store billing and payment information
  • Added form validation for tax ID and VAT numbers
  • Created new billing settings template with responsive design
src/pretix/control/forms/organizer_forms/organizer_form.py
src/pretix/base/models/organizer.py
src/pretix/control/templates/pretixcontrol/organizers/billing.html
Implemented Stripe integration for payment processing
  • Created utility functions for Stripe API interactions
  • Added setup intent and payment method handling
  • Implemented error handling for Stripe operations
  • Added client-side JavaScript for payment form handling
src/pretix/helpers/stripe_utils.py
src/pretix/static/billing/js/billing.js
Added validation to prevent event publication without complete billing information
  • Added check for credit card information in event live issues
  • Implemented validation for billing information completeness
src/pretix/base/models/event.py
Updated routing and navigation for billing settings
  • Added new URL patterns for billing-related endpoints
  • Added billing settings to organizer navigation menu
src/pretix/control/urls.py
src/pretix/control/navigation.py

Possibly linked issues


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

@lcduong lcduong marked this pull request as ready for review November 11, 2024 07:27
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 @lcduong - I've reviewed your changes - here's some feedback:

Overall Comments:

  • Please add test coverage for the Stripe integration and payment processing flows to ensure reliability of these critical payment features.
  • Consider adding documentation about security considerations and data handling, particularly around the storage and processing of sensitive payment information.
Here's what I looked at during the review
  • 🟢 General issues: all looks good
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟡 Complexity: 2 issues found
  • 🟢 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/helpers/stripe_utils.py Outdated Show resolved Hide resolved
src/pretix/control/forms/organizer_forms/organizer_form.py Outdated Show resolved Hide resolved
@mariobehling mariobehling merged commit c688a83 into fossasia:development Nov 20, 2024
4 of 5 checks passed
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.

3 participants