Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Stripe
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Extensions
Stripe
Commits
fde6da11
Commit
fde6da11
authored
8 years ago
by
Andie Hunt
Browse files
Options
Downloads
Patches
Plain Diff
set processor_id if it is obvious
parent
87833fda
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
CRM/Stripe/Upgrader.php
+20
-0
20 additions, 0 deletions
CRM/Stripe/Upgrader.php
with
20 additions
and
0 deletions
CRM/Stripe/Upgrader.php
+
20
−
0
View file @
fde6da11
...
...
@@ -68,6 +68,26 @@ class CRM_Stripe_Upgrader extends CRM_Stripe_Upgrader_Base {
CRM_Core_DAO
::
executeQuery
(
'ALTER TABLE civicrm_stripe_customers ADD COLUMN `processor_id` int(10) DEFAULT NULL COMMENT "ID from civicrm_payment_processor"'
);
CRM_Core_DAO
::
executeQuery
(
'ALTER TABLE civicrm_stripe_plans ADD COLUMN `processor_id` int(10) DEFAULT NULL COMMENT "ID from civicrm_payment_processor"'
);
CRM_Core_DAO
::
executeQuery
(
'ALTER TABLE civicrm_stripe_subscriptions ADD COLUMN `processor_id` int(10) DEFAULT NULL COMMENT "ID from civicrm_payment_processor"'
);
try
{
// Set processor ID if there's only one.
$processorCount
=
civicrm_api3
(
'PaymentProcessorType'
,
'get'
,
array
(
'name'
=>
"Stripe"
,
'api.PaymentProcessor.getcount'
=>
array
(
'is_test'
=>
0
),
));
foreach
(
$processorCount
[
'values'
]
as
$processorType
)
{
if
(
!
empty
(
$processorType
[
'api.PaymentProcessor.get'
][
'id'
]))
{
$p
=
array
(
1
=>
array
(
$processorType
[
'api.PaymentProcessor.get'
][
'id'
],
'Integer'
),
);
CRM_Core_DAO
::
executeQuery
(
'UPDATE civicrm_stripe_customers SET processor_id = %1 where processor_id IS NULL'
,
$p
);
CRM_Core_DAO
::
executeQuery
(
'UPDATE civicrm_stripe_plans SET processor_id = %1 where processor_id IS NULL'
,
$p
);
CRM_Core_DAO
::
executeQuery
(
'UPDATE civicrm_stripe_subscriptions SET processor_id = %1 where processor_id IS NULL'
,
$p
);
}
}
}
catch
(
CiviCRM_API3_Exception
$e
)
{
return
TRUE
;
}
}
return
TRUE
;
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment