INNER CODE UNIT · Go

resourceStripeCustomerPortalCreate

franckverrot/terraform-provider-stripe · stripe/resource_stripe_customer_portal.go:378

func resourceStripeCustomerPortalCreate(d *schema.ResourceData, m interface{}) error {
	client := m.(*client.API)
	params := &stripe.BillingPortalConfigurationParams{}
	if dru, ok := d.GetOk("default_return_url"); ok {
		params.DefaultReturnURL = stripe.String(dru.(string))
	}

	if bp, ok := d.GetOk("business_profile"); ok {
		params.BusinessProfile = expandBusinessProfile(bp.([]interface{}))
	}

	if bp, ok := d.GetOk("features"); ok {
		params.Features = expandFeatures(bp.([]interface{}))
	}

	params.Metadata = expandMetadata(d)
	portal, err := client.BillingPortalConfigurations.New(params)
	if err == nil {

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…