Forums

IPN PayPal does not work from mobile device

enzo.orsi 15 Jan, 2016
Hi,
my IPN PayPal works perfectly since 6 months...from PC.
But if I try from mobile device, it does not work...it never worked.
Did you already experienced something similar?

The payment is working perfectly, but when is redirected to my website to IPN Listener, it is going inside ON INVALID.

Here below, the screenshot from my mobile (both Blackberry and iPhone).
enzo.orsi 15 Jan, 2016
Sorry, this is the debug inside PayPal Listener ON INVALID
GreyHead 15 Jan, 2016
Hi enzo.orsi,

I'm not sure that I understand what the problem is. The IPN Listener action runs in a form event that does nothing in the browser so you never see it on your device. It only runs on your web server.

Bob
enzo.orsi 15 Jan, 2016
I guessed...but I never understood why it is working from PC and not from mobile...
Do you have any idea how to test IPN Listener? (a part from debug...that is not telling anything useful in this case)
GreyHead 15 Jan, 2016
Hi enzo.orsi,

The simplest way is to add email actions where you want to test, set to subject to identify the location e.g. 'Test PayPal IPN - on fail'; then add this code in the template:
<?php
echo'<div>$form->data: '.print_r($form->data, true).'</div>';
?>

Bob
enzo.orsi 18 Jan, 2016
Thanks Bob for your feedback.
I tried to add email action with that code, but I am not receiving anything useful:

$form->data: Array ( [option] => com_chronoforms5 [chronoform] => AAAPDF_Pagamento_e_generazione_contratti [event] => ipn )


In any case, I tried to create a single PayPal Redirect and a PayPal Listener and...it is working perfectly from computer, but from mobile is not working...and it is all the time going inside Invalid in IPN Listener...

Have you ever tried IPN Listener from mobile browser?

Thank you!
GreyHead 18 Jan, 2016
Hi enzo.orsi,

As I said before the IPN Listener runs on the server, it is not in the browser so the browser makes no difference.

It may be that your form is not sending the correct details from the mobile browser - that's a different question. Have you tried checking that?

Bob
enzo.orsi 18 Jan, 2016
I tried to enable debut inside PayPal redirect and PayPal link is exactly the same both from computer and from mobile:

https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&business=paypal%40legalesemplice.it&no_shipping=1&no_note=1&return=http%3A%2F%2Fwww.legalesemplice.it%2Findex.php%3Foption%3Dcom_chronoforms5%26chronoform%3DAAAPDF_Pagamento_e_generazione_contratti%26event%3Dipn¤cy_code=EUR&item_name=Contratto+di+locazione+ad+uso+abitativo+con+canone+concordato&amount=0.01&custom=180¬ify_url=http%3A%2F%2Fwww.legalesemplice.it%2Findex.php%3Foption%3Dcom_chronoforms5%26chronoform%3DAAAPDF_Pagamento_e_generazione_contratti%26event%3Dipn&cancel_url=http%3A%2F%2Fwww.legalesemplice.it%2Findex.php%3Foption%3Dcom_chronoforms5%26chronoform%3DAAAPDF_Pagamento_e_generazione_contratti&item_number=2&
enzo.orsi 20 Jan, 2016
I discovered something different.

PayPal Redirect works perfectly both from PC and from mobile (debug is the same as from my previous post).
From PayPal to CF PayPal Listener there is something not working when I am from mobile. Indeed:

- from mobile debug (after payment) contains only information about return URL:

Array
(
    [option] => com_chronoforms5
    [chronoform] => AAAPDF_Pagamento_e_generazione_contratti
    [event] => ipn
)


- from PC, debug (after payment) contains all the information that we need:

