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

Update Charge struct #405

Closed hzargar2 closed 1 year ago

hzargar2 commented 1 year ago

Summary

Repost of #398 using different branch instead of master.

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_report for 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

arlyon commented 1 year ago

Hey @hzargar2 the PR itself and description are great however any changes to the generated folder will be overwritten every week when the api is updated so I can't accept this change as-is. Updating the code to do what you need would require some changes to the codegen. You are more than welcome to dive in the deep end and try to resolve it, or I can make some time to take a look myself. Just update this PR if you have any progress :)

arlyon commented 1 year ago

After some reflection, I'd prefer a proper change to the codegen end up in a new PR.