Trying to safely capture error message response from PayPal
Ray,
On rare occasions, customers will say they get an error but we don’t know what that error is. My guess is it’s a declined card or incorrect city or state combination since dozens of orders go through successfully then one will fail.
When debugging a failed checkout, I use the code below. I think I got this from one of your posts a while back.
@session_start();
echo "<p>Direct Pay: <br>";
echo "Full Request: ".(isset($_SESSION["PP_DirectPayment_postedValues"])?htmlentities($_SESSION["PP_DirectPayment_postedValues"]):"n/a")."<br>";
echo "Full Response: ".(isset($_SESSION["PP_DirectPayment"])?htmlentities($_SESSION["PP_DirectPayment"]):"n/a")."<br></p>";
echo "<p>Express Authorize <br>";
echo "Full Request: ".(isset($_SESSION["ECO_Auth_Request"])?htmlentities($_SESSION["ECO_Auth_Request"]):"n/a")."<br>";
echo "Full Response: ".(isset($_SESSION["ECO_Auth_Result"])?htmlentities($_SESSION["ECO_Auth_Result"]):"n/a")."<br>";
echo "<p>Express Process: <br>";
echo "Full Request: ".(isset($_SESSION["ECO_Process_Request"])?htmlentities($_SESSION["ECO_Process_Request"]):"n/a")."<br>";
echo "Full Response: ".(isset($_SESSION["ECO_Process_Result"])?htmlentities($_SESSION["ECO_Process_Result"]):"n/a")."<br></p>";
Since I can’t leave that code exposed all of the time, I was wondering if I can simply add it to an email behavior that is triggered on the checkout_failure page so that it is safely emailed to me in the event that someone has an issue. You mentioned this briefly here, http://www.webassist.com/forums/post/195860/ but I am not sure how to do this.
Would it be as simple as adding to the email template? Do I need to include any other files to the failure page or email template since the above code already works on the failure page?
Thanks,
TroyD