pinax-stripe-light icon indicating copy to clipboard operation
pinax-stripe-light copied to clipboard

Refund not reflected in charge model

Open mclean25 opened this issue 8 years ago • 4 comments

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.

mclean25 avatar Apr 12 '16 22:04 mclean25

@paltman Could you help with this?

ossanna16 avatar Apr 13 '16 15:04 ossanna16

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.

paltman avatar Jun 22 '17 15:06 paltman

We already have the action, sync_charge_from_stripe_data implemented, we should just call it in the webhook processor.

paltman avatar Jun 22 '17 15:06 paltman

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.

refund

gregnewman avatar Jun 29 '17 12:06 gregnewman