The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Net::API::Stripe::Billing::PortalConfiguration - The portal configuration object

SYNOPSIS

    my $portal = $stripe->portal_conffiguration({
        created => 'now',
        active => $stripe->true,
        application => 'acct_fake123456789',
        business_profile =>
        {
            headline = q{Welcome to Example Business payment portal},
            privacy_policy_url => q{https://example.com/privacy-policy/},
            terms_of_service_url => q{https://example.com/tos/},
        },
        default_return_url => 'https://example.com/ec/df63685a-6cd2-4c5d-9d4c-81b417646a58',
        features =>
        {
            customer_update =>
            {
                allowed_updates => [qw( email address shipping phone tax_id )],
                enabled => 1,
            },
            invoice_history =>
            {
                enabled => 1,
            },
            payment_method_update =>
            {
                enabled => 1,
            },
            subscription_cancel =>
            {
                cancellation_reason =>
                {
                    enabled => 1,
                    options => [qw( too_expensive missing_features switched_service unused customer_service too_complex low_quality other )],
                },
                enabled => 1,
                mode => [qw( immediately at_period_end )],
                # Can also be 'none'
                proration_behavior => 'create_prorations',
            },
            subscription_pause =>
            {
                enabled => 0,
            },
            subscription_update =>
            {
                default_allowed_updates => [qw( price quantity promotion_code )],
                enabled => 1,
                products => [
                    { prices => [qw( price12345 price6789 )], product => 'prod123456789' },
                ],
                # Can also be 'none' and 'always_invoice'
                proration_behavior => 'create_prorations',
            },
        },
        is_default => 1,
        livemode => $stripe->false,
        metadata => { my_db_key => 123456789 },
    });

VERSION

    v0.2.0

DESCRIPTION

A portal configuration describes the functionality and features that you want to provide to your customers through the portal.

METHODS

id string

Unique identifier for the object.

object string

String representing the object's type. Objects of the same type share the same value.

active boolean

Whether the configuration is active and can be used to create portal sessions.

application string

Expandable "application" (Connect only)

ID of the Connect Application that created the configuration.

business_profile hash

The business information shown to customers in the portal.

  • headline string

    The messaging shown to customers in the portal.

  • privacy_policy_url string

    A link to the business’s publicly available privacy policy.

  • terms_of_service_url string

    A link to the business’s publicly available terms of service.

created timestamp

Time at which the object was created. Measured in seconds since the Unix epoch.

default_return_url string

The default URL to redirect customers to when they click on the portal’s link to return to your website. This can be overriden when creating the session.

features hash

Information about the features available in the portal.

It has the following properties:

customer_update hash

Information about updating customer details in the portal.

allowed_updates array

The types of customer updates that are supported. When empty, customers are not updateable.

enabled boolean

Whether the feature is enabled.

invoice_history hash

Information about showing invoice history in the portal.

When expanded, this is a Net::API::Stripe::Payment::Installment object.

payment_method_update hash

Information about updating payment methods in the portal. View the list of supported payment methods in the docs.

When expanded, this is a Net::API::Stripe::Payment::Installment object.

subscription_cancel hash

Information about canceling subscriptions in the portal.

cancellation_reason hash

Whether the cancellation reasons will be collected in the portal and which options are exposed to the customer

enabled boolean

Whether the feature is enabled.

options array

Which cancellation reasons will be given as options to the customer.

enabled boolean

Whether the feature is enabled.

mode string

Whether to cancel subscriptions immediately or at the end of the billing period.

proration_behavior string

Whether to create prorations when canceling subscriptions. Possible values are none and create_prorations.

subscription_pause hash

Information about pausing subscriptions in the portal.

When expanded, this is a Net::API::Stripe::Payment::Installment object.

subscription_update hash

Information about updating subscriptions in the portal.

default_allowed_updates array

The types of subscription updates that are supported for items listed in the products attribute. When empty, subscriptions are not updateable.

enabled boolean

Whether the feature is enabled.

products array

The list of products that support subscription updates.

prices string_array

The list of price IDs which, when subscribed to, a subscription can be updated.

product string

The product ID.

proration_behavior string

Determines how to handle prorations resulting from subscription updates. Valid values are none, create_prorations, and always_invoice.

is_default boolean

Whether the configuration is the default. If true, this configuration can be managed in the Dashboard and portal sessions will use this configuration unless it is overriden when creating the session.

livemode boolean

Has the value true if the object exists in live mode or the value false if the object exists in test mode.

login_page hash

The hosted login page for this configuration. Learn more about the portal login page in our integration docs.

It has the following properties:

enabled boolean

If true, a shareable url will be generated that will take your customers to a hosted login page for the customer portal.

If false, the previously generated url, if any, will be deactivated.

url string

A shareable URL to the hosted portal login page. Your customers will be able to log in with their email and receive a link to their customer portal.

metadata hash

Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format.

updated timestamp

Time at which the object was last updated. Measured in seconds since the Unix epoch.

API SAMPLE

    {
      "id": "bpc_1LJnbGCeyNCl6fY2uCGtb5z5",
      "object": "billing_portal.configuration",
      "active": true,
      "application": null,
      "business_profile": {
        "headline": null,
        "privacy_policy_url": "https://example.com/privacy",
        "terms_of_service_url": "https://example.com/terms"
      },
      "created": 1657411334,
      "default_return_url": null,
      "features": {
        "customer_update": {
          "allowed_updates": [
            "email",
            "tax_id"
          ],
          "enabled": true
        },
        "invoice_history": {
          "enabled": true
        },
        "payment_method_update": {
          "enabled": false
        },
        "subscription_cancel": {
          "cancellation_reason": {
            "enabled": false,
            "options": []
          },
          "enabled": false,
          "mode": "at_period_end",
          "proration_behavior": "none"
        },
        "subscription_pause": {
          "enabled": false
        },
        "subscription_update": {
          "default_allowed_updates": [],
          "enabled": false,
          "proration_behavior": "none"
        }
      },
      "is_default": true,
      "livemode": true,
      "metadata": null,
      "updated": 1657411334
    }

HISTORY

v0.1.0

Initial version

AUTHOR

Jacques Deguest <jack@deguest.jp>

SEE ALSO

Stripe API documentation:

https://stripe.com/docs/api/customer_portal/configuration

COPYRIGHT & LICENSE

Copyright (c) 2019-2022 DEGUEST Pte. Ltd.

You can use, copy, modify and redistribute this package and associated files under the same terms as Perl itself.