1

can we add field "name as on card" in moodle square payment plugin, on billing information from?

In the API and example, I found the only options for :

card number, cvv, exp, postal code

<form id="nonce-form" novalidate action="process-payment" method="post">
          <fieldset>
            <div id="sq-card-number"></div>
            <div class="third">
              <div id="sq-expiration-date"></div>
            </div>
            <div class="third">
              <div id="sq-cvv"></div>
            </div>
            <div class="third">
              <div id="sq-postal-code"></div>
            </div>
          </fieldset>
          <button id="sq-creditcard" class="button-credit-card" onclick="onGetCardNonce(event)">Pay $1.00</button>
          <!--
            After a nonce is generated it will be assigned to this hidden input field.
          -->
          <input type="hidden" id="card-nonce" name="nonce">
        </form>

I want to add a new form field "Name as on card" in the square payment form. can anybody please give some example or any help?

Muhammad Zahid
  • 355
  • 2
  • 13
  • What's wrong with just adding another input field for `name-on-card` and sending that to your backend after receiving your nonce? – mootrichard Jul 23 '19 at 21:20
  • @mootrichard So, You mean we can add any number of fields? Either it is defined or not in the documentation. – Muhammad Zahid Jul 25 '19 at 06:17
  • 1
    I don't see why not. It's just a matter of your backend accepting that additional field and processing it. I want to be upfront in that I'm not familiar with Moodle API or the Square integration with it, but I know that the Square Payment form is really intended to just capture card details to tokenize (in the form of a nonce) to send to your backend. – mootrichard Jul 29 '19 at 19:38

0 Answers0