erpnext
erpnext copied to clipboard
refactor: set_as_failed method on Payment Request
This PR removes the set_failed
method from the Payment Request Doctype, which did nothing and was referenced nowhere.
It replaces the set_failed
method with a set_as_failed
method which corresponds generally to the existing set_as_cancelled
and set_as_paid
methods, with the notable difference that it accepts a reason
parameter which populates the recently-introduced failed_reason
field.
This is somewhat related to my recent PR#75 on the payments app which attempts to incorporate payment status from GoCardless webhooks, including updating the failed_reason
field, where applicable. In that PR I utilize the existing set_as_cancelled
and set_as_paid
methods for those actions, but have created a manual workaround for the absence of a set_as_failed
method. It would be nice to have this consolidated eventually.
This pull request has been automatically marked as inactive because it has not had recent activity. It will be closed within 3 days if no further activity occurs, but it only takes a comment to keep a contribution alive :) Also, even if it is closed, you can always reopen the PR when you're ready. Thank you for contributing.
Keep alive ~ Any feedback would be appreciated!
BTW, here's a quick verification that the set_failed
method had no references anywhere else:
This pull request has been automatically marked as inactive because it has not had recent activity. It will be closed within 3 days if no further activity occurs, but it only takes a comment to keep a contribution alive :) Also, even if it is closed, you can always reopen the PR when you're ready. Thank you for contributing.