Forums

PayPal Listener triggers "Error" event on confirmed transactions

sydeley 03 Apr, 2016
Hi all,

I am testing the PayPal Listener and for all the successful transactions it triggers the "error" event. The Listener is set in the "Sandbox" mode, I test it using the IPN Simulator (https://developer.paypal.com/developer/ipnSimulator/)

Here is the output I have in the beginning of the "ipn" event before the PayPal Listener:
$form->data: Array (
  [chronoform] => Registration
  [event] => ipn
  [payment_type] => instant
  [payment_date] => Sun Apr 03 2016 20:09:49 GMT+0200 (W. Europe Daylight Time)
  [payment_status] => Completed
  [address_status] => confirmed
  [payer_status] => verified
  [first_name] => John
  [last_name] => Smith
  [payer_email] => buyer @[at] paypalsandbox [dot] com
  [payer_id] => TESTBUYERID01
  [address_name] => John Smith
  [address_country] => United States
  [address_country_code] => US
  [address_zip] => 95131
  [address_state] => CA
  [address_city] => San Jose
  [address_street] => 123 any street
  [business] => seller @[at] paypalsandbox [dot] com
  [receiver_email] => seller @[at] paypalsandbox [dot] com
  [receiver_id] => seller @[at] paypalsandbox [dot] com
  [residence_country] => US
  [item_name] => something
  [item_number] => AK-1234
  [quantity] => 1
  [shipping] => 3.04
  [tax] => 2.02
  [mc_currency] => USD
  [mc_fee] => 0.44
  [mc_gross] => 12.34
  [mc_gross_1] => 12.34
  [txn_type] => web_accept
  [txn_id] => 779886428
  [notify_version] => 2.1
  [custom] => xyz123
  [invoice] => abc1234
  [test_ipn] => 1
  [verify_sign] => AFcWxV21C7fd0v3bYYYRCpSSRl31AuLDnmKNcTR315KgOhyfMA5-WOxX
  [Registration] =>
)
Any ideas? Is it possible to debug the Listener anyhow?

Thank you in advance!

Slava
GreyHead 04 Apr, 2016
Hi Slava,

How do you have this set up? You usually can't see the IPN-created output from the Listener.

The 'Error' event is triggered when the cURL call to PayPal returns no result. (See the code around line 70 of /administrator/components/com_chronoforms5/chronoforms/actions/paypal_listener/paypal_listener.php

The most obvious explanations would be (a) that CURL is not enabled, which is unlikely; or (b)there is something wrong with the PayPal URL.They have recently changed the SandBox setup to require HTTPS connections ahead of a change to the live site later this year. That might be the problem here.

Because the Listener hand-shakes are not 'visible' actions you can't use the Debugger. What you can do is to add debug data to the code or the events that adds values to the $form->data[''] array, then use Email actions to send you those values.

Bob
sydeley 04 Apr, 2016
Hi Bob,

Thanks for your quick reply!

I receive this output by e-mail in the beginning of the ipn event, using this code:
<?php
echo'<div>$_POST: '.print_r($_POST, true).'</div>';
?>


I understand that the listener is working on the background.

What you can do is to add debug data to the code

- by this you mean to add debug data to /administrator/components/com_chronoforms5/chronoforms/actions/paypal_listener/paypal_listener.php ?

If I don't have access to this file (I have currently access to Joomla environment only), is there any other way to debug the listener using the chronoforms environment?

Cheers,
Slava
GreyHead 05 Apr, 2016
Hi Slava,

You can use custom code actions in the form event to add PHP to test. ChronoForms keeps the form data in the $form->data array so anything you save to that array can be shown in the email with
<?php
echo'<div>$form->data: '.print_r($form->data, true).'</div>';
?>

Bob
This topic is locked and no more replies can be posted.