​Using this code every payment_status not equal to "Completed" is changed with "expired" and PayPal Listener manage it with "On Invalid" event.It seems to work in sandbox.Before I start test in production, any suggestion?maybe this simplification could be dangerous​Many thanksPF"> IPN Listener only check payment_status "completed" and "expired" - Forums

Forums

IPN Listener only check payment_status "completed" and "expired"

PF 03 Apr, 2019
I am testing in Chronoforms5 a form with PayPal payment.
using Paypal IPN Listener I found that that application only consider payment_status="Completed" as "Verified" and payment_status="expired" as "Invalid".
I don't know when Paypal sends other payment_status, but there are a lot:
canceled_reversal, declined, failed, in-progress, partial_refunded, pending, processed, refunded, reversed, voided.
I want to manage all exit condition so I put a "Custom code" on IPN before "PayPal Listener":

<?php
if ( $_POST["payment_status"] == 'Completed' ) {}
else
{$_POST["payment_status"] = 'expired';}
?>

Using this code every payment_status not equal to "Completed" is changed with "expired" and PayPal Listener manage it with "On Invalid" event.
It seems to work in sandbox.
Before I start test in production, any suggestion?
maybe this simplification could be dangerous

Many thanks
PF
GreyHead 03 Apr, 2019
Hi PF,

As I read the action code it checks for the string VERIFIED in the return data and if found returns Valid, otherwise returns Invalid.

Bob
PF 03 Apr, 2019
OK. you are right. I wanted to do so...
I understand that I cannot consider" invalid" any payment status other than "completed". But IPN Listener only recognizes "completed" as Valid and "expired" as Invalid.
how to manage other payment_status?
many thanks
PF
healyhatman 03 Apr, 2019
Any reason you can't just build your new form in CFv6?
PF 04 Apr, 2019
No reason...
I read CFv6 manual and FAQ, no news about IPN Listener, but some work to do for migration from v5 to v6.
do you think that CFv6 will solve my problem?
GreyHead 04 Apr, 2019
Hi PF,

As I said, the IPN Listener recognises any response except 'Completed' as invalid. If you want to handle the invalid responses separately then you can use PHP in the On Fail event of the Listener action.

Bob
PF 04 Apr, 2019
you are right.
I deleted the custom code and IPN Listener only recognizes "completed" ad "Valid.
but all the other payment_status exit from IPN Listener without activating the "invalid" or "error" event.
maybe the problem is on PayPal IPN simulator?
many thanks
PF
Max_admin 07 Apr, 2019
Hi PF,

The CF6 PayPal IPN action should handle all the responses, you can install CF6 with 5 on the same site, build your form on v6 and try it!

Best regards
Max
ChronoForms developer...
Did you try ChronoMyAdmin for managing your Joomla database tables ?
This topic is locked and no more replies can be posted.