0
votes

I'm using Authorize.Net for integrating Online Credit Card Processing.I'm using the the form which will redirect to the Authorize.net hosted form after clicking the submit button. My sample code is as below

        <?PHP

            $loginID        = "My_LOGIN_ID";// login id
            $transactionKey = "MY_TRANS_KEY";//transaction key
            $amount         = "19.99";
            $description     = "SAMPLE TRANSACTION";
            $label             = "Submit Payment";//label for submit button
            $testMode        = "false";
            $url            = "https://test.authorize.net/gateway/transact.dll";
            $invoice    = date(YmdHis);
            $sequence    = rand(1, 1000);
            $timeStamp    = time ();
            if( phpversion() >= '5.1.2' )
            {    $fingerprint = hash_hmac("md5", $loginID . "^" . $sequence . "^" . $timeStamp . "^" . $amount . "^", $transactionKey); }
            else 
            { $fingerprint = bin2hex(mhash(MHASH_MD5, $loginID . "^" . $sequence . "^" . $timeStamp . "^" . $amount . "^", $transactionKey)); }
            ?>
            <form method='post' action='<?php echo $url; ?>' >
                <input type='hidden' name='x_login' value='<?php echo $loginID; ?>' />
                <input type='hidden' name='x_amount' value='<?php echo $amount; ?>' />
                <input type='hidden' name='x_description' value='<?php echo $description; ?>' />
                <input type='hidden' name='x_invoice_num' value='<?php echo $invoice; ?>' />
                <input type='hidden' name='x_fp_sequence' value='<?php echo $sequence; ?>' />
                <input type='hidden' name='x_fp_timestamp' value='<?php echo $timeStamp; ?>' />
                <input type='hidden' name='x_fp_hash' value='<?php echo $fingerprint; ?>' />
                <input type='hidden' name='x_test_request' value='<?php echo $testMode; ?>' />
                <input type='hidden' name='x_show_form' value='<?php echo PAYMENT_FORM; ?>' />
                <input type='submit' value='<?php echo $label; ?>' />
            </form>

After submitting the Authorize.net hosted form with correct credit card and personal details, i got the transaction success message as below

enter image description here

I also got the email with transaction detail. Now i want to save the transaction details such as transaction id, Invoice Number, credit card type and customer details on my database after transaction success. Is there any background process to save the information into database? Thanks in advance.

1

1 Answers

1
votes

You can handle this stuff at your return URL of x_receipt_link_url. You can check How to configure page.

If you use Receipt Link (and set x_relay_response to false), it means that you would like Authorize.Net to simply display our own receipt page and to place the defined receipt link at the bottom of the page.

You have to configure the URL in the control panel as well before you can successfully specify it as a value. Here's the text from the control panel (Settings -> Transaction Format Settings -> Transaction Response Settings -> Response/Receipt URL's)