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

Don't require paymentlib

parent 2e06edb4
Branches
Tags
1 merge request!95.1
......@@ -6,8 +6,6 @@
class CRM_Core_Payment_Stripe extends CRM_Core_Payment {
use CRM_Core_PaymentTrait;
/**
* We only need one instance of this object. So we use the singleton
* pattern and cache the instance in this variable
......@@ -821,5 +819,57 @@ class CRM_Core_Payment_Stripe extends CRM_Core_Payment {
$ipnClass->main();
}
/*******************************************************************
* THE FOLLOWING FUNCTIONS SHOULD BE REMOVED ONCE THEY ARE IN CORE
* getBillingEmail
* getContactId
******************************************************************/
/**
* Get the billing email address
*
* @param array $params
* @param int $contactId
*
* @return string|NULL
*/
protected static function getBillingEmail($params, $contactId) {
$billingLocationId = CRM_Core_BAO_LocationType::getBilling();
$emailAddress = CRM_Utils_Array::value("email-{$billingLocationId}", $params,
CRM_Utils_Array::value('email-Primary', $params,
CRM_Utils_Array::value('email', $params, NULL)));
if (empty($emailAddress) && !empty($contactId)) {
// Try and retrieve an email address from Contact ID
try {
$emailAddress = civicrm_api3('Email', 'getvalue', array(
'contact_id' => $contactId,
'return' => ['email'],
));
}
catch (CiviCRM_API3_Exception $e) {
return NULL;
}
}
return $emailAddress;
}
/**
* Get the contact id
*
* @param array $params
*
* @return int ContactID
*/
protected static function getContactId($params) {
return CRM_Utils_Array::value('contactID', $params,
CRM_Utils_Array::value('contact_id', $params,
CRM_Utils_Array::value('cms_contactID', $params,
CRM_Utils_Array::value('cid', $params, NULL
))));
}
}
......@@ -21,9 +21,6 @@
<comments>Original Author: Joshua Walker (drastik) - Drastik by Design.
Jamie Mcclelland (ProgressiveTech) did a lot of the 5.x compatibility work.
</comments>
<requires>
<ext>org.civicrm.paymentlib</ext>
</requires>
<civix>
<namespace>CRM/Stripe</namespace>
</civix>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment