Tips and Tricks HQ Support

Support site for Tips and Tricks HQ premium products

  • Home
  • Contact Us
  • Documentation
  • Forum Home
    • Forum
    • Forum Search
    • Forum Login
    • Forum Registration

Null Value on return from CURL Post

by

Tips and Tricks HQ Support Portal › Forums › WP PDF Stamper › Null Value on return from CURL Post

Tagged: purchased

  • This topic has 4 replies, 3 voices, and was last updated 11 years, 9 months ago by amin007.
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • June 17, 2011 at 5:01 pm #3614
    djmosoul
    Member

    I used this code here: http://www.tipsandtricks-hq.com/wp-pdf-stamper/wp-content/uploads/2010/06/pdf-stamper-integration-sample-php-code1.txt

    I have 3 PDF downloads that I wished to use with this plugin, and 2 out of the 3 are working perfectly.

    The one that isn’t working perfectly is being created in the directory with the proper stamp on the PDF, but the CURL POST to create the PDF is returning a blank value.

    The PDF in question is: http://breakingintowallstreet.com/biws/pdf_files/IBD-Questions-Answers.pdf

    Here is a link to the stamped PDF: http://breakingintowallstreet.com/biws/wp-content/plugins/wp-pdf-stamper/stamped-files/IBD-Questions-Answers_4dfa59769f6e7.pdf

    I could probably troubleshoot this myself, but the plugin code is encoded.

    Thanks for your help.

    Also, here is the function that is returning a blank value for the variable $returnValue:

    if(!function_exists(‘anatta_hotlinker_stamp_pdf’)):

    function anatta_hotlinker_stamp_pdf($fileURL=null){

    global $current_user;

    if(is_null($fileURL))

    return false;

    /*** Mandatory data ***/

    // Post URL (Get this value from the Integration Help menu of this plugin)

    $postURL = get_bloginfo(‘url’).”/wp-content/plugins/wp-pdf-stamper/api/stamp_api.php”;

    // The Secret key (Get this value from the settings menu of this plugin)

    $secretKey = “fwoieVNDSVONweoifjwo”;

    /*** Optional Data ***/

    //Customers Name

    $customerName = $current_user->first_name.” “.$current_user->last_name;

    //Customer Email address

    $customerEmail = $current_user->user_email;

    //Customer’s Address

    $customerAddress = $current_user->address1.”, “.$current_user->city.”, “.$current_user->state.” – “.$current_user->zip;

    // prepare the data

    $data = array ();

    $data = $secretKey;

    $data = $fileURL;

    $data = $customerName;

    $data = $customerEmail;

    $data = $customerAddress;

    // send data to post URL

    $ch = curl_init ($postURL);

    curl_setopt ($ch, CURLOPT_POST, true);

    curl_setopt ($ch, CURLOPT_POSTFIELDS, $data);

    curl_setopt ($ch, CURLOPT_RETURNTRANSFER, true);

    $returnValue = curl_exec ($ch);

    // Process the return values

    list ($status, $value) = explode (“n”, $returnValue);

    if(strpos($status,”Success!”) !== false){

    return trim($value);

    }

    return false;

    }

    endif;

    June 18, 2011 at 1:00 am #33519
    amin007
    Participant

    Did you try doing a manual stamping with this PDF File?

    http://breakingintowallstreet.com/biws/pdf_files/IBD-Questions-Answers.pdf

    If you haven’t please do that and let me know how the manual stamping goes.

    June 20, 2011 at 7:07 pm #33520
    djmosoul
    Member

    Maybe I don’t understand what a manual stamp is, but I am calling the API file, so I would imagine what I described above is a manual stamp.

    The CURL post, which I believe is a manual stamp, is returning a blank value.

    June 21, 2011 at 12:19 am #33521
    wpCommerce
    Moderator

    http://www.tipsandtricks-hq.com/wp-pdf-stamper/how-to-manually-stamp-a-pdf-file-63

    June 21, 2011 at 12:27 am #33522
    amin007
    Participant

    In your case you were able to successfully stamp a file using the code above which gives me indication that the code is fine. The problem could be with the PDF file itself. The manual stamping has more error condition checking so it might reveal the actual problem with the PDF file (for example: if the PDF file is locked then it won’t be able to stamp it).

  • Author
    Posts
Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.
Log In

Forum Related

  • Forum Home
  • Forum Search
  • Forum Login

Support Related Forms

  • Contact Us
  • Customer Support
  • Request a Plugin Update
  • Request Fresh Download Links

Useful Links

  • Plugin Upgrade Instructions
  • WP eStore Documentation
  • WP eMember Documentation
  • WP Affiliate Platform Documentation
  • WP PDF Stamper Documentation
  • WP Photo Seller Documentation
  • Tips and Tricks HQ Home Page
  • Our Projects

Quick Setup Video Tutorials

  • WP eStore Video Tutorial
  • WP eMember Video Tutorial
  • WP Affiliate Platform Video Tutorial
  • Lightbox Ultimate Video Tutorial
  • WP Photo Seller Video Tutorial

Our Other Plugins

  • WP Express Checkout
  • Stripe Payments Plugin
  • Simple Download Monitor

Copyright © 2023 | Tips and Tricks HQ