Page 1 of 1

[solved] After upgrade, values are not recognized by Authori

Posted: Wed Dec 15, 2010 12:41 am
by CMSmonkey
I upgraded a site that takes donations from 1.6 to 1.9.1.  We are using a UDT to process the donations through Authorize.net's AIM method. I am using Form Builder's "Call a UDT with Form Results" field to process the UDT. Everything worked fine until the upgrade: after the upgrade, the values are no longer being transmitted to Authorize.net.  If I print the params, they are recognized - but if I echo the info that Authorize.net received, nothing is received.

----------------------------------------------

Cms Version: 1.9.1

Modules:

   * FormBuilder: 0.6.4
   * FormBrowser: 0.3

Config Information:

   * php_memory_limit:
   * process_whole_template: false
   * output_compression: false
   * max_upload_size: 10000000
   * default_upload_permission: 664
   * url_rewriting: none
   * page_extension:
   * query_var: page
   * image_manipulation_prog: GD
   * auto_alias_content: true
   * locale:
   * default_encoding: utf-8
   * admin_encoding: utf-8
   * set_names: true


Php Information:

   * phpversion: 5.2.12
   * md5_function: On (True)
   * gd_version: 2
   * tempnam_function: On (True)
   * magic_quotes_runtime: Off (False)
   * E_STRICT: 0
   * memory_limit: 32M
   * max_execution_time: 300
   * output_buffering: On
   * safe_mode: Off (False)
   * file_uploads: On (True)
   * post_max_size: 10M
   * upload_max_filesize: 10M
   * session_save_path: /tmp (1777)
   * session_use_cookies: On (True)
   * xml_function: On (True)


Server Information:

   * Server Api: cgi
   * Server Db Type: MySQL (mysql)
   * Server Db Version: 5.0.83


----------------------------------------------


Here's my UDT:

Code: Select all

// Get params:

$amount=$params['Amount'];
$firstname=$params['First Name'];
$lastname=$params['Last Name'];
$address=$params['Address'];
$city=$params['City'];
$state=$params['State'];
$zip=$params['Zip'];
$ccnumber=$params['Credit Card Number'];
$expiration=$params['Expiration'];
$email=$params['Email'];
$phone=$params['Phone'];
$referencenumber=$params['Reference Number'];

$post_url = "https://secure.authorize.net/gateway/transact.dll";

$post_values = array(
    
    // the API Login ID and Transaction Key must be replaced with valid values
    "x_login"            => "xxxxxx",
    "x_tran_key"        => "xxxxxxxx",

    "x_version"            => "3.1",
    "x_delim_data"        => "TRUE",
    "x_delim_char"        => "|",
    "x_relay_response"    => "FALSE",

    "x_type"            => "AUTH_CAPTURE",
    "x_method"            => "CC",
    "x_card_num"        => "$ccnumber",
    "x_exp_date"        => "$expiration",

    "x_amount"            => "$amount",
         "x_invoice_num"        => "$referencenumber",

    "x_first_name"        => "$firstname",
    "x_last_name"        => "$lastname",
    "x_address"            => "$address",
        "x_city"            => "$city",
    "x_state"            => "$state",
    "x_zip"                => "$zip",
        "x_email"                => "$email",
        "x_phone"                => "$phone",

);

// This section takes the input fields and converts them to the proper format
// for an http post.  For example: "x_login=username&x_tran_key=a1B2c3D4"
$post_string = "";
foreach( $post_values as $key => $value )
    { $post_string .= "$key=" . urlencode( $value ) . "&"; }
$post_string = rtrim( $post_string, "& " );

$request = curl_init($post_url); // initiate curl object
    curl_setopt($request, CURLOPT_HEADER, 0); // set to 0 to eliminate header info from response
    curl_setopt($request, CURLOPT_RETURNTRANSFER, 1); // Returns response data instead of TRUE(1)
    curl_setopt($request, CURLOPT_POSTFIELDS, $post_string); // use HTTP POST to send form data
    curl_setopt($request, CURLOPT_SSL_VERIFYPEER, FALSE); // uncomment this line if you get no gateway response.
    $post_response = curl_exec($request); // execute curl post and store results in $post_response
    // additional options may be required depending upon your server configuration
    // you can find documentation on curl options at http://www.php.net/curl_setopt
curl_close ($request); // close curl object

// This line takes the response and breaks it into an array using the specified delimiting character
$response_array = explode($post_values["x_delim_char"],$post_response);

// The results are output to the screen in the form of an html numbered list.
echo "<OL>\n";
foreach ($response_array as $value)
{
    echo "<LI>" . $value . " </LI>\n";
    $i++;
}
echo "</OL>\n";

Any suggestions as to what is going on here?

Re: After upgrade, values are not recognized by Authorize.net

Posted: Thu Dec 16, 2010 3:08 pm
by CMSmonkey
BUMP

anyone? Authorize.net cannot find an issue with the code and this problem only came up after upgrading...

Re: After upgrade, values are not recognized by Authorize.net

Posted: Thu Dec 16, 2010 8:08 pm
by CMSmonkey
with print_r($params) I see my values

with print_r($_POST) I see my values

with print_r($post_values) no values are seen........

can anyone help PLEASE?

Re: After upgrade, values are not recognized by Authorize.net

Posted: Fri Dec 17, 2010 9:20 pm
by CMSmonkey
I could not get form and UDT to work.  Downgraded to FormBuilder 0.5.12 and it seemed to do the trick.... Wouldn't consider it sincerely resolved since it seems to be an underlying issue with FormBuilder 0.6.4 I can't pinpoint.

Re: [Partially Resolved] After upgrade, values are not recog

Posted: Thu Jan 26, 2012 12:28 am
by CMSmonkey
So I know this is an old thread, but I finally resolved this and wanted to let the community know how it was resolved in case someone runs into the same issue.

It seems that passing values through the $params['field_name'] are not recognized when using some FormBuilder module versions after 0.5.12, but it does recognize $params['field_alias'].

I ran into this problem a couple of times with certain FormBuilder module versions, but I did recently confirm that it works correctly with FormBuilder 0.7.1.