#masonhale-express-dashboard
1 messages ยท Page 1 of 1 (latest)
Thanks. First here's a screenshot of the Rocket Rides dashboard for reference:
And the code for that dashboard is here: https://github.com/stripe/stripe-connect-rocketrides/blob/f38e8595b39dfb713ace40482342852b304fb1d3/server/views/dashboard.pug
I notice in the Balance api - the available and pending attributes are arrays of hashes, suggesting that an account can have more than one available or pending balance. Yet in the RocketRides example, the first item of that array is only used. See: https://github.com/stripe/stripe-connect-rocketrides/blob/f38e8595b39dfb713ace40482342852b304fb1d3/server/routes/pilots/pilots.js#L55-L56
First question: under what circumstances would an account have multiple available or pending balances?
Second question: I would like to be able to show my customers the amount scheduled for their next payout. Ideally to show the amount and date that the payout is schedule to be made. However, when looking at the Payouts API (https://stripe.com/docs/api/payouts) I don't see any way to pass a stripe account id to query the payouts for a single account. Is it possible for me to show upcoming/scheduled payouts for a connected account in my app?
Third question: On the Stripe Express dashboard, transfers are shown with a clock icon. What does this icon mean?
Apologies, ended up with a flurry of questions all at once.
I'm not exactly sure of a scenario where there would be multiple balances (within each category). Let me see what I can find.
No problem @severe plinth . I'm patient.
re: my second question regarding Payouts for a specific account. I've found that via the ruby gem, I can pass the stripe account id like so: Stripe::Payout( { limit: 3 }, { stripe_account: 'account-id-goes-here' } )
First question's answer: The balances are arrays where each available currency will have an entry.
For example, this is output from a teammate's test account:
"object": "balance",
"available": [
{
"amount": 2217713,
"currency": "cad",
"source_types": {
"bank_account": 0,
"card": 2217713
}
},
{
"amount": 2685,
"currency": "nok",
"source_types": {
"bank_account": 0,
"card": 2685
}
},
{
"amount": 7254790,
"currency": "gbp",
"source_types": {
"bank_account": 0,
"card": 7254790
}
},
...```
For your second question. Payout objects reside on the connected account, so you instead of using the connected account as a filter you'll use the stripe-account parameter to execute the request as though it was being made by the connected account. This is the process that you've already found ๐
Thanks @severe plinth -- I didn't realize a single Connected account could handle more than one currency. I suppose I was thinking of/assuming the default_currency setting of the connected account was interpreted as the "only supported currency". But I see from the example a connected account can have balances in multiple currencies and each of those balances can have multiple difference sources. Ok, this rabbit hole goes a bit deeper than I thought. I think, for now at least, my app will be able to impose as one currency per account rule (even if Stripe doesn't) to simplify things.
I'm still looking for info on that clock icon, but does a tool tip appear if you hover over it?
@severe plinth no tooltip unfortunately
@vital horizon Do you have the id of that transfer/payment so we can inspect it?
@summer pewter I will look... just a sec
"id": "tr_3KF3dN2J1KLBnsI8047Xo3pm",
"object": "transfer",
"amount": 66000,
"amount_reversed": 0,
"balance_transaction": "txn_3KF3dN2J1KLBnsI80r8EvOUB",
"created": 1641505013,
"currency": "usd",
"description": null,
"destination": "acct_1KF3YZ2EThxV9szU",
"destination_payment": "py_1KF3dh2EThxV9szUr6SiJ9QN",
"livemode": false,
"metadata": {},
"reversals": {"object":"list","data":[],"has_more":false,"total_count":0,"url":"/v1/transfers/tr_3KF3dN2J1KLBnsI8047Xo3pm/reversals"},
"reversed": false,
"source_transaction": "ch_3KF3dN2J1KLBnsI80yPQfN8A",
"source_type": "card",
"transfer_group": "group_pi_3KF3dN2J1KLBnsI80z3nRDHc"
}]```
@vital horizon If you look at the charge related to that transfer, you'll see that it will be available_on Jan 13 -- so the balance is still pending
That's why the โฑ๏ธ icon is there, to indicated the pending state
@summer pewter ok thanks. That makes sense.
@summer pewter FYI, I did some digging and I did not find the "available_on" property on the Charge object associated with the transfer, but I did find it on the BalanceTransaction object:
[10] pry(main)> Stripe::BalanceTransaction.retrieve("txn_3KF3dN2J1KLBnsI80r8EvOUB")
=> #<Stripe::BalanceTransaction:0x3fc528cbc6f4 id=txn_3KF3dN2J1KLBnsI80r8EvOUB> JSON: {
"id": "txn_3KF3dN2J1KLBnsI80r8EvOUB",
"object": "balance_transaction",
"amount": -66000,
**"available_on": 1642032000**,
"created": 1641505013,
"currency": "usd",
"description": null,
"exchange_rate": null,
"fee": 0,
"fee_details": [
],
"net": -66000,
"reporting_category": "transfer",
"source": "tr_3KF3dN2J1KLBnsI8047Xo3pm",
"status": "pending",
"type": "transfer"
}
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.