IPN with Express Checkout - paypal

I'm overflowed a little bit reading Introducing IPN https://developer.paypal.com/webapps/developer/docs/classic/ipn/integration-guide/IPNIntro/:
at the begiining: "IPN is a message service that PayPal uses to notify you about events, such as: Instant payments, including Express Checkout, ..."
at the end: "If you are using Express Checkout ... You should not use IPN for this purpose."
Perhaps anybody knows correct option - to use or not to use IPN with Expres Checkout?

IPN can be used for purposes such as:
Trigger order fulfillment or enable media downloads
Update a list of customers
Update accounting records
Create specialized "to do" lists
If you are using Express Checkout or Direct Payment, the PayPal API notifies you of the status and details of the transaction immediately and automatically. In either case, you can immediately show your customer the payment information returned by PayPal . You should not use IPN for this purpose.
This means that you need not use IPN for knowing the transaction status , because once "dodirectpayment" is completed, you will know the transaction status immediately.
Yes, if you want to use IPN for backoffice operations such as updating your own database, emailing your customers upon purchase and offers etc. you can use IPN with Express Checkout.

Related

Javascript Express Checkout - are they IPN compatible?

I'm currently using PayPal buttons on a site. When the transaction completes, my backend system gets an IPN with the details to process and dispatch the purchased item.
The javascript-driven express checkout looks nice and fancy, but I'm confused by the mixed statements and documentation. Do I need to implement WebHooks to achieve the same with the newer express checkout? Or do I still receive IPNs?
I also have subscription buttons that won't use the express checkout yet. So I need to know if I can use IPNs to process both purchase types, or if JS-express checkouts only send webhooks and not IPNs.
I want to avoid signing up to webhooks and then receiving both webhooks and IPNs for the same order.
Found out I can actually test this in the sandbox by creating a sandbox merchant account, logging in on sandbox.paypal.com, and setting up IPNs there.
Yes, IPNs are still sent for the Javascript Express Checkout functionality. Webhooks are optional.

Do you need to use IPN with express checkout to confirm PayPal payments?

When I use the Checkout express API calls do I need to have an IPN listener to confirm payment?
Some places give the idea that once I receive a response from DoExpressCheckoutPayment the payment has gone through and I can take action - update the database etc.
Some posts here http://www.zen-cart.com/showthread.php?72304-Paypal-IPN-and-Express-Checkout suggests that IPN is old or outdated.
You could use either or, or you could use both. The IPN will will update your system if the buyer pays with an echeck once it clears, just as it will update your system of refunds and chargebacks. The respone from the Express Checkout API call wont do this. You would have to check manually.

Paypal Adaptive Payments - Finalizing payment

Is there anyway to have user finalize payment on my site instead of on paypal.com? I want to run a script before sending off for final authorization (not just before redirecting and logging into paypal).
I know IPN would help but will not satisfy a race condition completely.
I know Express checkout can do this but I need someone to pay someone else, not direct payment to myself. I don't think that's how Express checkout works if I read correctly.
You're correct in your assumption on Express Checkout; although it can do split payments over multiple different receivers.
With regards to Adaptive Payments; you can still call the Pay API with actionType=CREATE and the transaction is only finalized once you've called the ExecutePayment API call.
See also page 123 in https://cms.paypal.com/cms_content/US/en_US/files/developer/PP_AdaptivePayments.pdf

PayPal express checkout handling "pending payments" with IPN

I cant find anny clear documentations about this.
If you use paypal express checkout, when a payment is pending what happens next?
Does paypal sends you by IPN an update if the states changes, do you have options?
Let say you do an DoExpressCheckoutPayment (with NVP)
and you get this:
&PAYMENTSTATUS=Pending
&PENDINGREASON= ECHECK //The payment is pending because it was made by an eCheck that has not yet cleared.
&REASONCODE=None
So you've made the payment and you want to wait until its cleared? What should you do next.
Update Some (external documentation) I found only sugest you could use (IPN?) to handle pending payments.
"If the Do Express Checkout Payment PENDINGREASON response is a value
other than none or completed , the payment is pending. Typically,
this means the customer has paid with aneCheck. In such a case, funds
are not guaranteed, and you should not ship or deliver items or
services until the payment has successfully completed. NOTE:
PayPal recommends that you block eChecks as a payment method if you
are unable tohandle pending state payments.To find out the status of a
pending payment, you can:
Submit an Inquiry transaction.
Check the status using PayPal Manager. See PayPal Manager online help
for details."
The paypal sandbox seems to have the option to check IPN messages for the express checkout type. The only correlation (if its ment to be used this way) between the DoExpressCheckoutPayment and the IPN seems you can use the "custom" field to keep track of a pending status. The txn_id (ipn) isn't given in DoExpressCheckoutPayment (nvp). Does any one have any experience with this?
The transaction ID is most certainly given in DoExpressCheckoutPayment, even if the PAYMENTSTATUS=Pending. A pending payment is still a transaction.
So yes, you would be notified via IPN when the transaction is completed. This typically takes a few working days.
Once it has completed, you can correlate the transaction from DoExpressCheckoutPayment to the IPN you will have received via the txn_id in the IPN.
Note: If you want to test a 'Pending' payment in the PayPal Sandbox, simply go to https://developer.paypal.com/ > Test account and click on 'Payment review' for the seller account you're testing with.
Once payment review is enabled on that seller account, any transactions it receives will be in a 'Pending' state.
Simply disable payment review to release the tranasctions afterwards.
I thought i'd add my two pence worth of thoughts to this.
I was getting a pending return status using Express Checkout via the dotNet SDK, according to the doc's and examples I should have been getting an 'approved' status.
I couldn't figure out why but it turned out to be because I was passing through a new currency, in our case 'GBP'. I had to log in as the facilitator sandbox account and decide what to do with the new currency.. convert it or setup a new balance in the currency. Once I did this, and set it as the default action, the pending return status no longer occurred.
hope that helps someone!
One thing not noted here and I haven't found anything else to confirm.. is that Paypal Express API doesn't support passing in the NOTIFYURL with the code. So you have to use the hardcoded IPN url set in your paypal account. This of course causes issues because you need a common callback file that can redirect to the individual payment options.
For example, if you are using Paypal Express AND Paypal Advanced.. Neither of those properly support a notifyurl passed in using the code. Paypal Advanced claims to, but it doesn't seem to work. So there needs to be a common IPN callback file that handles the redirection to each.
Unless someone else can confirm a working notify url for Express Checkout variable that can be passed in the code?

Checking if paypal payment was successful

I have downloaded sample code from paypal to allow me to use parallel payments via their sandbox accounts. When I run parallel.php, I get redirected to paypal's sandbox login page.
How am I supposed to know "server side" that the payment has been made successfully, so I can update my database records?
I believe you have to work with PayPals IPN system. This will basically send a confirmation to your server that tells you it has gone through.
https://www.paypal.com/ipn
Paypal lets you register a notification url which is part of the IPN (instant payment notification IIRC) system. So if someone pays by a delayed payment (such as a bank transfer) the transaction will update days later. You need to have an application (web page) on your server that can be called by Paypal with transaction details to update a payment.
You'll need to create an initial transaction record in your system when paypal redirects back to you so refer to their documentation for that. I'd also recommend looking at either OSCommerce or Zen cart for an idea of how they do it as they support the same kind of thing.