Katie Horn has submitted this change and it was merged.
Change subject: Need at least one pair of (gross amount, currency), or the
"original_" fields.
......................................................................
Need at least one pair of (gross amount, currency), or the "original_" fields.
Change-Id: Iddf01d7cde8dcace7d870e586351074f11914d48
---
M sites/all/modules/wmf_common/wmf_civicrm/wmf_civicrm.module
1 file changed, 12 insertions(+), 2 deletions(-)
Approvals:
Katie Horn: Verified; Looks good to me, approved
jenkins-bot: Verified
diff --git a/sites/all/modules/wmf_common/wmf_civicrm/wmf_civicrm.module
b/sites/all/modules/wmf_common/wmf_civicrm/wmf_civicrm.module
index 995f692..766f786 100644
--- a/sites/all/modules/wmf_common/wmf_civicrm/wmf_civicrm.module
+++ b/sites/all/modules/wmf_common/wmf_civicrm/wmf_civicrm.module
@@ -562,13 +562,23 @@
*
* Do exchange rate conversions and set appropriate fields for CiviCRM
* based on information contained in the message.
- *
+ *
+ * Upon exiting this function, the message is guaranteed to have these fields:
+ * currency - settlement currency
+ * original_currency - currency remitted by the donor
+ * gross - settled total amount
+ * original_gross - remitted amount in original currency
+ * fee - processor fees, when available
+ * net - gross less fees
+ *
* @param $msg
* @return array
*/
function wmf_civicrm_normalize_contribution_amounts( $msg ) {
- if ( empty( $msg['gross'] ) or empty( $msg['currency'] ) ) {
+ if ( ( empty( $msg['gross'] ) or empty( $msg['currency'] ) )
+ and ( empty( $msg['original_gross'] ) or empty(
$msg['original_currency'] ) )
+ ) {
// just... don't
return $msg;
}
--
To view, visit https://gerrit.wikimedia.org/r/93509
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Iddf01d7cde8dcace7d870e586351074f11914d48
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/fundraising/crm
Gerrit-Branch: master
Gerrit-Owner: Adamw <[email protected]>
Gerrit-Reviewer: Katie Horn <[email protected]>
Gerrit-Reviewer: Mwalker <[email protected]>
Gerrit-Reviewer: jenkins-bot
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits