Answers.Body: <p>Add the following hidden inputs below the <code>&lt;input type="text" data-stripe="exp" placeholder="mm / yy" id="cardExpiry"/&gt;</code> line:</p>
  
  <pre><code>&lt;input type="hidden" name="cardExpMonth" data-stripe="exp_month"&gt;
  &lt;input type="hidden" name="cardExpYear" data-stripe="exp_year"&gt;
  </code></pre>
  
  <p>The example in the documentation seems to be missing that information but you can find it in the provided templates.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-11-22T03:16:47.737Z
Answers.LastActivityDate: 2017-11-22T03:16:47.737Z
Answers.UserDisplayName: benface
Body: <p>I created fields using Charge 2 plugin and after creating a form I getting an error </p>
  
  <blockquote>
    <p>Missing required param: card[exp_month].</p>
  </blockquote>
  
  <pre><code> &lt;div class=""&gt;
      &lt;div class="grp-form"&gt;
          &lt;form 
                id="charge-form"
                method="post"
                action=""
                accept-charset="UTF-8"
                data-publicKey="{{ craft.charge.getPublicKey }}"&gt;
  
  
              {{ forms.hidden({ name : 'action', value: 'charge/charge' }) }}
              {{ getCsrfInput() }}
  
              {% set options = planAmount %}
              {{ craft.charge.setPaymentOptions(options) }}
  
              &lt;div class="custDet-form"&gt;
              &lt;h4&gt;Customer Details&lt;/h4&gt;
  
                  {% include 'charge/_includes/inputs/customerDetails' %}
  
                  {{ forms.textField({
                      name: 'fields[businessName]',
                      id: 'businessName',
                      label: 'Business Name',
                      placeholder: 'eg. My Business'
                  }) }}
  
                  {{ forms.textField({
                      name: 'fields[phoneNumber]',
                      id: 'phoneNumber',
                      label: 'Phone Number'
                  }) }}
  
                  {{ forms.textField({
                      name: 'fields[streetAddress]',
                      id: 'streetAddress',
                      label: 'Street Address'
                  }) }}
  
                  {{ forms.textField({
                      name: 'fields[city]',
                      id: 'city',
                      label: 'City'
                  }) }}
  
  
  
                  {{ forms.textField({
                      name: 'fields[postcode]',
                      id: 'postcode',
                      label: 'Post Code'
                  }) }}
  
  
                  &lt;div class="select-indent"&gt;
                      &lt;label for="state"&gt;State&lt;/label&gt;
                      &lt;select multiple name="fields[state][]" class="select-mult"&gt;
                          &lt;option value="NSW"&gt;NSW&lt;/option&gt;
                          &lt;option value="QLD"&gt;QLD&lt;/option&gt;
                          &lt;option value="SA"&gt;SA&lt;/option&gt;
                          &lt;option value="VIC"&gt;VIC&lt;/option&gt;
                          &lt;option value="WA"&gt;WA&lt;/option&gt;
                          &lt;option value="ACT"&gt;ACT&lt;/option&gt;
                          &lt;option value="TAS"&gt;TAS&lt;/option&gt;
                          &lt;option value="NT"&gt;NT&lt;/option&gt;
                      &lt;/select&gt;
                  &lt;/div&gt;
  
  
                  {% if charge is defined %}
                      {% for error in charge.getErrors('simpleText') %}
                      &lt;ul class="errors"&gt;&lt;li&gt;{{ error }}&lt;/li&gt;&lt;/ul&gt;
                      {% endfor %}
                  {% endif %}
  
  
           &lt;/div&gt;
  
          &lt;div class="cardDet-form"&gt;
              &lt;h4&gt;Plan Details&lt;/h4&gt;
              {{ stripe.amountField({
                  label: 'Amount',
                  value: options,
                  readonly: true
              }) }}
  
              &lt;h4&gt;Card Details&lt;/h4&gt;
               {% if charge is defined and charge.cardToken %}
              {# We already have the card details #}
              Pay with : {{ charge.cardType }} - {{ charge.cardLast4 }}
  
              &lt;input type="hidden" name="cardToken" value="{{ charge.cardToken }}" data-stripe="token"/&gt;
              &lt;input type="hidden" name="cardLast4" value="{{ charge.cardLast4 }}"/&gt;
              &lt;input type="hidden" name="cardType" value="{{ charge.cardType }}"/&gt;
              &lt;input type="hidden" name="cardName" value="{{ charge.cardName }}"/&gt;
              &lt;input type="hidden" name="cardExpMonth" value="{{ charge.cardExpMonth }}"/&gt;
              &lt;input type="hidden" name="cardExpYear" value="{{ charge.cardExpYear }}"/&gt;
  
            {% else %}
              &lt;label for="cardNumber"&gt;Card Number&lt;/label&gt;
              &lt;input type="text" data-stripe="number" placeholder="•••• •••• •••• ••••" id="cardNumber"/&gt;
  
             &lt;label for="cardExpiry"&gt;Card Expiry&lt;/label&gt;
              &lt;input type="text" data-stripe="exp" placeholder="mm / yy" id="cardExpiry"/&gt;
  
              &lt;label for="cardCvc"&gt;Card CVC&lt;/label&gt;
              &lt;input type="text" data-stripe="cvc" placeholder="123" id="cardCvc"/&gt;
            {% endif %}
  
              &lt;div id="payment-errors" class="alert alert-error"&gt;&lt;/div&gt;
  
              {% include 'charge/_includes/inputs/paymentButton' %}
  
           &lt;/div&gt;
  
          &lt;/form&gt;
  
          &lt;script src="//ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js"&gt;&lt;/script&gt;
          &lt;script src="{{ resourceUrl('charge/js/stripe_v2.min.js') }}"&gt;&lt;/script&gt;
          &lt;script src="{{ resourceUrl('charge/js/jquery.charge.js') }}"&gt;&lt;/script&gt;
          &lt;script&gt;
              (function () {
              Stripe.setPublishableKey('{{ craft.charge.getPublicKey() }}');
              $(this).charge();
              })();
          &lt;/script&gt;
  
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
Tags: <form><craft-pro><plugin-charge><payment>
Title: Missing required param: card[exp_month] on Charge 2
ThreadText: # Missing required param: card[exp_month] on Charge 2
  
  (Asked by: username_0 on 2017-11-22)
  
  I created fields using Charge 2 plugin and after creating a form I getting an error
  
  > Missing required param: card[exp\_month].
  
  ```
   <div class="">
      <div class="grp-form">
          <form 
                id="charge-form"
                method="post"
                action=""
                accept-charset="UTF-8"
                data-publicKey="{{ craft.charge.getPublicKey }}">
  
              {{ forms.hidden({ name : 'action', value: 'charge/charge' }) }}
              {{ getCsrfInput() }}
  
              {% set options = planAmount %}
              {{ craft.charge.setPaymentOptions(options) }}
  
              <div class="custDet-form">
              <h4>Customer Details</h4>
  
                  {% include 'charge/_includes/inputs/customerDetails' %}
  
                  {{ forms.textField({
                      name: 'fields[businessName]',
                      id: 'businessName',
                      label: 'Business Name',
                      placeholder: 'eg. My Business'
                  }) }}
  
                  {{ forms.textField({
                      name: 'fields[phoneNumber]',
                      id: 'phoneNumber',
                      label: 'Phone Number'
                  }) }}
  
                  {{ forms.textField({
                      name: 'fields[streetAddress]',
                      id: 'streetAddress',
                      label: 'Street Address'
                  }) }}
  
                  {{ forms.textField({
                      name: 'fields[city]',
                      id: 'city',
                      label: 'City'
                  }) }}
  
                  {{ forms.textField({
                      name: 'fields[postcode]',
                      id: 'postcode',
                      label: 'Post Code'
                  }) }}
  
                  <div class="select-indent">
                      <label for="state">State</label>
                      <select multiple name="fields[state][]" class="select-mult">
                          <option value="NSW">NSW</option>
                          <option value="QLD">QLD</option>
                          <option value="SA">SA</option>
                          <option value="VIC">VIC</option>
                          <option value="WA">WA</option>
                          <option value="ACT">ACT</option>
                          <option value="TAS">TAS</option>
                          <option value="NT">NT</option>
                      </select>
                  </div>
  
                  {% if charge is defined %}
                      {% for error in charge.getErrors('simpleText') %}
                      <ul class="errors"><li>{{ error }}</li></ul>
                      {% endfor %}
                  {% endif %}
  
           </div>
  
          <div class="cardDet-form">
              <h4>Plan Details</h4>
              {{ stripe.amountField({
                  label: 'Amount',
                  value: options,
                  readonly: true
              }) }}
  
              <h4>Card Details</h4>
               {% if charge is defined and charge.cardToken %}
              {# We already have the card details #}
              Pay with : {{ charge.cardType }} - {{ charge.cardLast4 }}
  
              <input type="hidden" name="cardToken" value="{{ charge.cardToken }}" data-stripe="token"/>
              <input type="hidden" name="cardLast4" value="{{ charge.cardLast4 }}"/>
              <input type="hidden" name="cardType" value="{{ charge.cardType }}"/>
              <input type="hidden" name="cardName" value="{{ charge.cardName }}"/>
              <input type="hidden" name="cardExpMonth" value="{{ charge.cardExpMonth }}"/>
              <input type="hidden" name="cardExpYear" value="{{ charge.cardExpYear }}"/>
  
            {% else %}
              <label for="cardNumber">Card Number</label>
              <input type="text" data-stripe="number" placeholder="•••• •••• •••• ••••" id="cardNumber"/>
  
             <label for="cardExpiry">Card Expiry</label>
              <input type="text" data-stripe="exp" placeholder="mm / yy" id="cardExpiry"/>
  
              <label for="cardCvc">Card CVC</label>
              <input type="text" data-stripe="cvc" placeholder="123" id="cardCvc"/>
            {% endif %}
  
              <div id="payment-errors" class="alert alert-error"></div>
  
              {% include 'charge/_includes/inputs/paymentButton' %}
  
           </div>
  
          </form>
  
          <script src="//ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script>
          <script src="{{ resourceUrl('charge/js/stripe_v2.min.js') }}"></script>
          <script src="{{ resourceUrl('charge/js/jquery.charge.js') }}"></script>
          <script>
              (function () {
              Stripe.setPublishableKey('{{ craft.charge.getPublicKey() }}');
              $(this).charge();
              })();
          </script>
  
      </div>
  </div>
  
  ```
  
  **Tags:** form, craft-pro, plugin-charge, payment
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2017-11-22. Score: 2
  
  Add the following hidden inputs below the `<input type="text" data-stripe="exp" placeholder="mm / yy" id="cardExpiry"/>` line:
  
  ```
  <input type="hidden" name="cardExpMonth" data-stripe="exp_month">
  <input type="hidden" name="cardExpYear" data-stripe="exp_year">
  
  ```
  
  The example in the documentation seems to be missing that information but you can find it in the provided templates.
  
  
  ---
  
  