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

Fixes for Charge #397

Closed Connoropolous closed 1 year ago

Connoropolous commented 1 year ago

Summary

Charge was not deserializing successfully... I had to go in and do line by line checks with the API response I was getting to see why.

I realize that I am not doing the right thing for fraud_details... here is what the API was giving in reality:

Screenshot 2023-06-28 at 12 33 13 PM

an empty object. What's the recommendation?

Note, I was using Charge in the context of BalanceTransactionSourceUnion not sure if that matters.

Checklist

Connoropolous commented 1 year ago

@arlyon look forward to your review

hzargar2 commented 1 year ago

@arlyon look forward to your review

Hi I encountered the same issue with regards to the deserialization of the refunds attribute but not the "fraud_details" object. It seems that the standard for List types in the lib is to call default() on the attribute when ser/de. I also added a missing attribute "stripe_report" on "fraud_details". This is my first pull request ever so I am not sure how to edit yours or what the git etiquette is so I've created a new PR #405 for this issue. Any pointers for the future would be appreciated on how to contribute to an existing pull request. Anyways, I thought perhaps the missing attribute on the fraud_details object may help fix your issue even though it's a long shot since it seems you're getting back an entirely empty object.

arlyon commented 1 year ago

Hello folks, thanks for taking the time to make a change. Unfortunately I cannot accept PRs that directly modify the generated code since they will be lost next week when the codegen reruns. I would be more than happy to guide you if you'd like to work through updating the codegen to work around this, or I will try to get round to it at some point. I am going to close this PR as well as #405 for this reason but feel free to open an issue regarding the charge so we can explore this further.