if ($hasBillingField) {
$addressParams = array_merge($this->_params, $addressParams);
+ // CRM-18277 don't let this get passed in because we don't want contribution source to override contact source.
+ // Ideally we wouldn't just randomly merge everything into addressParams but just pass in a relevant array.
+ // Note this source field is covered by a unit test.
+ if (isset($addressParams['source'])) {
+ unset($addressParams['source']);
+ }
//here we are setting up the billing contact - if different from the member they are already created
// but they will get billing details assigned
CRM_Contact_BAO_Contact::createProfileContact($addressParams, $fields,
'receipt_date_time' => '',
'payment_processor_id' => $paymentProcessorID,
'currency' => 'USD',
- 'source' => '',
+ 'source' => 'bob sled race',
), CRM_Core_Action::ADD);
}
catch (Civi\Payment\Exception\PaymentProcessorException $e) {
'contact_id' => $this->_individualId,
'contribution_status_id' => 'Pending',
), 1);
+ $contact = $this->callAPISuccessGetSingle('Contact', array('id' => $this->_individualId));
+ $this->assertEmpty($contact['source']);
}
/**