<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="bbPress/1.0.1" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title>Gravity Support Forums Topic: Encrypt data or prevent its being stored to DB</title>
		<link>https://legacy.forums.gravityhelp.com/topic/encrypt-data-or-prevent-its-being-stored-to-db</link>
		<description>Gravity Support Forums Topic: Encrypt data or prevent its being stored to DB</description>
		<language>en-US</language>
		<pubDate>Wed, 08 Apr 2026 16:34:16 +0000</pubDate>
		<generator>http://bbpress.org/?v=1.0.1</generator>
		<textInput>
			<title><![CDATA[Search]]></title>
			<description><![CDATA[Search all topics from these forums.]]></description>
			<name>q</name>
			<link>https://legacy.forums.gravityhelp.com/search.php</link>
		</textInput>
		<atom:link href="https://legacy.forums.gravityhelp.com/rss/topic/encrypt-data-or-prevent-its-being-stored-to-db" rel="self" type="application/rss+xml" />

		<item>
			<title>Alex Cancado on "Encrypt data or prevent its being stored to DB"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/encrypt-data-or-prevent-its-being-stored-to-db#post-34148</link>
			<pubDate>Thu, 01 Sep 2011 10:13:18 +0000</pubDate>
			<dc:creator>Alex Cancado</dc:creator>
			<guid isPermaLink="false">34148@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Very nice! I am glad it worked out for you.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>BIGLIFE on "Encrypt data or prevent its being stored to DB"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/encrypt-data-or-prevent-its-being-stored-to-db#post-34146</link>
			<pubDate>Thu, 01 Sep 2011 10:11:33 +0000</pubDate>
			<dc:creator>BIGLIFE</dc:creator>
			<guid isPermaLink="false">34146@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Alex,&#60;br /&#62;
