Description
Symfony version(s) affected
7.0
Description
I was having an issue with returning Stripe\Refund object and serializing it. Where it would issue a refund and immediately after call Stripe's Cancel Refund API even though it was nowhere in my code. I've spent days looking into this and through Stripe-PHP issues and Stripe's support system.
If I did not return the $refund object, the refund would succeed. I believe it occurs due to the serializer looking for is,get,set,can methods and it finds "cancel" - canCel()
This happens on 7.0, as well as 7.1
https://docs.stripe.com/api/refunds/cancel
How to reproduce
I provided sample script that reproduces the issue. The PaymentIntent and Secret Key are obfuscated.
The "stripe error on serialize" message appears
https://gist.github.com/program-the-brain-not-the-heartbeat/3fc5b85d3c8dc4f97c8bb90887d9446b
Possible Solution
No response
Additional Context
No response