SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Zealot BuyAnswersLinks's Avatar
    Join Date
    Aug 2008
    Posts
    123
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    authorize.net sample code help

    Help, Im working on the authorize.net api and need some help. There is a way to get the resppnce codes from using explode() but i dont know how. The code is below:

    PHP Code:
    // 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 "&nbsp;</LI>\n";

        
    $i++;

    }

    echo 
    "</OL>\n"
    After that part is then says:

    // individual elements of the array could be accessed to read certain response

    // fields. For example, response_array[0] would return the Response Code,

    // response_array[2] would return the Response Reason Code.

    // for a list of response fields, please review the AIM Implementation Guide

    So how do I get the response_array[0] so I can echo it? Thanks

  2. #2
    SitePoint Addict
    Join Date
    Jul 2008
    Posts
    213
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It is actually how they show you. Hopefully the documentation has what the value of each position in the array is, ie: position zero is Response Code.
    PHP Code:
    echo 'Response Code: '.$response_array[0];
    echo 
    'Response Reason Code: '.$response_array[2]; 
    The foreach loop will list all the responses. The above code allows you to pick only the ones you want to display.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •