Skip to content

approveOrDeclineHeldTransaction() response is always "Approved" #158

Open
@drewboater

Description

When attempting to "decline" any transaction that has a FDS Pending Review Hold on it, the transaction is always being "approved".

I have been having a problem for a while now. This seems to be happening in both the Sandbox and Live Production environments.

I have run many test orders and received the same results. Just to confirm that I am indeed setting the action to "decline" and the correct transaction ID, I even tried hard coding those values in.

Pasted below is sample approveOrDeclineHeldTransaction() with values hard-coded in, and below that is the response object as received from the Sandbox.

function _approveOrDeclineHeldTransaction( $transactionid, $action )
{		
	$result = array();

	$merchantAuthentication = $this->_new_merchant_auth();

	//create a transaction
	$transactionRequestType = new net\authorize\api\contract\v1\HeldTransactionRequestType();
	//$transactionRequestType->setAction( $action );		// possible values: approve or decline
	//$transactionRequestType->setRefTransId( $transactionid );
	$transactionRequestType->setRefTransId( "40040828699" );
	$transactionRequestType->setAction( "decline" );		// possible values: approve or decline

	$request = new net\authorize\api\contract\v1\UpdateHeldTransactionRequest();
	$request->setMerchantAuthentication( $merchantAuthentication ) ;
	$request->setHeldTransactionRequest( $transactionRequestType );
	
	$controller = new net\authorize\api\controller\UpdateHeldTransactionController($request);
	
	$response = $this->_execute_api( $controller );
	

	$result = $this->_parse_authnet_response( $response );

	log_message('message', print("<pre>".print_r($response,true)."</pre>") );

	return $result;
}

RESPONSE OBJECT:

net\authorize\api\contract\v1\UpdateHeldTransactionResponse Object
(
[transactionResponse:net\authorize\api\contract\v1\UpdateHeldTransactionResponse:private] => net\authorize\api\contract\v1\TransactionResponseType Object
(
[responseCode:net\authorize\api\contract\v1\TransactionResponseType:private] => 1
[rawResponseCode:net\authorize\api\contract\v1\TransactionResponseType:private] =>
[authCode:net\authorize\api\contract\v1\TransactionResponseType:private] => 8I55C8
[avsResultCode:net\authorize\api\contract\v1\TransactionResponseType:private] => P
[cvvResultCode:net\authorize\api\contract\v1\TransactionResponseType:private] =>
[cavvResultCode:net\authorize\api\contract\v1\TransactionResponseType:private] =>
[transId:net\authorize\api\contract\v1\TransactionResponseType:private] => 40040828699
[refTransID:net\authorize\api\contract\v1\TransactionResponseType:private] => 40040828699
[transHash:net\authorize\api\contract\v1\TransactionResponseType:private] =>
[testRequest:net\authorize\api\contract\v1\TransactionResponseType:private] => 0
[accountNumber:net\authorize\api\contract\v1\TransactionResponseType:private] => XXXX1111
[entryMode:net\authorize\api\contract\v1\TransactionResponseType:private] =>
[accountType:net\authorize\api\contract\v1\TransactionResponseType:private] => Visa
[splitTenderId:net\authorize\api\contract\v1\TransactionResponseType:private] =>
[prePaidCard:net\authorize\api\contract\v1\TransactionResponseType:private] =>
[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.
)

            )

        [errors:net\authorize\api\contract\v1\TransactionResponseType:private] => Array
            (
            )

        [splitTenderPayments:net\authorize\api\contract\v1\TransactionResponseType:private] => Array
            (
            )

        [userFields:net\authorize\api\contract\v1\TransactionResponseType:private] => Array
            (
            )

        [shipTo:net\authorize\api\contract\v1\TransactionResponseType:private] => 
        [secureAcceptance:net\authorize\api\contract\v1\TransactionResponseType:private] => 
        [emvResponse:net\authorize\api\contract\v1\TransactionResponseType:private] => 
        [transHashSha2:net\authorize\api\contract\v1\TransactionResponseType:private] => 
        [profile:net\authorize\api\contract\v1\TransactionResponseType:private] => 
        [networkTransId:net\authorize\api\contract\v1\TransactionResponseType:private] => 
    )

[refId:net\authorize\api\contract\v1\ANetApiResponseType:private] => 
[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.
                    )

            )

    )

[sessionToken:net\authorize\api\contract\v1\ANetApiResponseType:private] => 

)

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions