<?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: Form Payment API integration help?</title>
		<link>https://legacy.forums.gravityhelp.com/topic/form-payment-api-integration-help</link>
		<description>Gravity Support Forums Topic: Form Payment API integration help?</description>
		<language>en-US</language>
		<pubDate>Sat, 04 Apr 2026 09:14:42 +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/form-payment-api-integration-help" rel="self" type="application/rss+xml" />

		<item>
			<title>Chris Hajer on "Form Payment API integration help?"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/form-payment-api-integration-help#post-124413</link>
			<pubDate>Thu, 17 Jan 2013 11:04:28 +0000</pubDate>
			<dc:creator>Chris Hajer</dc:creator>
			<guid isPermaLink="false">124413@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Before line 5, I would add this:&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;[php]
if (defined($entry[&#38;#39;24&#38;#39;])) {
	$payment= $entry[&#38;#39;24&#38;#39;];
}
else {
	$payment = $entry[&#38;#39;16&#38;#39;];
}&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;Then on line 09, change it to use this new variable rather than the $entry['24']:&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;[php]
&#38;#39;Payment&#38;#39; =&#38;gt; $payment,&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;That will use field 24 if it is defined or if not, will use field 16.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>housedesigns143 on "Form Payment API integration help?"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/form-payment-api-integration-help#post-123972</link>
			<pubDate>Thu, 17 Jan 2013 00:41:39 +0000</pubDate>
			<dc:creator>housedesigns143</dc:creator>
			<guid isPermaLink="false">123972@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;I am working on a donate form (&#60;a href=&#34;http://www.avance.org/donate/&#34; rel=&#34;nofollow&#34;&#62;http://www.avance.org/donate/&#60;/a&#62;) to integrate with pyrix API (&#60;a href=&#34;http://code.google.com/p/piryx-api/wiki/Payments)&#34; rel=&#34;nofollow&#34;&#62;http://code.google.com/p/piryx-api/wiki/Payments)&#60;/a&#62;.&#60;/p&#62;
&#60;p&#62;On the form, under Contribution Amount, there are two donation amounts. 1. is a drop-down with set amounts, or if you click &#34;Other&#34;, conditional logic will allow you to enter another amount instead. Right now I have it set only to pull ('Payment' =&#38;gt; $entry['24'],). How do I write the code to make it pull 'Payment' =&#38;gt; $entry['16'], if there is no amount selected in $entry['24']?&#60;br /&#62;
&#60;pre&#62;&#60;code&#62;&#38;lt;?php
add_action(&#38;#39;gform_after_submission_2&#38;#39;, &#38;#39;post_to_third_party&#38;#39;, 10, 2);
function post_to_third_party($entry, $form) {

    $post_url = &#38;#39;https://secure.piryx.com/api/accounts/iLE6xTsx/payments&#38;#39;;
    $body = array(
        &#38;#39;CampaignCode&#38;#39; =&#38;gt; $entry[&#38;#39;&#38;#39;],
        &#38;#39;Amount&#38;#39; =&#38;gt; $entry[&#38;#39;15&#38;#39;],
	&#38;#39;Payment&#38;#39; =&#38;gt; $entry[&#38;#39;24&#38;#39;],
        &#38;#39;Description&#38;#39; =&#38;gt; $entry[&#38;#39;21&#38;#39;],
        &#38;#39;CardNumber&#38;#39; =&#38;gt; $entry[&#38;#39;38&#38;#39;],
        &#38;#39;CardSecurityCode&#38;#39; =&#38;gt; $entry[&#38;#39;41&#38;#39;],
	&#38;#39;CardExpirationMonth&#38;#39; =&#38;gt; $entry[&#38;#39;39&#38;#39;],
        &#38;#39;CardExpirationYear&#38;#39; =&#38;gt; $entry[&#38;#39;40&#38;#39;],
        &#38;#39;RoutingNumber&#38;#39; =&#38;gt; $entry[&#38;#39;25&#38;#39;],
        &#38;#39;AccountNumber&#38;#39; =&#38;gt; $entry[&#38;#39;26&#38;#39;],
	&#38;#39;BillingAddress1&#38;#39; =&#38;gt; $entry[&#38;#39;31&#38;#39;],
        &#38;#39;BillingAddress2&#38;#39; =&#38;gt; $entry[&#38;#39;42&#38;#39;],
        &#38;#39;BillingCity&#38;#39; =&#38;gt; $entry[&#38;#39;32&#38;#39;],
        &#38;#39;BillingState&#38;#39; =&#38;gt; $entry[&#38;#39;33&#38;#39;],
	&#38;#39;BillingZip&#38;#39; =&#38;gt; $entry[&#38;#39;34&#38;#39;],
        &#38;#39;BillingPeriod&#38;#39; =&#38;gt; $entry[&#38;#39;28&#38;#39;],
        &#38;#39;TotalPayments&#38;#39; =&#38;gt; $entry[&#38;#39;29&#38;#39;],
        &#38;#39;Email&#38;#39; =&#38;gt; $entry[&#38;#39;36&#38;#39;],
	&#38;#39;FirstName&#38;#39; =&#38;gt; $entry[&#38;#39;2&#38;#39;],
        &#38;#39;MiddleName&#38;#39; =&#38;gt; $entry[&#38;#39;3&#38;#39;],
        &#38;#39;LastName&#38;#39; =&#38;gt; $entry[&#38;#39;4&#38;#39;],
        &#38;#39;Phone&#38;#39; =&#38;gt; $entry[&#38;#39;10&#38;#39;],
	&#38;#39;WorkPhone&#38;#39; =&#38;gt; $entry[&#38;#39;11&#38;#39;],
        &#38;#39;MobilePhone&#38;#39; =&#38;gt; $entry[&#38;#39;13&#38;#39;],
        &#38;#39;FaxPhone&#38;#39; =&#38;gt; $entry[&#38;#39;12&#38;#39;]
        );

    $request = new WP_Http();
    $response = $request-&#38;gt;post($post_url, array(&#38;#39;body&#38;#39; =&#38;gt; $body));

}
?&#38;gt;&#60;/code&#62;&#60;/pre&#62;</description>
		</item>

	</channel>
</rss>
