Skip to content
Snippets Groups Projects
Commit f4032ae8 authored by mattwire's avatar mattwire
Browse files

Fix contact ID

parent c9cdd98c
No related branches found
No related tags found
No related merge requests found
......@@ -38,6 +38,10 @@ class Charge extends Base {
return $this->contactID;
}
public function hasContactID(): bool {
return isset($this->contactID);
}
/**
* @var int The CiviCRM Contribution ID
*/
......@@ -104,7 +108,7 @@ class Charge extends Base {
$this->setDescription('Stripe: Manual import via API');
}
if (empty($this->getContactID())) {
if (!$this->hasContactID()) {
// Derive contact ID from stripe customer
if (empty(\CRM_Stripe_Api::getObjectParam('customer_id', $stripeCharge))) {
throw new \Exception('Missing customer_id in Stripe Charge. Cannot derive contact ID');
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment