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
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
175031a4
Commit
175031a4
authored
2 years ago
by
mattwire
Browse files
Options
Downloads
Patches
Plain Diff
Fix fallback update email
parent
a386ebd6
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!209
6.8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
CRM/Stripe/BAO/StripeCustomer.php
+5
-3
5 additions, 3 deletions
CRM/Stripe/BAO/StripeCustomer.php
with
5 additions
and
3 deletions
CRM/Stripe/BAO/StripeCustomer.php
+
5
−
3
View file @
175031a4
<?php
use
Civi\Api4\Contact
;
use
Civi\Api4\Email
;
use
Civi\Api4\Extension
;
use
Civi\Api4\StripeCustomer
;
use
CRM_Stripe_ExtensionUtil
as
E
;
...
...
@@ -28,13 +29,14 @@ class CRM_Stripe_BAO_StripeCustomer extends CRM_Stripe_DAO_StripeCustomer {
// @todo: Remove when we drop support for CiviCRM < 5.53
// APIv4 - Read & write contact primary and billing locations as implicit joins
// https://github.com/civicrm/civicrm-core/pull/23972 was added in 5.53
$email
=
\Civi\Api4\Email
::
get
(
FALSE
)
$emailResult
=
Email
::
get
(
FALSE
)
->
addWhere
(
'contact_id'
,
'='
,
$contactID
)
->
addOrderBy
(
'is_primary'
,
'DESC'
)
->
addOrderBy
(
'is_billing'
,
'DESC'
)
->
execute
()
->
first
();
if
(
!
empty
(
$email
[
'email'
]))
{
$contact
[
'email_primary.email'
]
=
$email
[
'email'
];
if
(
!
empty
(
$email
Result
[
'email'
]))
{
$contact
[
'email_primary.email'
]
=
$email
Result
[
'email'
];
}
}
...
...
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