cancel
Showing results for 
Search instead for 
Did you mean: 

Issue with Transaction ID in Test Mode for authOnlyTransaction

Hello All,
I am currently developing an integration with the Authorize.Net payment gateway and using the sandbox environment for testing. During the implementation, I encountered an issue with the authOnlyTransaction transaction type.
When I attempt to authorize a credit card transaction using authOnlyTransaction, I do not receive a valid transaction ID. Instead, the response indicates a transaction ID of 0. Below is an example of the response I am receiving:

net\authorize\api\contract\v1\CreateTransactionResponse Object
(
    [transactionResponse:net\authorize\api\contract\v1\CreateTransactionResponse:private] => net\authorize\api\contract\v1\TransactionResponseType Object
        (
            [responseCode:net\authorize\api\contract\v1\TransactionResponseType:private] => 1
            [authCode:net\authorize\api\contract\v1\TransactionResponseType:private] => 000000
            [avsResultCode:net\authorize\api\contract\v1\TransactionResponseType:private] => P
            [transId:net\authorize\api\contract\v1\TransactionResponseType:private] => 0
            [accountNumber:net\authorize\api\contract\v1\TransactionResponseType:private] => XXXX5821
            [accountType:net\authorize\api\contract\v1\TransactionResponseType:private] => MasterCard
            [messages:net\authorize\api\contract\v1\TransactionResponseType:private] => Array
                (
                    [0] => net\authorize\api\contract\v1\TransactionResponseType\MessagesAType\MessageAType Object
                        (
                            [code:net\authorize\api\contract\v1\TransactionResponseType\MessagesAType\MessageAType:private] => 1
                            [description:net\authorize\api\contract\v1\TransactionResponseType\MessagesAType\MessageAType:private] => This transaction has been approved.
                        )
                )
        )
    [messages:net\authorize\api\contract\v1\ANetApiResponseType:private] => net\authorize\api\contract\v1\MessagesType Object
        (
            [resultCode:net\authorize\api\contract\v1\MessagesType:private] => Ok
            [message:net\authorize\api\contract\v1\MessagesType:private] => Array
                (
                    [0] => net\authorize\api\contract\v1\MessagesType\MessageAType Object
                        (
                            [code:net\authorize\api\contract\v1\MessagesType\MessageAType:private] => I00001
                            [text:net\authorize\api\contract\v1\MessagesType\MessageAType:private] => Successful.
                        )
                )
        )
)

As shown, the transId is 0 despite the transaction being approved. Consequently, when I attempt to capture this transaction using priorAuthCaptureTransaction, I receive the following error due to the invalid transaction ID:

net\authorize\api\contract\v1\CreateTransactionResponse Object
(
    [transactionResponse:net\authorize\api\contract\v1\TransactionResponseType:private] => net\authorize\api\contract\v1\TransactionResponseType Object
        (
            [responseCode:net\authorize\api\contract\v1\TransactionResponseType:private] => 3
            [transId:net\authorize\api\contract\v1\TransactionResponseType:private] => 0
            [messages:net\authorize\api\contract\v1\TransactionResponseType:private] => 
            [errors:net\authorize\api\contract\v1\TransactionResponseType:private] => Array
                (
                    [0] => net\authorize\api\contract\v1\TransactionResponseType\ErrorsAType\ErrorAType Object
                        (
                            [errorCode:net\authorize\api\contract\v1\TransactionResponseType\ErrorsAType\ErrorAType:private] => 33
                            [errorText:net\authorize\api\contract\v1\TransactionResponseType\ErrorsAType\ErrorAType:private] => A valid referenced transaction ID is required.
                        )
                )
        )
    [messages:net\authorize\api\contract\v1\ANetApiResponseType:private] => net\authorize\api\contract\v1\MessagesType Object
        (
            [resultCode:net\authorize\api\contract\v1\MessagesType:private] => Error
            [message:net\authorize\api\contract\v1\MessagesType:private] => Array
                (
                    [0] => net\authorize\api\contract\v1\MessagesType\MessageAType Object
                        (
                            [code:net\authorize\api\contract\v1\MessagesType\MessageAType:private] => E00027
                            [text:net\authorize\api\contract\v1\MessagesType\MessageAType:private] => The transaction was unsuccessful.
                        )
                )
        )
)

Could you please suggest a proper way to generate a valid transaction ID in test mode so I can successfully capture the authorized transaction?
I appreciate your assistance in resolving this issue.
Thanks & Regards,
Ashwini Nehe
ashwini_nehe
Member
2 REPLIES 2

Hi Ashwini nehe

It looks like you're encountering an issue where the transaction ID returned for the `authOnlyTransaction` is `0`, which is causing problems for the `priorAuthCaptureTransaction`.

Here’s a brief solution to this problem:

**To fix this issue, follow these steps:**

1. **Verify Test Mode Settings:** Ensure you are using the correct test mode settings and the sandbox environment. The `authOnlyTransaction` should work properly in the sandbox environment.

2. **Check API Credentials:** Make sure your API credentials (API Login ID and Transaction Key) are correct and configured for the sandbox environment.

3. **Use a Different Test Card Number:** Sometimes using different test card numbers provided by Authorize.Net can help generate valid transactions.

4. **Contact Authorize.Net Support:** If the above steps don’t resolve the issue, contact Authorize.Net support for assistance, as there might be a specific issue with the sandbox environment.

By following these steps, you should be able to generate a valid transaction ID for further testing.

Hello @maverickwhites 

Thanks for your reply.

I found the solution to our issue. Although we are using a sandbox account, we need to perform transactions in live mode instead of test mode. Authorize.net has a provision that allows for testing with test cards in a sandbox account using live mode. This generates valid transaction IDs and settles transactions accordingly.

Thank you for your assistance.

Best regards,
Ashwini Nehe