#Val-billing-portal
1 messages ยท Page 1 of 1 (latest)
Hi there! Not a PHP developer but I don't believe you need the {} at all? I think it should just be ['product' => '?', 'prices' => '?']
Did you already try that?
Hi @raw widget / thanks for your reply.
I did try that, as well, and just get an 'Invalid Array'
Just to be clear, you are actually setting product IDs and price Ids as opposed to the ?
Do you have a request ID I can look at?
Ah, you are passing null for default_allowed_updates but this is a required field.
Also I might be incorrect and it may need [ ['product' => '?'], [ 'prices' => '?'] ]
since we allow for a list of price IDs
Yes that is because you aren't passing an enum for default_allowed_updates. See: https://stripe.com/docs/api/customer_portal/configurations/create#create_portal_configuration-features-subscription_update-default_allowed_updates
If that is empty then the request won't fail, but updates won't be allowed.
You need to set it to one or all of price, quantity, promotion_code
Yeah, looking at exactly that for the past few hours ๐
The thing is that, I am trying to dissallow updates (valid in certain cases, when the user has to remove a few things from their account, before being able to do so)
Sorry I don't fully understand. Let's back up and maybe you can explain exactly what you are trying to do? If you don't want to allow for certain updates then you just don't include that update param in your configuration request
Hmm. I probably have it all wrong.
Backstory: I am using the Customer Portal, however I need to turn off a few products from time to time so a user cannot downgrade (if they haven't done a few things beforehand)
Got it. So yeah you should think of your default configuration as if no updates are possible. Then you build configs based on what you want to allow them to update.
Basically you don't want to build configs in order to stop them from updating... if you don't pass any of the params into the config then they can't update by default. Does that make sense?
Yeah! Makes total sense. Ok back to the drawing board. Thanks for the discussion @raw widget. Appreciate the time you took to help me with this conundrum. ๐
No problem! Feel free to come back here if we can help further.
Thanks a ton. Will try to report back with the solution.
Also @outer dune you can set default customer portal configs via your Dashboard so you can work with that too
Just making sure you are aware of that.
I've done that yes. Have the 3 default products. My guess was trying to turn them off afterwards.
Got it. Just making sure you realize that you can just create the custom configs with that default in mind.