#Vatsal

1 messages · Page 1 of 1 (latest)

iron nymphBOT
floral acorn
#

Hi, how can we help?

warped umbra
#

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

floral acorn
#

Not sure about per passes pricing table ID. How are you currently passing the pricing table ID?

warped umbra
#

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 ??

floral acorn
#

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);
warped umbra
floral acorn
#

similar to ConfigurationFeaturesCustomerUpdateOptions on the above code block

warped umbra
#

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

floral acorn
#

Sorry I don't have the IDE and environment setup. What is not working specifically? Does it autocomplete the class ConfigurationFeaturesSubscriptionUpdateOptions for you?

warped umbra
#

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

floral acorn
#

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

warped umbra
#

yes but how to add that choice of subscription into options ?

#

you are allowed to access the remote system and help ?

floral acorn
#

No we can only help here

#

ConfigurationFeaturesOptions

#

Inside this one, instead of CustomerUpdate = new ConfigurationFeaturesCustomerUpdateOptions you can have, for example SubscriptionUpdate = new ConfigurationFeaturesSubscriptionUpdateOptions

#
GitHub

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

warped umbra
#

now how to limit for a particular subscription type ?

floral acorn
#
GitHub

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

warped umbra
#

that will be product ID ?

#

in list ?

floral acorn
#

Yep

#

ah list of Products object seemingly

warped umbra
#

list of products ?

floral acorn
#

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

warped umbra
#

showing error when passing product ID

floral acorn
#

It's not DefaultAllowedUpdates

warped umbra
#

please guide

floral acorn
#

You need

new List<ConfigurationFeaturesSubscriptionUpdateProductOptions> {
  ...
}
#

Are you familiar with .NET?

warped umbra
#

new to .net

floral acorn
#

I would recommend looking at how to initialize an object array in .NET first

warped umbra
#

ok

floral acorn
#

here you need an array of ConfigurationFeaturesSubscriptionUpdateProductOptions as the Products inside ConfigurationFeaturesCustomerUpdateOptions