pinax-stripe-light
pinax-stripe-light copied to clipboard
Refund not reflected in charge model
I'm not sure if this is intended to be like this, but when I create a charge, and then refund it, the refunded
attribute still stays at False
.
Example:
In [24]: a
Out[24]: <User: alex>
In [25]: c0 = charges.create(customer=a.customer.stripe_id, amount=decimal.Decimal('17.38'))
# invoice prints
In [27]: c0.refunded
Out[27]: False
# says refunded on stripe
In [28]: refunds.create(c0)
In [29]: c0.refunded
Out[29]: False
I know this could be easily resolved by setting the attribute after the refund is made, but wasn't sure if there is something else going on that I am missing.
@paltman Could you help with this?
This is happening because we are not handling the webhook right now for refund events.
We should implement the process_webhook
method on this handler to sync the charge.
We already have the action, sync_charge_from_stripe_data
implemented, we should just call it in the webhook processor.
I cannot reproduce this. I created a charge and then refunded it and it's showing as refunded.
Furthermore, the webhook for charges is properly calling sync_charge_from_stripe_data
in the webhook processor.