#edutomesco

1 messages ยท Page 1 of 1 (latest)

coral brambleBOT
analog tusk
#

๐Ÿ‘‹ happy to help

#

you can put GB in the price name

#

but there isn't a unit description

trim nest
#

thank you

analog tusk
#

let me know if you need any more help

trim nest
#

one thing

#

I have a subscription with a threshold just when it have yearly prices, but when I downgrade to a monthly prices I want to remove the threshold. When it applies the downgrade I didn't see that the threshold billing disapear

analog tusk
#

I'm not sure I follow, would you mind elaborating more? and what do you mean by threshold?

trim nest
#

the billing threshold

#

How can I remove it?

#

from a subcription?

analog tusk
#

what language are you using?

#

Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. When updating, pass an empty string to remove previously-defined thresholds.

trim nest
#

golang

analog tusk
#

๐Ÿ‘

trim nest
#

but it says to me to pass a *SubscriptionBillingThresholdsParams

#

how I pass then an empty string

analog tusk
#

that's why I asked which lang

#

let me try to see what is the right syntax in go

trim nest
#

thank you

analog tusk
#

did you try ""

trim nest
#

yes

#

it's needed a *SubscriptionBillingThresholdsParams object

#

I can't pass an empty string

analog tusk
#

could you try nil

#

sorry I'm not really proficient in golang

#

@floral estuary do you know if there's a special struct/enum or something to say it's an empty param? or does nil work?

trim nest
#

nil maybe

floral estuary
#

in the API itself it's "". You're using Golang I take it?

#

I think we have some kind of special enum value for this, looking

analog tusk
#

I wasn't able to find it ๐Ÿคฆ

trim nest
#

i'm trying with nil reference let me check

#

with nil reference doesn't work

#

maybe you didn't adapt this for golang yet?

floral estuary
#

we definitely did

#

I'll find it eventually

trim nest
#

I wait for that, thanks

floral estuary
#

can't find right now, I'd suggest writing to https://support.stripe.com/?contact=true for a guaranteed response

as a workaround though, you can do this :

params := &stripe.SubscriptionUpdateParams{ .... }
params.AddExtra("billing_thresholds", "")
#

does that make sense? you can use AddExtra to add any parameter with any value even if the library doesn't directly support it

trim nest
#

actually I'm using this object

#

&stripe.SubscriptionSchedulePhaseParams

#

becaue I schedule the plan

#

This object doesn't have the AddExtra function

floral estuary
#

it does, all Param objects have that

#

or rather, maybe not SubscriptionSchedulePhaseParams as that's a sub-param, but you're using that inside another param, like SubscriptionScheduleUpdateParams, right?

#

you set it on that param object, the one you pass to the service. I could show you easily if you posted your code.

trim nest
#

right!!!

#

i got this error

floral estuary
#

can you share the exact Go code you wrote?

#

so I was wrong, you do need to use AddExtra on the SubscriptionSchedulePhaseParams

trim nest
floral estuary
#

do phases[0].billing_thresholds instead in the AddExtra line as the string for the first key argument

#

that should work

trim nest
#

I've try and nothing

#

and i want to be the second phase so it should be phases[1].billing_threshols

floral estuary
#

yep, then you'd want to do [1]

#

what does "nothing" mean

trim nest
#

doesn't work

floral estuary
#

did you get an error?

trim nest
#

error

#

yes

floral estuary
#

could you post it?

trim nest
floral estuary
#

you have a typo

#

as the error message implies, you likely wrote AddExtra("phases[1][.billing_thresholds]", "") in your code instead of AddExtra("phases[1][billing_thresholds]", "")

trim nest
#

right

floral estuary
#

does that mean you tried again and it works now?

trim nest
#

no

#

it puts automatically that format

#

I wrote good

floral estuary
#

hmm

#

ah right I'm an idiot

#

it's "phases[1][billing_thresholds]"