Array
(
    [option] => com_chronoforms5
    [chronoform] => AAAPDF_Pagamento_e_generazione_contratti
    [event] => ipn
    [mc_gross] => 0.01
    [protection_eligibility] => Ineligible
    [payer_id] => UADA4QHC2G5JY
    [tax] => 0.00
    [payment_date] => 10:31:38 Jan 20, 2016 PST
    [payment_status] => Completed
    [charset] => windows-1252
    [first_name] => Enzo
    [mc_fee] => 0.01
    [notify_version] => 3.8
    [custom] => 180
    [payer_status] => unverified
    [business] => paypal@legalesemplice.it
    [quantity] => 1
    [payer_email] => enzo.orsi@gmail.com
    [verify_sign] => AFcWxV21C7fd0v3bYYYRCpSSRl31A9q6xtJexr1sqyDDs-5uG3nHEdy.
    [txn_id] => 91C054472C1974101
    [payment_type] => instant
    [payer_business_name] => Enzo Orsi
    [last_name] => Orsi
    [receiver_email] => paypal@legalesemplice.it
    [payment_fee] => 
    [receiver_id] => KXQDXQ3K4MN2A
    [txn_type] => web_accept
    [item_name] => Contratto di locazione ad uso abitativo con canone concordato
    [mc_currency] => EUR
    [item_number] => 2
    [residence_country] => IT
    [handling_amount] => 0.00
    [transaction_subject] => 180
    [payment_gross] => 
    [shipping] => 0.00
    [merchant_return_link] => clicca qui
    [auth] => Aeq2L7yUqq9aC-M-zQWsalX3oUe9u51S8DPNdwdUIYJO526V0ZozEkI9fPr2CyBZcVnF7.VdMMiSyqf6xzojR7Q
)
enzo.orsi 21 Jan, 2016
After long discussion with PayPal support, they told it is a problem of CF and not of PayPal😟
Any idea why from mobile I do not receive all the parameters, while from pc yes?
enzo.orsi 21 Jan, 2016
Another test...unsuccessful...
I tried from PC but simulating Iphone device from Chrome and same results: I do not receive any parameters in Paypal Listener
enzo.orsi 21 Jan, 2016
If someone would like to try, I prepared a really really simple form with only PayPal redirect and PayPal Listener.
You can find also in this link:

http://www.xxxxxxxxxxxxxxxxxx...it/index.php?demo=1&option=com_chronoforms5&chronoform=AAA_TEST_PAYPAL

Not working from mobile...nothing...no parameter after payments...always in Invalid Listener...
enzo.orsi 26 Jan, 2016
Hello,
PayPal support wrote several times that is not its problem since CF should get the parameters even from mobile process.

Can anyone try a test transaction from this link from mobile and from desktop?

http://www.legalesemplice.it/index.php?demo=1&option=com_chronoforms5&chronoform=AAA_TEST_PAYPAL

You can find the form in the attachment too.

Thank you so much!
GreyHead 26 Jan, 2016
Hi enzo.orsi,

As I've said several times the IPN Listener runs on the server, not in the browser and so not on the mobile device. And because it is doing a hand-shake with PayPal the output is not visible unless you send it in an email, or save it to a database table or a log file.

In normal use there is no way to see debugger output in the way you have it set up.

Bob
enzo.orsi 26 Jan, 2016
Thank you Bob.
But...just tell me...have you ever experienced any problems with PayPal IPN Listener from mobile?
GreyHead 26 Jan, 2016
Hi enzo.orsi,

No, and I've seen no other reports of problems either.

How are you seeing the Debugger data?

Bob
enzo.orsi 26 Jan, 2016
Hi Bob,
thanks for your reply.

This is the debug from mobile (almost empty...)
Array
(
    [option] => com_chronoforms5
    [chronoform] => AAAPDF_Pagamento_e_generazione_contratti
    [event] => ipn
)


