Reply
Member
Posts: 8
Registered: ‎06-05-2012
Accepted Solution

AIM PHP - Retrieving Custom Merchant Defined Fields

In my code I have defined a custom field:

 

$transaction->setCustomFields('cart_id', '1');

$response = $transaction->authorizeAndCapture();

if ($response->approved) {
  $cart_id = $response->cart_id;
  //...do stuff with $cart_id
}

 However, I get this error suggesting that "$response->cart_id" is not correct:

 

Notice: Undefined property: AuthorizeNetAIM_Response::$cart_id

 How do I retreive the custom fields from the $response object?

 

Also, in the email I receive as a merchant, only cart_id shows up (with no value) despite having defined 3 other custom fields.

 

========== MERCHANT DEFINED =========
0 : cart_id

 What am I doing wrong?


Accepted Solutions
Highlighted
Solution
Accepted by topic author js2393
‎08-21-2015 01:58 AM
Member
Posts: 8
Registered: ‎06-05-2012

Re: AIM PHP - Retrieving Custom Merchant Defined Fields

UPDATE: extremely careless mistake: I was using setCustomFields instead of setCustomField

View solution in original post


All Replies
Highlighted
Solution
Accepted by topic author js2393
‎08-21-2015 01:58 AM
Member
Posts: 8
Registered: ‎06-05-2012

Re: AIM PHP - Retrieving Custom Merchant Defined Fields

UPDATE: extremely careless mistake: I was using setCustomFields instead of setCustomField