UNPKG

pulumi-stripe

Version:

A Pulumi package for creating and managing Stripe resources.

155 lines 6.47 kB
"use strict"; // *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** // *** Do not edit by hand unless you're certain you know what you are doing! *** Object.defineProperty(exports, "__esModule", { value: true }); exports.PortalConfiguration = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("./utilities"); /** * With this resource, you can create a Customer Portal Configuration - [Stripe API portal configuration documentation](https://stripe.com/docs/api/customer_portal/configuration). * * The Billing customer portal is a Stripe-hosted UI for subscription and billing management. * * A portal configuration describes the functionality and features that you want to provide to your customers through the portal. * * > Removal of the Customer Portal isn't supported through the Stripe SDK. The best practice, which this provider follows, * is to deactivate the Customer Portal by marking it as inactive on destroy, which indicates that resource is no longer * available. * * ## Example Usage * * <!--Start PulumiCodeChooser --> * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as stripe from "pulumi-stripe"; * * // A billing portal using all the available options * const portalConfiguration = new stripe.PortalConfiguration("portalConfiguration", { * businessProfile: { * headline: "My special headline", * privacyPolicyUrl: "https://example.com/privacy", * termsOfServiceUrl: "https://example.com/terms", * }, * defaultReturnUrl: "https://example.com/special_headline", * features: { * customerUpdate: { * allowedUpdates: [ * "email", * "address", * "shipping", * "phone", * "tax_id", * ], * enabled: true, * }, * invoiceHistory: { * enabled: true, * }, * paymentMethodUpdate: { * enabled: true, * }, * subscriptionCancel: { * cancellationReason: { * enabled: true, * options: [ * "too_expensive", * "missing_features", * "switched_service", * "unused", * "customer_service", * "too_complex", * "low_quality", * "other", * ], * }, * enabled: true, * mode: "at_period_end", * prorationBehavior: "none", * }, * subscriptionPauses: [{ * enabled: true, * }], * subscriptionUpdates: [{ * defaultAllowedUpdates: [ * "price", * "quantity", * "promotion_code", * ], * enabled: true, * products: [{ * prices: [ * "my_price_id1", * "my_price_id2", * ], * product: "my_product_id", * }], * prorationBehavior: "none", * }], * }, * metadata: { * foo: "bar", * }, * }); * ``` * <!--End PulumiCodeChooser --> */ class PortalConfiguration extends pulumi.CustomResource { /** * Get an existing PortalConfiguration resource's state with the given name, ID, and optional extra * properties used to qualify the lookup. * * @param name The _unique_ name of the resulting resource. * @param id The _unique_ provider ID of the resource to lookup. * @param state Any extra arguments used during the lookup. * @param opts Optional settings to control the behavior of the CustomResource. */ static get(name, id, state, opts) { return new PortalConfiguration(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of PortalConfiguration. This is designed to work even * when multiple copies of the Pulumi SDK have been loaded into the same process. */ static isInstance(obj) { if (obj === undefined || obj === null) { return false; } return obj['__pulumiType'] === PortalConfiguration.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["active"] = state ? state.active : undefined; resourceInputs["businessProfile"] = state ? state.businessProfile : undefined; resourceInputs["defaultReturnUrl"] = state ? state.defaultReturnUrl : undefined; resourceInputs["features"] = state ? state.features : undefined; resourceInputs["isDefault"] = state ? state.isDefault : undefined; resourceInputs["loginPage"] = state ? state.loginPage : undefined; resourceInputs["metadata"] = state ? state.metadata : undefined; } else { const args = argsOrState; if ((!args || args.businessProfile === undefined) && !opts.urn) { throw new Error("Missing required property 'businessProfile'"); } if ((!args || args.features === undefined) && !opts.urn) { throw new Error("Missing required property 'features'"); } resourceInputs["active"] = args ? args.active : undefined; resourceInputs["businessProfile"] = args ? args.businessProfile : undefined; resourceInputs["defaultReturnUrl"] = args ? args.defaultReturnUrl : undefined; resourceInputs["features"] = args ? args.features : undefined; resourceInputs["loginPage"] = args ? args.loginPage : undefined; resourceInputs["metadata"] = args ? args.metadata : undefined; resourceInputs["isDefault"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(PortalConfiguration.__pulumiType, name, resourceInputs, opts); } } exports.PortalConfiguration = PortalConfiguration; /** @internal */ PortalConfiguration.__pulumiType = 'stripe:index/portalConfiguration:PortalConfiguration'; //# sourceMappingURL=portalConfiguration.js.map