if ($paymentProcessorOutcome) {
$contributionParams['payment_processor'] = CRM_Utils_Array::value('payment_processor', $paymentProcessorOutcome);
}
+ if (!empty($params["is_email_receipt"])) {
+ $contributionParams += array(
+ 'receipt_date' => $receiptDate,
+ );
+ }
if (!$pending && $paymentProcessorOutcome) {
$contributionParams += array(
'fee_amount' => CRM_Utils_Array::value('fee_amount', $paymentProcessorOutcome),
// lineItem isn't set until Register postProcess
$this->_lineItem = $this->get('lineItem');
$this->_ccid = $this->get('ccid');
- $this->_paymentProcessor = $this->get('paymentProcessor');
+
$this->_params = $this->controller->exportValues('Main');
$this->_params['ip_address'] = CRM_Utils_System::ipAddress();
$this->_params['amount'] = $this->get('amount');
try {
$this->processMembership($membershipParams, $contactID, $customFieldsFormatted, $fieldTypes, $premiumParams, $membershipLineItems);
}
+ catch (\Civi\Payment\Exception\PaymentProcessorException $e) {
+ CRM_Core_Session::singleton()->setStatus($e->getMessage());
+ if (!empty($this->_contributionID)) {
+ CRM_Contribute_BAO_Contribution::failPayment($this->_contributionID,
+ $contactID, $e->getMessage());
+ }
+ CRM_Utils_System::redirect(CRM_Utils_System::url('civicrm/contribute/transact', "_qf_Main_display=true&qfKey={$this->_params['qfKey']}"));
+ }
catch (CRM_Core_Exception $e) {
CRM_Core_Session::singleton()->setStatus($e->getMessage());
CRM_Utils_System::redirect(CRM_Utils_System::url('civicrm/contribute/transact', "_qf_Main_display=true&qfKey={$this->_params['qfKey']}"));
$this->_fields = $this->get('fields');
$this->_bltID = $this->get('bltID');
$this->_paymentProcessor = $this->get('paymentProcessor');
+ if (!$this->_paymentProcessor) {
+ $this->_paymentProcessor = array('object' => Civi\Payment\System::singleton()->getById(0));
+ }
$this->_priceSetId = $this->get('priceSetId');
$this->_priceSet = $this->get('priceSet');
* @param bool $isContributionMainPage
* Is this the main page? If so add form input fields.
* (or better yet don't have this functionality in a function shared with forms that don't share it).
- * @param int $selectedMembershipTypeID
+ * @param int|array $selectedMembershipTypeID
* Selected membership id.
* @param bool $thankPage
* Thank you page.
// Assign autorenew option (0:hide,1:optional,2:required) so we can use it in confirmation etc.
$autoRenewOption = CRM_Price_BAO_PriceSet::checkAutoRenewForPriceSet($this->_priceSetId);
- if (isset($membershipTypeValues[$selectedMembershipTypeID]['auto_renew'])) {
+ //$selectedMembershipTypeID is retrieved as an array for membership priceset if multiple
+ //options for different organisation is selected on the contribution page.
+ if (is_numeric($selectedMembershipTypeID) && isset($membershipTypeValues[$selectedMembershipTypeID]['auto_renew'])) {
$this->assign('autoRenewOption', $membershipTypeValues[$selectedMembershipTypeID]['auto_renew']);
}
else {