goteo
goteo copied to clipboard
Fix/stripe refunds
: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
- Set the stripe-cli to forward webhook events to your localhost.
- Generate a subscription from Goteo.
- Check on the /admin board that the new invest has the subscription id and invoice id under the payment and transaction.
- Make a refund of the payment at the stripe dashboard.
- Check on the /admin board that the new invest now has an status of "cancelled".
:hearts: Thank you!