Jump to content
X2Community Forums

Issue when capturing leads using leadCapture.php, lead not captured. (SOLVED)

Recommended Posts

in leadCapture.php line #61 
the comparison is between the response (supposed to be a string) and a string (the message), but in this new version of X2Engine the response generated in line #59 returns a JSON object.  So the comparison always will fail.

Original code (will fail everytime because ccResult is a JSON object, not a string):
$ccResult = curl_exec($ccSession);
if($ccResult!="No Item found with specified attributes."){
SOLUTION (adding the two lines marked as "FIX"):
$ccResult = curl_exec($ccSession);
$tmp = json_decode($ccResult);  // FIX
$ccResult = $tmp["message"];    // FIX
if($ccResult!="No Item found with specified attributes."){
it solve the issue.
Link to post
Share on other sites
  • 2 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...