And this is the (correct) debug from desktop
Array
(
    [option] => com_chronoforms5
    [chronoform] => AAAPDF_Pagamento_e_generazione_contratti
    [event] => ipn
    [mc_gross] => 0.01
    [protection_eligibility] => Ineligible
    [payer_id] => UADA4QHC2G5JY
    [tax] => 0.00
    [payment_date] => 10:31:38 Jan 20, 2016 PST
    [payment_status] => Completed
    [charset] => windows-1252
    [first_name] => Enzo
    [mc_fee] => 0.01
    [notify_version] => 3.8
    [custom] => 180
    [payer_status] => unverified
    [business] => paypal @[at] legalesemplice [dot] it
    [quantity] => 1
    [payer_email] => enzo.orsi @[at] gmail [dot] com
    [verify_sign] => AFcWxV21C7fd0v3bYYYRCpSSRl31A9q6xtJexr1sqyDDs-5uG3nHEdy.
    [txn_id] => 91C054472C1974101
    [payment_type] => instant
    [payer_business_name] => Enzo Orsi
    [last_name] => Orsi
    [receiver_email] => paypal @[at] legalesemplice [dot] it
    [payment_fee] => 
    [receiver_id] => KXQDXQ3K4MN2A
    [txn_type] => web_accept
    [item_name] => Contratto di locazione ad uso abitativo con canone concordato
    [mc_currency] => EUR
    [item_number] => 2
    [residence_country] => IT
    [handling_amount] => 0.00
    [transaction_subject] => 180
    [payment_gross] => 
    [shipping] => 0.00
    [merchant_return_link] => clicca qui
    [auth] => Aeq2L7yUqq9aC-M-zQWsalX3oUe9u51S8DPNdwdUIYJO526V0ZozEkI9fPr2CyBZcVnF7.VdMMiSyqf6xzojR7Q
)


You can try this link both from mobile and from desktop:
http://www.legalesemplice.it/index.php?demo=1&option=com_chronoforms5&chronoform=AAA_TEST_PAYPAL
enzo.orsi 27 Jan, 2016
Hi Bob,
I am sorry...do you have an example of IPN Listener? I would like to try it from mobile...
enzo.orsi 27 Jan, 2016
I discovered one more thing: in case I am paying via mobile, PayPal Listener is going both in VALID and in INVALID side.
I added an email debug both in VALID and in INVALID inside PayPal Listener and I am receiving two mail!!
One email with the right parameters (from VALID) and one email with no parameters (from INVALID).
It seems to be a bug...
GreyHead 01 Feb, 2016
Hi enzo.orsi,

I think that this is all working correctly. I downloaded your form backup and found a few bugs which might explain some of the problems.

In the Custom Code you are setting the PayPal ReDirect return URL to chronoform=AAA_TEST_PAYPAL&event=ipn - you want that to be chronoform=AAA_TEST_PAYPAL&event=submit - you never want to return the User to the ipn event - that is only for use in the hand-shake exchanges with PayPal. (I think that you also had the cancel URL set to the ipn event).

If you have PayPal set to return to the ipn event then there will be no form data as PayPal doesn't send any additional transaction info on return (though you can look it up if needed).

I added an extra email in the IPN event after the listener and that gives me results like this when I test from my iPad - though on the screen I see only the short list (see above).
$form->data: Array (
  [demo] => 1
  [option] => com_chronoforms5
  [chronoform] => AAA_TEST_PAYPAL
  [event] => ipn
  [transaction_subject] => Test PayPal mobile
  [payment_date] => 05:35:53 Feb 01, 2016 PST
  [txn_type] => web_accept
  [last_name] => Janes
  [residence_country] => GB
  [pending_reason] => unilateral
  [item_name] => Test PayPal mobile
  [payment_gross] =>
  [mc_currency] => EUR
  [payment_type] => instant
  [protection_eligibility] => Ineligible
  [verify_sign] => AlAlnsACWRTf4OV6vRMZG4sCyEdYAYnrRnfP4BPbL7fImje1mijNluYp
  [payer_status] => unverified
  [test_ipn] => 1
  [tax] => 0.00
  [payer_email] => pptest@some_domain.com
  [txn_id] => 54E35674N80126333
  [quantity] => 1
  [receiver_email] => paypal@some_domain.it
  [first_name] => Bob
  [payer_id] => QQCBLC3XJ2U8L
  [item_number] =>
  [payer_business_name] => RandJ test Ltd
  [handling_amount] => 0.00
  [payment_status] => Pending
  [shipping] => 0.00
  [mc_gross] => 0.04
  [custom] =>
  [charset] => windows-1252
  [notify_version] => 3.8
  [ipn_track_id] => ac4d88c4e1bb3
)
So all the information is there as expected,

The reason for checking after the Listener is that the Listener events don't seem to be correctly triggered when you are using a PayPal Sandbox account.

