Just like charge objects can have id's that start with either ch_ (if they are a credit card charge) or py_ (if they are made with some other payment method) refund object appear to have id's that start with either re_ or pyr_.
Additional context
The following is an example of a balance_transaction returned by stripe that the library currently fails to deserialize due to the pyr_ id in the source field.
Just like
charge
objects can have id's that start with eitherch_
(if they are a credit card charge) orpy_
(if they are made with some other payment method)refund
object appear to have id's that start with eitherre_
orpyr_
.Additional context
The following is an example of a
balance_transaction
returned by stripe that the library currently fails to deserialize due to thepyr_
id in thesource
field.Fetching that same
balance_transaction
with thesource
expanded you can see that stripe considers that source a "refund" object: