Skip to content
Snippets Groups Projects
Commit cb830346 authored by ayduns's avatar ayduns Committed by mattwire
Browse files

Don't check permissions - same behaviour as old version

parent 788c831b
No related branches found
No related tags found
1 merge request!2096.8
...@@ -38,7 +38,7 @@ class CRM_Stripe_Customer { ...@@ -38,7 +38,7 @@ class CRM_Stripe_Customer {
throw new PaymentProcessorException('Stripe Customer (find): contact_id is required'); throw new PaymentProcessorException('Stripe Customer (find): contact_id is required');
} }
$result = StripeCustomer::get() $result = StripeCustomer::get(FALSE)
->addWhere('contact_id', '=', $params['contact_id']) ->addWhere('contact_id', '=', $params['contact_id'])
->addWhere('processor_id', '=', $params['processor_id']) ->addWhere('processor_id', '=', $params['processor_id'])
->addSelect('customer_id') ->addSelect('customer_id')
...@@ -55,7 +55,7 @@ class CRM_Stripe_Customer { ...@@ -55,7 +55,7 @@ class CRM_Stripe_Customer {
* @return array|null * @return array|null
*/ */
public static function getParamsForCustomerId($stripeCustomerId) { public static function getParamsForCustomerId($stripeCustomerId) {
$result = StripeCustomer::get() $result = StripeCustomer::get(FALSE)
->addWhere('customer_id', '=', $stripeCustomerId) ->addWhere('customer_id', '=', $stripeCustomerId)
->addSelect('contact_id', 'processor_id') ->addSelect('contact_id', 'processor_id')
->execute() ->execute()
...@@ -76,6 +76,7 @@ class CRM_Stripe_Customer { ...@@ -76,6 +76,7 @@ class CRM_Stripe_Customer {
return civicrm_api4('StripeCustomer', 'get', [ return civicrm_api4('StripeCustomer', 'get', [
'select' => ['customer_id'], 'select' => ['customer_id'],
'where' => [['processor_id', '=', $processorId]], 'where' => [['processor_id', '=', $processorId]],
'checkPermissions' => FALSE,
] + $options, ['customer_id']); ] + $options, ['customer_id']);
} }
...@@ -87,7 +88,7 @@ class CRM_Stripe_Customer { ...@@ -87,7 +88,7 @@ class CRM_Stripe_Customer {
* @throws \Civi\Payment\Exception\PaymentProcessorException * @throws \Civi\Payment\Exception\PaymentProcessorException
*/ */
public static function add($params) { public static function add($params) {
return civicrm_api4('StripeCustomer', 'create', ['values' => $params]); return civicrm_api4('StripeCustomer', 'create', ['checkPermissions' => FALSE, 'values' => $params]);
} }
/** /**
...@@ -230,7 +231,7 @@ class CRM_Stripe_Customer { ...@@ -230,7 +231,7 @@ class CRM_Stripe_Customer {
* @return void * @return void
*/ */
public static function updateMetadataForContact(int $contactId, int $processorId = NULL): void { public static function updateMetadataForContact(int $contactId, int $processorId = NULL): void {
$customers = StripeCustomer::get() $customers = StripeCustomer::get(FALSE)
->addWhere('contact_id', '=', $contactId); ->addWhere('contact_id', '=', $contactId);
if ($processorId) { if ($processorId) {
$customers = $customers->addWhere('processor_id', '=', $processorId); $customers = $customers->addWhere('processor_id', '=', $processorId);
......
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