Below userFields are printed in XML response. But I want to read and store userFields variables into other variables for website internal use purpose as they contain some useful info. So how can I do it? Please let me know.
<userFields>
<userField>
<name>Name001</name>
<value>Value001</value>
</userField>
<userField>
<name>Name002</name>
<value>Value002</value>
</userField>
</userFields>
Thank you,
09-13-2016 05:13 AM
Hello @kra091978
User fields are returned in the API Response where you can read and act on them as you wish. They are not stored as part of the transaction.
Richard
09-13-2016 02:03 PM
We received 'userFields' in XML response but we can't store it in other variables for further manipulation and database storage purpose.
This userFields variables' values are displayed when we print $xml variable...
For e.g.
When I try to get value of <resultCode></resultCode> from response XML then I can get this value... For this i wrote: <?php echo ($xml->messages->resultCode); ?>
But when I try to get the value of 'userFields' then I can't get the value...
For this i write: <?php echo ($xml->userFields->userField->value); ?>
but I can't read this value with this...
Below code is used to pass userFields in XML request.
'userFields' => array(
'userField' => array(
0 => array(
'name' => 'itm_id',
'value' => $itm_id,
),
1 => array(
'name' => 'unq_id',
'value' => $unq_id,
),
),
),
09-13-2016 09:23 PM - edited 09-13-2016 09:36 PM