Paypal IPN Completed with Custom Form


(Nic Hubbard) #1

Is it possible to use the Paypal IPN Completed trigger event with a custom form?


We have a simple Custom Form for our online giving. It passes the donation amount to a redirect on the Thank You page then brings the user to paypal to make the payment. Once the payment is completed, we want to send them an email.



If I don't have to, I don't want to set up a complicated paypal setup with eCommerce since the form works quite well.



Is there any way to do this?


(Ashish Karelia) #2

[quote]
Is it possible to use the Paypal IPN Completed trigger event with a custom form?



We have a simple Custom Form for our online giving. It passes the donation amount to a redirect on the Thank You page then brings the user to paypal to make the payment. Once the payment is completed, we want to send them an email.



If I don't have to, I don't want to set up a complicated paypal setup with eCommerce since the form works quite well.



Is there any way to do this?

[/quote]



Hi Nic,

From what I can see in the code. The trigger event is fired only from assets in ecom package. So the obvious answer would be no. I am not sure myself but may be some implementer specialist from Squiz might have some sort of work around that can help you. Will leave it upto them.



Cheers,



Ash


(Nic Hubbard) #3

[quote]


From what I can see in the code. The trigger event is fired only from assets in ecom package. So the obvious answer would be no. I am not sure myself but may be some implementer specialist from Squiz might have some sort of work around that can help you. Will leave it upto them.

[/quote]



Hmm, seems like we should just be able to setup a url that listens for the IPN for paypal, would be so much easier.


(Kbaker) #4

Hi Nic,


Yeah, that should work as the event will be triggered based on the URL you supply to Paypal. Beware though, if your system updates loads of metadata or takes a while to get the response back to paypal, the IPN is resent which'll cause the same trigger to fire, rinse-repeat, etc. In the case of sending an email to a client, you could spam them pretty quickly :huh:


(Nic Hubbard) #5

[quote]
Yeah, that should work as the event will be triggered based on the URL you supply to Paypal. Beware though, if your system updates loads of metadata or takes a while to get the response back to paypal, the IPN is resent which'll cause the same trigger to fire, rinse-repeat, etc. In the case of sending an email to a client, you could spam them pretty quickly :huh:

[/quote]



Hmm, so you think this is a bad way to do it? When does the IPN really get sent? Once paypal has processed the payment or once it is submitted?



The reason I wanted to use IPN, was that if I used just the standard Email Options of a Custom Form to send a "Thank You" email to a person who donated, they might have gotten to the paypal screen and decided not to donate. At which point, we would have already sent them this Thank You email.


(Kbaker) #6

[quote]
Hmm, so you think this is a bad way to do it? When does the IPN really get sent? Once paypal has processed the payment or once it is submitted?



The reason I wanted to use IPN, was that if I used just the standard Email Options of a Custom Form to send a "Thank You" email to a person who donated, they might have gotten to the paypal screen and decided not to donate. At which point, we would have already sent them this Thank You email.

[/quote]



It's not a bad way really as long as the system's not doing things like applying multiple metadata schema's and updating metadata, which may delay the generation of the IPN listener page.



The IPN is sent once the transaction has completed (either successful or some error but not someone not going through with the transaction), so you should be able to specify the URL to hit once a transaction is completed. The IPN has post data which should contain things like the email address, amount, etc so you're able to save it to metadata/email.



Once it hits the page you've defined, all it's really looking for is a 200 OK response from your web server to confirm that you've got the post data and are happy. If it doesn't get the response within say 20 seconds, it'll resend the IPN after another minute or so and repeat in a specific increment of minutes. I can't quite remember what the repeats are and finding on the paypal site was quite a mission. :angry:



Hope this helps


(Nic Hubbard) #7

Thanks, I will give it a try and see how it goes.


(Fiona) #8

Hi Nic, I know this is from a few years ago, but did you get it to work?
I am wanting to do something similar in that:

 

  • A public user creates an event using an asset builder
  • Once created, the user is then required to pay through paypal – a link to PayPal is on the created asset
  • If the user does pay with paypal, the newly created event would be sent live – this is the step I thought could use the PayPal IPN

So just wondering if it is possible? And if so, any pointers in the right direction would be appreciated.

Thanks, Fiona


(Nic Hubbard) #9

Hi Nic, I know this is from a few years ago, but did you get it to work?
I am wanting to do something similar in that:

 

  • A public user creates an event using an asset builder
  • Once created, the user is then required to pay through paypal – a link to PayPal is on the created asset
  • If the user does pay with paypal, the newly created event would be sent live – this is the step I thought could use the PayPal IPN

So just wondering if it is possible? And if so, any pointers in the right direction would be appreciated.

Thanks, Fiona

 

I don't even remember, it was so long ago. :(


(Fiona) #10

Ah no probs, yes it was ages ago. Cheers.