goteo icon indicating copy to clipboard operation
goteo copied to clipboard

Fix/stripe refunds

Open subiabre opened this issue 1 year ago • 0 comments

:tophat: What? Why?

This PR fixes an issue on the Stripe Gateway that was making it impossible for the invests to be written with the correct reference value, the subscription id, under the payment property, making it impossible for the webhook controller to find the referenced invests when receiving a refund event.

It also saves the Stripe invoice id under the transaction property, this makes invests be tied 1:1 to an specific stripe invoice (i.e a payment for the subscription).

:pushpin: Related Issues

  • Fixes https://app.asana.com/0/1206149597772083/1206194873937420

Testing

  1. Set the stripe-cli to forward webhook events to your localhost.
  2. Generate a subscription from Goteo.
  3. Check on the /admin board that the new invest has the subscription id and invoice id under the payment and transaction.
  4. Make a refund of the payment at the stripe dashboard.
  5. Check on the /admin board that the new invest now has an status of "cancelled".

:hearts: Thank you!

subiabre avatar Jan 18 '24 14:01 subiabre