#Ishan-Connect
1 messages · Page 1 of 1 (latest)
You can trigger any event from Dashboard or Stripe CLI
Go to your Webhook endpoint and "Send test event", then choose the "payout.created", click "Send"
curl https://api.stripe.com/v1/balance_transactions
-H "Stripe-Account: acct_1Jr4HRQdKAMzg6Yl"
-d payout=po_1JuSGrQdKAMzg6Yli7BQPrYx
-d type=payment
-d expand[]=data.source.source_transfer
-G
I am retrieving the source transfers involved like this.
If I send a payout.created webhook endpoint from here, it is sending dummy data.
I want to use the transfer ids fetched and do some more logic at my end. So, I need a proper payout id to be present in the webhook payload.
I see.
Unfortunately there is no way to force accelerating the event. Let me see if there is option to customize the Stripe CLI trigger command
This won't work for manual payouts, right ?
For manual Payout, the Payout will only be created if you call the API. After that this Balance Transaction API should work like normal
I tried it for a manual payout id. This is the response which I am getting : 'Balance transaction history can only be filtered on automatic transfers, not manual.'.
Hmm I might missed something. Can you share the request id?
Where will I be able to see the request id ? I have hit a curl request for manual payout id.
This is the payout id : po_1JwQkLQacp6n1mnZoziLLeWn
You can check on your Dashboard requests log
Can you please share me a link redirecting to this section ? I don't know about this.
But as the payout was made from connected account's stripe balance to the external bank account, will this event be shown in dashboard ? It is not a platform event.
Your call to Balance Transaction should appear here: https://dashboard.stripe.com/test/logs
Request id : req_HMMqO85VNpFWJD
When you logged into your Connected Account Dashboard, navigate to Developers > Events and you could see the Payout Event there
Are you talking about this section ?
Yes but that's your event. To see your Connected Account event, you would want to go to that account in Dashboard first, then logged in their Dashboard, then find that section (if a payout.created events has been fired on their account you should see it there)
Yes, I am a bit stretched right now, will try to take a look as soon as I can!
Ah yes
With manual payout, we don't have the link to the Payment. So it's expected that error
Documented here 👆
So, how can I trigger an automatic payout quickly ? I can't wait for 2 days. Or is there any other workaround ?
Yeah that's the point left... When you send a payout.created from Dashboard, I think it does create real objects and returns a valid Payout Id. It's not "dummy" AFAIK. Have you tried it?
Ah but that won't be the Automatic Payout
Yes unfortunately no way to speed that up today. I have found an internal doc saying it's not possible
po_1JuSGrQdKAMzg6Yli7BQPrYx
po_1Jt0KRQdKAMzg6YltC3CLUyC
This 2 payouts were made automatically by stripe, but at that time I didn't configure any webhook endpoint to listen for events.
Will you be able to share webhook payload for 'payout.created' and 'payout.paid' webhook events for this 2 payout ids ?
But I have used Webhook.constructEvent() method to get the event and then deserialized it and fetched the Payout object. So, I need a valid 'Stripe-Signature' header value too.
I think you can resend an event
Complete reference documentation for the Stripe CLI.
Can you try this?
You might need to use the Stripe header/parameter to resend an event on your Connected Account
I am trying this.
stripe events resend evt_1JuSHMQdKAMzg6YLVLyPbWxj --webhook_endpoint=secret
I fired the command, but it is saying 'stripe command not found: events resend'.
See the last command in screenshot. Am I doing something wrong ?
stripe events resend evt_1JuSHMQdKAMzg6YLVLyPbWxj --webhook-endpoint=secret
By mistake I had put '_' instead of '-'. Have changed it, but still getting the same error.
Thanks for the feedback. I can confirm it doesn't work on the site. Could you download and try in local. The command work in local for me
Ok. Will try.
unexpected http status code: 400 {"error":{"message":"The livemode of the authorization key you provided does not match that of the key provided in the Stripe-Account header.","message_code":"stripe_account_livemode_mismatch"}}
I am getting this error message when I fire the command 'stripe login'.
did you authorize using your Platform Account?
My email-id was not verified. I have verified it now.
Let me try again.
Getting the same error.
What should I do for this ?
My account is in test mode right now.
Hey there. Taking over form @warped gyro – just catching up
To be clear, which command are you entering to see that error?
stripe login
And which account are you logging in as? The platform, or connected account?
Platform
Can I ask you to run stripe logout --all
Ok. I will run this command.
stripe logout --all
Logging out...
open C:\Users\ishan.config\stripe\config.toml: The system cannot find the path specified.
Getting this error.
Ok, just means you aren't logged in. I thought there may have been some previous auth leftover
Which event are you trying to resend?
I have logged-in in stripe account. Still this message will come ?
I am trying to send payout.created event.
This one: evt_1JuSHMQdKAMzg6YLVLyPbWxj?
But was not able to as I am not able to pair.
Yes. I want to resend this event, but not able to from stripe cli as I am not able to pair using 'stripe login' command.
Are you sure that's the correct ID?
Yes. I rechecked it. I was trying to fire resend command from online stripe cli, but then @warped gyro said that its not possible. So, I downloaded the zip file and when I fire 'stripe login' command, I am unable to pair.
Platform's account id ?
Well was the Payout object on the platform or the connected account?
On connected account. Payout was done from connected account's stripe balance to external bank account of connected account.
Sure, then you'll need to authenticate the CLI with that account
Assuming it's a standard account?
It is a custom connected account.
Which command should I fire instead of 'stripe login' command ?
Or how should I fire this 'stripe login' command.
Checking on this, never seen that error before
Which version of the CLI are you using? I guess latest (stripe -v)
1.7.8
acct_1HrckWHHgiuTDwmO
Thanks, checking
Ok, sorry for the delay here. It appears that acct_1HrckWHHgiuTDwmO is a 'testmode' only account
Specifically, it was created using the test API keys of another account (acct_1HpUV0Ap3C0MLMUP)
These types of account just won't work with the CLI, as you're seeing
Plus, you're going to run into issues if you eventually need to go live with this account
So what you need to do to get the CLI working is sign out of the Dashboard, and then use the credentials for acct_1HpUV0Ap3C0MLMUP to sign in
Can you please tell me the name of the account with id 'acct_1HpUV0Ap3C0MLMUP' ?
Looks to be New Business
I don't remember now. I had created this account [ acct_1HrckWHHgiuTDwmO ] last year I think.
So, if I use a different stripe account, I will be able to fire 'stripe login' command successfully, right ?
Yes, just not acct_1HrckWHHgiuTDwmO
Ok, but then I need to wait for automatic payout to happen for 'payout.created' event on my different account.
Why do you need to wait for an automatic payout to happen? You can just trigger a specific event you want to test: stripe trigger payout.created
I need a valid payout id in the payload and then will fetch the transfer ids involved in the payout.
Ok, let's take one step first. Can you do stripe login yet?
Excellent!
Now you can do stripe trigger payout.created
Which will create a dummy Payout object (and other associated objects)
Do I have to mention connected account's id while firing this command ?
yes, if you want to test a payout happening on a connected account specifically, then I believe you need to pass --stripe-account=acct_xxxx on the command as well (https://stripe.com/docs/cli/trigger#trigger-stripe_account)
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).
stripe trigger payout.created --stripe-account=acct_1Jyv9C2E3SHANZpF
Why am I getting insufficient funds error ?
looks like stripe-cli assumes there is enough balance in the connected account to test a payout but there isn't here
you should make sure they have enough balance, the easiest way would be to do a payment on your platform using the card that skips the delay(first one in the list at https://stripe.com/docs/testing#cards-responses ) and transfer the funds to the account, then test the payout.
If I do this, then the funds will be shown in both 'Total Balance' and 'Future Payouts' sections, right ?
I think so
I tried to trigger a payout which has balance in both 'Total Balance' and 'Future Payouts' sections. Still I am getting the error.
In the message, it is mentioned 'Your card balance is too low.' . I don't have any card attached to my custom connected account.
what is the balance in the API? Payouts use your available balance
that is why I mentioned using that test card that skips the delay and goes straight to your available balance. Did you use that?
No. I just added funds to connected account's stripe balance from dashboard. I will try it.
cool cool
you likely want something like stripe charges create --source=tok_bypassPending --amount=10000 --currency=usd
then stripe transfers create .... (can't remember the specific arguments but you'll find it in the docs) to transfer some money to the connected account
Now the payout has triggered.
But this is a manual payout. I won't get transfer ids involved.
oh yeah, true!
there isn't really any way to test automatic payouts without just waiting unfortunately, you can only manually trigger manual payouts
I guess then I have to wait. I will try to do the logic and check when the actual automatic payout is triggered by stripe.
And I wanted to confirm following things :
-
When a payout is initiated by stripe, I will get a 'payout.created' webhook event first. Then, when the payout is paid, I will receive a 'payout.paid' event. So, in payout success scenario, the sequence of webhooks will be 'payout.created -> payout.paid'.
-
In case of payout failure scenario, the sequence can be :
a. payout.created -> payout.failed
b. payout.created -> payout.paid -> payout.failed
Is my understanding correct ?
FYI: And payout is made from connected account's stripe balance to the external bank account of the connected account and the connected account's payout interval is set to 'daily'.
- In case of payout failure scenario, the sequence can be :
a. payout.created -> payout.failed
b. payout.created -> payout.paid -> payout.failed
yep, exactly!
yep that is all correct
Thanks for confirming. I am done. Will get back if I have any more queries.