r80200 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r80199‎ | r80200 | r80201 >
Date:22:41, 13 January 2011
Author:awjrichards
Status:deferred
Tags:
Comment:
Updated recurring module to insert user's location data on subscr_payment rather than subscr_signup per discussions with paypal devs (ps paypal documentation is horrendous)
Modified paths:
  • /civicrm/trunk/sites/all/modules/queue2civicrm/recurring/recurring.module (modified) (history)

Diff [purge]

Index: civicrm/trunk/sites/all/modules/queue2civicrm/recurring/recurring.module
@@ -237,10 +237,27 @@
238238 //insert the contribution
239239 $contribution = _queue2civicrm_contribution_insert( $msg, $contact, $recur_record->id );
240240
241 - // Insert the contribution record.
 241+ /**
 242+ * Insert the contribution record.
 243+ *
 244+ * PayPal only sends us full address information for the user in payment messages,
 245+ * but we only want to insert this data once unless we're modifying the record.
 246+ * We know that this should be the first time we're processing a contribution
 247+ * for this given user if we are also updating the contribution_tracking table
 248+ * for this contribution.
 249+ */
242250 if ( $msg_normalized[ 'contribution_tracking_update' ] ) {
243251 // Map the tracking record to the CiviCRM contribution
244252 _queue2civicrm_update_contribution_tracking( $msg, $contribution );
 253+
 254+ // update the contact
 255+ $contact = _queue2civicrm_contact_update( $msg, $contact[ 'contact_id' ] );
 256+
 257+ // Insert the location record
 258+ $location = _queue2civicrm_location_update( $msg, $contact );
 259+
 260+ // Tag contact for review
 261+ $tag = _queue2civicrm_tag_insert( $contact );
245262 }
246263
247264 // update subscription record with next payment date
@@ -548,7 +565,7 @@
549566 }
550567
551568 // Contact info
552 - if ( $msg[ 'txn_type' ] == 'subscr_signup' || $msg[ 'txn_type' ] == 'subscr_modify' ) {
 569+ if ( $msg[ 'txn_type' ] == 'subscr_payment' || $msg[ 'txn_type' ] == 'subscr_modify' ) {
553570 $msg_normalized[ 'first_name' ] = $msg[ 'first_name' ];
554571 $msg_normalized[ 'last_name' ] = $msg[ 'last_name' ];
555572 $split = split("\n", str_replace("\r", '', $msg[ 'address_street' ]));

Status & tagging log