cancel
Showing results for 
Search instead for 
Did you mean: 

Card Present: Undefined Property $_custom_fields PHP

Hi,

I am getting this issue when I am attempting to get a response from the transaction using the card present method:
Undefined property: AuthorizeNetCP::$_custom_fields in /vendor/ajbdev/authorizenet-php-api/lib/AuthorizeNetCP.php line 86

I am sending:
$track='%B4111111111111111^DOE/JOHN^1803101000000000020000831000000?';
        $transaction->amount = $amount;
        $transaction->device_type = '8';
        $transaction->setTrack1Data($track);
        $transaction->setCustomField('order_id', $order_id);
        $response = $transaction->authorizeAndCapture();

The transaction goes through fine, but fails at the response part of it.

I have looked everywhere and it honestly doesn't look like the $this->custom_fields variable is defined in the AuthorizeNetAIM class or the AuthorizeNetCP class.  The only way I am able to resolve this issue is by setting it manually in the class.  I have tried adding custom fields to the transaction and it's still throwing the same error.  Searching for this error on google returns no results.  

 

The line in question (line 86) is the return of this method:

protected function _handleResponse($response)
    {
        return new AuthorizeNetCP_Response($response, $this->_x_post_fields['delim_char'], $this->_x_post_fields['encap_char'], $this->_custom_fields);
    }

Thank you!

vlutton
Member
1 REPLY 1

Is in theAuthorizeNetAIM

/**
     * Only used if merchant wants to send custom fields.
     */
    private $_custom_fields = array();

 so it only error if you set a custom field? could use echo the $response ?

 

RaynorC1emen7
Expert