Answers.Body: <p>Webform-CiviCRM integration is not yet compatible with CiviCRM 4.7.  See here: <a href="https://www.drupal.org/node/2661232" rel="nofollow">https://www.drupal.org/node/2661232</a></p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-03-27T21:33:32.763Z
Answers.LastActivityDate: 2016-03-27T21:33:32.763Z
Answers.UserDisplayName: Jon G - Megaphone Tech
Answers.Body: <p><strong>TLDR;</strong>
  I've created a patched repo for easier download: <a href="https://github.com/emphanos/webform_civicrm" rel="nofollow noreferrer">https://github.com/emphanos/webform_civicrm</a></p>
  
  <pre><code>cd &lt;your_drupal_7_docroot&gt;
  cd sites/all/modules/contrib/
  rm -rf webform_civicrm
  git clone https://github.com/emphanos/webform_civicrm.git
  drush en -y webform_civicrm
  drush updatedb -y
  drush cc all
  </code></pre>
  
  <p><strong>The longer more detailed information on the bug fix:</strong></p>
  
  <p>For webform_civicrm to work with CiviCRM 4.7.18 you'll need the latest dev branch of webform <a href="https://www.drupal.org/project/webform_civicrm/releases/7.x-4.x-dev" rel="nofollow noreferrer">https://www.drupal.org/project/webform_civicrm/releases/7.x-4.x-dev</a> (released 2017-Apr-05) and patch it with this patch <a href="https://www.drupal.org/files/issues/2661232.patch" rel="nofollow noreferrer">https://www.drupal.org/files/issues/2661232.patch</a></p>
  
  <pre><code>cd &lt;your_doc_root&gt;
  drush dl -y webform_civicrm --dev
  drush en -y webform_civicrm
  drush updatedb -y
  cd sites/all/modules/contrib/webform_civicrm/
  wget https://www.drupal.org/files/issues/2661232.patch
  </code></pre>
  
  <p>(see issue here: <a href="https://www.drupal.org/node/2661232" rel="nofollow noreferrer">https://www.drupal.org/node/2661232</a>) NOTE: Everything except for the last chunk of the patch will be applied, just skip the last chunk.</p>
  
  <pre><code>patch -p1 &lt; 2661232.patch
  patching file includes/wf_crm_webform_base.inc
  Hunk #1 succeeded at 32 (offset 8 lines).
  Hunk #2 succeeded at 71 with fuzz 2 (offset 11 lines).
  patching file includes/wf_crm_webform_postprocess.inc
  Hunk #1 succeeded at 1926 with fuzz 1 (offset 151 lines).
  patching file includes/wf_crm_webform_preprocess.inc
  Hunk #1 FAILED at 183.
  1 out of 1 hunk FAILED -- saving rejects to file includes/wf_crm_webform_preprocess.inc.rej
  patching file js/webform_civicrm_payment.js
  Reversed (or previously applied) patch detected!  Assume -R? [n]
  Apply anyway? [n] n
  Skipping patch.
  1 out of 1 hunk ignored -- saving rejects to file js/webform_civicrm_payment.js.rej
  </code></pre>
  
  <p>You'll notice that the payment fields don't get displayed, but that the total is also coming out as zero. There is a problem in the JQuery summation function in tally() that will incorrectly add up the data-amount values and in case the total is zero will not display the payment block.</p>
  
  <p>The Paypal Express Orange Checkout button will also not work, so it's best to hide it from showing up to avoid user confusion.</p>
  
  <p>You'll need to fix the tally function you need to apply a few changes to this file sites/all/modules/contrib/webform_civicrm/js/webform_civicrm_payment.js</p>
  
  <pre><code>diff --git a/js/webform_civicrm_payment.js b/js/webform_civicrm_payment.js
  index d1eaf44..a8ad53d 100644
  --- a/js/webform_civicrm_payment.js
  +++ b/js/webform_civicrm_payment.js
  @@ -26,11 +26,7 @@ cj(function($) {
           // When an express payment button is clicked, skip the billing fields and submit the form with a placeholder
           var $expressButton = $('input[name$=_upload_express]', '#billing-payment-block');
           if ($expressButton.length) {
  -          $expressButton.removeClass('crm-form-submit').click(function(e) {
  -            e.preventDefault();
  -            $('input[name=credit_card_number]', '#billing-payment-block').val('express');
  -            $(this).closest('form').find('input.webform-submit.button-primary').click();
  -          })
  +            $('#billing-payment-block .description').hide();
           }
         });
       }
  @@ -50,7 +46,7 @@ cj(function($) {
  
     function tally() {
       var total = 0;
  -    $('.line-item:visible', '#wf-crm-billing-items').each(function() {
  +    $("#wf-crm-billing-items tr:not(#wf-crm-billing-total)").each(function() {
         total += parseFloat($(this).data('amount'));
       });
       $('td+td', '#wf-crm-billing-total').html(CRM.formatMoney(total));
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-05-12T19:42:00.850Z
Answers.Text: Does this also work for 4.7.19? We just updated our dev site to the latest CiviCRM and I cloned the repository, however I'm not still not seeing the payment fields.
Answers.UserDisplayName: Corey Brown
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-05-20T08:22:05.630Z
Answers.Text: I haven't tested this on the latest 4.7.19 but once I do I'll report back here and update the repo. Also, did you by chance clear the drupal cache after enabling the drupal module?
Answers.UserDisplayName: Young-Jin Kim
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-06-19T23:04:37.213Z
Answers.Text: I've since updated to 4.7.20, however I've cleared the cache multiple times on both versions with the patched version you provided and still nothing. I've also used the latest dev version (June 14th) and nothing.
Answers.UserDisplayName: Corey Brown
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-05-03T20:47:10.310Z
Answers.LastActivityDate: 2017-05-07T21:31:47.433Z
Answers.LastEditDate: 2017-05-07T21:31:47.433Z
Answers.UserDisplayName: Young-Jin Kim
Answers.Body: <p>Try the following suggestions:</p>
  
  <p>1) Clear Drupal Cache (under System -> Performance).</p>
  
  <p>2) Look to see if you are using any custom templates - these can show different fields to those required by webform. If you aren't a coder your developer or webadmin will be able to help you here.</p>
  
  <p>3) Remember that payment values generally need to be handled differently than normal data. Particularly be wary of this information being stored longer than needed in the submissions table.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-03-27T20:00:08.480Z
Answers.LastActivityDate: 2016-03-27T20:00:08.480Z
Answers.UserDisplayName: JohnFF
Body: <p>I am using CiviCRM 4.7 in combination with Webform CiviCRM version 7.4-14. The payment fields are not showing,  but on submitting it asks for the invisible fields to be filled in. </p>
  
  <p>Is there anything wrong with the config that I am missing?</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-03-27T18:15:17.403Z
Comments.Text: I followed a re roll from this link too : http://civicrm.stackexchange.com/questions/10055/webform-civi-payment-fields-not-showing-up but its not helping out much
Comments.UserDisplayName: Boby
Tags: <webform-civicrm><payment-processor>
Title: Webform CiviCRM not showing credit card payment fields
ThreadText: # Webform CiviCRM not showing credit card payment fields
  
  (Asked by: username_0 on 2016-03-27)
  
  I am using CiviCRM 4.7 in combination with Webform CiviCRM version 7.4-14. The payment fields are not showing, but on submitting it asks for the invisible fields to be filled in.
  
  Is there anything wrong with the config that I am missing?
  
  **Tags:** webform-civicrm, payment-processor
  
  > **Comments:**
  > **username_0**: I followed a re roll from this link too : http://civicrm.stackexchange.com/questions/10055/webform-civi-payment-fields-not-showing-up but its not helping out much  
  
  ---
  
  ## 3 answers
  
  ### Answer by username_1 on 2016-03-27. Score: 3
  
  Webform-CiviCRM integration is not yet compatible with CiviCRM 4.7. See here: <https://www.drupal.org/node/2661232>
  
  
  ---
  
  ### Answer by username_2 on 2017-05-03. Score: 3
  
  **TLDR;**
  I've created a patched repo for easier download: <https://github.com/emphanos/webform_civicrm>
  
  ```
  cd <your_drupal_7_docroot>
  cd sites/all/modules/contrib/
  rm -rf webform_civicrm
  git clone https://github.com/emphanos/webform_civicrm.git
  drush en -y webform_civicrm
  drush updatedb -y
  drush cc all
  
  ```
  
  **The longer more detailed information on the bug fix:**
  
  For webform\_civicrm to work with CiviCRM 4.7.18 you'll need the latest dev branch of webform <https://www.drupal.org/project/webform_civicrm/releases/7.x-4.x-dev> (released 2017-Apr-05) and patch it with this patch <https://www.drupal.org/files/issues/2661232.patch>
  
  ```
  cd <your_doc_root>
  drush dl -y webform_civicrm --dev
  drush en -y webform_civicrm
  drush updatedb -y
  cd sites/all/modules/contrib/webform_civicrm/
  wget https://www.drupal.org/files/issues/2661232.patch
  
  ```
  
  (see issue here: <https://www.drupal.org/node/2661232>) NOTE: Everything except for the last chunk of the patch will be applied, just skip the last chunk.
  
  ```
  patch -p1 < 2661232.patch
  patching file includes/wf_crm_webform_base.inc
  Hunk #1 succeeded at 32 (offset 8 lines).
  Hunk #2 succeeded at 71 with fuzz 2 (offset 11 lines).
  patching file includes/wf_crm_webform_postprocess.inc
  Hunk #1 succeeded at 1926 with fuzz 1 (offset 151 lines).
  patching file includes/wf_crm_webform_preprocess.inc
  Hunk #1 FAILED at 183.
  1 out of 1 hunk FAILED -- saving rejects to file includes/wf_crm_webform_preprocess.inc.rej
  patching file js/webform_civicrm_payment.js
  Reversed (or previously applied) patch detected!  Assume -R? [n]
  Apply anyway? [n] n
  Skipping patch.
  1 out of 1 hunk ignored -- saving rejects to file js/webform_civicrm_payment.js.rej
  
  ```
  
  You'll notice that the payment fields don't get displayed, but that the total is also coming out as zero. There is a problem in the JQuery summation function in tally() that will incorrectly add up the data-amount values and in case the total is zero will not display the payment block.
  
  The Paypal Express Orange Checkout button will also not work, so it's best to hide it from showing up to avoid user confusion.
  
  You'll need to fix the tally function you need to apply a few changes to this file sites/all/modules/contrib/webform\_civicrm/js/webform\_civicrm\_payment.js
  
  ```
  diff --git a/js/webform_civicrm_payment.js b/js/webform_civicrm_payment.js
  index d1eaf44..a8ad53d 100644
  --- a/js/webform_civicrm_payment.js
  +++ b/js/webform_civicrm_payment.js
  @@ -26,11 +26,7 @@ cj(function($) {
           // When an express payment button is clicked, skip the billing fields and submit the form with a placeholder
           var $expressButton = $('input[name$=_upload_express]', '#billing-payment-block');
           if ($expressButton.length) {
  -          $expressButton.removeClass('crm-form-submit').click(function(e) {
  -            e.preventDefault();
  -            $('input[name=credit_card_number]', '#billing-payment-block').val('express');
  -            $(this).closest('form').find('input.webform-submit.button-primary').click();
  -          })
  +            $('#billing-payment-block .description').hide();
           }
         });
       }
  @@ -50,7 +46,7 @@ cj(function($) {
  
     function tally() {
       var total = 0;
  -    $('.line-item:visible', '#wf-crm-billing-items').each(function() {
  +    $("#wf-crm-billing-items tr:not(#wf-crm-billing-total)").each(function() {
         total += parseFloat($(this).data('amount'));
       });
       $('td+td', '#wf-crm-billing-total').html(CRM.formatMoney(total));
  
  ```
  
  > **Comments:**
  > **username_3**: Does this also work for 4.7.19? We just updated our dev site to the latest CiviCRM and I cloned the repository, however I'm not still not seeing the payment fields.  
  > **username_2**: I haven't tested this on the latest 4.7.19 but once I do I'll report back here and update the repo. Also, did you by chance clear the drupal cache after enabling the drupal module?  
  > **username_3**: I've since updated to 4.7.20, however I've cleared the cache multiple times on both versions with the patched version you provided and still nothing. I've also used the latest dev version (June 14th) and nothing.  
  
  ---
  
  ### Answer by username_4 on 2016-03-27. Score: 0
  
  Try the following suggestions:
  
  1) Clear Drupal Cache (under System -> Performance).
  
  2) Look to see if you are using any custom templates - these can show different fields to those required by webform. If you aren't a coder your developer or webadmin will be able to help you here.
  
  3) Remember that payment values generally need to be handled differently than normal data. Particularly be wary of this information being stored longer than needed in the submissions table.
  
  
  ---
  
  