beam-community / stripity-stripe

An Elixir Library for Stripe
Other
965 stars 346 forks source link

Extend `Stripe.Invoice.t()` with `from_invoice` to allow to track invoice revisions #770

Closed tristantreb closed 1 year ago

tristantreb commented 1 year ago

Problem: stripe-elixir does not support the new Stripe API version that allows to edit finalized invoices.

Solution: This PR simply extends Stripe.Invoice.t() struct with the field from_invoice. I've tested the code updates end2end.

Why is this field useful? It allows to record all changes made on Stripe in 1 webhook event instead of 2 (because you can access the parent invoice id).

Question: I haven't seen tests for the invoice struct's keys. If I missed this, could you wire me to the right file?