#mtanzi-portal-configs

1 messages ยท Page 1 of 1 (latest)

candid wagon
#

Hi there!

#

Can you provide the request ID for the error?

errant aurora
#

Hi!

#

I can provide the json that I am passing to the method

#

I am trying to create the configuration via console

#
Stripe::BillingPortal::Configuration.create({
    business_profile: {
      privacy_policy_url: 'https://test.com/privacy',
      terms_of_service_url: 'https://test.com/terms',
    },
    features: {
      subscription_update: {
        default_allowed_updates: ['price'],
        enabled: true,
        products: {
          prices: [ 'price_1', 'price_2' ],
        },
        proration_behavior: 'always_invoice'
      }
    },
})
candid wagon
#

Ah okay

#

Yeah so you need products.prices and products.product. And that should be an array of objects

#
          prices:'price_1',
          product: 'prod_abc'
        },
        { prices: 'price_2',
          product: 'prod_abc'
}]```
errant aurora
#

ah!

#

it's not very clear from the API doc ๐Ÿ™‚ - maybe it can be added to the example

#

Thanks!

candid wagon
#

Sure!

errant aurora
#

@candid wagon with this configuration now I am getting the following error:

Stripe::InvalidRequestError: Cannot enable subscription updates while disabling payment method update.

Do you know what is it about?

candid wagon
#

Hmmm I wasn't familiar with that requirement but it is likely due to the fact that updates can generate invoices which then would require payment and potentially updating payment methods.

#

I can look into it further in a sec

errant aurora
#

I see, I have them enabled by default through the stripe dashboard, should I define them also here?

candid wagon
#

Oh my, totally missed that you weren't even passing it as disabled here

#

Hmm if enabled in the Dashboard then this should definitely just work

#

Try passing it here as well

#

But also if you can send me a request ID I can check if this is a bug

errant aurora
#

I have to head off for half hour, if you leave the thread open Iโ€™ll find the req Iโ€™d for you ๐Ÿ‘๐Ÿป

candid wagon
#

๐Ÿ‘

errant aurora
#

Hey @candid wagon I am back, here is the req_id: req_6f11MPedmeX6ct

candid wagon
#

๐Ÿ‘€

candid wagon
#

Yeah this feels like a bug to me

#

Can you test setting the payment_method_update: enbaled on the config creation?

#

Want to know if that works as a workaround in the meantime. But I'll file internally to get this fixed as you shouldn't need to pass that as it is on in your default settings

errant aurora
#

passing that parameter I am getting this error:
Stripe::InvalidRequestError: Received unknown parameter: features[subscription_update][payment_method_update]

#

look like is not a valid parameter

candid wagon
#

Shouldn't be under subscription_update

#

It is its own object within features

errant aurora
#

ah right, my bad ๐Ÿคฆโ€โ™‚๏ธ

#

now I get invalid_request_error, here is the request req_6f11MPedmeX6ct

candid wagon
#

That didn't pass payment_method_update

#

That's the same as before as far as I can tell

errant aurora
#

wait.. I thinbk is the following:

payment_method_update: {
        enabled: true,
      },
candid wagon
errant aurora
#

worked!

candid wagon
#

Yeah okay

#

Thanks for testing

#

Ohhh wait....

#

This is a config

#

So your default settings can change.

#

That is why you have to set it explicitly here

errant aurora
#

Ah I see.. to avoid that someone change it and suddendly it throws an error

#

that makes sense ๐Ÿ‘

#

Awesome, thanks for the help! ๐Ÿ™