#DanTheGoodman
1 messages ยท Page 1 of 1 (latest)
?
wait maybe.... let me test lol
the format was really strange, like it was grabbing random crap from memory. But I was reusing one from another request that had a still different format than what I see in the log
ok so I think i fixed the issue with the idempotency key, but now because I had to do some reversals it now says we don't have the stripe funds to payout a connect account even though I see we do
Great to hear. Happy to be a rubber ๐ฆ
{"level":"error","reqID":"f85a910b-2475-4450-867c-bfc3a8d321dc","userID":"user_2C1kOTDZ8OQvpyaBzdwUgcGRDtl","user_id":"user_2C1kOTDZ8OQvpyaBzdwUgcGRDtl","error":"error sending stripe payout: {\"code\":\"balance_insufficient\",\"doc_url\":\"https://stripe.com/docs/error-codes/balance-insufficient\",\"status\":400,\"message\":\"You have insufficient funds in your Stripe account for this transfer. Your card balance is too low. You can use the /v1/balance endpoint to view your Stripe balance (for more details, see stripe.com/docs/api#balance).\",\"request_id\":\"req_gd1WeNe4ON2FYo\",\"type\":\"invalid_request_error\"}","time":"2022-10-10T17:09:57.944265678Z","caller":"/app/http_server/admin.go:315 http_server.(*HTTPServer).SetPayoutState()","message":"error sending payout"}
this is the error we get back, how long until we get funds available if we instantly reversed something?
๐ stepping in as Snufkin needs to step away
I can get a few requests
/v1/transfers/tr_1LrP06CyQAg6NyoScFsJOhsz/reversals
12:44:55 PM
200 OK
POST
/v1/transfers/tr_1LrOzzCyQAg6NyoSkpTOexSv/reversals
12:44:39 PM
200 OK
POST
/v1/transfers/tr_1LrP02CyQAg6NyoSpdYyfQbQ/reversals
12:44:23 PM
200 OK
POST
/v1/transfers/tr_1LrP09CyQAg6NyoS0sDRazmW/reversals
12:43:51 PM
200 OK
POST
/v1/transfers/tr_1LrP0CCyQAg6NyoSHp61fgi3/reversals
12:43:32 PM
200 OK
POST
/v1/transfers/tr_1LrP0GCyQAg6NyoSYWVw36q1/reversals
12:43:18 PM
200 OK
POST
/v1/transfers/tr_1LrP0WCyQAg6NyoSR1HXWGT2/reversals
12:42:55 PM
200 OK
POST
/v1/transfers/tr_1LrP0ZCyQAg6NyoScdF00Q7Y/reversals```
That request in that error is using an idempotency key from a previous request
So it is just replaying
Can you make a new request with new idempotency key?
well the issue is not that, the issue is that the first one errors with that we dont have sufficient funds, so our retry loops because it doesn't know about that error
Ah okay so you are asking about the original error?
Let me look at one of the transfers
So you are reversing these transfers then attempting to create a payout, correct?
Looks to me like the reversals come after the payout attempt which errors for NSF?
so what happened basically is I screwed up the idempotency key for the transfer, so when we got an error it retried a bunch without the key and made a ton of duplicate transfers
so we then reversed all of them, BUT now stripe says we dont have enough funds to send transfer, which is now causing the transfer request to retry-loop again but now we have a fixed idempotency key so it's fine that they loop
https://dashboard.stripe.com/logs?method[0]=post&method[1]=delete&direction[0]=connect_in&direction[1]=self&starting_after=1665421793-req_PNr3fJ7QDzxSJX here is the original that said not enough funds for me
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
even thouhg it was a 200? I can try it again
acct_1LnqTU2SXRMH603P
here is one account specifically
That request you just shared was a replay as well, of https://dashboard.stripe.com/logs/req_ibztiQ2V0tIZHp
im going to do another one real quick
haha ok well now they are all failing becuase I've used the key before ๐ since they key is tied to the payout
also. Idon't see the logs for the payouts or account updates.. only the transfer requests which is weird
I see this, but my code does a account update, payout, then transfer each time. Not just a transfer
You are only seeing your platform's logs
Click the "More" button
And select "Outgoing Connect requests" as well
Then you should see all of them
oh ๐
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
you can see it says insufficient funds
I just did someone for like $4 a few min ago to test
that went through, but I've got way more than that request to payout
sorry sec
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
whiffed the copy ๐
No worries
Are you sure that is the right ID? That is another 400 due to an idempotent replay
mmm so I'm guessing the issue is then that it's replaying the response from the original request, which probably happened after they all looped and we had nothing in the account (before we reversed)
Yep
I guess the easiest thing is to manually do all these lol
I don't want to change to the code to ignore idempotency keys
I'm still unclear exactly what you are trying to do.
But sounds like you need a new script here imo
pay out people from my internal dashboard, but a idempotency error made it spin a bunch and then one of my highly sophisticated teammates decided to keep pressing buttons even though errors were throwing ๐
lol
including after I fixed the keys but before the transfers were reversed
so now all the good idempotency keys are stuck with insufficient fund responses
The other option is to wait 24 hours for the idempotency keys to expire
eh it will only take me a few min to handle, but thanks for the help sorting it XD
I think im all good now but thanks!