Forum Replies Created
-
AuthorPosts
-
thpwebteamMember
Brilliant! I’m not even sure how I missed something like that! Thank you so much!
thpwebteamMemberAlso, note that if I use the GET request it works. So something like this works:
http://www.webdev4.com/wp-content/plugins/wp-pdf-stamper/api/stamp_api.php?secret_key=4ca4929b783ec5.XXXXXXXX&source_file=http://www.webdev4.com/wp-content/uploads/fw4.pdf&customer_name=jon doe&customer_email=jon.doe@gmail.com&customer_address=123 Some Street, San Jose, CA – 95130, U.S.A
Post is failing, no PDF is being stamped and I’m not getting any errors.
thpwebteamMemberThe URL that I used is from the Integration Menu. See screenshot:
http://www.tyndale.com/external_parties/pics/tipsandtricks_techsupport/integration_help.jpg
I also checked that file on the web-server and it is correct.
If you try to type in the URL you will get a 404. The domain is setup internally on our development web server.
thpwebteamMemberI basically took the code below, put it in a php file, placed the file in the root, and ran it from the browser.
<?
/*** Mandatory data ***/
// Post URL (Get this value from the Integration Help menu of this plugin)
$postURL = "http://www.webdev4.com/wp-content/plugins/wp-pdf-stamp/api/stamp_api.php";
// The Secret key (Get this value from the settings menu of this plugin)
$secretKey = "4ca4929b783ec5.15678014"; //not actual for security purposes
//The source file URL (The file that you want to stamp)
$fileURL = "http://www.webdev4.com/wp-content/uploads/fw4.pdf";
/*** Optional Data ***/
//Customers Name
$customerName = "John Doe";
//Customer Email address
$customerEmail = "john.doe@gmail.com";
//Customer's Address
$customerAddress = "123 Some Street, San Jose, CA - 95130, U.S.A.";
// prepare the data
$data = array ();
$data['secret_key'] = $secretKey;
$data['source_file'] = $fileURL;
$data['customer_name'] = $customerName;
$data['customer_email'] = $customerEmail;
$data['customer_address'] = $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)
{
$file_url = trim($value);
echo "The URL of the stamped file is: ".$file_url;
}
else
{
echo "An error occured while trying to stamp the file! Error details: ".$value;
}
?> -
AuthorPosts