Index: civicrm/trunk/sites/all/modules/queue2civicrm/recurring/recurring.module |
— | — | @@ -237,10 +237,27 @@ |
238 | 238 | //insert the contribution |
239 | 239 | $contribution = _queue2civicrm_contribution_insert( $msg, $contact, $recur_record->id ); |
240 | 240 | |
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 | + */ |
242 | 250 | if ( $msg_normalized[ 'contribution_tracking_update' ] ) { |
243 | 251 | // Map the tracking record to the CiviCRM contribution |
244 | 252 | _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 ); |
245 | 262 | } |
246 | 263 | |
247 | 264 | // update subscription record with next payment date |
— | — | @@ -548,7 +565,7 @@ |
549 | 566 | } |
550 | 567 | |
551 | 568 | // 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' ) { |
553 | 570 | $msg_normalized[ 'first_name' ] = $msg[ 'first_name' ]; |
554 | 571 | $msg_normalized[ 'last_name' ] = $msg[ 'last_name' ]; |
555 | 572 | $split = split("\n", str_replace("\r", '', $msg[ 'address_street' ])); |