I am working on a donate form (http://www.avance.org/donate/) to integrate with pyrix API (http://code.google.com/p/piryx-api/wiki/Payments).
On the form, under Contribution Amount, there are two donation amounts. 1. is a drop-down with set amounts, or if you click "Other", conditional logic will allow you to enter another amount instead. Right now I have it set only to pull ('Payment' => $entry['24'],). How do I write the code to make it pull 'Payment' => $entry['16'], if there is no amount selected in $entry['24']?
<?php
add_action('gform_after_submission_2', 'post_to_third_party', 10, 2);
function post_to_third_party($entry, $form) {
$post_url = 'https://secure.piryx.com/api/accounts/iLE6xTsx/payments';
$body = array(
'CampaignCode' => $entry[''],
'Amount' => $entry['15'],
'Payment' => $entry['24'],
'Description' => $entry['21'],
'CardNumber' => $entry['38'],
'CardSecurityCode' => $entry['41'],
'CardExpirationMonth' => $entry['39'],
'CardExpirationYear' => $entry['40'],
'RoutingNumber' => $entry['25'],
'AccountNumber' => $entry['26'],
'BillingAddress1' => $entry['31'],
'BillingAddress2' => $entry['42'],
'BillingCity' => $entry['32'],
'BillingState' => $entry['33'],
'BillingZip' => $entry['34'],
'BillingPeriod' => $entry['28'],
'TotalPayments' => $entry['29'],
'Email' => $entry['36'],
'FirstName' => $entry['2'],
'MiddleName' => $entry['3'],
'LastName' => $entry['4'],
'Phone' => $entry['10'],
'WorkPhone' => $entry['11'],
'MobilePhone' => $entry['13'],
'FaxPhone' => $entry['12']
);
$request = new WP_Http();
$response = $request->post($post_url, array('body' => $body));
}
?>