You're the man! That worked great.&#60;br /&#62;
Thanks so much.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Alex Cancado on "Encrypt data or prevent its being stored to DB"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/encrypt-data-or-prevent-its-being-stored-to-db#post-34085</link>
			<pubDate>Wed, 31 Aug 2011 17:42:49 +0000</pubDate>
			<dc:creator>Alex Cancado</dc:creator>
			<guid isPermaLink="false">34085@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;I think the best way to handle this is using a combination of hooks. Use the gform_save_field_value to truncate the credit card number and then use the gform_post_submission to do your third party integration. The only thing you have to be aware of, is that you will need to use the $_POST variable in the gform_post_submission hook in order to access the full credit card number. If you use the $entry variable, you will only get the truncated number.&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;add_action(&#38;quot;gform_post_submission_9&#38;quot;, &#38;quot;donation&#38;quot;, 10, 2);
function donation($entry, $form){

    //NOTE: need to access credit card via the $_POST global variable because the $entry variable will only have the last 4 characters
    $full_credit_card = $_POST[&#38;quot;input_22&#38;quot;];    

    include(&#38;quot;donate.php&#38;quot;); //This has a bunch of my third party processing stuff
}

add_filter(&#38;quot;gform_save_field_value&#38;quot;, &#38;quot;save_field_value&#38;quot;, 10, 4);
function save_field_value($value, $lead, $field, $form){

    //trimming credit card field to last 4 digits
    if($form[&#38;quot;id&#38;quot;] == 9 &#38;amp;&#38;amp; $field[&#38;quot;id&#38;quot;] == 22)
        $value = str_repeat(&#38;#39;x&#38;#39;, (strlen($value) - 4)) . substr($value,-4,4);

    return $value;
}&#60;/code&#62;&#60;/pre&#62;</description>
		</item>
		<item>
			<title>BIGLIFE on "Encrypt data or prevent its being stored to DB"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/encrypt-data-or-prevent-its-being-stored-to-db#post-34071</link>
			<pubDate>Wed, 31 Aug 2011 16:44:08 +0000</pubDate>
			<dc:creator>BIGLIFE</dc:creator>
			<guid isPermaLink="false">34071@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Ok...What am I missing?&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;add_action(&#38;quot;gform_post_submission_9&#38;quot;, &#38;quot;donation&#38;quot;, 10, 2);
function donation($entry, $form){
	include(&#38;quot;donate.php&#38;quot;); //This has a bunch of my third party processing stuff
	$entry[&#38;#39;22&#38;#39;] = str_repeat(&#38;#39;x&#38;#39;, (strlen($ccNumber) - 4)) . substr($ccNumber,-4,4);
}&#60;/code&#62;&#60;/pre&#62;</description>
		</item>
		<item>
			<title>Carl Hancock on "Encrypt data or prevent its being stored to DB"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/encrypt-data-or-prevent-its-being-stored-to-db#post-34061</link>
			<pubDate>Wed, 31 Aug 2011 16:20:03 +0000</pubDate>
			<dc:creator>Carl Hancock</dc:creator>
			<guid isPermaLink="false">34061@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;When you use the gform_post_submission hook to access and manipulate the entry object you ARE accessing the entry in the database once it's been submitted.  &#60;/p&#62;
&#60;p&#62;The gform_save_field_value hook happens BEFORE the value is stored in the database.  So yes, you could use that too as long as you are processing the credit card field to do whatever you need to do with it before this hook is fired.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>BIGLIFE on "Encrypt data or prevent its being stored to DB"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/encrypt-data-or-prevent-its-being-stored-to-db#post-34055</link>
			<pubDate>Wed, 31 Aug 2011 15:57:51 +0000</pubDate>
			<dc:creator>BIGLIFE</dc:creator>
			<guid isPermaLink="false">34055@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Thanks Carl,&#60;br /&#62;
I am currently using that hook to send data to a third party, so I'm familiar with it.  What I don't understand is how to access the entry in the database once its been submitted to change it. I do not want to keep credit card info in my WP database.  Once I get a hold of it I would apply this code to strip the number and leave only the last four:&#60;/p&#62;
&#60;p&#62;&#60;code&#62;$entry[&#38;#39;22&#38;#39;] = str_repeat(&#38;#39;x&#38;#39;, (strlen($entry[&#38;#39;22&#38;#39;]) - 4)) . substr($entry[&#38;#39;22&#38;#39;],-4,4);&#60;/code&#62;&#60;/p&#62;
&#60;p&#62;Could I not use the &#34;Gform save field value&#34; to change the value?
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Carl Hancock on "Encrypt data or prevent its being stored to DB"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/encrypt-data-or-prevent-its-being-stored-to-db#post-33945</link>
			<pubDate>Tue, 30 Aug 2011 16:14:26 +0000</pubDate>
			<dc:creator>Carl Hancock</dc:creator>
			<guid isPermaLink="false">33945@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;You would write custom PHP and add it to your themes functions.php (or create a custom plugin if you know how to do that) that uses the gform_post_submission hook to manipulate the value of the field you are using for the credit card.&#60;/p&#62;
&#60;p&#62;Here is documentation on the gform_post_submission hook:&#60;/p&#62;
&#60;p&#62;&#60;a href=&#34;http://www.gravityhelp.com/documentation/page/Gform_post_submission&#34; rel=&#34;nofollow&#34;&#62;http://www.gravityhelp.com/documentation/page/Gform_post_submission&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;It has access to the Entry object for accessing and changing entry data.&#60;/p&#62;
&#60;p&#62;This hook is fired after the entire form process is complete and an entry exists.  So it would be fine to do what you need to do at this point.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>BIGLIFE on "Encrypt data or prevent its being stored to DB"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/encrypt-data-or-prevent-its-being-stored-to-db#post-33944</link>
			<pubDate>Tue, 30 Aug 2011 16:12:15 +0000</pubDate>
			<dc:creator>BIGLIFE</dc:creator>
			<guid isPermaLink="false">33944@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;I would like to go with the deletion method.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Carl Hancock on "Encrypt data or prevent its being stored to DB"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/encrypt-data-or-prevent-its-being-stored-to-db#post-33938</link>
			<pubDate>Tue, 30 Aug 2011 15:39:25 +0000</pubDate>
			<dc:creator>Carl Hancock</dc:creator>
			<guid isPermaLink="false">33938@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;You have described two different things.  You can either encrypt the data, or you can delete it from the entry after it's been processed so it is not stored.  If it's a Credit Card number I would suggest either deleting it, or changing it's value so it only retains the last 4 digits.&#60;/p&#62;
&#60;p&#62;Which method you choose is going to depend on what you are doing with this data.  &#60;/p&#62;
&#60;p&#62;If you need it visible in the entry details by an admin then you'd have to encrypt and decrypt it.  &#60;/p&#62;
&#60;p&#62;If you are processing the credit card when the form is submitted via a customization, then you would just store a portion of the card data and not the entire card number after it's been processed.... but only if you are processing the card automatically when the form is submitted via a customization.&#60;/p&#62;
&#60;p&#62;Let me know which you would prefer and I can point you in the right direction.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>BIGLIFE on "Encrypt data or prevent its being stored to DB"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/encrypt-data-or-prevent-its-being-stored-to-db#post-33777</link>
			<pubDate>Mon, 29 Aug 2011 10:09:31 +0000</pubDate>
			<dc:creator>BIGLIFE</dc:creator>
			<guid isPermaLink="false">33777@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;I am gathering personal data in a donation form and I would like to either keep certain fields (credit card) from posting to the database at all or encrypt them via &#34;Gform save field value.&#34; First let me state that I am a noobie, so bear with me. I would place this in my WP functions.php file right?&#60;/p&#62;
&#60;p&#62;OK, I understand most of the arguments but I'm a bit lost on the &#34;$lead.&#34; Could someone enlighten me? How would I gather this info? Is this part of the POST from a submission?&#60;/p&#62;
&#60;p&#62;To encrypt multiple fields do I call this function again or can I combine into one call? Lastly, is there a way to keep certain fields from even being saved in database?
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
