* Should form building stop at this point?
*/
public function buildForm(&$form) {
- return FALSE;
+ return FALSE;
}
/**
}
}
-
self::setPaymentFieldsByProcessor($form, $processor, empty($isBillingDataOptional));
self::addCommonFields($form, !$isBillingDataOptional, $form->_paymentFields);
self::addRules($form, $form->_paymentFields);
public function buildForm(&$form) {
if ($this->_processorName == 'PayPal Express' || $this->_processorName == 'PayPal Pro') {
$this->addPaypalExpressCode($form);
+ if ($this->_processorName == 'PayPal Express') {
+ CRM_Core_Region::instance('billing-block-post')->add(array(
+ 'template' => 'CRM/Financial/Form/PaypalExpress.tpl',
+ ));
+ }
+ if ($this->_processorName == 'PayPal Pro') {
+ CRM_Core_Region::instance('billing-block-pre')->add(array(
+ 'template' => 'CRM/Financial/Form/PaypalPro.tpl',
+ ));
+ }
}
return FALSE;
}
*
* @param $form
*/
- protected static function addPaypalExpressCode(&$form) {
+ protected function addPaypalExpressCode(&$form) {
if (empty($form->isBackOffice)) {
$form->_expressButtonName = $form->getButtonName('upload', 'express');
$form->assign('expressButtonName', $form->_expressButtonName);
$form->add(
'image',
$form->_expressButtonName,
- $form->_paymentProcessor['url_button'],
+ $this->_paymentProcessor['url_button'],
array('class' => 'crm-form-submit')
);
}
+--------------------------------------------------------------------+
*/
+use Civi\Payment\System;
/**
*
* @package CRM
* @copyright CiviCRM LLC (c) 2004-2015
*/
+
/**
- * base class for building payment block for online contribution / event pages
+ * Base class for building payment block for online contribution / event pages.
*/
class CRM_Core_Payment_ProcessorForm {
}
$form->set('paymentProcessor', $form->_paymentProcessor);
- $form->_paymentObject = CRM_Core_Payment::singleton($mode, $form->_paymentProcessor, $form);
+ $form->_paymentObject = Civi\Payment\System::singleton()->getByProcessor($form->_paymentProcessor);
$form->assign('suppressSubmitButton', $form->_paymentObject->isSuppressSubmitButtons());
{literal}
CRM.$(function($) {
- toggleConfirmButton();
enableHonorType();
showRecurHelp();
skipPaymentMethod();
{$paymentTypeLabel}
</legend>
{crmRegion name="billing-block-pre"}
- {* todo move this region assignment to paypal processor *}
- {include file= "CRM/Financial/Form/PaypalPro.tpl"}
{/crmRegion}
<div class="crm-section billing_mode-section {$paymentTypeName}_info-section">
{foreach from=$paymentFields item=paymentField}
$('#credit_card_number').val(cc);
});
});
- {/literal}
- function toggleConfirmButton() {
- var suppressSubmitButton = "{/literal}{$suppressSubmitButton}{literal}";
- var elementObj = cj('input[name="payment_processor"]');
- if ( elementObj.attr('type') == 'hidden' ) {
- var processorTypeId = elementObj.val( );
- }
- else {
- var processorTypeId = elementObj.filter(':checked').val();
- }
+ $('input[name="payment_processor_id"]').change( function() {
+ function toggleConfirmButton() {
+ var suppressSubmitButton = {/literal}"{$suppressSubmitButton}"{literal};
+ var elementObj = $('input[name="payment_processor"]');
+ if ( elementObj.attr('type') == 'hidden' ) {
+ var processorTypeId = elementObj.val( );
+ }
+ else {
+ var processorTypeId = elementObj.filter(':checked').val();
+ }
- if (suppressSubmitButton) {
- cj("#crm-submit-buttons").hide();
- }
- else {
- cj("#crm-submit-buttons").show();
+ if (suppressSubmitButton) {
+ $("#crm-submit-buttons").hide();
+ }
+ else {
+ $("#crm-submit-buttons").show();
+ }
}
- }
-
- cj('input[name="payment_processor_id"]').change( function() {
toggleConfirmButton();
});
</script>
+ {/literal}
{/if}
{/crmRegion}
{crmRegion name="billing-block-post"}
{* Payment processors sometimes need to append something to the end of the billing block. We create a region for
clarity - the plan is to move to assigning this through the payment processor to this region *}
- {include file= "CRM/Financial/Form/PaypalExpress.tpl"}
{/crmRegion}
});
CRM.$(function($) {
- toggleConfirmButton();
skipPaymentMethod();
});
| see the CiviCRM license FAQ at http://civicrm.org/licensing |
+--------------------------------------------------------------------+
*}
-{if $paymentProcessor.payment_processor_type EQ 'PayPal_Express'}
+
<div id="paypalExpress">
{assign var=expressButtonName value='_qf_Main_upload_express'}
<fieldset class="crm-group paypal_checkout-group">
</div>
</fieldset>
</div>
-{/if}