This PR adds the ability to delete a payment scheme that has not been linked to any recurring contribution.
Before
Delete link did not work.
After
Screencast shows a payment scheme cannot be deleted if it has been linked to a recurring contribution(s). The error toast message will display if the payment scheme cannot be deleted.
In this PR, I updated the existing class CRM_MembershipExtras_Form_PaymentScheme in process deletion in delete and add the logic to validate if payment scheme is linked to any recurring contribution by using ContributionRecur API v4 to check.
In the smarty template, I also added the condition to display delete warning message by checking if the action equals to 8 which aligns with constant in Civi Action class
Overview
This PR adds the ability to delete a payment scheme that has not been linked to any recurring contribution.
Before
Delete link did not work.
After
Screencast shows a payment scheme cannot be deleted if it has been linked to a recurring contribution(s). The error toast message will display if the payment scheme cannot be deleted.
screencast to delete payment scheme.webm
Screencast shows payment scheme was deleted successfully.
screencast-compucorp.atlassian.net-2023.06.06-14_31_21.webm
Technical Details
In this PR, I updated the existing class
CRM_MembershipExtras_Form_PaymentScheme
in process deletion in delete and add the logic to validate if payment scheme is linked to any recurring contribution by using ContributionRecur API v4 to check.In the smarty template, I also added the condition to display delete warning message by checking if the action equals to 8 which aligns with constant in Civi Action class