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
d4ba89f7
Commit
d4ba89f7
authored
6 years ago
by
mattwire
Browse files
Options
Downloads
Patches
Plain Diff
Comments and function renames for clarity
parent
c658ad43
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
CRM/Core/Payment/Stripe.php
+8
-6
8 additions, 6 deletions
CRM/Core/Payment/Stripe.php
stripe.php
+3
-2
3 additions, 2 deletions
stripe.php
with
11 additions
and
8 deletions
CRM/Core/Payment/Stripe.php
+
8
−
6
View file @
d4ba89f7
...
...
@@ -335,13 +335,14 @@ class CRM_Core_Payment_Stripe extends CRM_Core_Payment {
}
/**
*
Implementation of hook_civicrm_buildForm().
*
* @param
$form - reference to the form object
*
Set default values when loading the (payment) form
*
* @param
\CRM_Core_Form $form
*/
public
function
buildForm
(
&
$form
)
{
// Set default values
$paymentProcessorId
=
CRM_Utils_Array
::
value
(
'id'
,
$form
->
_paymentProcessor
);
$publishableKey
=
self
::
s
tripe
_
get
_k
ey
(
$paymentProcessorId
);
$publishableKey
=
CRM_Core_Payment_S
tripe
::
get
PublishableK
ey
(
$paymentProcessorId
);
$defaults
=
[
'stripe_id'
=>
$paymentProcessorId
,
'stripe_pub_key'
=>
$publishableKey
,
...
...
@@ -349,14 +350,14 @@ class CRM_Core_Payment_Stripe extends CRM_Core_Payment {
$form
->
setDefaults
(
$defaults
);
}
/**
/**
* Given a payment processor id, return the publishable key (password field)
*
* @param $paymentProcessorId
*
* @return string
*/
public
function
stripe_get_k
ey
(
$paymentProcessorId
)
{
public
static
function
getPublishableK
ey
(
$paymentProcessorId
)
{
try
{
$publishableKey
=
(
string
)
civicrm_api3
(
'PaymentProcessor'
,
'getvalue'
,
array
(
'return'
=>
"password"
,
...
...
@@ -922,5 +923,6 @@ class CRM_Core_Payment_Stripe extends CRM_Core_Payment {
$ipnClass
=
new
CRM_Core_Payment_StripeIPN
(
$data
);
$ipnClass
->
main
();
}
}
This diff is collapsed.
Click to expand it.
stripe.php
+
3
−
2
View file @
d4ba89f7
...
...
@@ -233,8 +233,9 @@ function stripe_civicrm_alterContent( &$content, $context, $tplName, &$object )
/**
* Add stripe.js to forms, to generate stripe token
* hook_civicrm_alterContent is not called for all forms (eg. CRM_Contribute_Form_Contribution on backend)
* @param $formName
* @param $form
*
* @param string $formName
* @param CRM_Core_Form $form
*/
function
stripe_civicrm_buildForm
(
$formName
,
&
$form
)
{
global
$_stripe_scripts_added
;
...
...
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