data: Array ( [chronoform] => test-paypal[event] => ipn [mc_gross] => 24.00 [protection_eligibility] =>Eligible [address_status] => confirmed [payer_id] => XRVWREJS4BPEU [tax]=> 21.00 [address_street] => Rue du Cornet 6 [payment_date] =>15:44:09 Mar 24, 2020 PDT [payment_status] => Completed [charset] =>windows-1252 [address_zip] => 4800 [first_name] => John [mc_fee] => 1.17[address_country_code] => BE [address_name] => John Doe [notify_version]=> 3.9 [custom] => [payer_status] => verified [business] => sb-9zyky1221299@business.example.com[address_country] => Belgium [address_city] => Verviers [quantity] =>1 [verify_sign] => AR8C9ynzP-lseAK10lgmjWwiCHawAtvttz2ZyW1-oeG5rh1MvsOdOxrH[payer_email] => sb-0lhr01228887@personal.example.com[txn_id] => 46D88597GA124041U [payment_type] => instant [last_name] =>Doe [address_state] => BE_zip = 4800 [receiver_email] => sb-9zyky1221299@business.example.com[payment_fee] => [shipping_discount] => 0.00 [insurance_amount] =>0.00 [receiver_id] => K8X5L7TJQ72XL [txn_type] => web_accept [item_name]=> SOFTWARE#123 [discount] => 0.00 [mc_currency] => EUR [item_number]=> 112233 [residence_country] => BE [test_ipn] => 1 [shipping_method]=> Default [handling_amount] => 0.00 [transaction_subject] =>[payment_gross] => [shipping] => 0.00 [ipn_track_id] => 45fb3a80b4499[option] => com_chronoforms6 [Itemid] => ) ​it looks fine to me, but I don't understand why, the same email placed in the "success" case doesn't fire.​Any idea?​thanks in dvance for your help.​Raffaele"> PayPal IPN firing email on success - Forums

Forums

PayPal IPN firing email on success

raffaele.jacovelli 24 Mar, 2020
Hello Bob,

long time no talk.

I'm now setting up a new site on Chronoforms v6, in particular using the PayPal plugin.

the Redirect works well (testing in Sandbox)., but I've problem with the IPN event (always in Sandbox, also tested with IPN Simulator).

when I get the response, the email is fired only if the status is: pending, failed, denied, etc., but not on success or fail.

I've tried to put an email after ipn Paypal in the ipn event page and it fires ok. Below the content of the email I receive on "Completed":


$this->data: Array ( [chronoform] => test-paypal
[event] => ipn [mc_gross] => 24.00 [protection_eligibility] =>
Eligible [address_status] => confirmed [payer_id] => XRVWREJS4BPEU [tax]
=> 21.00 [address_street] => Rue du Cornet 6 [payment_date] =>
15:44:09 Mar 24, 2020 PDT [payment_status] => Completed [charset] =>
windows-1252 [address_zip] => 4800 [first_name] => John [mc_fee] => 1.17
[address_country_code] => BE [address_name] => John Doe [notify_version]
=> 3.9 [custom] => [payer_status] => verified [business] => sb-9zyky1221299@business.example.com
[address_country] => Belgium [address_city] => Verviers [quantity] =>
1 [verify_sign] => AR8C9ynzP-lseAK10lgmjWwiCHawAtvttz2ZyW1-oeG5rh1MvsOdOxrH
[payer_email] => sb-0lhr01228887@personal.example.com
[txn_id] => 46D88597GA124041U [payment_type] => instant [last_name] =>
Doe [address_state] => BE_zip = 4800 [receiver_email] => sb-9zyky1221299@business.example.com
[payment_fee] => [shipping_discount] => 0.00 [insurance_amount] =>
0.00 [receiver_id] => K8X5L7TJQ72XL [txn_type] => web_accept [item_name]
=> SOFTWARE#123 [discount] => 0.00 [mc_currency] => EUR [item_number]
=> 112233 [residence_country] => BE [test_ipn] => 1 [shipping_method]
=> Default [handling_amount] => 0.00 [transaction_subject] =>
[payment_gross] => [shipping] => 0.00 [ipn_track_id] => 45fb3a80b4499
[option] => com_chronoforms6 [Itemid] => )

it looks fine to me, but I don't understand why, the same email placed in the "success" case doesn't fire.

Any idea?

thanks in dvance for your help.

Raffaele
healyhatman 25 Mar, 2020
if($this->data('payment_status') == 'Completed'){
if(empty($function['receiver_email']) OR ($function['receiver_email'] == $this->data('receiver_email'))){
$this->Parser->fevents[$function['name']]['success'] = true;
}else{ ....
Make sure your "receiver email" is correct
raffaele.jacovelli 25 Mar, 2020
Hi Healy,

thanks for your reply.

I thought so in the first place, but in fact this is not the problem as you can see comparing the email address shown for the receiver in the email above and from the snapshot below they are the same...... I've double-checked if there ar any blanks before or after but nope..... any other ideas?


raffaele.jacovelli 25 Mar, 2020
By the way, the hadnshake works well as I get the return page on "Complete" event. On the Sandbox account the transaction is regularly and succesfully booked both for the seller and the buyer, hence everything else works!!!

Anoher thing to notice is that if "success" is not "true" it should be "fail" hence fire the email that I've placed there, but doesn't work either. It seems that simply "dies" there...
quite frustrating.
healyhatman 25 Mar, 2020
Put an email action as the first thing, with just {data.pr:} or {debug:} in it and see what the data coming from PayPal looks like
raffaele.jacovelli 25 Mar, 2020
This is what I did in the first place.

I tested it again, below the content of the email:

as you can see the receiver email is the same that is in the Paypal IPN action!

$_POST: Array ( [mc_gross] => 24.00
[protection_eligibility] => Eligible [address_status] => confirmed
[payer_id] => XRVWREJS4BPEU [tax] => 21.00 [address_street] => Rue du
Cornet 6 [payment_date] => 06:21:54 Mar 25, 2020 PDT [payment_status] =>
Completed [charset] => windows-1252 [address_zip] => 4800 [first_name]
=> John [mc_fee] => 1.17 [address_country_code] => BE [address_name]
=> John Doe [notify_version] => 3.9 [custom] => [payer_status] =>
verified [business] => sb-9zyky1221299@business.example.com
[address_country] => Belgium [address_city] => Verviers [quantity] =>
1 [verify_sign] => As1ZtiT4.O8fOv1ZnOB0kMgjrszEATCYI2qLZTlXo2nCT5Ebxtb25srC
[payer_email] => sb-0lhr01228887@personal.example.com
[txn_id] => 0PH256113N442571W [payment_type] => instant [last_name] =>
Doe [address_state] => BE_zip = 4800 [receiver_email] => sb-9zyky1221299@business.example.com
[payment_fee] => [shipping_discount] => 0.00 [insurance_amount] =>
0.00 [receiver_id] => K8X5L7TJQ72XL [txn_type] => web_accept [item_name]
=> SOFTWARE#123 [discount] => 0.00 [mc_currency] => EUR [item_number]
=> 112233 [residence_country] => BE [test_ipn] => 1 [shipping_method]
=> Default [handling_amount] => 0.00 [transaction_subject] => [payment_gross]
=> [shipping] => 0.00 [ipn_track_id] => 71dbb20c7bb4e )
healyhatman 25 Mar, 2020
What about if you email a {debug:} after the IPN event?
raffaele.jacovelli 25 Mar, 2020
Hi Healy,

see below the debug output in the email

In effect it clearly states that email6 - which is the one that was supposed to be fired in case of success - could not be fired ! The question remains why?
Array
(
    [chronoform] => test-paypal
    [event] => ipn
    [mc_gross] => 24.00
    [protection_eligibility] => Eligible
    [address_status] => confirmed
    [payer_id] => XRVWREJS4BPEU
    [tax] => 21.00
    [address_street] => Rue du Cornet 6
    [payment_date] => 10:03:00 Mar 25, 2020 PDT
    [payment_status] => Completed
    [charset] => windows-1252
    [address_zip] => 4800
    [first_name] => John
    [mc_fee] => 1.17
    [address_country_code] => BE
    [address_name] => John Doe
    [notify_version] => 3.9
    [custom] => 
    [payer_status] => verified
    [business] => sb-9zyky1221299@business.example.com
    [address_country] => Belgium
    [address_city] => Verviers
    [quantity] => 1
    [verify_sign] => AIO6wyrHbxsnymNr6d3dg2ZSy9pNAaS-RFvHsgbyJzuhOk72vrSkQMuT
    [payer_email] => sb-0lhr01228887@personal.example.com
    [txn_id] => 27L82495Y6632460P
    [payment_type] => instant
    [last_name] => Doe
    [address_state] => BE_zip = 4800
    [receiver_email] => sb-9zyky1221299@business.example.com
    [payment_fee] => 
    [shipping_discount] => 0.00
    [insurance_amount] => 0.00
    [receiver_id] => K8X5L7TJQ72XL
    [txn_type] => web_accept
    [item_name] => SOFTWARE#123
    [discount] => 0.00
    [mc_currency] => EUR
    [item_number] => 112233
    [residence_country] => BE
    [test_ipn] => 1
    [shipping_method] => Default
    [handling_amount] => 0.00
    [transaction_subject] => 
    [payment_gross] => 
    [shipping] => 0.00
    [ipn_track_id] => acb30969f557f
    [option] => com_chronoforms6
    [Itemid] => 
)
Array
(
    [email15] => Array
        (
            [recipients] => Array
                (
                    [0] => raffaele.jacovelli@hightechpartners.net
                )
            [subject] => Paypal data
            [body] => <div>$_POST: Array
(
    [mc_gross] => 24.00
    [protection_eligibility] => Eligible
    [address_status] => confirmed
    [payer_id] => XRVWREJS4BPEU
    [tax] => 21.00
    [address_street] => Rue du Cornet 6
    [payment_date] => 10:03:00 Mar 25, 2020 PDT
    [payment_status] => Completed
    [charset] => windows-1252
    [address_zip] => 4800
    [first_name] => John
    [mc_fee] => 1.17
    [address_country_code] => BE
    [address_name] => John Doe
    [notify_version] => 3.9
    [custom] => 
    [payer_status] => verified
    [business] => sb-9zyky1221299@business.example.com
    [address_country] => Belgium
    [address_city] => Verviers
    [quantity] => 1
    [verify_sign] => AIO6wyrHbxsnymNr6d3dg2ZSy9pNAaS-RFvHsgbyJzuhOk72vrSkQMuT
    [payer_email] => sb-0lhr01228887@personal.example.com
    [txn_id] => 27L82495Y6632460P
    [payment_type] => instant
    [last_name] => Doe
    [address_state] => BE_zip = 4800
    [receiver_email] => sb-9zyky1221299@business.example.com
    [payment_fee] => 
    [shipping_discount] => 0.00
    [insurance_amount] => 0.00
    [receiver_id] => K8X5L7TJQ72XL
    [txn_type] => web_accept
    [item_name] => SOFTWARE#123
    [discount] => 0.00
    [mc_currency] => EUR
    [item_number] => 112233
    [residence_country] => BE
    [test_ipn] => 1
    [shipping_method] => Default
    [handling_amount] => 0.00
    [transaction_subject] => 
    [payment_gross] => 
    [shipping] => 0.00
    [ipn_track_id] => acb30969f557f
)
</div><br><br><div>$this->data: Array
(
    [chronoform] => test-paypal
    [event] => ipn
    [mc_gross] => 24.00
    [protection_eligibility] => Eligible
    [address_status] => confirmed
    [payer_id] => XRVWREJS4BPEU
    [tax] => 21.00
    [address_street] => Rue du Cornet 6
    [payment_date] => 10:03:00 Mar 25, 2020 PDT
    [payment_status] => Completed
    [charset] => windows-1252
    [address_zip] => 4800
    [first_name] => John
    [mc_fee] => 1.17
    [address_country_code] => BE
    [address_name] => John Doe
    [notify_version] => 3.9
    [custom] => 
    [payer_status] => verified
    [business] => sb-9zyky1221299@business.example.com
    [address_country] => Belgium
    [address_city] => Verviers
    [quantity] => 1
    [verify_sign] => AIO6wyrHbxsnymNr6d3dg2ZSy9pNAaS-RFvHsgbyJzuhOk72vrSkQMuT
    [payer_email] => sb-0lhr01228887@personal.example.com
    [txn_id] => 27L82495Y6632460P
    [payment_type] => instant
    [last_name] => Doe
    [address_state] => BE_zip = 4800
    [receiver_email] => sb-9zyky1221299@business.example.com
    [payment_fee] => 
    [shipping_discount] => 0.00
    [insurance_amount] => 0.00
    [receiver_id] => K8X5L7TJQ72XL
    [txn_type] => web_accept
    [item_name] => SOFTWARE#123
    [discount] => 0.00
    [mc_currency] => EUR
    [item_number] => 112233
    [residence_country] => BE
    [test_ipn] => 1
    [shipping_method] => Default
    [handling_amount] => 0.00
    [transaction_subject] => 
    [payment_gross] => 
    [shipping] => 0.00
    [ipn_track_id] => acb30969f557f
    [option] => com_chronoforms6
    [Itemid] => 
)
</div>
            [result] => the Mail sent successfully.
            [var] => 1
        )
    [email6] => Array
        (
            [recipients] => Array
                (
                    [0] => raffaele.jacovelli@hightechpartners.net
                )
            [subject] => Successfull purchase email!
            [body] => <pre style="word-wrap:break-word; white-space:pre-wrap;">Array
(
    [chronoform] => test-paypal
    [event] => ipn
    [mc_gross] => 24.00
    [protection_eligibility] => Eligible
    [address_status] => confirmed
    [payer_id] => XRVWREJS4BPEU
    [tax] => 21.00
    [address_street] => Rue du Cornet 6
    [payment_date] => 10:03:00 Mar 25, 2020 PDT
    [payment_status] => Completed
    [charset] => windows-1252
    [address_zip] => 4800
    [first_name] => John
    [mc_fee] => 1.17
    [address_country_code] => BE
    [address_name] => John Doe
    [notify_version] => 3.9
    [custom] => 
    [payer_status] => verified
    [business] => sb-9zyky1221299@business.example.com
    [address_country] => Belgium
    [address_city] => Verviers
    [quantity] => 1
    [verify_sign] => AIO6wyrHbxsnymNr6d3dg2ZSy9pNAaS-RFvHsgbyJzuhOk72vrSkQMuT
    [payer_email] => sb-0lhr01228887@personal.example.com
    [txn_id] => 27L82495Y6632460P
    [payment_type] => instant
    [last_name] => Doe
    [address_state] => BE_zip = 4800
    [receiver_email] => sb-9zyky1221299@business.example.com
    [payment_fee] => 
    [shipping_discount] => 0.00
    [insurance_amount] => 0.00
    [receiver_id] => K8X5L7TJQ72XL
    [txn_type] => web_accept
    [item_name] => SOFTWARE#123
    [discount] => 0.00
    [mc_currency] => EUR
    [item_number] => 112233
    [residence_country] => BE
    [test_ipn] => 1
    [shipping_method] => Default
    [handling_amount] => 0.00
    [transaction_subject] => 
    [payment_gross] => 
    [shipping] => 0.00
    [ipn_track_id] => acb30969f557f
    [option] => com_chronoforms6
    [Itemid] => 
)
</pre>
            [from_name] => Admin Ataya & Partners Academy 
            [from_email] => rj@atayapartners.com
            [reply_name] => Admin Ataya & Partners Academy 
            [reply_email] => rj@atayapartners.com
            [result] => the Mail could not be sent.
            [var] => 
        )
    [email8] => Array
        (
            [recipients] => Array
                (
                    [0] => raffaele.jacovelli@hightechpartners.net
                )
            [subject] => PostPaypal IPN Action
            [var] => 
        )
)
raffaele.jacovelli 25 Mar, 2020
Well, I've changed the email putting the same one I've in the configuration in Joomla - that was the case for the other email actions - and now it works!

The question remains though: why I cannot change the email from ? Shall I create data field and put in there something like {data:emai_from} ?
You think that is the reason?
healyhatman 25 Mar, 2020
has to be from your own domain unless you've put in all the required settings for an external email service
raffaele.jacovelli 01 Apr, 2020
Hello Heaaly,

I've managed to solve all the other small issues, and I was about to go live, but then I've realised that using the sandbox, Paypal doesn't add the VAT to the fee.
maybe I'm doing something wrong, but enabling the debugger, I've noticed that in the url is passed "tax" as opposed to "tax_cart". Could this be the reason? or it's because of the Sandbox, where I cannot configure my standard VAT rate?

It will be helpful if you could advise.

Thanks
Raffaele

ps: below the url taht has been sent to the sandbox in case you wish to look at it:

https://www.sandbox.paypal.com/cgi-bin/webscr?cmd=_cart&business=sb-9zyky1221299%40business.example.com¤cy_code=EUR&tax=777&no_shipping=0&no_note=0&cn=¬ify_url=https%3A%2F%2Facademy.atayapartners.com%2Fcomponent%2Fchronoforms6%2F%3Fchronoform%3Dpaypal-ipn%26event%3Dipn&return=https%3A%2F%2Facademy.atayapartners.com%2Fbasket%3Fevent%3Dcomplete&cancel_return=https%3A%2F%2Facademy.atayapartners.com%2Fbasket%3Fevent%3Dcanceled&image_url=https%3A%2F%2Facademy.atayapartners.com%2Fimages%2Fatayasite2.png&custom=&invoice=APA2020047&email=patrizia.tucci%40gmail.com&first_name=Patrizia&last_name=Tucci&address1=Dieweg%2C54%2F9&address2=&city=Brussels&state=&zip=1180&country=Belgium&lc=EN&upload=1&item_name_1=iso-27001-li-0330&item_name_2=iso-27001-li-may&item_number_1=0&item_number_2=1&amount_1=850.00&amount_2=2850.00&shipping_1=0&shipping_2=0&shipping2_1=0&shipping2_2=0&handling_1=0&handling_2=0&on0_1=client&on0_2=client&os0_1=IMC+SA&os0_2=IMC+SA&on1_1=cf_user_id&on1_2=cf_user_id&os1_1=583&os1_2=583&quantity_1=2&quantity_2=2
crealiagroup 23 May, 2022
I have a similar issue, in the PayPal IPN Success box, placed 2 emails (for user and for admin) but no emails are sent out when payment is completed.
I've filled the Receiver email with the same business paypal email setted in PayPal Redirect Business email (please note that this email has not the same domain of my website).

Any idea why emails are not sent out?
raffaele.jacovelli 23 May, 2022
Have you tested if the email are sent by the system with other Chronoforms apps?
crealiagroup 23 May, 2022
Thanks Raffaele for reply. Yes they are correctly sent out. My form includes also a double payment method. Bank transfer or PayPal. An event switcher handles it and if I choose Bank Transfer, the relatives emails are correctly sent out.
This topic is locked and no more replies can be posted.