4 replies
I need some help implementing IPN Payment Processing. I know php but I am for some reason, having a problem understanding the IPN Process. I know basically that it works this way:

1) Customer pays through PayPal
2) Paypal sends the post to the IPN handler
3) The IPN handler reposts it to PayPal
4) Paypal responds to the post with "Verified"
5) At that time, I update the sales database indicating that the payment had cleared.

My question is this...

1) How to I pass the Sales Invoice number to the IPN handler so it knows which sale to validate?

2) What happens in the mean time with the customer, who has been returned to the delivery page? IPN can take a min or so to verify if it is busy.. How can I have them wait.. (Reload the page every x seconds?)

I appreciate any help that I can get on this.

Dan
#ipn
  • Profile picture of the author mywebwork
    Hi Dan

    1 - Use the "Custom" field that PayPal supplies to record the Invoice number. Pass it to PayPal in Step #1 as a hidden field with a name and id of "custom".

    2 -Don't rely on PayPal to pass the Verified IPN back right away, a few nights ago I was testing this on the Sandbox and it took over 90 minutes in some cases! If PayPal has passed the customer back to the delivery page (the one specified in the"return" field) then they have cleared the payment "hurdle" and they deserver to get their product or membership. Provide this for them on that page, all you are doing is waiting for the Verified IPN information to update your records.

    I find PayPal's "Instant Payment Notification Guide" that is on their development site to be of great help, if you decide to use the sample PHP code in it add a closing bracket ( }) to the end as they are missing it!

    Bill
    {{ DiscussionBoard.errors[699405].message }}
    • Profile picture of the author danmart
      Thanks Bill,

      If I don't wait for PayPal IPN to post, then there is really no need to use it. I wanted to use IPN as a security measure to keep people from taking the link off the form code. If I just give it to them on the return url then they just have to copy that link and put it in manually.

      Do you know of another secure way to do a paypal transaction? I can't use DLP because I am going to have multiple payees and I tried to call the form in an Iframe and it worked just fine in Firefox but, when I tried it in IE paypal gave an error.
      {{ DiscussionBoard.errors[699493].message }}
  • Profile picture of the author mywebwork
    Hi Dan

    Not sure if you're distributing a digital product (e-book, video) or a membership. If its a digital product then have you thought of using eJunkie? They integrate with PayPal and will give your customer a temporary secure link to download from. You also get a bunch of management features to track your downloads (and supply new links to customers who have legitimately lost theirs).

    PayPal also has a way of using their API to complete the transaction without having the customer leave your site.

    Hope this is of some help.

    Bill
    {{ DiscussionBoard.errors[699537].message }}
  • Profile picture of the author yosis
    Hi Dan,

    How this is handled it is based on your script or program. One way to do it is that the sales number is generated by your own system once PayPal IPN "tells" your system that the transaction has been completed. That way you want generate invoices automatically when someone just clicks a button and changes their mind. This wills still track "problematic" or non-instant orders though. So let's say someone purchases with e-check, then IPN will send the appropriate "pending" status and your program will hold off on sending the download link. So that invoice will be pending and it will be up to you to follow up on it...

    2) I would personally set it up so that emails are automatically sent with the transaction. The customer usually gets the confirmaiton within minutes.

    Have you taken a look at a script writen by Micah Carrick at micahcarrick.com. This is a good example on how to implement ipn into your program or site.
    {{ DiscussionBoard.errors[720307].message }}

Trending Topics