Bob
enzo.orsi 01 Feb, 2016
Thank you Bob!
I know that debug is showing all the information AFTER the PayPal Listener.
The problem is that what I want (that should be something normal...):
IF valid payment => do something
IF invalid/error payment => return error message

And, if I am testing from mobile, it is not doing anything inside VALID, but only inside INVALID.
Of course, afterwards, it is executing what there is after PayPal Listener...

Can you try to let it do something inside VALID and something in INVALID? For me it is doing both events...
GreyHead 01 Feb, 2016
Hi enzo.orsi,

I know that debug is showing all the information AFTER the PayPal Listener.Maybe - but that certainly wasn't what I understood from your posts.

I have done a little bit of digging using the PayPal Sandbox and have found a problem which may or may not be the same (as far as I can see it is the same for both mobile and fixed browsers and still haven't found a problem that is mobile specific).

The PayPal Listener action checks (a) to see if there is a response from PayPal - if that is empty it triggers the 'Error' event; (b) it them looks for the string 'VERIFIED' in the result if that is found it triggers the 'Verified' event, if not it triggers the 'Invalid' event.

I added some debugger code that shows me that I am getting errors back from PayPal - so presumably the 'Error' event is being triggered. The Error message is like this:
[curl_err] => "error:14077410:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure"


Googling I found this StackOverFlow answer that suggests this problem is from security updates that PayPal is currently implementing. There is a link from that page to the relevant PayPal docs - from a quick read I don't really understand exactly what needs to be done. But note that these changes aren't yet on the PayPal live site - just the Sandbox one.

It looks as though the Listener needs to be upgraded for this. When I have some time I'll try to dig deeper.

Bob
enzo.orsi 01 Feb, 2016
Thank you Bob.
I am not using Sandbox.

Can I please just ask if you can try this link from desktop and from mobile?

http://www.legalesemplice.it/index.php?demo=1&option=com_chronoforms5&chronoform=AAA_TEST_PAYPAL

Only this last test...please. I want to let you see that there is something wrong.

PS: we are absolutely available to pay anyone will help to fix this bug.
GreyHead 02 Feb, 2016
Hi enzo-orsi,

Have you fixed the problems with the return URLs? There is no point my testing a form that is not properly set up.

Bob
enzo.orsi 02 Feb, 2016
Hi Bob,
I am sorry but maybe I am not sure about the purpuse of RETURN URL.
I have everything inside PayPal Listener:
- in case payment was ok, I am doing everything inside VALID from PayPal Listener.
- if payment was not ok, I am managing an error message inside INVALID or ERROR from PayPal Listener.
enzo.orsi 02 Feb, 2016
Ok, sorry Bob.
I understood now...

I changed the RETURN URL, but it does not impact on my problem.

Can I please just ask if you can try this link from mobile and from desktop?
http://www.legalesemplice.it/index.php?demo=1&option=com_chronoforms5&chronoform=AAA_TEST_PAYPAL
enzo.orsi 02 Feb, 2016
Hi Bob,
it is for sure a bug: I tried with defaul sample form that you can find inside standard CF "demo-paypal-redirect" and...the same problem in case of mobile payment!!!

Can someone try it to confirm that is a bug?

Thank you!!!
enzo.orsi 17 Feb, 2016

Hi enzo.orsi,

I think that this is all working correctly. I downloaded your form backup and found a few bugs which might explain some of the problems.

In the Custom Code you are setting the PayPal ReDirect return URL to chronoform=AAA_TEST_PAYPAL&event=ipn - you want that to be chronoform=AAA_TEST_PAYPAL&event=submit - you never want to return the User to the ipn event - that is only for use in the hand-shake exchanges with PayPal. (I think that you also had the cancel URL set to the ipn event).

If you have PayPal set to return to the ipn event then there will be no form data as PayPal doesn't send any additional transaction info on return (though you can look it up if needed).

I added an extra email in the IPN event after the listener and that gives me results like this when I test from my iPad - though on the screen I see only the short list (see above).

$form->data: Array (
  [demo] => 1
  [option] => com_chronoforms5
  [chronoform] => AAA_TEST_PAYPAL
  [event] => ipn
  [transaction_subject] => Test PayPal mobile
  [payment_date] => 05:35:53 Feb 01, 2016 PST
  [txn_type] => web_accept
  [last_name] => Janes
  [residence_country] => GB
  [pending_reason] => unilateral
  [item_name] => Test PayPal mobile
  [payment_gross] =>
  [mc_currency] => EUR
  [payment_type] => instant
  [protection_eligibility] => Ineligible
  [verify_sign] => AlAlnsACWRTf4OV6vRMZG4sCyEdYAYnrRnfP4BPbL7fImje1mijNluYp
  [payer_status] => unverified
  [test_ipn] => 1
  [tax] => 0.00
  [payer_email] => pptest@some_domain.com
  [txn_id] => 54E35674N80126333
  [quantity] => 1
  [receiver_email] => paypal@some_domain.it
  [first_name] => Bob
  [payer_id] => QQCBLC3XJ2U8L
  [item_number] =>
  [payer_business_name] => RandJ test Ltd
  [handling_amount] => 0.00
  [payment_status] => Pending
  [shipping] => 0.00
  [mc_gross] => 0.04
  [custom] =>
  [charset] => windows-1252
  [notify_version] => 3.8
  [ipn_track_id] => ac4d88c4e1bb3
)
So all the information is there as expected,

The reason for checking after the Listener is that the Listener events don't seem to be correctly triggered when you are using a PayPal Sandbox account.

Bob




Dear Bob,
I do not understand why I do not have to use IPN URL equal to RETURN URL.

If I setup:
- ipn notify url to ipn event (PayPal Listener)
- return url to a confirmation page (where for example I write in my db that user paied succesfully)
=> how can I check if user succesfully paied or if it is just going to that url without paying?

That's why I am using PayPal Listener and I write in my db only inside PayPal Listener VALID.

What's the problem to use return_url = notify_url?

Thank you!!
GreyHead 18 Feb, 2016
1 Likes
Hi enzo.orsi,

There are three URLs that PayPal uses:

The Cancel URL is the one used when the User goes to PayPal but cancels before paying. This is used to return the User to your site and let you know that they have cancelled.

The Return URL is the one used when the User goes to PayPal, pays, then clicks 'Return to Merchant' (or something similar). This is used to return the User to your site after they have paid (though they may not click it).

The Notify URL is only used behind the scenes with the more advanced PayPal payments. PayPal calls this URL with the transaction information to check that the transaction is valid; later it calls the URL again with the payment status - sometimes this happens several times if the payment confirmation is delayed . Normally this URL is only used for these transactions.

Bob
enzo.orsi 18 Feb, 2016
Aaaaah! That's why I am receiving more confirmation from Listener.

But...how can I check if user is going to return url by himself (because he can know the address) or if the user really paid and he has been redirected to that url?
GreyHead 18 Feb, 2016
HI enzo.orsi,

If you have IPN enabled then PayPal will have confirmed the payment (or not) to the PayPal Listener action. In the IPN event you update your database table to show the payment status. Then when the user comes back to the Return URL page you check the record to see if they have paid (or not).

Bo
enzo.orsi 18 Feb, 2016

HI enzo.orsi,

If you have IPN enabled then PayPal will have confirmed the payment (or not) to the PayPal Listener action. In the IPN event you update your database table to show the payment status. Then when the user comes back to the Return URL page you check the record to see if they have paid (or not).

Bo



You mean to update db with payment status inside PayPal Listener or after PayPal Listener (inside IPN event)?
GreyHead 19 Feb, 2016
Hi enzo.orsi,

I would probably do it "after PayPal Listener (inside IPN event)" because I want to record the status whether it is success or pending or . . .

Bob
enzo.orsi 19 Feb, 2016
Thank you Bob, I will think about it.
I am still afraid to use Return URL outside from IPN Listener on Valid...because I have so many events to do that from security point of view an user could do going directly to Return URL (passing in url some variables) without going in PayPal...

In any case, coming back to first topic of this post.
I received an answer from PayPal and they told there is no bugs from their point of view:
- GET method for the response when the purchase is made from a mobile device
- POST method for the response when the purchase is made from a desktop
POST method is used only for devices that can manage communication between webserver. And mobile devices are not able to do it.

How is it possible to manage in IPN Listener in CF the GET method for mobile?
At the end it is a bug in CF...
GreyHead 19 Feb, 2016
Hi enzo.orsi,

Thanks for that - but it makes no sense. The IPN Listener is never used on the mobile device, only on the server so using POST or cURL is fine and there no bug that I can see.

Bob
enzo.orsi 19 Feb, 2016

Hi enzo.orsi,

Thanks for that - but it makes no sense. The IPN Listener is never used on the mobile device, only on the server so using POST or cURL is fine and there no bug that I can see.

Bob



Max provided me this link:
http://www.jotform.com/answers/768594-How-Do-I-Receive-IPN-from-Mobile-Website

I wrote PayPal with these details and they told that is normal that POST method is used only from desktop.
In any case, it seems only this the difference between payment from mobile and from desktop.

By the way, have you ever tried this link from mobile?

http://www.legalesemplice.it/index.php?demo=1&option=com_chronoforms5&chronoform=AAA_TEST_PAYPAL
GreyHead 19 Feb, 2016
Hi enzo.orsi,

Please think through the process carefully.

And yes, I have tested your form from a mobile - but as you have it set up incorrectly* that tells me nothing useful.

Bob

*or you had at that time
enzo.orsi 19 Feb, 2016
Thanks Bob; I changed return url different by notify url, but nothing changed😟
enzo.orsi 01 Mar, 2016
Hi Bob,
I am sorry, but I still have a doubt how to use IPN event: how can I check if the payment was successful or not?

I mean:
- IPN events => after PayPal Listener I will write the status of the payments, but based on which variable? And how can I avoid that user will put this variable as a GET variable? (e.g. www.mylink.com/myform?event=ipn&<b>payment=success</b> )

Thank you!
GreyHead 01 Mar, 2016
Hi enzo,

To answer the last question first - the User never sees the notify URL so the chances of them duplicating it are slim. You should check that the transaction data from PayPal is valid - that is it matches the data you sent (the PayPal listener doesn't do that for you), Also PayPal is requiring HTTPS on IPN confirmations from later this year (SandBox accounts require it now).

PayPal sends you back all of the transaction data in the IPN return including the status - you need to check that to see what the status is and then take the appropriate action.

Bob
enzo.orsi 01 Mar, 2016
Thanks Bob for your patience🙂
I had another idea: since if I add a DB Save inside IPN event even after PayPal Listener, I do not know why but sometimes it happened that runs several times and it write several times the record in the table.

What's about if I will use an Event Switcher inside Return URL where I will check the variable payment_status=completed ?
Is it a bad idea? Is it more safe the previous solution?

    [option] => com_chronoforms5
    [mc_gross] => 0.01
    [protection_eligibility] => Ineligible
    [payer_id] => UADA4QHC2G5JY
    [tax] => 0.00
    [payment_date] => 02:53:53 Mar 01, 2016 PST
    [payment_status] => Completed
    [charset] => windows-1252
    [first_name] => Enzo
    [mc_fee] => 0.01
    [notify_version] => 3.8
    [custom] => 248
    [payer_status] => verified
    [business] => paypal@
    [quantity] => 1
    [payer_email] => enzo.orsi@gmail.com
    [verify_sign] => AFcWxV21C7fd0v3bYYYRCpSSRl31ArR.VF0N-TK2hKTK56grp5vwbJNg
    [txn_id] => 1FU184280T053351K
    [payment_type] => instant
    [payer_business_name] => Enzo Orsi
    [last_name] => Orsi
    [receiver_email] => paypal@
    [payment_fee] => 
    [receiver_id] => KXQDXQ3K4MN2A
    [txn_type] => web_accept
    [item_name] => Lettera
    [mc_currency] => EUR
    [item_number] => 2
    [residence_country] => IT
    [handling_amount] => 0.00
    [transaction_subject] => 
    [payment_gross] => 
    [shipping] => 0.00
    [merchant_return_link] => clicca qui
    [auth] => AvEDRmyXnwprlLiLlAtA7NHMl0GfhToJH3NQu3yjm6udZNw.A4G3SYhycIPy3-U9eTfJ9QUHHBpkKgOJMmmIkhw
GreyHead 01 Mar, 2016
Hi enzo.orsi,

The IPN URL may be called several times - it is always called twice and, if the payment is marked as pending sometimes more that that. You need to update the record there to show the latest status*.

The Return URL does not tell you if the payment succeeded or not so that isn't helpful to you.

Bob

* For example, in the case of an e-check payment the success confirmation can be some days later.
enzo.orsi 01 Mar, 2016
I understand, thank you!

Two more doubts:
[*] Return URL runs after Notify URL finished (I mean sequentially) or in parallel? If they are in parallel, when user is inside Return URL, maybe payment status is not yet updated...right?
[*] In return URL debug i have following variable, cannot I use it?
[payment_status] => Completed
GreyHead 01 Mar, 2016
Hi enzo.orsi,

First, you cannot be sure that the User will click the Return URL and come back to your site - probably they will but they may go off somewhere else. Don't rely on it.

The process - when it works smoothly - is:
[list]User goes to PayPal
PayPal sends handshake to notify URL to check the transaction is valid
Your site confirms to PayPal
PayPal shows payment page to User
User pays (or not)
PayPal confirms status back to notify URL
User Clicks return URL (or not)[/list]


Bob
enzo.orsi 01 Mar, 2016
Ehy Bob, you gave me a great hint!
Because if user does not press that small button to return to the website, actually his pdf is not generated at all...

BUT, I need to generate a pdf after the payment:
[*] If TCPDF inside IPN event => more pdf will be generated, since notify_url is called more times
[*] If TCPDF insice return URL event => pdf will not be generated when user will not press return button

I am still confused where to generate the pdf...😟
enzo.orsi 02 Mar, 2016
Sorry guys...any suggestions?😟
PDF should be created in IPN event or in return URL event? Both solutions have pros/cons😟
GreyHead 02 Mar, 2016
Hi enzo.orsi,

It depends a bit on what the pdf is for, Probably I'd create it in the IPN event when payment is confirmed, save the file to server and the file-name to the database table. That way you can email it from the IPN event or show a download link from the return URL page if you need to.

Bob
enzo.orsi 02 Mar, 2016
Mmm...I think it is a good idea...
If this will solve also the problem from mobile, I have to offer you at least a dinner, not a coffee or a beer😀

What do you think about this solution?
[*] IPN event => after PayPal Listener to add an Event Switcher: if from IPN payment_status=completed (or is it better to store in DB), then create and save PDF
[*] Return URL event => show link of PDF
GreyHead 02 Mar, 2016
1 Likes
Hi enzo.orsi,

First, update the database with the info from PayPal
Second, create the pdf
Third, update the database again with the pdf file name

You do it like this so that if something goes wrong with the pdf creation your database record is still correct.

In the Return URL action use another Event switcher and check if the pdf exists, if it does show the link, if show a message saying what has happened e.g. the payment is not yet confirmed.

Bob
enzo.orsi 03 Mar, 2016
Thanks Bob for your hints...

I changed everything as you told...but...in RETURN URL event still not parameters from PayPal when I am from mobile...for example item_number, custom field, item_name...😟
And without them, I cannot show anything to the customer...a part from a static "thank you"😟

From my point of view, this is a bug...
Do you agree?
GreyHead 03 Mar, 2016
Hi enzo.orsi,

No, I don't agree it is a bug - it is exactly correct. As I've said several times before you need to have saved the information to a database table and look it up in the On Return event.

Bob
enzo.orsi 03 Mar, 2016
Hi Bob,
I am already doing like this: saving in DB table from IPN event and then look data from Return event.
But, as I told several times, when I am from mobile device there are no parameters in return event when I am from mobile (while working perfectly from desktop).
So how can I look for the information in DB table from return event if I do not have any parameters from paypal? I need an id from paypal for the "where condition" in db read...

I am sorry, but this is absolutely a bug...
enzo.orsi 03 Mar, 2016
I will try to change my question: if I have a debug in Return URL event, why:
[*] I get all the data from Paypal in debug when I am from dekstop device
[*] debug is completely empty when I am from mobile/tablet device
?
This topic is locked and no more replies can be posted.