public function preProcess() {
parent::preProcess();
- $this->_ccid = CRM_Utils_Request::retrieve('ccid', 'Positive', $this);
$this->_paymentProcessors = $this->get('paymentProcessors');
$this->preProcessPaymentOptions();
}
$this->applyFilter('__ALL__', 'trim');
- $hidePayLater = FALSE;
if (empty($this->_ccid)) {
$this->add('text', "email-{$this->_bltID}",
ts('Email Address'),
else {
$this->addElement('hidden', "email-{$this->_bltID}", 1);
$this->add('text', 'total_amount', ts('Total Amount'), array('readonly' => TRUE), FALSE);
- if (!empty($this->_paymentProcessors[0])) {
- $hidePayLater = TRUE;
- }
}
- $this->assign('hidePayLater', $hidePayLater);
$pps = array();
//@todo - this should be replaced by a check as to whether billing fields are set
$onlinePaymentProcessorEnabled = FALSE;
// current contribution page id
$this->_id = CRM_Utils_Request::retrieve('id', 'Positive', $this);
+ $this->_ccid = CRM_Utils_Request::retrieve('ccid', 'Positive', $this);
if (!$this->_id) {
// seems like the session is corrupted and/or we lost the id trail
// lets just bump this to a regular session error and redirect user to main page
// check for is_monetary status
$isMonetary = CRM_Utils_Array::value('is_monetary', $this->_values);
$isPayLater = CRM_Utils_Array::value('is_pay_later', $this->_values);
+ if (!empty($this->_ccid) && $isPayLater) {
+ $isPayLater = FALSE;
+ $this->_values['is_pay_later'] = FALSE;
+ }
if ($isMonetary &&
(!$isPayLater || !empty($this->_values['payment_processor']))
</div>
{/if}
</div>
-
<script type="text/javascript">
{if $isHonor}
pcpAnonymous();
{/if}
- {if $hidePayLater}
- hidePayLater();
- {/if}
-
{literal}
cj('input[name="soft_credit_type_id"]').on('change', function() {
}
}
- function hidePayLater() {
- cj('#billingcheckbox').hide();
- cj('#billingcheckbox').next('label').hide();
- cj('input:radio[name="payment_processor_id"][value=0]').hide();
- cj('input:radio[name="payment_processor_id"][value=0]').next('label').hide();
- }
-
cj('input[id="is_recur"]').on('change', function() {
toggleRecur();
});
<div>
{if $onBehalfEmail AND ($onBehalfEmail neq $email)}
{ts 1=$email 2=$onBehalfEmail}An email receipt has also been sent to %1 and to %2{/ts}
- {else}
+ {elseif $email}
{ts 1=$email}An email receipt has also been sent to %1{/ts}
{/if}
</div>
</fieldset>
{/if}
{if $billingDetailsFields|@count && $paymentProcessor.payment_processor_type neq 'PayPal_Express'}
- {if $profileAddressFields}
+ {if $profileAddressFields && !$ccid}
<input type="checkbox" id="billingcheckbox" value="0">
<label for="billingcheckbox">{ts}My billing address is the same as above{/ts}</label>
{/if}
$this->assertFalse($this->isElementPresent("xpath=//div[@class='crm-public-form-item crm-section premium_block-section']"));
$this->assertFalse($this->isElementPresent("xpath=//div[@class='crm-public-form-item crm-group custom_pre_profile-group']"));
$this->assertFalse($this->isElementPresent("xpath=//input[@id=email-5]"));
- $this->assertTrue($this->isElementPresent("xpath=//input[@name='payment_processor_id'][@value=0][@style='display: none;']"));
+ $this->assertFalse($this->isElementPresent("xpath=//input[@name='payment_processor_id'][@value=0]"));
$this->click("xpath=//input[@name='payment_processor_id'][@value=1]");
$this->waitForAjaxContent();