erpnext icon indicating copy to clipboard operation
erpnext copied to clipboard

refactor: set_as_failed method on Payment Request

Open batonac opened this issue 11 months ago • 4 comments

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.

batonac avatar Mar 21 '24 15:03 batonac

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.

stale[bot] avatar Apr 10 '24 02:04 stale[bot]

Keep alive ~ Any feedback would be appreciated!

batonac avatar Apr 10 '24 10:04 batonac

BTW, here's a quick verification that the set_failed method had no references anywhere else: image

batonac avatar Apr 10 '24 10:04 batonac

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.

stale[bot] avatar Apr 28 '24 10:04 stale[bot]