Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refunded state #315

Open
dancixx opened this issue Nov 26, 2021 · 10 comments · May be fixed by #650
Open

Refunded state #315

dancixx opened this issue Nov 26, 2021 · 10 comments · May be fixed by #650
Labels
enhancement New feature or request

Comments

@dancixx
Copy link

dancixx commented Nov 26, 2021

Hi guys.

This is not actually a bug but maybe later can be a feature request. So the main question is that how can I detect on saved invoices and payments the refunded state? Is there a listener for this event in this package?

@dackers86 dackers86 added the enhancement New feature or request label Mar 11, 2022
@Spitzbua
Copy link

The Charge Object in the Payment Intent Object already has a refunded boolean flag - only it is not updated on a refund. We need to revoke the user's authorisation if the payment has been refunded - what are the options?

@joshkautz
Copy link

joshkautz commented Sep 13, 2023

Bumping this. Is there a way to tell if a payment in the Payments sub-collection was refunded? Adding these events to the webhook doesn't appear to be enough - none of the Firebase Cloud Functions handle updating the corresponding payment document to reflect the refunded change.

I assume the change would be made in the insertPaymentRecord function, belonging to the handleWebhookEvents webhook handler function. Similar to how changes to existing subscriptions update the document, I would think that refund events on Stripe could be used to update the existing payment document.

@joshkautz
Copy link

I'd be happy to start on adding a Pull Request with the changes, since I'd definitely use a feature of this nature, but I'm not sure if that's a Stripe anti-pattern or goes against the intended usage. I'd be interested in hearing what folks at Invertase think about that matter. Dare I tag someone - @dackers86 ? If that sounds like something reasonable to add, I'd be happy to do some work on it, but don't wanna go down a rabbit hole if that's just not a good route. To be clear, my ultimate goal is to pick up on refunds to single-payment product purchases. Is this silly?

@dackers86
Copy link
Member

This sounds very useful feature. Perhaps we could update the Firestore payment document in Firestore based by adding the necessary web-hook event to the following:

Api reference: https://stripe.com/docs/api/charges/object#charge_object-refunded.

A PR may also provide additional context from the community on how best to use this property in Firestore.

@joshkautz
Copy link

Sounds good, thanks for the reply, I'll get cooking on this in the near future here. Cheers 👍

@kenneth-ew
Copy link

Hi there, Is there an update on this issue? We are selling our product with a one-time payment and we have no way yet to differentiate between users who have purchased and users who were refunded after purchase (thus, should not access the app). Thanks for your help!

@F46y
Copy link

F46y commented Aug 13, 2024

Any news on this? A status change or sth like that in the payment document that is being refunded would be very helpful.

@joshkautz
Copy link

I never ended up doing any work on this, but I have been checking in on progress from Invertase over the past few months. - mostly because I spent time upgrading all my firebase functions to be 2nd gen.; I was curious if this extension was going to use the 2nd gen functions from the firebase-functions SDK. I don't know the status of project, but haven't seen much activity in a while unfortunately.

@F46y
Copy link

F46y commented Aug 13, 2024

Thank you very much for your reply! Ok - I guess we'll just have to mark them manually as refunded in firebase since our customer base is not that huge yet. So, I can't justify spending too much time on it.

@chetbox
Copy link
Contributor

chetbox commented Dec 4, 2024

We really could use this functionality too. We are introducing a one-off purchase for our customers which can be bought instead of a subscription.

Refunds seems like a fairly obvious omission given the payments sub-collection contains a list of charges but the refunds on each charge remains empty.

It would be great if we could add webhook events for charges.* and see the relevant payments updated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
7 participants