Refund status not set correctly when cancelled_payment_id is set
This is the same as extensions/stripe#260 (closed), but the issue lies in core.
Steps to Replicate
- Create a contribution.
- Refund the entire contribution via
Payment.create
. Set thecancelled_payment_id
.
Expected Result
The contribution's status should be "Refunded".
Actual Result
The contribution's status remains "Completed".
PR 16148's purpose is to set a contribution's status to "Refunded" when the refund's total equals the contribution's total (in CRM_Financial_BAO_Payment::create()
.
However, this function returns early if the cancelled_payment_id
is set. Stripe 6.5 sets that value (as it should). So that code never runs.
Moreover, the test on PR 16148 doesn't set this value, so the bug isn't caught.