#MD-filter-auth

1 messages ยท Page 1 of 1 (latest)

main apex
#

however, you won't be able to filter it based on the merchant unfortunately

ripe merlin
#

ok thankyou

#

error: type object 'Authorization' has no attribute 'created'

main apex
#

you'd want to pass it as a parameter inside list(...)

ripe merlin
#

oh ok

#

how exactly would I format it because i'm still getting an error

main apex
#

what language are you using?

ripe merlin
#

python

main apex
#

so in python created is a dictionary and then you'd pass gt as a key and set the value

#

I'm not super skilled in python but It should be something like

created=[gt=1000] or something similar

ripe merlin
#

still not working:

#

response = stripe.issuing.Authorization.list(created["gt"]=1000)

main apex
#

what's the error?

ripe merlin
#

SyntaxError: expression cannot contain assignment

main apex
#

it should be created= a dictionary I think

ripe merlin
#

I did: response = stripe.issuing.Authorization.list(created=gt["1000"])

#

I got this error: TypeError: 'builtin_function_or_method' object is not subscriptable

main apex
#

hmmm sorry about that, let me ask a colleague to see if they know the correct syntax for this

ripe merlin
#

ok thankyou

main apex
#

sorry its taking a while

#

can you try
.list(created={"gte": <anyvalue>})

ripe merlin
#

that doesn't seem like python syntax it's coming up as red

main apex
#

ugh that's what I figured ๐Ÿ˜ฆ

swift pulsar
#

๐Ÿ‘‹ the syntax hanzo gave you is real python

#

Can you clarify what the issue is and what exact error you get?

ripe merlin
#

I did response = stripe.issuing.Authorization.list(created=["gte": <10000>]) and got '(' was not closed

#

it also says '[' wasn't closed

#

as you can see though it is closed

swift pulsar
#

sure but that's not what my colleague told you to do

#

you're using square brackets [ ] and they said curly brackets { }

#

also < > shouldn't be here, it was just an example ๐Ÿ˜…

ripe merlin
#

oops sorry

swift pulsar
#

response = stripe.issuing.Authorization.list(created={"gte": 10000>})

#

I archived your other thread too since this is another question about python

#

Please ask here if you have a follow up question

swift pulsar
#

@ripe merlin are you still having issues?

ripe merlin
#

it's working now thankyou very much. I was just testing it

#

i have one more issue

#

I don't seem to be getting the has_more attribute

#

I'll paste here the request i sent

swift pulsar
#

just print(response.has_more) and you'll see it

#

you're just misunderstanding python mostly really

ripe merlin
#

Oh you're right that's weird. It wasn't anywhere in the file and i couldn't find it in the authorisation docs

#

why don't I see it in the response text?

swift pulsar
#

because of the way you wrote your code mostly with your loop, you're already looking at each Authorization in the data array, not what is at the "list" level