Ejegg has uploaded a new change for review. https://gerrit.wikimedia.org/r/224986
Change subject: Update recurring GC for DonationInterface changes ...................................................................... Update recurring GC for DonationInterface changes Needed a new global and needed to deal with a new return type. Also cleans up some unused return values. Bug: T105848 Change-Id: I71ffd5a5bb34cd4fe16cadfad3d19855f8eb6159 --- M sites/all/modules/recurring_globalcollect/recurring_globalcollect.module M sites/all/modules/wmf_civicrm/DonationInterface.php 2 files changed, 10 insertions(+), 20 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/crm refs/changes/86/224986/1 diff --git a/sites/all/modules/recurring_globalcollect/recurring_globalcollect.module b/sites/all/modules/recurring_globalcollect/recurring_globalcollect.module index 8e16239..76c7e1d 100644 --- a/sites/all/modules/recurring_globalcollect/recurring_globalcollect.module +++ b/sites/all/modules/recurring_globalcollect/recurring_globalcollect.module @@ -237,13 +237,8 @@ foreach ($contribution_batch as $contribution_recur) { try { - $status = recurring_globalcollect_charge($contribution_recur->id, $options); - - if ($status) { - $succeeded[] = $contribution_recur; - } else { - $failed[] = $contribution_recur; - } + recurring_globalcollect_charge($contribution_recur->id, $options); + $succeeded[] = $contribution_recur; } catch ( WmfException $e ) { @@ -275,8 +270,6 @@ * @param int $contribution_recur_id * @param array $options Accepts the following optional keys: * contribution_tags - array of tags to associate with the contribution - * - * @return array adapter result details * * @throws WmfException if the payment fails or any other error occurs. */ @@ -314,26 +307,20 @@ 'effort_id' => $subscription->processor_id + 1, ) ); - $result = $adapter->do_transaction('Recurring_Charge'); + $result = $adapter->do_transaction( 'Recurring_Charge' ); // If success, add a record to the contribution table and send a thank you email. - if ($result['status'] && empty($result['errors'])) { + if ( $result->getCommunicationStatus() && empty( $result->getErrors() ) ) { // Mark this donation as successful, and reschedule it for next month // This is done before anything else, otherwise any errors that occur while storing the contribution // record in civi might cause this subscription to end up in a weird state and not recur correctly. // If storing the donation in civi fails, that's not a big deal, we'll get the data eventually // by reconciling the data we get from the payment processor. - _recurring_globalcollect_update_record_success($contribution_recur_id); + _recurring_globalcollect_update_record_success( $contribution_recur_id ); $msg = recurring_globalcollect_create_message( $contribution_recur_id ); - $contribution = wmf_civicrm_contribution_message_import( $msg ); - - // FIXME: what is this nonsense? - $contribution['contribution_id'] = $contribution['id']; - unset( $contribution['id'] ); - - return $result; + wmf_civicrm_contribution_message_import( $msg ); } else { diff --git a/sites/all/modules/wmf_civicrm/DonationInterface.php b/sites/all/modules/wmf_civicrm/DonationInterface.php index 9fa57d2..a75ce8e 100644 --- a/sites/all/modules/wmf_civicrm/DonationInterface.php +++ b/sites/all/modules/wmf_civicrm/DonationInterface.php @@ -23,7 +23,8 @@ $wgDonationInterfacePriceCeiling, $wgGlobalCollectGatewayAccountInfo, $wgGlobalCollectGatewayURL, - $wgGlobalCollectGatewayMerchantID; + $wgGlobalCollectGatewayMerchantID, + $wgDonationInterfaceGatewayAdapters; // Adapt Drupal configuration into MediaWiki globals. $wgGlobalCollectGatewayMerchantID = variable_get('recurring_globalcollect_merchant_id', 0); @@ -40,6 +41,8 @@ $wgDonationInterfacePriceCeiling = 10000.00; $className = "{$type}Adapter"; + $wgDonationInterfaceGatewayAdapters = array( $className ); + $adapter = new $className( $adapterOptions ); return $adapter; } -- To view, visit https://gerrit.wikimedia.org/r/224986 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I71ffd5a5bb34cd4fe16cadfad3d19855f8eb6159 Gerrit-PatchSet: 1 Gerrit-Project: wikimedia/fundraising/crm Gerrit-Branch: master Gerrit-Owner: Ejegg <eeggles...@wikimedia.org> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits