<?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: Allow user to update the credit card info used for ARB?</title>
		<link>https://legacy.forums.gravityhelp.com/topic/allow-user-to-update-the-credit-card-info-used-for-arb</link>
		<description>Gravity Support Forums Topic: Allow user to update the credit card info used for ARB?</description>
		<language>en-US</language>
		<pubDate>Mon, 20 Apr 2026 14:07:18 +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/allow-user-to-update-the-credit-card-info-used-for-arb" rel="self" type="application/rss+xml" />

		<item>
			<title>tex77 on "Allow user to update the credit card info used for ARB?"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/allow-user-to-update-the-credit-card-info-used-for-arb#post-146158</link>
			<pubDate>Tue, 12 Feb 2013 03:08:53 +0000</pubDate>
			<dc:creator>tex77</dc:creator>
			<guid isPermaLink="false">146158@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;@MIke -- Sorry, I never did move that to production. The requirement for enabling a user to update his credit-card info (stored in Authorize.net) was removed from the project.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Mike Ciesiensky on "Allow user to update the credit card info used for ARB?"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/allow-user-to-update-the-credit-card-info-used-for-arb#post-123010</link>
			<pubDate>Wed, 16 Jan 2013 00:06:40 +0000</pubDate>
			<dc:creator>Mike Ciesiensky</dc:creator>
			<guid isPermaLink="false">123010@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Tex77, did you ever finish this code out for production?  I would love to have a copy of your final version.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Chris Hajer on "Allow user to update the credit card info used for ARB?"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/allow-user-to-update-the-credit-card-info-used-for-arb#post-75401</link>
			<pubDate>Fri, 14 Sep 2012 16:52:04 +0000</pubDate>
			<dc:creator>Chris Hajer</dc:creator>
			<guid isPermaLink="false">75401@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Thank you for posting that code.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>tex77 on "Allow user to update the credit card info used for ARB?"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/allow-user-to-update-the-credit-card-info-used-for-arb#post-75391</link>
			<pubDate>Fri, 14 Sep 2012 14:34:39 +0000</pubDate>
			<dc:creator>tex77</dc:creator>
			<guid isPermaLink="false">75391@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;I ended up doing this myself, using the GF hook &#34;gform_pre_submission&#34;, and my own api call using the AuthNet ARB php library. This worked in a proof-of-concept test, and in my AuthNet Sandbox account,.. but I have not actually built it into a real site yet, so use at your own risk. &#60;/p&#62;
&#60;p&#62;You should probably clean/sanitize the user input from the $_POST fields, of course change the $_POST field names to match your form. &#60;/p&#62;
&#60;p&#62;THE FORM&#60;br /&#62;
The form is on a page that is restricted to logged-in users. The ARB api requires the FirstName and LastName to be separate fields (as i recall), but GF's credit card field-group has the Cardholder Name a single input field, so I can't use that Cardholder Name field. Instead i hid that field with jquery, and added a separate Name field-group, with FirstName and LastName as separate fields. &#60;/p&#62;
&#60;p&#62;FUNCTIONS.PHP&#60;br /&#62;
&#60;pre&#62;&#60;code&#62;add_action(&#38;quot;gform_pre_submission&#38;quot;, &#38;quot;tz_anet_arb_update_cc&#38;quot;, 10, 2);
function tz_anet_arb_update_cc($entry,$form) {

	# ARB API CONFIG
	require (TEMPLATEPATH.&#38;#39;/anet-test/anet_php_sdk/AuthorizeNet.php&#38;#39;);  // path to Anet ARB php library
	define(&#38;quot;AUTHORIZENET_API_LOGIN_ID&#38;quot;, $my_anet_api_login_id);  // var set elsewhere
	define(&#38;quot;AUTHORIZENET_TRANSACTION_KEY&#38;quot;, $my_anet_api_transaction_id);  // var set elsewhere
	define(&#38;quot;AUTHORIZENET_SANDBOX&#38;quot;, true);  // true for testing, false for production
	define(&#38;quot;TEST_REQUEST&#38;quot;, &#38;quot;FALSE&#38;quot;);  // You may want to set to true if testing against production

	# PREP DATA ….

	# Card Number
	$creditCardCardNumber = $_POST[&#38;#39;input_1_1&#38;#39;]; // *todo: sanitize	

	# CCV
	$creditCardCardCode = strval(absint(intval($_POST[&#38;#39;input_1_3&#38;#39;])));

	# Exp date
	$exp_month = strval(absint(intval($_POST[&#38;#39;input_1_2&#38;#39;][0])));
	$exp_month = str_pad($exp_month, 2, &#38;#39;0&#38;#39;, STR_PAD_LEFT);
	$exp_year = strval(absint(intval($_POST[&#38;#39;input_1_2&#38;#39;][1])));
	$creditCardExpirationDate = $exp_month .&#38;quot;-&#38;quot;.$exp_year;

	# Name on Card
	$billToFirstName = $_POST[&#38;#39;input_2_3&#38;#39;]; // *todo: sanitize
	$billToLastName = $_POST[&#38;#39;input_2_6&#38;#39;]; // *todo: sanitize

	# PREP REQUEST
	$subscription = new AuthorizeNet_Subscription;
	$subscription-&#38;gt;creditCardCardNumber = $creditCardCardNumber; // test: 4007000000027, 6011000000000012
	$subscription-&#38;gt;creditCardExpirationDate = $creditCardExpirationDate; // test: 2018-10
	$subscription-&#38;gt;creditCardCardCode = $creditCardCardCode; // test: 123
	$subscription-&#38;gt;billToFirstName = $billToFirstName; // test: Bob
	$subscription-&#38;gt;billToLastName = $billToLastName; // test: Jones

	# Get Subscription ID to update
	global $current_user;
	get_currentuserinfo();
	$subscription_id = get_user_meta($current_user-&#38;gt;ID, &#38;#39;current-subscription-id&#38;#39;, true); // get from User meta (or Entry)

	$request = new AuthorizeNetARB;
	$response = $request-&#38;gt;updateSubscription($subscription_id, $subscription);

	# RESPONSE
	// parse and show success or failure accordingly  // *todo!

	# DEBUG
	//echo &#38;quot;&#38;lt;pre&#38;gt;&#38;quot;;print_r($response);echo &#38;quot;&#38;lt;/pre&#38;gt;&#38;quot;;
	//echo &#38;quot;&#38;lt;pre&#38;gt;&#38;quot;;print_r($_POST);echo &#38;quot;&#38;lt;/pre&#38;gt;&#38;quot;;
}&#60;/code&#62;&#60;/pre&#62;</description>
		</item>
		<item>
			<title>David Peralty on "Allow user to update the credit card info used for ARB?"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/allow-user-to-update-the-credit-card-info-used-for-arb#post-75376</link>
			<pubDate>Fri, 14 Sep 2012 13:20:34 +0000</pubDate>
			<dc:creator>David Peralty</dc:creator>
			<guid isPermaLink="false">75376@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Not that I know of. This isn't something within the scope of our current add-on options. I'll move this to Feature Requests for our developers to see.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>nachorevolution on "Allow user to update the credit card info used for ARB?"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/allow-user-to-update-the-credit-card-info-used-for-arb#post-75374</link>
			<pubDate>Fri, 14 Sep 2012 13:17:43 +0000</pubDate>
			<dc:creator>nachorevolution</dc:creator>
			<guid isPermaLink="false">75374@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Is this feature being worked on?
&#60;/p&#62;</description>
		</item>
		<item>
			<title>tex77 on "Allow user to update the credit card info used for ARB?"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/allow-user-to-update-the-credit-card-info-used-for-arb#post-71573</link>
			<pubDate>Sat, 18 Aug 2012 18:33:23 +0000</pubDate>
			<dc:creator>tex77</dc:creator>
			<guid isPermaLink="false">71573@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Has anyone used Gravity Forms to create a form that enables a user to update the credit card information (card number and/or expiration date) used for recurring payments on his subscription at Authorize.net?
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
