jaymedavis/stripe.net — pull request #2 by jslaybaugh (2012-01-06 23:27:01+00:00)
Title: Added Invoice and InvoiceItem functionality as well as some webhook utility methods and some refactoring

Jayme:

First off, great job on this library. I just started to use stripe last week and the only thing that could be simpler than their API is this library to access it. I needed the ability to charge a setup fee when a customer signs up for a plan and after chatting with the folks at stripe, they suggested that the best way to do that is to create the customer, add an invoiceitem for the setup fee, and then update the customer with the new subscription. That's when i realized that stripe.net didnt have anything for invoices or invoiceitems. I'll also be needing to do some stuff with the webhooks, so i figured I'd fork this and make a pass at adding in all that functionality.

I wrestled with your Mapper.FromJson implementation for about a day trying to build in some recursive functionality, but stuff with reflection might as well be greek to me. So, then it hit me. You were already using the Newtonsoft.JSON library and he had already invented the serialization and deserialization wheel and we didnt *need* to reinvent it. So I changed the attributes you were using to map to the JsonProperty he uses, and then wrote a custom converter for stripe's goofy integer dates and was back in business. Overall, I think its cleaner to read and use this way and I trust the performance of JSON.net's serialization.

I went ahead and added in the tests for invoices and invoice items (not webhooks since they are initated by stripe) and as of this commit, all 264 tests pass. This is actually my first experience with writing tests at all, so I hope I did a decent job. I tried to borrow as much from the existing tests as possible.

Lastly, I bumped the version from 1.0.2 to 1.1.0 just so I could keep track of the different .dll's on my end. I also updated the copyright to 2012 :)

This is my first time to fork and contribute to an open source project and its very exciting. Thanks for laying all the groundwork on something I could sink my teeth into and hopefully provide some helpful contributions.

- Jorin