Integration and Testing

Authorize.Net API questions and help with your payment integration.

Reply
Member
Posts: 1
Registered: ‎01-17-2013

Card Present: Undefined Property $_custom_fields PHP

[ Edited ]

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!

Expert
Posts: 4,525
Registered: ‎03-08-2010

Re: Card Present: Undefined Property $_custom_fields PHP

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 ?