#Vatsal
1 messages · Page 1 of 1 (latest)
Hi, how can we help?
I want to customize in a way that user can update the subscription as per the passed pricing table ID
I am creating a session using customer ID in .net core website
can I pass any extra parameter along with customer ID that allows me to customize the subscription available in customer Portal
2 types of users are available for that I have created 2 different pricing table and integrated.
if user has bought a horse owner subscription then that user shouldn't be able to switch subscription while updating the details using customer portal
Not sure about per passes pricing table ID. How are you currently passing the pricing table ID?
Btw there is configuration object here https://stripe.com/docs/api/customer_portal/configurations/create#create_portal_configuration-features-subscription_update-products
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
not passing at the moment
I am not able to understand that doc
can you please guide what should I pass
ignore about passing the pricing table ID,
guide me how can we customize subscription of customer portal when creating a session using customer ID ??
customizations of this option : https://prnt.sc/EP0Iac5B-p43
Here is the link to .NET example code https://stripe.com/docs/api/customer_portal/configurations/create?lang=dotnet#create_portal_configuration-features-subscription_update-products
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
On right hand side you would see something like
var options = new ConfigurationCreateOptions
{
Features = new ConfigurationFeaturesOptions
{
CustomerUpdate = new ConfigurationFeaturesCustomerUpdateOptions
{
AllowedUpdates = new List<string>
{
"email",
"tax_id",
},
Enabled = true,
},
InvoiceHistory = new ConfigurationFeaturesInvoiceHistoryOptions
{
Enabled = true,
},
},
BusinessProfile = new ConfigurationBusinessProfileOptions
{
PrivacyPolicyUrl = "https://example.com/privacy",
TermsOfServiceUrl = "https://example.com/terms",
},
};
var service = new ConfigurationService();
service.Create(options);
I already read that. but there is no option to customize subscription which I marked in above Image
It's the features.subscription_update.products, so it is https://github.com/stripe/stripe-dotnet/blob/master/src/Stripe.net/Services/BillingPortal/Configurations/ConfigurationFeaturesSubscriptionUpdateOptions.cs#L26
Stripe.net is a sync/async .NET 4.6.1+ client, and a portable class library for stripe.com. - stripe-dotnet/ConfigurationFeaturesSubscriptionUpdateOptions.cs at master · stripe/stripe-dotnet
similar to ConfigurationFeaturesCustomerUpdateOptions on the above code block
okay trying
still not able to understand
please can you give sample code from which I can understand configuration of using that subscription Update option
Sorry I don't have the IDE and environment setup. What is not working specifically? Does it autocomplete the class ConfigurationFeaturesSubscriptionUpdateOptions for you?
I am not able to understand where should I put that code
If you can help, I can give you remote access of my system
The code block above is to create a Portal Configuration object, see 2 last lines here
var service = new ConfigurationService();
service.Create(options);
When you have this service, you can supply it into the Customer Portal creation code you are having
yes but how to add that choice of subscription into options ?
you are allowed to access the remote system and help ?
No we can only help here
ConfigurationFeaturesOptions
Inside this one, instead of CustomerUpdate = new ConfigurationFeaturesCustomerUpdateOptions you can have, for example SubscriptionUpdate = new ConfigurationFeaturesSubscriptionUpdateOptions
it's just to initialize the ConfigurationFeaturesSubscriptionUpdateOptions class on https://github.com/stripe/stripe-dotnet/blob/master/src/Stripe.net/Services/BillingPortal/Configurations/ConfigurationFeaturesSubscriptionUpdateOptions.cs#L26
Stripe.net is a sync/async .NET 4.6.1+ client, and a portable class library for stripe.com. - stripe-dotnet/ConfigurationFeaturesSubscriptionUpdateOptions.cs at master · stripe/stripe-dotnet
You create a product list of https://github.com/stripe/stripe-dotnet/blob/master/src/Stripe.net/Services/BillingPortal/Configurations/ConfigurationFeaturesSubscriptionUpdateOptions.cs#L26, like the AllowedUpdates = new List<string> there
Stripe.net is a sync/async .NET 4.6.1+ client, and a portable class library for stripe.com. - stripe-dotnet/ConfigurationFeaturesSubscriptionUpdateOptions.cs at master · stripe/stripe-dotnet
Stripe.net is a sync/async .NET 4.6.1+ client, and a portable class library for stripe.com. - stripe-dotnet/ConfigurationFeaturesSubscriptionUpdateProductOptions.cs at master · stripe/stripe-dotnet
Sorry I don't have the IDE and environment so can't type code, you would want to use the auto-complete feature of your IDE
It's not DefaultAllowedUpdates
You need
new List<ConfigurationFeaturesSubscriptionUpdateProductOptions> {
...
}
Are you familiar with .NET?
new to .net
I would recommend looking at how to initialize an object array in .NET first
ok
here you need an array of ConfigurationFeaturesSubscriptionUpdateProductOptions as the Products inside ConfigurationFeaturesCustomerUpdateOptions