function hasValidMembership() {
// Since we don't currently shut off an expired member's benefits,
- // we only test that they have a membership, not that it is current.
+ // we only test that they have a membership, and not that its pending,
+ // because pending members havent yet paid us yet.
$params = array(
- 'contact_id' => $this->contact['id']
+ 'contact_id' => $this->contact['id'],
+ 'status_id' => ['!=' => "Pending"]
);
try {
- $result = civicrm_api3('membership', 'get', $params);
+ $result = ('membership', 'get', $params);
return $result['count'] > 0;
} catch (CiviCRM_API3_Exception $e) {
return false;