wyyerd / stripe-rs

Rust API bindings for the Stripe HTTP API.
Apache License 2.0
224 stars 88 forks source link

Corrected Webhook's construct event #51

Closed busarovalex closed 5 years ago

busarovalex commented 5 years ago

Took and example of event creation from official C# library EventUtilityTest And rewrote in rust

First of all, remove use of '[]' because it can panic

Then had to introduce 'current_timestamp' field in Webhook for testing purpose

Changed signature verification - looked it up in java library

Changed some type in InvoiceItem struct

busarovalex commented 5 years ago

Update: Left previous \"construct_event\" function signature untouched

kestred commented 5 years ago

Looks good at a glance. Let me give it a more through review this coming Saturday--

busarovalex commented 5 years ago

Looks good at a glance. Let me give it a more through review this coming Saturday--

It would be nice if you paid attention to method names and error types

busarovalex commented 5 years ago

Looks good at a glance. Let me give it a more through review this coming Saturday--

It would be nice if you paid attention to method names and error types

I mean to names and error types which were introduced in this PR

kestred commented 5 years ago

@busarovalex - I figured that is what you meant 😉 .

Sorry for the super slow followup. Looks good.

While I'm sure there are some refinements we could do here before a v1.0 (wrt. breaking API changes) this non-breaking approach is great for today.