Frustrated with entering sandbox credit card data into your Gravity Forms credit card fields? This snippet intelligently populates gateway-specific testing credit card data into your credit fields. The payment gateway is determined by the first payment gateway feed found configured for the current form.
Getting Started
- Confirm that Gravity Forms is installed and activated.
- Already have a license? Download Latest Gravity Forms
- Need a license? Buy Gravity Forms
- Install the snippet.
- Copy and paste the entire snippet into your theme’s functions.php file.
- Confirm you have a Gravity Forms payment feed configured for your form.
Limit to Administrators
This snippet is primarily targeted towards sites in development. In some cases, you might want to leave this active on a live site so you can periodically test data without needing to reinstall the snippet. If so, you can wrap the initiation line in a admin-only condition. Here is an example:
if( current_user_can( 'administrator' ) ) {
new GWPopulateCreditCardField();
}
Supported Payment Gateways
- Authorize.net
- PayPal Pro
- PayPal Payments Pro
Any questions?
We hope you find this snippet useful! If you do, show us some love by sharing this article on the social media platform of your choice. Let’s keep the Gravity Wiz pumping out awesome snippets.
Did this resource help you do something awesome with Gravity Forms?
Then you'll absolutely love Gravity Perks; a suite of 46+ essential add-ons for Gravity Forms with support you can count on.
This needs to be updated to work with latest GF expiration dates. See code.
Thanks, Zack. I had some other changes pending for this snippet as well. Check out the latest version above. :)
When I add this to my functions file, i get the following error: “Fatal error: Class ‘GWPopulateCreditCardField’ not found in… “
Hi Nadine, this might help you out: https://gravitywiz.com/documentation/snippet-troubleshooting/