feat(firestore-stripe-payments): Update payments collection for refunds #650
+56
−0
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Resolves #315
Updates the
charges
property in the payments collection.Requires adding the
charge.refunded
webhook handler event.Screenshots from Firebase Console
Tested by deploying a local copy of the extension in our Firebase test environment.
charges.data[0]
property of a payment before refund:charges.data[0]
property of the same payment after refund:Edit: I realised that a retrieving a Payment Intent does not include the
charges
list and it's not listed in the Payment Intent object. Thecharges
key does appear in the payments collection, however, so I've updated this change to find and update the Charge object incharges
when thecharge.refunded
data is received.Edit 2: I formatted the new code with Prettier and removed the
package-lock.json
changes.