Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Stripe
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
38
Issues
38
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Extensions
Stripe
Commits
a26693c6
Commit
a26693c6
authored
Oct 12, 2018
by
mattwire
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix saving customer to database
parent
8fdf1f4a
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
7 deletions
+7
-7
CRM/Stripe/Customer.php
CRM/Stripe/Customer.php
+7
-7
No files found.
CRM/Stripe/Customer.php
View file @
a26693c6
...
@@ -53,7 +53,7 @@ class CRM_Stripe_Customer {
...
@@ -53,7 +53,7 @@ class CRM_Stripe_Customer {
4
=>
[
$params
[
'processor_id'
],
'Integer'
],
4
=>
[
$params
[
'processor_id'
],
'Integer'
],
];
];
CRM_Core_DAO
::
executeQuery
(
"INSERT INTO civicrm_stripe_customers
CRM_Core_DAO
::
executeQuery
(
"INSERT INTO civicrm_stripe_customers
(contact_id, id, is_live, processor_id) VALUES (%1, %2, %3, %
3
)"
,
$queryParams
);
(contact_id, id, is_live, processor_id) VALUES (%1, %2, %3, %
4
)"
,
$queryParams
);
}
}
public
static
function
create
(
$params
,
$paymentProcessor
)
{
public
static
function
create
(
$params
,
$paymentProcessor
)
{
...
@@ -77,17 +77,17 @@ class CRM_Stripe_Customer {
...
@@ -77,17 +77,17 @@ class CRM_Stripe_Customer {
'metadata'
=>
[
'civicrm_contact_id'
=>
$params
[
'contact_id'
]],
'metadata'
=>
[
'civicrm_contact_id'
=>
$params
[
'contact_id'
]],
];
];
$stripe
_c
ustomer
=
$paymentProcessor
->
stripeCatchErrors
(
'create_customer'
,
$sc_create_params
,
$params
);
$stripe
C
ustomer
=
$paymentProcessor
->
stripeCatchErrors
(
'create_customer'
,
$sc_create_params
,
$params
);
// Store the relationship between CiviCRM's email address for the Contact & Stripe's Customer ID.
// Store the relationship between CiviCRM's email address for the Contact & Stripe's Customer ID.
if
(
isset
(
$stripe
_c
ustomer
))
{
if
(
isset
(
$stripe
C
ustomer
))
{
if
(
$paymentProcessor
->
isErrorReturn
(
$stripe
_c
ustomer
))
{
if
(
$paymentProcessor
->
isErrorReturn
(
$stripe
C
ustomer
))
{
return
$stripe
_c
ustomer
;
return
$stripe
C
ustomer
;
}
}
$params
=
[
$params
=
[
'contact_id'
=>
$params
[
'contact_id'
],
'contact_id'
=>
$params
[
'contact_id'
],
'customer_id'
=>
$stripe
_c
ustomer
->
id
,
'customer_id'
=>
$stripe
C
ustomer
->
id
,
'is_live'
=>
$params
[
'is_live'
],
'is_live'
=>
$params
[
'is_live'
],
'processor_id'
=>
$params
[
'processor_id'
],
'processor_id'
=>
$params
[
'processor_id'
],
];
];
...
@@ -96,7 +96,7 @@ class CRM_Stripe_Customer {
...
@@ -96,7 +96,7 @@ class CRM_Stripe_Customer {
else
{
else
{
Throw
new
CRM_Core_Exception
(
ts
(
'There was an error saving new customer within Stripe.'
));
Throw
new
CRM_Core_Exception
(
ts
(
'There was an error saving new customer within Stripe.'
));
}
}
return
$stripe
_c
ustomer
;
return
$stripe
C
ustomer
;
}
}
/**
/**
* Delete a Stripe customer from the CiviCRM database
* Delete a Stripe customer from the CiviCRM database
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment