Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
Developer Documentation
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
Package registry
Model registry
Operate
Environments
Terraform modules
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
brienne
Developer Documentation
Commits
aa8e4536
Unverified
Commit
aa8e4536
authored
6 years ago
by
eileen
Committed by
GitHub
6 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Ripped out some old stuff
parent
be4f16b0
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
docs/extensions/payment-processors/index.md
+9
-29
9 additions, 29 deletions
docs/extensions/payment-processors/index.md
with
9 additions
and
29 deletions
docs/extensions/payment-processors/index.md
+
9
−
29
View file @
aa8e4536
...
...
@@ -30,7 +30,8 @@ fields in the user form.
**Billing Mode**
is a CiviCRM-specific classification of different types
of payment processing: 'form', 'button', or 'notify'. These determine
the user workflow required and how the CiviCRM code works.
the user workflow required and how the CiviCRM code works. The concept is
mostly obsolete now.
## Processors
...
...
@@ -84,9 +85,8 @@ the directory `CRM/Core/Payment` that subclasses this abstract class. Any
extensions that provide a payment processor have to provide a
corresponding subclass file in their own
`CRM/Core/Payment directory`
.
The key method defined by the payment-processor-specific payment class
depends on the
[
billing mode
](
/extensions/payment-processors/types.md
)
.
This is roughly documented in the page on
[
creating a payment processor
](
/extensions/payment-processors/create.md
)
The key methods are roughly documented in the page on
[
creating a payment processor
](
/extensions/payment-processors/create.md
)
but the main method for all processors to implement is
`doPayment`
The payment object is used in several places in the CiviCRM code base.
It's intention is to encapsulate all the details of processing a
...
...
@@ -95,32 +95,12 @@ donations, a payment for a membership, a payment for an event, and some
combination of those (e.g. a recurring series of payments for an
auto-renewed membership).
The way that payment objects get created is a bit convoluted. The
payment objects are not created with the typical
`new ClassName()`
command, but use a mangled version of the singleton pattern to create
new payment objects, with no more than one per mix of mode, payment
processor, and whether it's attached to a form. Specifically, they get
created with this kind of thing:
The way that payment objects get created historically was a bit convoluted.
They are mostly now created by the
\C
ivi
\P
ayment
\S
ystem
`$paymentObject = CRM_Core_Payment::singleton($mode, $paymentProcessor, $paymentForm);`
Inside the singleton function,
`$cacheKey = "{$mode}_{$paymentProcessor['id']}_" . (int)isset($paymentForm);`
So that means we are creating unique payment objects per distinct value
of:
`mode + payment processor id + <is it associated with a payment
form>`
, where 'mode' in this case just means test or not (not the
"billing mode"!).
The paymentProcessor object is just the simple BAO object of fields from
the corresponding database table, and the singleton function then finds
the classname of the processor, and runs the singleton function of that
class to create the actual payment object that subclasses the abstract
CRM_Core_Payment class.
At the end of this process, you have a payment object that includes
payment processor specific methods and a reasonably simple payment
processor object attached to it.
Due to the historical complexity we sometimes use the id of the
live processor in test mode for the test processor although
where possible we use the id of the test processor itself.
## Payment Processor Objects, and in the Database
...
...
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