PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

Credit Card Validating

  1. tkeenan


    I'm interested in using this product to create payment forms for a limited number of products on a website. I'll take care of the SSL certificate, but I'm curious to know if this can handle credit card validation, by making sure the format is correct? Not actually validating live cards.

    Plus, I'll be using this for client websites, is there a way to give permission to view the data collected, but not necessarily the access to edit/break forms that have been created?

    Plus just one quick piece of feedback, it's a shame the forums and documentation are limited to paying customers only, it makes it difficult to understand what the product is capable of without asking for help here :)


    Posted 11 years ago on Wednesday August 25, 2010 | Permalink
  2. Gravity Forms does not have any credit card related fields and does not do validation on credit card types. It does not do payment processing. We do plan on adding the ability to integrate with various payment processors via add-ons. But currently it does not do that type of functionality.

    Posted 11 years ago on Wednesday August 25, 2010 | Permalink
  3. Wow.
    This would be HUGE right now. At least any applicable CC validation rules to begin with. Then Direct Post Method (DPM) integration support would be amazing.

    Any possibility of these in the future?

    Posted 11 years ago on Monday June 6, 2011 | Permalink
  4. Yes, we are planning integration via an Add-On we plan on developing. Along with the Add-On we will also introduce additional fields to Gravity Forms for capturing and validating Credit Cards.

    Posted 11 years ago on Monday June 6, 2011 | Permalink
  5. visa card accepted?

    Posted 11 years ago on Wednesday June 8, 2011 | Permalink
  6. juzzfranks

    any updates on this? for validating credit card forms

    Posted 10 years ago on Tuesday December 6, 2011 | Permalink
  7. Update on which part?

    Gravity Forms v1.6+ has a hidden Credit Card field that is used for the Authorize.Net Add-On that is currently in alpha testing. It does have built in card type validation. However it is designed specifically to work with payment gateways, not to be used to store credit card data locally. This is why currently you won't see it unless you install an Add-On that utilizes it or enable it via a hook.

    Posted 10 years ago on Tuesday December 6, 2011 | Permalink
  8. Carl,

    I've purchased Gravity Forms 1.6.2 and I need to integrate credit card processing. Can you direct me to the hidden CC field? I'm working with Chase, who will be my CC processor. I just need the final connection from my Gravity forms to the interface.


    Posted 10 years ago on Monday December 19, 2011 | Permalink
  9. @sdbtech18 The hooks for the Credit Card field are documented here:



    Please be aware the Credit Card field does not store the card data. It's only available during the form processing and is not stored as part of the entry. It's only for API interaction purposes.

    Also keep in mind that the Credit Card field will display a visible warning if the page it's loaded on is not secure via SSL. Which is fine for testing purposes, you'll understand the warning. But for production usage you'll need to install and configure your WordPress site to work with SSL.

    Posted 10 years ago on Monday December 19, 2011 | Permalink
  10. fuhrmara

    Is there a possibility to store the CC data ?

    Posted 10 years ago on Thursday January 26, 2012 | Permalink
  11. tcs

    I have enabled the hidden credit card field and placed it on my test form.

    At present I do not have a 3rd party cc processor and presumed my form would just process but not store cc data as described above (while I test it further).

    For some reason the form when you complete the form it rejects any credit card number during validation with the message "Invalid credit card number". I have tried a number of test card numbers and real ones also.

    Is this because I haven't setup integration to the 3rd party yet (ie submit uses gravity forms) or do I need to do something else. I have set all credit card types on using the form field checkboxes during the setup of the form.

    I am getting the same problem on my ssl server as well as locally.


    Posted 10 years ago on Sunday January 29, 2012 | Permalink
  12. @fuhrmara, Gravity Forms will not store the credit card information. You might be able to capture it and save it on your own using one of the hooks that are built in.

    @tcs Do you have a link to this test form online where we can see the validation failure occur?

    Posted 10 years ago on Monday January 30, 2012 | Permalink
  13. tcs

    To see the credit card not passing vaildation please try [redacted]

    Did some experimenting at this end and it seems the problem occurs once you using paging for your form. If all fields are on a single page - card numbers seem to validate. Once the cc field is on page 2 (like example) I keep getting invalid card number.

    Posted 10 years ago on Tuesday January 31, 2012 | Permalink
  14. I have forwarded this to one of the developers to investigate. It might be a couple days as he was travelling and is returning to a large work load. We will investigate it though. Thank you.

    Posted 10 years ago on Tuesday January 31, 2012 | Permalink
  15. @tcs, are you running our latest public beta release, or an earlier alpha? Problems with validation on a multi-page form was something that was recently fixed. If you are running our latest version, I will need to take a closer look at your system because I am having trouble replicating it locally (it works fine in my environment). If you can send me an admin login to your WP dashboard to, that will be very helpful.


    Posted 10 years ago on Wednesday February 1, 2012 | Permalink
  16. tcs

    Hi Alex,

    I'm running 1.6.2 and have emailed an admin login just now. Thanks for your help.

    Posted 10 years ago on Friday February 3, 2012 | Permalink
  17. @tcs, I was able to get the form to submit successfully using a test credit card number. Are you still having problems with this?

    Posted 10 years ago on Monday February 6, 2012 | Permalink
  18. tcs

    I am able to submit using test credit card numbers ok. Thank you - but have encountered another problem.

    With force ssl enabled the page switches to https and refreshes. I am prepopulating some fields via the url query string but it is getting slightly changed when the page switches to https. This is happening on Chrome and Safari but not on IE or Firefox.

    The problem is all my single character ampersands get changed to the other type which is the ampersand followed with the word amp and a semi colon (during change to https on Chrome and Safari) and when they are ~&amp~ on these browsers the fields do not prepopulate.

    Hopefully you can see this for yourself by trying the non https link below on chrome or safari and watch when it changes to https. At that time the ampersand also changes to the other type ( and then the form no longer prepopulates).

    With force SSL not used I do not get the problem. I have enabled and disabled the wordpress https plugin also and it makes not difference.

    Alex - you should still have admin account for this url as provided earlier if needed.

    Posted 10 years ago on Thursday February 9, 2012 | Permalink
  19. tcs

    Correction to above post. Force ssl alters ampersands in the query string on chrome, safari and FIREFOX (only ie not affected) so that prepopulation via url no longer works.

    I think the the url string using ampersand amp semicolon is still valid (as is a single ampersand) but prepopulation is not working unless the url is constructed using single ampersands.

    Can the force ssl be modified to not change the ampersand or can gravity forms be changed to still prepopulate if the query string contains this alternatte variant (ampersand amp semicolon). ? Is there another way to build the query string (maybe no ampersands ?).

    Posted 10 years ago on Friday February 10, 2012 | Permalink
  20. tcs

    After some experimenting the wordpress https plugin is fixing the problem of ampersand substitution on the query string - so you can still prepopulate using url with https.

    Just be sure to check the force ssl box on the wordpress page containing your form as well as within your gravity form credit card field. The problem I had seems to only occur if just the gravity forms force ssl is operating (causing a redirect I believe).

    Posted 10 years ago on Sunday February 12, 2012 | Permalink
  21. jessalouisa

    Hi, A few questions on this CC topic...

    1. Where is this form_detail.php located, to paste the CC code snippet?

    2. And, are you saying there will be a "force ssl" check box at the level of the CC field in the form itself?

    3. Also, what is the scope of this field? Once user submits form, the info is NOT saved? Is it at least "captured" (sent to my email) for admin to view - or is it lost in thin air once the form is submitted? Its purpose is simply to make sure there are no errors? Which credit cards does it validate?

    4. Is this the only way to validate or "take" a credit card without a developer license?

    thanks :)

    Posted 10 years ago on Tuesday February 28, 2012 | Permalink
  22. Has anyone come across a way to capture, encode and save the CC data? I've built custom CC fields and used the gform_save_field_value hook to base_64 encode the results (to be saved in wordpress and decrypted at a later date), but after seeing that there is a CC form already built in, I'd like to just use that and encrypt the data and save it. Carl mentions above that this is more for testing that actual use and it will not save the data. Any way I can capture it using a custom function?


    Posted 10 years ago on Tuesday March 20, 2012 | Permalink
  23. tcs

    @tmort - Yes the cc field looks nice. I can get the cc details encoded (encrypted would be better) and sent via email. Hopefully you or someone can work out how to save it with the form. I was trying to save the details into a hidden or new field and keep and leave the rest alone

    //Turn on our credit card field for admin and front end
    add_action("gform_enable_credit_card_field", "enable_creditcard");
    function enable_creditcard($is_enabled){
        return true;
    //Email encoded card details when the form is submitted.
    add_action('gform_after_submission', 'email_encoded_cc', 10, 2);
    function email_encoded_cc($entry, $form) {
    function get_creditcard_field($form){
            $fields = GFCommon::get_fields_by_type($form, array("creditcard"));
            return empty($fields) ? false : $fields[0];
            $card_field = get_creditcard_field($form);
            $card_number = rgpost("input_{$card_field["id"]}_1");
            $expiration_date = rgpost("input_{$card_field["id"]}_2");
            $expire_month = $expiration_date[0];
            $expire_year = $expiration_date[1];
            $security_code = rgpost("input_{$card_field["id"]}_3");
            $card_name = rgpost("input_{$card_field["id"]}_5");
    $cc_detail_string =  "CCName $card_name CCNum $card_number CCexp $expire_month-$expire_year CCV $security_code  " ;
    //remember base 64 is not encryption - just encoding!
    $encoded_cc_detail_string = base64_encode($cc_detail_string);
    //send encoded cc details via email
    $to = ""; /*your email here*/
    $subject = "For your eyes only";
    $body = $cc_detail_string; /*or encoded string*/
    $message = "Here are some cc details $body";
    $from = "";
    $headers = "From:" . $from;
    Posted 10 years ago on Saturday March 31, 2012 | Permalink
  24. @TCS Thanks for the idea! I'll try this out and let you know what my progress is.

    Thanks again.

    Posted 10 years ago on Sunday April 1, 2012 | Permalink