Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
C
Core
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 977
    • Issues 977
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Operations
    • Operations
    • Incidents
  • Analytics
    • Analytics
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • Development
  • Core
  • Issues
  • #1585

Closed
Open
Opened Feb 10, 2020 by pbatroff@pbatroff

Payment Notification sent wrongly

Overview

When the system recurring contribution is configured to NOT send Email notification, it is still triggered via PayPal hook, when a Expired notification is received.

Reproduction steps

Hard to reproduce, since it takes the recurring amount time to reproduce the issue. But the general procedure would be:

  1. Configure civicrm to not send emails on contributions start/end (civicrm_contribution_recur - is_email_receipt)
  2. Create a recurring Paypal donation
  3. Log the donation in the system
  4. Cancel recurring donation
  5. Paypal sends out a webhook event, the Contribution is expired, but an email is sent nevertheless.

Current behaviour

An Email is sent even though CiviCRM is configured to not send emails for contributions.

Expected behaviour

On a cancelled contribution, if no emailing for contributions is configured, no mail should be sent.

Environment information

  • Happened in 5.19.4
  • Code seems to be the same in current master.
  • Relevant code pieces: CRM/Core/Payment/PayPalProIPN.php:150 in case of a paypal notification $sendNotification is set to TRUE, not checking if emailing is configured or not.

Then in CRM/Contribute/BAO/ContributionPage.php:L544, if an id for the recurring BAO object is present, $emailReceipe is set to TRUE. ID is set in case of a webhook event.

Comments

The code comment says

 // This means we are coming from back-office - ie. no page ID, but recurring.
 // Ideally this information would be passed into the function clearly rather than guessing by convention.

But this will be accessed via paypal webhook. It should either be tested in PayPalProIPN.php, or the logic in ContributionPage needs to be adjusted. The check for the id seems flawed.

I'm having a hard time reproducing this, so I wanted to gather my findings and put them up for review! thanks for looking into this.

Edited Feb 11, 2020 by BjoernE
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
None
Due date
None
Reference: dev/core#1585