54 points · by whyleyc · 15y ago · 15 comments
They are supposedly keeping merchants up to date here: https://www.x.com/community/ppx/system_status/payflowstatus/blog/2011/03/18/bulletin-system-maintenance-notification
That page hasn't been updated for the last 2 hours.
What they aren't mentioning is:
- The new endpoint for PayFlow processing is down (payflowpro.paypal.com [66.211.171.141])
- The old endpoint for PayFlow processing is also down (216.113.190.148)
- When it was up earlier delayed capture payments failed
- Anything related to trying to process new recurring payments also seems broken
Thanks PayPal !
Even their new APIs are based on the IPN "reliable messaging" notification system. But there's nothing reliable about it:
* You receive a message from Paypal
* You post it back to Paypal
* You get back "VERIFIED" or "INVALID"
* The burning stupid: This postback is also what acknowledges the message and stops the retries.
In other words, your code must either:
1) Commit transactions in your database based on unverified information, then figure out how to revert the changes if the message comes back invalid. Or:
2) Verify the message (stopping retries) and then try to commit your transaction, possibly failing and losing the IPN message entirely. Your customer may never get his product enabled.
Oh, and let me mention that the verification postback can happen only once. It's impossible to build an idempotent handler for IPN messages.
Paypal's documentation and sample code push you towards solution #2. This is just negligent. I've built porn-serving infrastructure that was a thousand times more robust. People trust this with real money?
And don't get me started on Paypal's near-useless morass of documentation. And the fact that IPN messages don't have any kind of unique identifier.
Technology FAIL.
So the correct strategy is: 1. Receive an IPN from Paypal. 2. Post it back to Paypal. 3. Make sure the response is VERIFIED. 4. Idempotently handle the payment. 5. Send "200 OK" response.
Step 4 needs to be idempotent in case your server dies or times out before sending the 200 OK response, but there's no way to avoid this without potentially losing messages. (I can't remember what the theorem is called, but in a lossy system it's impossible to avoid both messages being lost and messages being duplicated.)
Paypal has 99 problems, but its IPN processing isn't one.
A couple of useful links I found on here:
Use http://activemerchant.org for rails implementation of authorize gateway and http://feefighters.com to find and setup a merchant account (awesome service)
Hopefully, there will be a framework for C# developers for this alternative...
Or maybe we are just lucky and did not get affected?