#soma - BalanceTransaction created filter

1 messages · Page 1 of 1 (latest)

worthy wadi
#

Interesting. Are the results that you are getting not changing at all?

#

Do you have an example charge that is being returned from before that timestamp?

eternal tartan
#

thanks for responding

#

I have 8 items in the balance list

#

these items are returned over and over

#

no matter what the "created" parameter is

worthy wadi
#

Can you send me the 8 items that you are getting?

#

This filter is working for e at the moment, unsure what may be going wrong here

eternal tartan
#

how can I do that?

worthy wadi
#

I just meant like pasting the json response here

eternal tartan
#

can you show me the curl you are sending?

worthy wadi
#

Was doing it in python but can figure out the curl, one minute

eternal tartan
#

Sorry I'm kind of new on this, and discord is telling me the message I was trying to send to you as json is too long

#

this is my curl:
curl --location --request POST 'URL'
--header 'Authorization: Bearer token'
--header 'Content-Type: application/json'
--data-raw '{
"limit": 10,
"currency": "usd",
"created": {
"gte": "1653609600"
}
}'

worthy wadi
#

Interesting. When I make that curl call I also do not see the filter work

#

Checking in to what we see on our backend...

eternal tartan
#

by the way is there any playground for testing the api?

worthy wadi
#

Ah it looks like we don't get the body at all from that curl command

#

Yes there is

#

If you create an account with us you will get a test mode API key that you can use to create your own data

worthy wadi
#

Or you can use your existing account in test mode which it sounds like you have

#

That was poor language on my part, I don't see the request body that you pass in via --data-raw in my own API logs

eternal tartan
#

then how can I send it properly in nodejs?

worthy wadi
#

So here is a modified version of the curl command from our docs, it works for me

  -u sk_test_12345: \
  -d limit=3 \
  -d created[gte]=1653609600
  -G```
eternal tartan
#

you are redirecting me to the same documentation I've been consulting

#

could you share with me a single example on how to manage this using nodejs besides the example in the documentation related to the limit?

worthy wadi
#

Yep I can figure out the node.js syntax, will get back to you when I have it nailed down

#

Can you send me your current node code?

eternal tartan
#

sure

#

const resp = await stripe.balanceTransactions.list(body);

#

from here body is

#

const body = {
limit: 10,
currency: 'usd',
created: {
gte: "1653609600"
}
}

worthy wadi
#

Interesting, that code works for me

      limit: 3,
      created: {
        gte: 1653609600
      }
    }
    const balanceTransactions = await stripe.balanceTransactions.list(body);```
#

That only gives me balance transactions after that timestamp

#

I was testing with 3 as I only have 2 after then.

#

Does the limit variable work for you? If you change it to be less than 8 do you get less than 8 transactions back?

eternal tartan
#

it was working last time I checked... please, let me retry

#

nothing seems to be working on my side

#

thanks for your time

#

I will try to figure it out by myself

split mason
#

I note soma shows the timestamp as a string, and you as a number

eternal tartan
#

documentation says: A filter on the list based on the object created field. The value can be a string with an integer Unix timestamp, or it can be a dictionary with the following options:

split mason
#

Shame it didn't help - just noticing differences.

worthy wadi
#

String works for me as well.

eternal tartan
#

oh, for sure

#

here req_FEzlqAkmLbuV0j

#

@worthy wadi ?

worthy wadi
#

Was bouncing around to other threads. Checking in to that request now

#

Interesting. I am not seeing a request body on that call either. Wonder if it is a difference in our stripe-node bodies or something

eternal tartan
#

this is overwhelming

worthy wadi
#

I'm sorry to hear that. I am really not sure what might be happening here. Trying to think of what differences might cause this

#

Out of curiosity, are you running this code locally?

eternal tartan
#

yes, I have a local server of express pointing to stripe

#

I think that I found the issue

worthy wadi
#

Nice! What is it?

eternal tartan
#

wait a minute please

#

np

#

nop

#

problem persists

median dust
#

taking over for Pompey! are you getting any results from this request, or any errors?

eternal tartan
#

I get all the transactions

#

no matter what I pass to the filter

#

no errors

median dust
#

got it, thanks for clarifying. could you share which version of the Stripe API you're using for these requests?

eternal tartan
#

sure

#

2020-08-27

median dust
#

thanks for confirming. this might take me a bit to test

eternal tartan
#

I thank you

#

hey stripe guys, do not look anymore, the thing is this

#

await stripe.balanceTransactions.list(body, {
stripeAccount: stripeAccountId
});

#

you need to pass the stripeAccount as an option

#

I thank you guys for your time and I thank you so much for walk this with me. I hope this might be helpful next time