#Divya.Shalini

1 messages ยท Page 1 of 1 (latest)

hushed nestBOT
neon latch
zenith wing
#

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. ๐Ÿ˜…

#

Can you give me more details about what you're trying to do?

neon latch
neon latch
#

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.

zenith wing
#

Not sure I understand. Are you asking what you should do when you receive a refund.created Event?

neon latch
#

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:-

zenith wing
#

Can you give me the ID of that refund?

neon latch
#

Right top option of refund

neon latch
#

ch_3NQXC4Hdtz9jEBQS1MKYqYPT

zenith wing
#

Okay, that's a Charge which has two Refunds associated with it. What questions do you have about that?

neon latch
#

My question is how to trigger refund.created webhook event from stripe dashboard?

#

Is the above steps are correct to follow?

zenith wing
#

You create a Refund.

neon latch
#

From where in the stripe dashboard?

zenith wing
#

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.

neon latch
#

Can you check this event "evt_3NRIY6Hdtz9jEBQS0ZlWePpW"?

#

Is it refund

zenith wing
#

What do you want me to check it for?

neon latch
#

Because it is not triggering refund.created it is triggering charge.refunded.

zenith wing
#

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?

neon latch
#

I am actually listening it and performing email notification as the response

zenith wing
#

So you're trying to test that email flow?

neon latch
#

Yes, I am sending mail to user who would be creating the refund

#

But unable to trigger it to listen in my code

zenith wing
neon latch
#

I am working on test mode

neon latch
zenith wing
#

Okay. The error indicates what you need to do to move forward. Do you have a question about it?

neon latch
#

How to verify email address?

zenith wing
#

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.

neon latch
#

Although one more thing I want to ask

#

I need to find user detail from bank id or card id is there any option?

zenith wing
#

Yep, what's up?

#

What details are you looking for specifically?

neon latch
#

User's id mainly

zenith wing
#

Not sure what that means. Which ID?

neon latch
#

Id mean customer id or connect account id

zenith wing
#

So you want to figure out the Customer ID with the starting point of a Payment Method?

neon latch
#

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

zenith wing
hushed nestBOT
neon latch
#

It not getting any account property in request

tropic rivet
#

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

neon latch
#

Can you help me cancel this payout. "po_1NRJkLHdtz9jEBQSR52Wr1BZ".

#

So that it would be confirmed also

tropic rivet
#

No it's already paid

#

You can only cancel payouts that haven't been paid yet

neon latch
tropic rivet
#

What's the end goal? What are you trying to test?

neon latch
#

My work is to listen whenever payout.canceled is triggering then send mail to connect account user that your payout has been cancelled

tropic rivet
#

Ah I see so you just need to trigger that event to test your code

neon latch
#

yes

tropic rivet
#

That way you can trigger any event you want easily

neon latch
#

Let me try

#

My endpoints has been registered on stripe itself so I should use this first right?

tropic rivet
#

Yes exactly

#

That's just so you can test locally

neon latch
#

Am I missing something here?

tropic rivet
#

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

neon latch
#

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?

tropic rivet
#

Not sure I understand

#

All those payout events would contain a payout object

#

If that's what you're asking

neon latch
#

Yes

#

In that payout object properties are same right, only value would be different?

tropic rivet
#

Yup that's correct

neon latch
#

So If we check the object then in here we donot have any account related property right?

tropic rivet
#

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

neon latch
#

So, event object can differ in every payout.paid, payout.updated, payout.canceled?

tropic rivet
#

Yes it can

#

The different params will change

#

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

neon latch
#

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

tropic rivet
#

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

neon latch
#

What to do for making it connect events?

tropic rivet
neon latch
#

Yes you are right. I got it now.

#

Although one question, this facility is not available for customer right?

tropic rivet
#

What facility?

neon latch
#

event.account for connect account like this for customer

tropic rivet
#

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

neon latch
#

From here it will not right?

tropic rivet
#

Correct because that's your platform account not the connect account

neon latch
#

Ok, got it

#

Thank you so much for your help

#

It's been pleasure talking to you ๐Ÿ˜Š

tropic rivet
#

No problem

#

happy I could help