I am integrating pyrix API with a form and had a question for my coding. Pyrix api requires authentication (http://code.google.com/p/piryx-api/wiki/Authentication). I am not a strong php coder. Where and what would I add to my code below to make it work?
<?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));
}
?>