forked from civicrm/civicrm-core
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[REF] extract internals of Payment.create into function on BAO class.
This is a partial of civicrm#13330 - trying to separate out the main code move from the changes. My only change was to change the name to addPayment since that is what we are doing but here are some additionaly thoughts. 1) I'm inclined to put the class onto a new pseudo-bao CRM_Finanial_BAO_Payment. We already have this pseudo-entity on the api level & it gives us a way to build up a place for the functions we are migrating towards. 2) I think we should consider changing the input parameters to this function to be - contributionID, total_amount & line_items or in some way limiting the parameters tha t get passed through. We have historically gotten ourselves in trouble by having people hacking in another parameter to go through whereas the strength of the api is clear inputs & outputs. I note the api will need to support 'is_email_receipt' as will this fn & the CRM_Contribute_Form_AdditionalPayment::emailReceipt should be moved off the form layer - possibly to our new BAO 3) I think the exceptions need to be CRM_Core_Exceptions if thrown in the BAO although this is kinda cosmetic Change-Id: Ib5caf0d878e9c5cc735cb1a20c640f61da2dbfc6
- Loading branch information
1 parent
0e35e2a
commit 5625fdf
Showing
2 changed files
with
88 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters