Links in PayPal Standard recurring contribution confirmation email don’t work
Ref: #760 (closed)
Contribution confirmation emails for recurring PayPal Standard contributions contain three links that are non-functional.
Link 1: “This is a recurring contribution. You can cancel future contributions by visiting this web page.”
- Two questions are shown which seem inappropriate for a front-end page:
- Send cancellation request to PayPal Standard ?
- Notify Contributor?
- On submit:
- If Send Cancellation = Yes:
- Green-background status message: "The recurring contribution could not be cancelled."
- No change to recurring status in Civi or PayPal.
- If Send Cancellation = No:
- Green-background status message: “The recurring contribution of 5.20, every 1 month has been cancelled.”
- Contact record shows recurring contribution is cancelled
- Merchant and donor PayPal accounts continue to show active recurring transaction.
- If Send Cancellation = Yes:
Link 2: “You can update billing details for this recurring contribution by visiting this web page.”
- There are only Save and Cancel buttons, but no form fields.
- Submit: "There was some problem updating the billing details"
Link 3: “You can update recurring contribution amount or change the number of installments for this recurring contribution by visiting this web page.”
- Recurrence Period is indicated as "(every )" rather than ‘(every month)”.
- If not logged in:
- Popup: "Access is denied. Ensure that you are still logged in and have permission to access this feature."
- On submit: Blank screen.
- If logged in:
- On submit:
- Displays Find Contributions page with no error indicated.
- No change observed in either merchant or donor PayPal accounts. Both show an active recurring payment.
- On submit:
Analysis
(I’ll focus on link 2 as an example, and assume that none of these 3 links should appear as their functions are unsupported by PayPal (?) for PayPal Standard payments)
- Sending of confirmation email is initiated by Paypal performing an IPN POST.
- CRM_Contribute_BAO_Contribution->composeMessageArray calls CRM_Core_Payment_PayPalImpl->subscriptionURL to form the problematic URLs.
- CRM_Core_Payment_PayPalImpl->subscriptionURL attempts to determine if the payment processor supports each operation by doing, for example “if (!$this->supports('updateSubscriptionBillingInfo'))” which in turn returns method_exists($this, supportsUpdateSubscriptionBillingInfo).
- CRM_Core_Payment (parent class of CRM_Core_Payment_PayPalImpl) does indeed contain function supportsUpdateSubscriptionBillingInfo which returns “method_exists(CRM_Utils_System::getClassName($this), 'updateSubscriptionBillingInfo')”.
- CRM_Core_Payment_PayPalImpl does include function updateSubscriptionBillingInfo, although it begins with “if ($this->isPayPalType($this::PAYPAL_PRO)) “ and therefore simply returns false for PayPal Standard or Express
- Template "Contributions - Receipt (on-line)" includes the problematic URL section based on the existence of $updateSubscriptionBillingUrl (for example).
Conclusion
- Step 3 seems to be a problem as it tests only for the existence of supportsUpdateSubscriptionBillingInfo (found in the parent class) rather than calling that function to get a meaningful result.
- Step 4 seems to be a problem because while the function 'updateSubscriptionBillingInfo' does indeed exist, it does nothing if the payment processor is PayPal Standard.
Behavior confirmed in 5.13.4 and in master (5.18.alpha1).