Forums

Paypal Listener does not redirect back to my website

enzo.orsi 13 Aug, 2015
Hello,
first of all, I would like to tell you that I love Chronoforms, as soon as I will test everything what I need, I will buy for sure the activation and the PayPal action.

I am very new with PayPal.
I need to add a PayPal payment at the end of my form and (after the payment) I need to come back to my website for other actions (e.g. TCPDF).

I tried to design as follows, really simple (following this your guide http://www.chronoengine.com/faqs/2583-how-to-use-the-paypal-redirect-action):
[attachment=0]paypal.png[/attachment]

In the custom code I added this:
<?php
$form->data['notify_url'] = 'http://www.legalexpert.it/index.php?option=com_chronoforms&chronoform=AA_PROVA_PAYPAL&event=ipn';
?>


...and in PayPal redirect I added this in extra params:
notify_url=notify_url


It works everything perfect...till payment...I pay via PayPal but after payment I get the confirmation page from PayPal (as follows) but it does not come back to my website (in order to continue with other Events...).
Can you help me? What I am doing wrong?

[attachment=1]paypal_confirmation.png[/attachment]
GreyHead 13 Aug, 2015
Hi enzo.orsi,

I suspect that the URL is missing the 5 in &option=com_chronoforms5 . . .

Bob
enzo.orsi 13 Aug, 2015

Hi enzo.orsi,

I suspect that the URL is missing the 5 in &option=com_chronoforms5 . . .

Bob


Nothing, tried to add also "5"...no way (even if in your guide there was without "5").
I changed my PayPal account to business, and I added IPN like this, even if I will need to have several forms connected to my PayPal, not just this... (I did not anything else in PayPal account...should I do something different?)

[attachment=0]paypal_business.png[/attachment]
GreyHead 13 Aug, 2015
Hi enzo.orsi,

You need the 5 for ChronoForms v5 - the FAQ was originally written for CFv4.

There are three URLs that you can use with PayPal: notify_url, return_url and cancel_url

You can set each of these in the PayPal ReDirect action>

The notify_url is used for the behind the scenes handshake confirmation with IPN

The cancel_url is used to return the user to your site if they click the Cancel link instead of paying

The return_url is used to return the user to the site after payment - not that this does not mean that payment succeeded, you need the IPN confirmation for that.

Bob
enzo.orsi 13 Aug, 2015

Hi enzo.orsi,

You need the 5 for ChronoForms v5 - the FAQ was originally written for CFv4.

There are three URLs that you can use with PayPal: notify_url, return_url and cancel_url

You can set each of these in the PayPal ReDirect action>

The notify_url is used for the behind the scenes handshake confirmation with IPN

The cancel_url is used to return the user to your site if they click the Cancel link instead of paying

The return_url is used to return the user to the site after payment - not that this does not mean that payment succeeded, you need the IPN confirmation for that.

Bob


Thank you very much Bob for your support!
Nothing changed, after payment, PayPal is not redirecting me back in the chronoforms...I tried with this:

[attachment=0]return.png[/attachment]
GreyHead 13 Aug, 2015
Hi enzo.orsi,

Please try adding the full URL there.

Bob
enzo.orsi 13 Aug, 2015
Great, it works!! Now there is a link from PayPal to come back to chronoforms.

But now, PayPal Listener is going inside "On error", even if payment has been done...

[attachment=0]listener_error.png[/attachment]

Here debug:
Array
(
    [option] => com_chronoforms5
    [chronoform] => AA_PROVA_PAYPAL
    [event] => ipn
    [mc_gross] => 0.01
    [protection_eligibility] => Ineligible
    [payer_id] => UADA4QHC2G5JY
    [tax] => 0.00
    [payment_date] => 08:49:20 Aug 13, 2015 PDT
    [payment_status] => Completed
    [charset] => windows-1252
    [first_name] => Enzo
    [mc_fee] => 0.01
    [notify_version] => 3.8
    [custom] => 
    [payer_status] => unverified
    [business] => XXXXXXXXXXXXXXXXXX
    [quantity] => 1
    [payer_email] => XXXXXXXXXXXXXXXXXX
    [verify_sign] => AiKZhEEPLJjSIccz.2M.tbyW5YFwAKNxcAeC6UwUrMCZSMQ-kSLIFeIr
    [txn_id] => 16X55141KB5934138
    [payment_type] => instant
    [payer_business_name] => Legal Expert
    [last_name] => Orsi
    [receiver_email] => enzo.orsi@legalexpert.it
    [payment_fee] => 
    [receiver_id] => TNXPDP9XE3R8W
    [txn_type] => web_accept
    [item_name] => 
    [mc_currency] => EUR
    [item_number] => 
    [residence_country] => IT
    [handling_amount] => 0.00
    [transaction_subject] => 
    [payment_gross] => 
    [shipping] => 0.00
    [auth] => AGB.No4Xl5m1Dyq-aBR0Hxz.QFCPThsETbnhFgGKxMPaqnOJ0RFB4vcIDNDQo4grQvMO6EGIxzX2xX4ReBBexhw
)
enzo.orsi 14 Aug, 2015
I am trying again, but no way...the Listener is going inside "On error" even if the payment is successful.
Someone already experienced it?
Thank you in advance...

This is the PayPal after the payment, there is a link to come back to the website...
[attachment=0]paypal_error.png[/attachment]
enzo.orsi 14 Aug, 2015
If it could help...in the debug there is:
[payer_status] => unverified

Could it be this the problem?

Thank you!!!
enzo.orsi 15 Aug, 2015
Or maybe, it is just because I have to purchase "PayPal plugin"?
Thank you!
GreyHead 16 Aug, 2015
Hi enzo.orsi,

I don't think it's because you have the trial version - as far as I know that just randomises the amount but otherwise works normally.

I have seen this before when testing with the PayPal sandbox. It seemed to work OK on a live account though.

The checks the action does are:

+ If there is no response set the Error event

+ If the 'payment_status' in the response is 'Completed' set the Verified event

+ otherwise set the Invalid event

So the data you showed should show Completed. I'm not clear how you are getting this Debugger output though as usually the PayPal Listener isn't visible in the front-end?

Bob
enzo.orsi 16 Aug, 2015
Hi Bob,
I just insterted Debug after Listener (as shown below),
I inserted a Display message inside each Listener "path" and it is continuing to enter in "On error" side...

[attachment=0]listener.png[/attachment]
GreyHead 16 Aug, 2015
Hi enzo.orsi,

I don't' understand how you have this set up. Are you using the ipn event in the Return URL as well as the notify_url? That's the only way I think that you would see that debugger output.

Bob
enzo.orsi 18 Aug, 2015
Hi Bob,
I will describe better what I did:
ON LOAD
[*]HTML render form (I added just a text box and a submit button, I left every standard settings)

ON SUBMIT
Custom code:
<?php $form->data['notify_url'] =
'http://www.mywebsite.it/index.php?option=com_chronoforms5&chronoform=AA_PROVA_PAYPAL&event=ipn'; ?>

PayPal redirect
[*]Command: _xclick
[*]Business address: I switched my normal PayPal address in a business one, I didn't change anything else (neither activate IPN because I need to add more than one payment for my account)
[*]Return URL: http://www.mywebsite.it/index.php?option=com_chronoforms5&chronoform=AA_PROVA_PAYPAL&event=ipn
[*]No shipping: No
[*]No Note: Yes
[*]Debug: No
[*]Sendbox mode: No
[*]Extra params: notify_url=notify_url
[*]All the other fields blank

ON IPN
PayPal Listener
[*]Sandbox mode: No
[*]On verified: message OK
[*]On invalid: message INVALID
[*]On error: message ERROR => I always get this my message as soon as PayPal redirect back to my website

What's wrong? I did it very basic...It is almost one week that I am continuing to try😟
GreyHead 18 Aug, 2015
Hi enzo.orsi,

The notify_url is the one that needs to go to the ipn event with the PayPal listener action.

The return_url is the one that you bring the user back to after payment.

Bob
enzo.orsi 20 Aug, 2015
Yes, but it could be the same...
I still do not understand why PayPal Listener is always going inside "ON INVALID"...
GreyHead 20 Aug, 2015
Hi enzo.orsi,

Yes it could be the same but it probably won’t work if it is.

Bob
enzo.orsi 20 Aug, 2015

Hi enzo.orsi,

Yes it could be the same but it probably won’t work if it is.

Bob



I used this for both RETURN URL and NOTIFY URL:
http://www.mywebsite.it/index.php?option=com_chronoforms5&chronoform=AA_PROVA_PAYPAL&event=ipn

If I change RETURN URL, it is not coming back anymore to the form, which notify URL should I use?

Which is the condition for which PayPal Listener should go to ON INVALID?

Thank you!
GreyHead 20 Aug, 2015
Hi enzo.orsi,

The notify_url is the one that needs to go to the ipn event with the PayPal listener action.

The return_url is the one that you bring the user back to after payment.


Bob
enzo.orsi 20 Aug, 2015
I tried changing both...

If I change return_url, it is not coming back in the right page.
If I change notify_url, the result does not change: always inside ON INVALID...

I followed step by step your guides, I am trying since one week, but always in that ON INVALID...😟
enzo.orsi 20 Aug, 2015
I added DEBUG inside ON INVALID...it seems that I don't receive anything from PayPal....even if the payment successful and I can see in my PayPal transactions...

This INVALID is making me crazy...

[attachment=0]INVALID.png[/attachment]
GreyHead 21 Aug, 2015
Hi enzo.orsi,

You lost me long ago. You can't just change settings and expect them to work.

Here's how IPN is supposed to work:

+ The user comes to your site and chooses to pay

+ You redirect them to PayPal with details of the purchase and three URLs: cancel return and notify

++ If they cancel before purchasing PayPal returns them to the cancel URL

++ If they purchase PayPal sends a message to the notify URL to confirm the transaction is valid; your IPN listener confirms the transaction to PayPal; PayPal completes the transaction and sends a confirmation back to the notify URL. None of these transactions are visible to you and adding a Debugger tells you nothing because you can't see it. Adding an Email or logging code can give you information.

++ After the purchase is complete PayPal returns the user to your site using the Return URL.

Bob
enzo.orsi 21 Aug, 2015
Thank you Bob for your support, I really appreciate!

This morning, I woke up and...I didn't change anything, I just tried...and it is working...now Listener is going inside ON VERIFIED.
I am really scared about this behavior...I wrote PayPal support, I could imagine it is a problem in the account...

Now I have another issue: I added this custom before PayPal Redirect:
$form->data["custom"] = $form->data["id"];
$form->data["FORM_NAME"] = $form->data["FORM_NAME"];

(where FORM_NAME is coming properly from a previous DB Read)
...and I added these extra params in PayPal Redirect:
custom=custom
item_name=FORM_NAME

But in debug after payment, only custom is working, I don't get anything from item_name.

Do you see something wrong?
GreyHead 21 Aug, 2015
Hi enzo.orsi,

This line does nothing - both sides are the same: should one be different?

$form->data["FORM_NAME"] = $form->data["FORM_NAME"];

Bob
enzo.orsi 21 Aug, 2015

Hi enzo.orsi,

This line does nothing - both sides are the same: should one be different?


$form->data["FORM_NAME"] = $form->data["FORM_NAME"];

Bob



FORM_NAME is coming from DB read, in any case if I write item_name=FORM_NAME in extra params in PayPal Redirect, after payment there is nothing in item_name...
This topic is locked and no more replies can be posted.