# Generated by Django 2.2.5 on 2019-09-11 23:33

import django.db.models.deletion
from django.db import migrations, models

import djstripe.enums
import djstripe.fields


def fix_djstripepaymentmethod_index_name_forwards(apps, schema_editor):
    # Altering the index is required because while we changed the name of old PaymentMethod model to
    # DjStripePaymentMethod, the migrations didn't update the names of index.
    # In the current migration, we create a new PaymentMethod model, hence before creating it, its
    # better to rename the old index.
    if not schema_editor.connection.vendor.startswith("postgres"):
        return
    schema_editor.execute(
        "ALTER INDEX djstripe_paymentmethod_id_0b9251df_like rename TO djstripe_paymentmethod_legacy_id_0b9251df_like"
    )


def fix_djstripepaymentmethod_index_name_backwards(apps, schema_editor):
    if not schema_editor.connection.vendor.startswith("postgres"):
        return
    schema_editor.execute(
        "ALTER INDEX djstripe_paymentmethod_legacy_id_0b9251df_like rename TO djstripe_paymentmethod_id_0b9251df_like"
    )


class Migration(migrations.Migration):

    dependencies = [
        ("djstripe", "0003_auto_20181117_2328_squashed_0004_auto_20190227_2114")
    ]

    operations = [
        # Altering the index is required because while we have changed the name of old PaymentMethod model to
        # DjStripePaymentMethod, the migrations didn't update the names of index.
        # In the current migration, we create a new PaymentMethod model, hence before creating it, its
        # better to rename the old index.
        migrations.RunPython(
            code=fix_djstripepaymentmethod_index_name_forwards,
            reverse_code=fix_djstripepaymentmethod_index_name_backwards,
        ),
        migrations.AlterField(
            model_name="subscriptionitem",
            name="quantity",
            field=models.PositiveIntegerField(
                blank=True,
                help_text="The quantity of the plan to which the customer should be subscribed.",
                null=True,
            ),
        ),
        migrations.AddField(
            model_name="invoice",
            name="auto_advance",
            field=models.NullBooleanField(
                help_text="Controls whether Stripe will perform automatic collection of the invoice. When false, the invoice’s state will not automatically advance without an explicit action."
            ),
        ),
        migrations.RenameField(
            model_name="account", old_name="business_logo", new_name="branding_icon"
        ),
        migrations.AddField(
            model_name="account",
            name="branding_logo",
            field=models.ForeignKey(
                help_text="A logo for the account that will be used in Checkout instead of the icon and without the account’s name next to it if provided. Must be at least 128px x 128px.",
                null=True,
                on_delete=django.db.models.deletion.SET_NULL,
                related_name="logo_account",
                to="djstripe.FileUpload",
            ),
        ),
        migrations.AddField(
            model_name="account",
            name="business_profile",
            field=djstripe.fields.JSONField(
                blank=True,
                help_text="Optional information related to the business.",
                null=True,
            ),
        ),
        migrations.AddField(
            model_name="account",
            name="business_type",
            field=djstripe.fields.StripeEnumField(
                blank=True,
                default="",
                enum=djstripe.enums.BusinessType,
                help_text="The business type.",
                max_length=10,
            ),
        ),
        migrations.AddField(
            model_name="account",
            name="company",
            field=djstripe.fields.JSONField(
                blank=True,
                help_text="Information about the company or business. This field is null unless business_type is set to company.",
                null=True,
            ),
        ),
        migrations.AddField(
            model_name="account",
            name="individual",
            field=djstripe.fields.JSONField(
                blank=True,
                help_text="Information about the person represented by the account. This field is null unless business_type is set to individual.",
                null=True,
            ),
        ),
        migrations.AddField(
            model_name="account",
            name="requirements",
            field=djstripe.fields.JSONField(
                blank=True,
                help_text="Information about the requirements for the account, including what information needs to be collected, and by when.",
                null=True,
            ),
        ),
        migrations.AddField(
            model_name="account",
            name="settings",
            field=djstripe.fields.JSONField(
                blank=True,
                help_text="Account options for customizing how the account functions within Stripe.",
                null=True,
            ),
        ),
        migrations.AlterModelOptions(
            name="invoice", options={"ordering": ["-created"]}
        ),
        migrations.RenameField(
            model_name="invoice",
            old_name="application_fee",
            new_name="application_fee_amount",
        ),
        migrations.RemoveField(model_name="invoice", name="date"),
        migrations.AddField(
            model_name="invoice",
            name="status_transitions",
            field=djstripe.fields.JSONField(blank=True, null=True),
        ),
        migrations.RenameField(
            model_name="customer", old_name="account_balance", new_name="balance"
        ),
        migrations.CreateModel(
            name="PaymentMethod",
            fields=[
                (
                    "djstripe_id",
                    models.BigAutoField(
                        primary_key=True, serialize=False, verbose_name="ID"
                    ),
                ),
                ("id", djstripe.fields.StripeIdField(max_length=255, unique=True)),
                (
                    "livemode",
                    models.NullBooleanField(
                        default=None,
                        help_text="Null here indicates that the livemode status is unknown or was previously unrecorded. Otherwise, this field indicates whether this record comes from Stripe test mode or live mode operation.",
                    ),
                ),
                (
                    "created",
                    djstripe.fields.StripeDateTimeField(
                        blank=True,
                        help_text="The datetime this object was created in stripe.",
                        null=True,
                    ),
                ),
                (
                    "metadata",
                    djstripe.fields.JSONField(
                        blank=True,
                        help_text="A set of key/value pairs that you can attach to an object. It can be useful for storing additional information about an object in a structured format.",
                        null=True,
                    ),
                ),
                (
                    "description",
                    models.TextField(
                        blank=True, help_text="A description of this object.", null=True
                    ),
                ),
                ("djstripe_created", models.DateTimeField(auto_now_add=True)),
                ("djstripe_updated", models.DateTimeField(auto_now=True)),
                (
                    "billing_details",
                    djstripe.fields.JSONField(
                        help_text="Billing information associated with the PaymentMethod that may be used or required by particular types of payment methods."
                    ),
                ),
                (
                    "card",
                    djstripe.fields.JSONField(
                        help_text="If this is a card PaymentMethod, this hash contains details about the card."
                    ),
                ),
                (
                    "card_present",
                    djstripe.fields.JSONField(
                        blank=True,
                        help_text="If this is an card_present PaymentMethod, this hash contains details about the Card Present payment method.",
                        null=True,
                    ),
                ),
                (
                    "type",
                    models.CharField(
                        blank=True,
                        help_text="The type of the PaymentMethod. An additional hash is included on the PaymentMethod with a name matching this value. It contains additional information specific to the PaymentMethod type.",
                        max_length=255,
                    ),
                ),
                (
                    "customer",
                    models.ForeignKey(
                        blank=True,
                        help_text="Customer to which this PaymentMethod is saved.This will not be set when the PaymentMethod has not been saved to a Customer.",
                        null=True,
                        on_delete=django.db.models.deletion.SET_NULL,
                        related_name="payment_methods",
                        to="djstripe.Customer",
                    ),
                ),
            ],
            options={"get_latest_by": "created", "abstract": False},
        ),
        migrations.AlterField(
            model_name="payout",
            name="destination",
            field=models.ForeignKey(
                help_text="Bank account or card the payout was sent to.",
                null=True,
                on_delete=django.db.models.deletion.PROTECT,
                to="djstripe.BankAccount",
            ),
        ),
        migrations.CreateModel(
            name="SetupIntent",
            fields=[
                (
                    "djstripe_id",
                    models.BigAutoField(
                        primary_key=True, serialize=False, verbose_name="ID"
                    ),
                ),
                ("id", djstripe.fields.StripeIdField(max_length=255, unique=True)),
                (
                    "livemode",
                    models.NullBooleanField(
                        default=None,
                        help_text="Null here indicates that the livemode status is unknown or was previously unrecorded. Otherwise, this field indicates whether this record comes from Stripe test mode or live mode operation.",
                    ),
                ),
                (
                    "created",
                    djstripe.fields.StripeDateTimeField(
                        blank=True,
                        help_text="The datetime this object was created in stripe.",
                        null=True,
                    ),
                ),
                (
                    "metadata",
                    djstripe.fields.JSONField(
                        blank=True,
                        help_text="A set of key/value pairs that you can attach to an object. It can be useful for storing additional information about an object in a structured format.",
                        null=True,
                    ),
                ),
                (
                    "description",
                    models.TextField(
                        blank=True, help_text="A description of this object.", null=True
                    ),
                ),
                ("djstripe_created", models.DateTimeField(auto_now_add=True)),
                ("djstripe_updated", models.DateTimeField(auto_now=True)),
                (
                    "application",
                    models.CharField(
                        blank=True,
                        help_text="ID of the Connect application that created the SetupIntent.",
                        max_length=255,
                    ),
                ),
                (
                    "cancellation_reason",
                    djstripe.fields.StripeEnumField(
                        blank=True,
                        enum=djstripe.enums.SetupIntentCancellationReason,
                        help_text="Reason for cancellation of this SetupIntent, one of abandoned, requested_by_customer, or duplicate",
                        max_length=21,
                    ),
                ),
                (
                    "client_secret",
                    models.TextField(
                        blank=True,
                        help_text="The client secret of this SetupIntent. Used for client-side retrieval using a publishable key.",
                        max_length=5000,
                    ),
                ),
                (
                    "last_setup_error",
                    djstripe.fields.JSONField(
                        blank=True,
                        help_text="The error encountered in the previous SetupIntent confirmation.",
                        null=True,
                    ),
                ),
                (
                    "next_action",
                    djstripe.fields.JSONField(
                        blank=True,
                        help_text="If present, this property tells you what actions you need to take inorder for your customer to continue payment setup.",
                        null=True,
                    ),
                ),
                (
                    "payment_method_types",
                    djstripe.fields.JSONField(
                        help_text="The list of payment method types (e.g. card) that this PaymentIntent is allowed to use."
                    ),
                ),
                (
                    "status",
                    djstripe.fields.StripeEnumField(
                        enum=djstripe.enums.SetupIntentStatus,
                        help_text="Status of this SetupIntent, one of requires_payment_method, requires_confirmation, requires_action, processing, canceled, or succeeded.",
                        max_length=23,
                    ),
                ),
                (
                    "usage",
                    djstripe.fields.StripeEnumField(
                        default="off_session",
                        enum=djstripe.enums.IntentUsage,
                        help_text="Indicates how the payment method is intended to be used in the future.",
                        max_length=11,
                    ),
                ),
                (
                    "customer",
                    models.ForeignKey(
                        blank=True,
                        help_text="Customer this SetupIntent belongs to, if one exists.",
                        null=True,
                        on_delete=django.db.models.deletion.SET_NULL,
                        to="djstripe.Customer",
                    ),
                ),
                (
                    "on_behalf_of",
                    models.ForeignKey(
                        blank=True,
                        help_text="The account (if any) for which the setup is intended.",
                        null=True,
                        on_delete=django.db.models.deletion.SET_NULL,
                        to="djstripe.Account",
                    ),
                ),
                (
                    "payment_method",
                    models.ForeignKey(
                        blank=True,
                        help_text="Payment method used in this PaymentIntent.",
                        null=True,
                        on_delete=django.db.models.deletion.SET_NULL,
                        to="djstripe.PaymentMethod",
                    ),
                ),
            ],
            options={"get_latest_by": "created", "abstract": False},
        ),
        migrations.CreateModel(
            name="PaymentIntent",
            fields=[
                (
                    "djstripe_id",
                    models.BigAutoField(
                        primary_key=True, serialize=False, verbose_name="ID"
                    ),
                ),
                ("id", djstripe.fields.StripeIdField(max_length=255, unique=True)),
                (
                    "livemode",
                    models.NullBooleanField(
                        default=None,
                        help_text="Null here indicates that the livemode status is unknown or was previously unrecorded. Otherwise, this field indicates whether this record comes from Stripe test mode or live mode operation.",
                    ),
                ),
                (
                    "created",
                    djstripe.fields.StripeDateTimeField(
                        blank=True,
                        help_text="The datetime this object was created in stripe.",
                        null=True,
                    ),
                ),
                (
                    "metadata",
                    djstripe.fields.JSONField(
                        blank=True,
                        help_text="A set of key/value pairs that you can attach to an object. It can be useful for storing additional information about an object in a structured format.",
                        null=True,
                    ),
                ),
                ("djstripe_created", models.DateTimeField(auto_now_add=True)),
                ("djstripe_updated", models.DateTimeField(auto_now=True)),
                (
                    "amount",
                    djstripe.fields.StripeQuantumCurrencyAmountField(
                        help_text="Amount (in cents) intended to be collected by this PaymentIntent."
                    ),
                ),
                (
                    "amount_capturable",
                    djstripe.fields.StripeQuantumCurrencyAmountField(
                        help_text="Amount (in cents) that can be captured from this PaymentIntent."
                    ),
                ),
                (
                    "amount_received",
                    djstripe.fields.StripeQuantumCurrencyAmountField(
                        help_text="Amount (in cents) that was collected by this PaymentIntent."
                    ),
                ),
                (
                    "canceled_at",
                    djstripe.fields.StripeDateTimeField(
                        blank=True,
                        default=None,
                        help_text="Populated when status is canceled, this is the time at which the PaymentIntent was canceled. Measured in seconds since the Unix epoch.",
                        null=True,
                    ),
                ),
                (
                    "cancellation_reason",
                    djstripe.fields.StripeEnumField(
                        blank=True,
                        enum=djstripe.enums.PaymentIntentCancellationReason,
                        help_text="Reason for cancellation of this PaymentIntent, either user-provided (duplicate, fraudulent, requested_by_customer, or abandoned) or generated by Stripe internally (failed_invoice, void_invoice, or automatic).",
                        max_length=21,
                    ),
                ),
                (
                    "capture_method",
                    djstripe.fields.StripeEnumField(
                        enum=djstripe.enums.CaptureMethod,
                        help_text="Capture method of this PaymentIntent, one of automatic or manual.",
                        max_length=9,
                    ),
                ),
                (
                    "client_secret",
                    models.TextField(
                        help_text="The client secret of this PaymentIntent. Used for client-side retrieval using a publishable key.",
                        max_length=5000,
                    ),
                ),
                (
                    "confirmation_method",
                    djstripe.fields.StripeEnumField(
                        enum=djstripe.enums.ConfirmationMethod,
                        help_text="Confirmation method of this PaymentIntent, one of manual or automatic.",
                        max_length=9,
                    ),
                ),
                (
                    "currency",
                    djstripe.fields.StripeCurrencyCodeField(
                        help_text="Three-letter ISO currency code", max_length=3
                    ),
                ),
                (
                    "description",
                    models.TextField(
                        default="",
                        help_text="An arbitrary string attached to the object. Often useful for displaying to users.",
                        max_length=1000,
                    ),
                ),
                (
                    "last_payment_error",
                    djstripe.fields.JSONField(
                        blank=True,
                        help_text="The payment error encountered in the previous PaymentIntent confirmation.",
                        null=True,
                    ),
                ),
                (
                    "next_action",
                    djstripe.fields.JSONField(
                        blank=True,
                        help_text="If present, this property tells you what actions you need to take in order for your customer to fulfill a payment using the provided source.",
                        null=True,
                    ),
                ),
                (
                    "payment_method_types",
                    djstripe.fields.JSONField(
                        help_text="The list of payment method types (e.g. card) that this PaymentIntent is allowed to use."
                    ),
                ),
                (
                    "receipt_email",
                    models.CharField(
                        blank=True,
                        help_text="Email address that the receipt for the resulting payment will be sent to.",
                        max_length=255,
                    ),
                ),
                (
                    "setup_future_usage",
                    djstripe.fields.StripeEnumField(
                        blank=True,
                        enum=djstripe.enums.IntentUsage,
                        help_text="Indicates that you intend to make future payments with this PaymentIntent’s payment method. If present, the payment method used with this PaymentIntent can be attached to a Customer, even after the transaction completes. Use `on_session` if you intend to only reuse the payment method when your customer is present in your checkout flow. Use `off_session` if your customer may or may not be in your checkout flow. Stripe uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules. For example, if your customer is impacted by SCA, using `off_session` will ensure that they are authenticated while processing this PaymentIntent. You will then be able to make later off-session payments for this customer.",
                        max_length=11,
                        null=True,
                    ),
                ),
                (
                    "shipping",
                    djstripe.fields.JSONField(
                        blank=True,
                        help_text="Shipping information for this PaymentIntent.",
                        null=True,
                    ),
                ),
                (
                    "statement_descriptor",
                    models.CharField(
                        blank=True,
                        help_text="For non-card charges, you can use this value as the complete description that appears on your customers’ statements. Must contain at least one letter, maximum 22 characters.",
                        max_length=22,
                    ),
                ),
                (
                    "status",
                    djstripe.fields.StripeEnumField(
                        enum=djstripe.enums.PaymentIntentStatus,
                        help_text="Status of this PaymentIntent, one of requires_payment_method, requires_confirmation, requires_action, processing, requires_capture, canceled, or succeeded. You can read more about PaymentIntent statuses here.",
                        max_length=23,
                    ),
                ),
                (
                    "transfer_data",
                    djstripe.fields.JSONField(
                        blank=True,
                        help_text="The data with which to automatically create a Transfer when the payment is finalized. See the PaymentIntents Connect usage guide for details.",
                        null=True,
                    ),
                ),
                (
                    "transfer_group",
                    models.CharField(
                        blank=True,
                        help_text="A string that identifies the resulting payment as part of a group. See the PaymentIntents Connect usage guide for details.",
                        max_length=255,
                    ),
                ),
                (
                    "customer",
                    models.ForeignKey(
                        help_text="Customer this PaymentIntent is for if one exists.",
                        null=True,
                        on_delete=django.db.models.deletion.CASCADE,
                        to="djstripe.Customer",
                    ),
                ),
                (
                    "on_behalf_of",
                    models.ForeignKey(
                        blank=True,
                        help_text="The account (if any) for which the funds of the PaymentIntent are intended.",
                        null=True,
                        on_delete=django.db.models.deletion.CASCADE,
                        to="djstripe.Account",
                    ),
                ),
                (
                    "payment_method",
                    models.ForeignKey(
                        blank=True,
                        help_text="Payment method used in this PaymentIntent.",
                        null=True,
                        on_delete=django.db.models.deletion.SET_NULL,
                        to="djstripe.PaymentMethod",
                    ),
                ),
            ],
            options={"get_latest_by": "created", "abstract": False},
        ),
        migrations.AddField(
            model_name="charge",
            name="payment_intent",
            field=models.ForeignKey(
                help_text="PaymentIntent associated with this charge, if one exists.",
                null=True,
                on_delete=django.db.models.deletion.SET_NULL,
                related_name="charges",
                to="djstripe.PaymentIntent",
            ),
        ),
        migrations.AddField(
            model_name="invoice",
            name="payment_intent",
            field=models.OneToOneField(
                help_text="The PaymentIntent associated with this invoice. The PaymentIntent is generated when the invoice is finalized, and can then be used to pay the invoice.Note that voiding an invoice will cancel the PaymentIntent",
                null=True,
                on_delete=django.db.models.deletion.CASCADE,
                to="djstripe.PaymentIntent",
            ),
        ),
        migrations.AddField(
            model_name="subscription",
            name="pending_setup_intent",
            field=models.ForeignKey(
                blank=True,
                help_text="We can use this SetupIntent to collect user authentication when creating a subscription without immediate payment or updating a subscription’s payment method, allowing you to optimize for off-session payments.",
                null=True,
                on_delete=django.db.models.deletion.CASCADE,
                related_name="setup_intents",
                to="djstripe.SetupIntent",
            ),
        ),
        migrations.AddField(
            model_name="customer",
            name="address",
            field=djstripe.fields.JSONField(
                blank=True, help_text="The customer's address.", null=True
            ),
        ),
        migrations.AddField(
            model_name="customer",
            name="invoice_prefix",
            field=models.CharField(
                blank=True,
                default="",
                help_text="The prefix for the customer used to generate unique invoice numbers.",
                max_length=255,
            ),
        ),
        migrations.AddField(
            model_name="customer",
            name="invoice_settings",
            field=djstripe.fields.JSONField(
                blank=True,
                help_text="The customer's default invoice settings.",
                null=True,
            ),
        ),
        migrations.AddField(
            model_name="customer",
            name="name",
            field=models.TextField(
                blank=True,
                default="",
                help_text="The customer's full name or business name.",
                max_length=5000,
            ),
        ),
        migrations.AddField(
            model_name="customer",
            name="phone",
            field=models.TextField(
                blank=True,
                default="",
                help_text="The customer's phone number.",
                max_length=5000,
            ),
        ),
        migrations.AddField(
            model_name="customer",
            name="preferred_locales",
            field=djstripe.fields.JSONField(
                blank=True,
                help_text="The customer's preferred locales (languages), ordered by preference.",
                null=True,
            ),
        ),
        migrations.AddField(
            model_name="customer",
            name="tax_exempt",
            field=djstripe.fields.StripeEnumField(
                default="",
                enum=djstripe.enums.CustomerTaxExempt,
                help_text='Describes the customer\'s tax exemption status. When set to reverse, invoice and receipt PDFs include the text "Reverse charge".',
                max_length=7,
            ),
        ),
        migrations.AlterField(
            model_name="bankaccount",
            name="account",
            field=models.ForeignKey(
                blank=True,
                help_text="The account the charge was made on behalf of. Null here indicates that this value was never set.",
                null=True,
                on_delete=django.db.models.deletion.PROTECT,
                related_name="bank_account",
                to="djstripe.Account",
            ),
        ),
        migrations.AlterField(
            model_name="charge",
            name="fraud_details",
            field=djstripe.fields.JSONField(
                blank=True,
                help_text="Hash with information on fraud assessments for the charge.",
                null=True,
            ),
        ),
        migrations.AlterField(
            model_name="charge",
            name="outcome",
            field=djstripe.fields.JSONField(
                blank=True,
                help_text="Details about whether or not the payment was accepted, and why.",
                null=True,
            ),
        ),
        migrations.AlterField(
            model_name="subscription",
            name="status",
            field=djstripe.fields.StripeEnumField(
                enum=djstripe.enums.SubscriptionStatus,
                help_text="The status of this subscription.",
                max_length=18,
            ),
        ),
        migrations.AddField(
            model_name="customer",
            name="default_payment_method",
            field=models.ForeignKey(
                blank=True,
                help_text="default payment method used for subscriptions and invoices for the customer.",
                null=True,
                on_delete=django.db.models.deletion.SET_NULL,
                related_name="+",
                to="djstripe.PaymentMethod",
            ),
        ),
        migrations.AlterField(
            model_name="balancetransaction",
            name="type",
            field=djstripe.fields.StripeEnumField(
                enum=djstripe.enums.BalanceTransactionType, max_length=29
            ),
        ),
        migrations.AddField(
            model_name="charge",
            name="payment_method_details",
            field=djstripe.fields.JSONField(
                blank=True,
                help_text="Details about the payment method at the time of the transaction.",
                null=True,
            ),
        ),
        migrations.AddField(
            model_name="charge",
            name="receipt_url",
            field=models.TextField(
                blank=True,
                default="",
                help_text="This is the URL to view the receipt for this charge. The receipt is kept up-to-date to the latest state of the charge, including any refunds. If the charge is for an Invoice, the receipt will be stylized as an Invoice receipt.",
                max_length=5000,
            ),
        ),
        migrations.CreateModel(
            name="Session",
            fields=[
                (
                    "djstripe_id",
                    models.BigAutoField(
                        primary_key=True, serialize=False, verbose_name="ID"
                    ),
                ),
                ("id", djstripe.fields.StripeIdField(max_length=255, unique=True)),
                (
                    "livemode",
                    models.NullBooleanField(
                        default=None,
                        help_text="Null here indicates that the livemode status is unknown or was previously unrecorded. Otherwise, this field indicates whether this record comes from Stripe test mode or live mode operation.",
                    ),
                ),
                (
                    "created",
                    djstripe.fields.StripeDateTimeField(
                        blank=True,
                        help_text="The datetime this object was created in stripe.",
                        null=True,
                    ),
                ),
                (
                    "metadata",
                    djstripe.fields.JSONField(
                        blank=True,
                        help_text="A set of key/value pairs that you can attach to an object. It can be useful for storing additional information about an object in a structured format.",
                        null=True,
                    ),
                ),
                (
                    "description",
                    models.TextField(
                        blank=True, help_text="A description of this object.", null=True
                    ),
                ),
                ("djstripe_created", models.DateTimeField(auto_now_add=True)),
                ("djstripe_updated", models.DateTimeField(auto_now=True)),
                (
                    "billing_address_collection",
                    djstripe.fields.StripeEnumField(
                        blank=True,
                        enum=djstripe.enums.SessionBillingAddressCollection,
                        help_text="The value (auto or required) for whether Checkoutcollected the customer’s billing address.",
                        max_length=8,
                    ),
                ),
                (
                    "cancel_url",
                    models.TextField(
                        blank=True,
                        help_text="The URL the customer will be directed to if theydecide to cancel payment and return to your website.",
                        max_length=5000,
                    ),
                ),
                (
                    "client_reference_id",
                    models.TextField(
                        blank=True,
                        help_text="A unique string to reference the Checkout Session.This can be a customer ID, a cart ID, or similar, andcan be used to reconcile the session with your internal systems.",
                        max_length=5000,
                    ),
                ),
                (
                    "customer_email",
                    models.CharField(
                        blank=True,
                        help_text="If provided, this value will be used when the Customer object is created.",
                        max_length=255,
                    ),
                ),
                (
                    "display_items",
                    djstripe.fields.JSONField(
                        blank=True,
                        help_text="The line items, plans, or SKUs purchased by the customer.",
                        null=True,
                    ),
                ),
                (
                    "locale",
                    models.CharField(
                        blank=True,
                        help_text="The IETF language tag of the locale Checkout is displayed in.If blank or auto, the browser’s locale is used.",
                        max_length=255,
                    ),
                ),
                (
                    "payment_method_types",
                    djstripe.fields.JSONField(
                        help_text="The list of payment method types (e.g. card) that this Checkout Session is allowed to accept."
                    ),
                ),
                (
                    "submit_type",
                    djstripe.fields.StripeEnumField(
                        blank=True,
                        enum=djstripe.enums.SubmitTypeStatus,
                        help_text="Describes the type of transaction being performed by Checkoutin order to customize relevant text on the page, such as the submit button.",
                        max_length=6,
                    ),
                ),
                (
                    "success_url",
                    models.TextField(
                        blank=True,
                        help_text="The URL the customer will be directed to after the payment or subscriptioncreation is successful.",
                        max_length=5000,
                    ),
                ),
                (
                    "customer",
                    models.ForeignKey(
                        help_text="Customer this Checkout is for if one exists.",
                        null=True,
                        on_delete=django.db.models.deletion.SET_NULL,
                        to="djstripe.Customer",
                    ),
                ),
                (
                    "payment_intent",
                    models.ForeignKey(
                        help_text="PaymentIntent created if SKUs or line items were provided.",
                        null=True,
                        on_delete=django.db.models.deletion.SET_NULL,
                        to="djstripe.PaymentIntent",
                    ),
                ),
                (
                    "subscription",
                    models.ForeignKey(
                        help_text="Subscription created if one or more plans were provided.",
                        null=True,
                        on_delete=django.db.models.deletion.SET_NULL,
                        to="djstripe.Subscription",
                    ),
                ),
                (
                    "mode",
                    djstripe.fields.StripeEnumField(
                        blank=True,
                        enum=djstripe.enums.SessionMode,
                        help_text="The mode of the Checkout Session, one of payment, setup, or subscription.",
                        max_length=12,
                    ),
                ),
            ],
            options={"get_latest_by": "created", "abstract": False},
        ),
        migrations.AddField(
            model_name="charge",
            name="payment_method",
            field=models.ForeignKey(
                help_text="PaymentMethod used in this charge.",
                null=True,
                on_delete=django.db.models.deletion.SET_NULL,
                related_name="charges",
                to="djstripe.PaymentMethod",
            ),
        ),
    ]
