I have been getting the same error today with PaypalGateway 2.0 and Orders 1.4.
This may be the blind leading the blind, but here is a checklist to make sure you have it configured correctly:
1. You have orders set up on a certain page with {Orders} in the content block.
2. You have a second page to receive gateway payments with {Orders}
3. In Orders preferences tab, you have set Orders to assume it is on the page in #1.
#Note - to simplify error testing, keep all of your Orders pages set to "none" except the one for Orders and the one for Invoices.
4. In Orders preferences tab, you make sure that page for Invoice display is #2, this catches your Gateway response.
5. In Orders preferences tab, at the very bottom, the PayPal PDT Gateway is selected as the gateway module.
6. Log into your PayPal account and click on the "Profile" tab, after that page loads, click "Website Payment Preferences" in the far right column. Make sure Auto Return is set to "On".
7. In the same PayPal Website Payment Prefs page make sure the "Return URL" is to the same page as #2 above. Double check the URL works by opening a browser window and pasting it to see if the page comes up. I wasted hours looking for a bug when it was a typo in the page alias! If your URL is correct a page will come up saying that you need to log in before you can do anything with your cart. If you are logged in to the front end, it will say the cart is empty. That means you hit the orders module on that URL which is correct.
8. In the same Paypal Website Payment Prefs page, make sure that Payment Data Transfer is "On". Also copy the identity token string from this field and save it for step #10.
9. Save the Paypal Website Payment Preferences page. Then click that page again to verify that all fields from #6, #7, #8 remain set correctly.
10. On your website admin, go to Extensions->Paypal PDT Gateway, in the preferences tab make sure that:
- The payment url is correct. If this is a live site the domain name should not have
www.sandbox.paypal.com it should be
www.paypal.com
11. Paste the token from step #8 into the "PDT Identity Token" field. Also make sure your business email address is in the email field.
12. Save these preferences and then return to make sure they "stuck".
Now you have double checked that all of these fields are correct and you are still getting failed transactions like I was. Here is something else you can do to get more info.
Create a user defined tag called "email_error" like this and make sure to put your email address where it says "
youremail@yourdomain.com".
Code: Select all
// UDT email_error
// Sends an error to youremail@yourdomain.com
global $gCms;
$smarty =& $gCms->GetSmarty();
if( !isset($gCms) ) exit;
$email = 'youremail@yourdomain.com';
$bodytext = $params['error'];
foreach ( $params as $key => $parm ) {
$bodytext .= $key.' = '.$parm.' = '.print_r($parm).'<br />';
}
$cmsmailer =& $gCms->modules['CMSMailer']['object'];
$cmsmailer->AddAddress($email);
$cmsmailer->SetBody($bodytext);
$cmsmailer->IsHTML(false);
$cmsmailer->SetSubject('Error From Post_Gateway_Complete');
$cmsmailer->Send();
Now in the Orders Module, go to the Payment Complete Template. If you already have a template and have set it to default then use that one. Otherwise, create a new template and after the {else} insert this line:
Code: Select all
{email_error error=$status order=$order item=$item gateway_status=$gateway_status transaction_id=$transaction_id}
Then save the template and then make that one the default template by checking it.
Now run through a test transaction again. When you come to the gateway complete page it will email the template variables to you.
When I do this the variables are empty, so it is making me think that there is a bug in PaypalGateway 2.0 on the return template. But there are so many things that could be wrong that I am not confident of it yet. So help me by testing your own setup thoroughly and posting here.
Thanks!