Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

approveOrDeclineHeldTransaction() response is always "Approved" #158

Open
drewboater opened this issue Nov 21, 2019 · 0 comments
Open

approveOrDeclineHeldTransaction() response is always "Approved" #158

drewboater opened this issue Nov 21, 2019 · 0 comments

Comments

@drewboater
Copy link

drewboater commented Nov 21, 2019

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] => 

)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant