// From a lot of code reading /debugging I'm still not sure the intent WRT first & subsequent payments in this code
// it would be good if someone added some comments or refactored this
if ($contribution->id) {
- $contributionStatuses = CRM_Contribute_PseudoConstant::contributionStatus(NULL, 'name');
- if ((empty($input['prevContribution']) && $paymentProcessorId) || (!$input['prevContribution']->is_pay_later &&
- $input['prevContribution']->contribution_status_id == array_search('Pending', $contributionStatuses))) {
- $input['payment_processor'] = $paymentProcessorId;
+ $contributionStatuses = CRM_Core_PseudoConstant::get('CRM_Contribute_DAO_Contribution', 'contribution_status_id', array(
+ 'labelColumn' => 'name',
+ 'flip' => 1
+ ));
- if ((empty($input['prevContribution']) && $paymentProcessorId) || (!$input['prevContribution']->is_pay_later && -$input['prevContribution']->contribution_status_id == $contributionStatuses['Pending'])) {
++ if ((empty($input['prevContribution']) && $paymentProcessorId) || (!$input['prevContribution']->is_pay_later && $input['prevContribution']->contribution_status_id == $contributionStatuses['Pending'])) {
+ $input['payment_processor'] = $paymentProcessorId;
}
- $input['contribution_status_id'] = array_search('Completed', $contributionStatuses);
+ $input['contribution_status_id'] = $contributionStatuses['Completed'];
$input['total_amount'] = $input['amount'];
$input['contribution'] = $contribution;
$input['financial_type_id'] = $contribution->financial_type_id;
$this->click('link=Fees');
$this->waitForElementPresent('_qf_Fee_upload_done-bottom');
$this->click('CIVICRM_QFID_1_is_monetary');
- $this->click("xpath=//tr[@class='crm-event-manage-fee-form-block-payment_processor']/td[2]/label[text()='$processorName']");
- $this->select('financial_type_id', 'label=Event Fee');
+ $this->click("xpath=//tbale[@id='paymentProcessor']/tbody/tr[1]/td[2]/label[text()='$processorName']");
+ $this->select('financial_type_id','label=Event Fee');
$this->select('price_set_id', 'label=' . $setTitle);
-
// intro text for registration page
$registerIntro = 'Fill in all the fields below and click Continue.';
$this->clickLink('_qf_Fee_upload-bottom', 'link=Online Registration', FALSE);