What I did was first generate a transaction and then log the output to a text file using the callback page:
$logfile = "{$_SERVER['DOCUMENT_ROOT']}/mylogfolder/log.txt";
$handle = fopen($logfile, 'a');
fwrite($handle, print_r($_POST, true));
This is with some of the field data modified or the fields removed entirely for security reasons, but it will give you an idea of what the output looks like:
Array
(
[x_response_code] => 1
[x_response_reason_code] => 1
[x_response_reason_text] => This transaction has been approved.
[x_avs_code] => Y
[x_auth_code] => 012335
[x_trans_id] => 12345678
[x_card_type] => Visa
[x_first_name] => Theodore
[x_last_name] => Pride
[x_company] => Fenton Web Design Firm.
[x_address] => 1731 Smizer Mill Rd.
[x_city] => Fenton
[x_state] => MO
[x_zip] => 63026
[x_country] => US
[x_description] => My transaction description
[x_cust_id] => 1234
[x_amount] => 19.95
[x_MD5_Hash] => X5C2BA75F23E5666AD9D3A3B693E584X
)
From there it was simple - I knew what the field names were and what the data looked like, just had to test for success (I'm using x_response_code == 1) and if successful, store the transaction record in the database. I'll leave the database storage part up to you.