arlyon / async-stripe

Async (and blocking!) Rust bindings for the Stripe API
https://payments.rs
Apache License 2.0
445 stars 128 forks source link

struct Charge deserialization fix, "refunds" is optional, added missing attribute "stripe_report" in "fraud_details" sub object #398

Closed hzargar2 closed 1 year ago

hzargar2 commented 1 year ago

Summary

Fixed de/serialization of Charge struct. "refunds" attribute is expandable and is not sent in webhook events as the most minimum size is sent so deserialization fails. This can be seen by running stripe trigger charge.succeeded in the stripe-cli. Implemented #[serde(default)]on attribute. Also added missing attribute stripe_reportfor fraud_details object.

This is my first pull request ever so I am not sure whether I have done things correctly so feel free to give any suggestions for improvement.

Thanks!

Checklist

hzargar2 commented 1 year ago

Opening new pull request using different branch instead of master