if (isset($membershipContributionID)) {
$form->_values['contribution_id'] = $membershipContributionID;
}
- // The concept of contributeMode is deprecated.
- // the is_monetary concept probably should be too as it can be calculated from
- // the existence of 'amount' & seems fragile.
- if ($form->_contributeMode) {
+
+ if ($form->_paymentProcessor) {
+ // the is_monetary concept probably should be deprecated as it can be calculated from
+ // the existence of 'amount' & seems fragile.
if ($form->_values['is_monetary'] && $form->_amount > 0.0 && !$form->_params['is_pay_later']) {
// call postProcess hook before leaving
$form->postProcessHook();
}
+
$payment = Civi\Payment\System::singleton()->getByProcessor($form->_paymentProcessor);
$paymentActionResult = $payment->doPayment($form->_params, 'contribute');
$this->completeTransaction($paymentActionResult, $paymentResult['contribution']->id);
public static function mapParams($id, $src, &$dst, $reverse = FALSE) {
// Set text version of state & country if present.
if (isset($src["billing_state_province_id-{$id}"])) {
- $src["billing_state_province-{$id}"] = CRM_Core_PseudoConstant::stateProvinceAbbreviation ($src["billing_state_province_id-{$id}"]);
+ $src["billing_state_province-{$id}"] = CRM_Core_PseudoConstant::stateProvinceAbbreviation($src["billing_state_province_id-{$id}"]);
}
if (isset($src["billing_country_id-{$id}"])) {
$src["billing_country-{$id}"] = CRM_Core_PseudoConstant::countryIsoCode($src["billing_country_id-{$id}"]);;
if (is_object($payment)) {
try {
$result = $payment->doPayment($value);
- dpm($result);
$value = array_merge($value, $result);
}
catch (\Civi\Payment\Exception\PaymentProcessorException $e) {