#some1ataplace

1 messages · Page 1 of 1 (latest)

haughty pelicanBOT
lavish obsidian
stoic remnant
#

For example, in python it would be this? print(stripe.Balance.retrieve(stripe_account='acct_1Nu7mfIsMFguiimW'))

#

I see this:

{
"available": [
{
"amount": 0,
"currency": "usd",
"source_types": {
"card": 0
}
}
],
"instant_available": [
{
"amount": 7500,
"currency": "usd",
"source_types": {
"card": 7500
}
}
],
"livemode": false,
"object": "balance",
"pending": [
{
"amount": 12500,
"currency": "usd",
"source_types": {
"card": 12500
}
}
]
}

lavish obsidian
#

That looks right to me

stoic remnant
#

So all 3 - available, instant_available, pending need to be all 0?

lavish obsidian
#

Need to be 0 for what?

stoic remnant
#

If a user is to delete their account from my website. How do I stop them from deleting their account unless they have a 0 balance?

lavish obsidian
#

Ah we discussed this yesterday, I forgot

stoic remnant
#

Yea sorry, I just got to it now since I have some free time

lavish obsidian
#

Yeah so you will need to either reverse the transfers that were sent to that account equal to the amount of their current balance, or you need to wait until that balance is paid out.

#

Then you can delete the account within Stripe.

stoic remnant
#

oh wow how could I determine either of those in the API?

lavish obsidian
#

Either of those being a payout or reversing transfers?

stoic remnant
#

yes

lavish obsidian
stoic remnant
#
  1. reverse the transfers that were sent to that account equal to the amount of their current balance

  2. wait until that balance is paid out - how can you check this

lavish obsidian
#

And if the account is on automatic payouts then that will just happen... automatically

#

In terms of checking on when that occurs, you either listen to Webhooks for payout.paid or you just check once a day using a cron job or something like that

stoic remnant
#

hmm all right this is going to require more effort than I thought. Give me some time I will try to write some code.

#

So print(stripe.Transfer.list(destination='acct_1Nu7mfIsMFguiimW')) will list all historic transfers? Or just the ones that are pending?

lavish obsidian
#

All

stoic remnant
#

Oh boy so I would have to reverse all the transfers even if they successfully completed?

#

Wouldn't I just need to reverse the pending ones that have not completed yet, how would i do that?

lavish obsidian
#

No you wouldn't reverse all

haughty pelicanBOT
stoic remnant
#

ok cool so just the ones that have not completed yet, how can i see that in the api

lavish obsidian
stoic remnant
#

thanks will review this after my work meeting

lavish obsidian
#

👍

haughty pelicanBOT
stoic remnant
#

I am unable to do this?

print(stripe.BalanceTransaction.list(id='txn_3NzuhiIeTJrsS1re27hFhwHe'))

#

Received unknown parameter: id

pearl ibex
#

Hi there

stoic remnant
#

hi

pearl ibex
#

The suggestion above wasn't to pass an id either

#

If you want to list balance transactions on a connect account, don't pass that id param and make sure to pass the stripe account header of the connect account whose balance transactions you're trying to get: https://stripe.com/docs/connect/authentication

stoic remnant
#

ah

#

That worked

print(stripe.BalanceTransaction.list(stripe_account='acct_1Nu7mfIsMFguiimW'))

pearl ibex
#

But then you also want to expand source as suggested above

stoic remnant
#

yes trying that now

#

print(stripe.BalanceTransaction.list(stripe_account='acct_1Nu7mfIsMFguiimW', expand=['data.source']))

#

How would I say the full amount even if it is not 100? I would have to extract that from stripe.BalanceTransaction.list?

#

or can i exclude amount=100 and it will do the entire amount?

lavish obsidian
#

If you exclude amount it will reverse the entire amount