Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
CiviCRM Core
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container registry
Model registry
Analyze
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
Development
CiviCRM Core
Commits
2204d007
Commit
2204d007
authored
5 years ago
by
mattwire
Browse files
Options
Downloads
Patches
Plain Diff
Refactor to reduce duplication on payment forms
parent
75f7fb93
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
CRM/Core/Form.php
+8
-2
8 additions, 2 deletions
CRM/Core/Form.php
CRM/Core/Payment/ProcessorForm.php
+3
-0
3 additions, 0 deletions
CRM/Core/Payment/ProcessorForm.php
CRM/Financial/Form/Payment.php
+0
-5
0 additions, 5 deletions
CRM/Financial/Form/Payment.php
with
11 additions
and
7 deletions
CRM/Core/Form.php
+
8
−
2
View file @
2204d007
...
...
@@ -766,6 +766,13 @@ class CRM_Core_Form extends HTML_QuickForm_Page {
$this
->
assign
(
'bltID'
,
$this
->
_bltID
);
}
/**
* @return int
*/
public
function
getPaymentProcessorID
()
{
return
$this
->
_paymentProcessorID
;
}
/**
* This if a front end form function for setting the payment processor.
*
...
...
@@ -878,9 +885,8 @@ class CRM_Core_Form extends HTML_QuickForm_Page {
else
{
$this
->
_paymentProcessor
=
[];
}
CRM_Financial_Form_Payment
::
addCreditCardJs
(
$this
->
_paymentProcessorID
);
}
$this
->
assign
(
'paymentProcessorID'
,
$this
->
_paymentProcessorID
);
// We save the fact that the profile 'billing' is required on the payment form.
// Currently pay-later is the only 'processor' that takes notice of this - but ideally
// 1) it would be possible to select the minimum_billing_profile_id for the contribution form
...
...
This diff is collapsed.
Click to expand it.
CRM/Core/Payment/ProcessorForm.php
+
3
−
0
View file @
2204d007
...
...
@@ -73,6 +73,9 @@ class CRM_Core_Payment_ProcessorForm {
$form
->
assign
(
'suppressSubmitButton'
,
$form
->
_paymentObject
->
isSuppressSubmitButtons
());
CRM_Financial_Form_Payment
::
addCreditCardJs
(
$form
->
getPaymentProcessorID
());
$form
->
assign
(
'paymentProcessorID'
,
$form
->
getPaymentProcessorID
());
$form
->
assign
(
'currency'
,
$form
->
getCurrency
());
// also set cancel subscription url
...
...
This diff is collapsed.
Click to expand it.
CRM/Financial/Form/Payment.php
+
0
−
5
View file @
2204d007
...
...
@@ -79,11 +79,6 @@ class CRM_Financial_Form_Payment extends CRM_Core_Form {
CRM_Core_Payment_ProcessorForm
::
preProcess
(
$this
);
self
::
addCreditCardJs
(
$this
->
_paymentProcessorID
);
$this
->
assign
(
'paymentProcessorID'
,
$this
->
_paymentProcessorID
);
$this
->
assign
(
'currency'
,
$this
->
currency
);
$this
->
assign
(
'suppressForm'
,
TRUE
);
$this
->
controller
->
_generateQFKey
=
FALSE
;
}
...
...
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