Skip to content
/ payform Public

A general purpose JQuery library for building credit card forms, validating inputs, and formatting numbers.

Notifications You must be signed in to change notification settings

tuxado/payform

Repository files navigation

A general purpose library for building credit card forms, validating inputs, and formatting numbers.

How to use

    <script src="jquery.min.js"></script>
    <script src="imask.js"></script>
    <script src="payform.plugin.js"></script>
    <script>
      $(document).ready(function () {
        $(".payform").creditCard({
          form: {
            num: {
              selector: '[role="cc-num-field"]',
              mask: { separator: " " },
              icon: '[role="cc-num-field-icon"]',
            },
            name: {
              selector: '[role="cc-name-field"]',
            },
            expiry: {
              selector: '[role="cc-expiary-field"]',
            },
            cvc: { selector: '[role="cc-cvc-field"]' },
          },
          image: {
            card: '[role="cc-img-wrapper"]',
            informations: {
              num: '[role="cc-num-info"]',

              name: '[role="cc-name-info"]',
              expiry: '[role="cc-expiry-info"]',
              cvc: '[role="cc-cvc-info"]',
            },
          },
          error: {
            isInvalid: "is-invalid",

            subject: undefined,
          },
        });
      });
    </script>

1

2

About

A general purpose JQuery library for building credit card forms, validating inputs, and formatting numbers.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published