#Divya.Shalini
1 messages ยท Page 1 of 1 (latest)
Hello! I don't know what that's a screenshot of, but I can't really comment on what someone wrote in a random spreadsheet. ๐
It looks like the wording was copied and pasted from our API reference for that Event though: https://stripe.com/docs/api/events/types?lang=curl#event_types-refund.created
Can you give me more details about what you're trying to do?
Yes maybe I also don't know ๐
Yeah sure
Here what we are suppose to do whenever the refund.created event is getting triggered from webhook, then we need to check that if verify order for refund adjustment, if not then need to adjust order and send the invoice.
Not sure I understand. Are you asking what you should do when you receive a refund.created Event?
So what is your thought, what is cash balance refers to?
I want to when when it is getting triggered?
refund.created from customer stripe dashboard
Is it triggering by following below steps:-
Can you give me the ID of that refund?
Right top option of refund
Okay, that's a Charge which has two Refunds associated with it. What questions do you have about that?
My question is how to trigger refund.created webhook event from stripe dashboard?
Is the above steps are correct to follow?
You create a Refund.
From where in the stripe dashboard?
The same place you created a Refund before. One of the Refunds on the Charge you gave me was created in the Dashboard.
You navigate to the payment you want to refund and create a refund from there.
What do you want me to check it for?
Because it is not triggering refund.created it is triggering charge.refunded.
For refund.created to fire you need to create a refund that uses a Customer's cash balance. That said, I think we might be talking past each other. What is your ultimate goal? Why do you want to trigger refund.created?
I am actually listening it and performing email notification as the response
So you're trying to test that email flow?
Yes, I am sending mail to user who would be creating the refund
But unable to trigger it to listen in my code
You can follow the steps here and that should trigger that Event: https://stripe.com/docs/payments/customer-balance/refunding#create-return-dashboard
I am working on test mode
I followed the steps mentioned, and got this.
Okay. The error indicates what you need to do to move forward. Do you have a question about it?
How to verify email address?
Since this is in test mode I recommend you use the email address you use to log in to Stripe, that one should already be verified.
I used this from your recommended link. And it worked. Thank you
Although one more thing I want to ask
I need to find user detail from bank id or card id is there any option?
User's id mainly
Not sure what that means. Which ID?
Id mean customer id or connect account id
So you want to figure out the Customer ID with the starting point of a Payment Method?
Let me explain
I am having this type of payout request
My work is listen whenever payout.canceled is triggering then send mail to connect account user that your payout has been cancelled
But if we see in the request object of payout we donot have any connect account detail
The payout.canceled Event should have an account property on it which tells you the connected account ID: https://stripe.com/docs/api/events/object#event_object-account
It not getting any account property in request
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
It's on the event object not the payout object
So when you receive the payout.canceled event on your webhook endpoint, the event object will have an account property
Can you help me cancel this payout. "po_1NRJkLHdtz9jEBQSR52Wr1BZ".
So that it would be confirmed also
How to create a payout which has not been paid because I used the below curl to create a payout and it already getting paid
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
What's the end goal? What are you trying to test?
My work is to listen whenever payout.canceled is triggering then send mail to connect account user that your payout has been cancelled
Ah I see so you just need to trigger that event to test your code
yes
Recommend doing this: https://stripe.com/docs/webhooks/test
That way you can trigger any event you want easily
Let me try
My endpoints has been registered on stripe itself so I should use this first right?
Am I missing something here?
Ah I apologize then
Looks like payout.canceled isn't supported for stripe trigger then
Sorry to lead you down the wrong path
Let me see what your options are then
No worries
But as I gone through the stripe I got to know that all the objects same whatever action we are performing right?
So that way payout request object would be same for payout.paid, payout.updated, payout.canceled, or any for the same.
Right?
Not sure I understand
All those payout events would contain a payout object
If that's what you're asking
Yup that's correct
So If we check the object then in here we donot have any account related property right?
That's correct
The account property is on the event object
Not the payout object
The event object contains the payout object
So event.data is the payout object in your webhook code
To get account you need to do event.account
Here's what every webhook event object looks like. event.data is the part that changes depending on the event type that comes in https://stripe.com/docs/api/events/object
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
So, event object can differ in every payout.paid, payout.updated, payout.canceled?
Yes it can
The different params will change
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Type is whatever the event type is
But all webhook events come bundled in an event object
So you can get the account param you're after in every single type of event by accessing event.account
Are you sure, because I am checking my webhook through endpoint
And any of the event object is not having account property
{
"id": "evt_1NRJkMHdtz9jEBQSX3h0EGb5",
"object": "event",
"api_version": "2022-08-01",
"created": 1688755874,
"data": {
"object": {
// Other Object
}
},
"livemode": false,
"pending_webhooks": 1,
"request": {
"id": "req_VfcJJSxhVptTM0",
"idempotency_key": "d5ac39a4-1858-4848-92a3-413770a87857"
},
"type": "" // triggered event name
}
I am getting every in this pattern only
{
"id": "evt_1NREnLHdtz9jEBQSKu7gDMOm",
"object": "event",
"api_version": "2022-08-01",
"created": 1688736839,
"data": {
"object": {
// Other Object
}
},
"livemode": false,
"pending_webhooks": 1,
"request": {
"id": "req_GLNuZdbFvoxd8Z",
"idempotency_key": "56f5d024-d6ad-4efd-97b6-272249d491db"
},
"type": "" // triggered event name
}
Here is another example
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Well it needs to be a connect event to have the account param. Noted above
But all connect events should have it. If the events are just on your platform account, then they wont
So yeah both those events are not connect events
What to do for making it connect events?
You'd need to make the calls as the connect account: https://stripe.com/docs/connect/authentication
And also have a separate connect webhook listening for connect events. It's a different type of webhook: https://stripe.com/docs/connect/webhooks
Yes you are right. I got it now.
Although one question, this facility is not available for customer right?
What facility?
event.account for connect account like this for customer
If you create the customer ON the connect account then its event will also have the account object
Creating customer on the connect account makes it a connect event
Correct because that's your platform account not the connect account