Closed migueltol22 closed 6 months ago
I am hitting the same problem in the webhook charge.refunded
it wont deserialize properly
.. with err: BadParse(Error("missing field
refunds", line: 124, column: 5))
I am hitting the same problem in the webhook
charge.refunded
it wont deserialize properly.. with err: BadParse(Error("missing field
refunds", line: 124, column: 5))
Im currently working with 0.31.0 and having the same issue.
I think its because refunds is not optional in the charge struct causing it to fail.
async-stripe-0.31.0/src/resources/generated/charge.rs
/// A list of refunds that have been applied to the charge.
pub refunds: List<Refund>,
It looks like in the PR above they have a fix
pub refunds: Option<stripe_types::List<stripe_shared::Refund>>,
The last comment on the PR was to release so hopefully it goes out soon.
I have a PR for this here: https://github.com/arlyon/async-stripe/pull/503
Describe the bug
According to the stripe docs refunds on the charge object is nullable.
In situations when trying to deserialize the object to a Charge struct we get an error of
To Reproduce
In my specific scenario, I am listening to the
charge.succeeded
webhook that is equivalent to the example as part of the repoListen to stripe webhooks locally using stripe cli
charge.succeeded
event will fail with the example setup.Added additional logging for debugging
Expected Error:
Expected behavior
I'd expect refunds to be of type
Option<List<Refund>>
and be able to parse correctly if refunds is not provided in the payload.Code snippets
No response
OS
macOs
Rust version
1.74.0
Library version
async-stripe 0.22.2
API version
2022-11-15
Additional context
No response