3

I am working on a project which will be able to accept paypal payments. The sequence I am using is as follows:

My current development sites' payment steps:

  1. The user goes to my site,
  2. Chooses to pay for something,
  3. Is redirected to paypal,
  4. The payment is completed on paypal,
  5. Then the user gets redirected back to my sites success url.

This works fine, as I use an IPN listener to update my database in the background when paypal decides to confirm the committed payment and let the user know accordingly.

However, a few days ago, I was doing some online shopping of my own, and paid using paypal. I noticed that when I paid, I was redirected to paypal, where I logged in and saw the paypal invoice. I clicked confirm, and I was redirected back to the sellers website, where I so a summary and was told to commit the purchase!!!

So basically, the sequence was something like this:

My shopping experience from a different sellers site:

  1. I wanted to pay for the items,
  2. I was redirected to paypal,
  3. I was the invoice and confirmed the payment,
  4. I was redirected to the sellers site,
  5. I was was shown a confirmation of the order and was asked to commit the payment,
  6. I committed the payment and was told that the order has been completed.

The difference, my site commits the purchase on the paypal website and I listen for a reponse from paypal using their IPN system, but this second site seems to commit the payment on the sellers actual website.

I thought, wow, that felt so much more reassuring from a user experience point of view.

How is that done?

oshirowanen
  • 15,297
  • 82
  • 198
  • 350
  • Is there anything in the Paypal API documentation? – Phil Murray Dec 21 '12 at 13:44
  • It probably validates the order but doesn't process it. It then sends back the order id, and the seller website probably uses an API call to process the order. – Pitchinnate Dec 21 '12 at 13:47
  • https://cms.paypal.com/ca/cgi-bin/?cmd=_render-content&content_ID=developer/howto_admin_authcapture should give you a good start. – Steven Dec 21 '12 at 15:45

1 Answers1

5

Sounds like you're currently using Payments Standard and you want Express Checkout.

Express Checkout is very similar to Standard except that it's API based and the user gets returned to your site prior to finalizing the payment.

It consists of 3 API calls...

1) SetExpressCheckout - gets a token back from PayPal that you append to the end of a redirect URL that sends the person over to PayPal to login and review the payment.

2) GetExpressCheckoutDetails - This allows you to pull the payer details (name, phone, shipping address, etc.) back into your app from PayPal. This is an optional step.

3) DoExpressCheckoutPayament - this finalizes the payment. No money is moved until this API call happens, and it doesn't happen, of course, until the user is already back at your site and within your own app flow again.

You can still use IPN the way you are, but you could also things directly within the flow as well since you get instant responses back from the API, and you can setup your own review however you want to.

Drew Angell
  • 25,968
  • 5
  • 32
  • 51
  • Note: I'd highly recommend you stick with IPN in addition to watching for the API response, as your IPN listener will be called when a payment held under manual review is released (which happens on a small number of transactions). – Robert Jan 05 '13 at 12:14
  • Anything in particular you don't like about my answer? – Drew Angell Jan 07 '13 at 08:34
  • Nope, it's absolutely spot on with regards to Express Checkout itself. Though I felt I needed to point out the importance for IPN, so that people don't think they can completely get rid of it purely because they're looking at the DoExpressCheckoutPayment API response at the time of the transaction. – Robert Jan 07 '13 at 14:33
  • I guess I was asking oshirowanen. I see the question is still sitting here with a bounty on it. Seems like we've answered it. – Drew Angell Jan 07 '13 at 19:19
  • They listed "adaptive payments" in the tags, which unfortunately cannot use the aforementioned "express checkout" style flow. – Josh Stuart Jan 08 '13 at 23:36
  • That depends on the main objective. Based on what was outlined with the experience the OP is looking to achieve, I recommended EC, which can do Parallel Payments as well. If you need Chained Payments you'll indeed need to stick with Adaptive API's. – Drew Angell Jan 09 '13 at 03:22