paypalmarketplace

How to know when a transaction completes with Paypal?


I'm currently using Stripe Connect to allow sellers on my website to sell products to other users. I don't want to be a man in the middle and hold the money and then pass it along for legal reasons, so stripe connect works quite well for me, whilst still allowing me to know when a charge went through fully or was refunded, etc.

I'd like now to offer sellers in my marketplace the option to get paid by Paypal. This could be as simple as storing the seller's Paypal email and rendering the PayPal button on their shop, however, it seems now I wouldn't be able to track if a buyer actually finalized a purchase or abandoned the sale. I need this info for various reasons.

My question is how can I do this with PayPal?


Solution

  • All current PayPal checkout integrations have a "Capture" step, so you can know if a payment was successfully captured or not. Since you want to track this information on a server, you should use a server-side integration.

    Implement two routes, one for 'Set Up Transaction' and one for 'Capture Transaction', documented here.

    The best front end to use for approval is: https://developer.paypal.com/demo/checkout/#/pattern/server , paired with the above two routes you created.


    Oh and since you'll be sending the payment to an account other than your own, specify this in a payee object when you set up the transaction.