6

I've watched Ryan Bate's rails casts on PayPal integration. I've even gotten it to work with a Rails 3.1 test app and PayPal's sandbox.

However, the approach highlighted in the rails cast is more for end-users paying YOU (your business). What if you need to to send money to your customers? Is there a tutorial / video / documentation on how to go about this?

Ideally, I would like to use my Paypal account to send money to a customer's bank account which in some cases may not necessarily be Paypal owned.

Christian Fazzini
  • 19,613
  • 21
  • 110
  • 215

2 Answers2

2

The correct approach for sending user's money is to use the PayPal payout API. In order to do this you'll need a (validated) set of emails. Then the following API docs supply some information on the calls required:

https://developer.paypal.com/docs/integration/direct/create-single-payout/ https://developer.paypal.com/docs/integration/direct/create-batch-payout/

PayPal provides a Ruby gem (https://github.com/paypal/PayPal-Ruby-SDK/) for doing this integration. The even include a few a sample snippet to show how to integrate:

https://github.com/paypal/PayPal-Ruby-SDK/tree/master/samples/payouts

Kevin Sylvestre
  • 37,288
  • 33
  • 152
  • 232
-1

Once I was in the same situation but I couldn't figure it out either. The only thing that came to my mind is to store the important information for further transactions and then set up a cronjob with a script which transfers the money from your account to the thrid party.

Example: 'CustomerA' wants to buy from 'CustomerB' through you 'SiteOperator'
CustomerA pruchases a fake article from SiteOperator
You store information about the amount to forward to CustomerB (calculate fees, etc)
Cronjob loops every 15min and calls PayPal API to send money to CustomerB.

That's how I would do it.

unNamed
  • 969
  • 1
  • 10
  • 18
  • Using activemerchant or other gem? Paypal PayFlow, Adaptive Payments, or other service? – Christian Fazzini Sep 19 '11 at 07:46
  • You need to to chose which one fits you best... [Here](http://stackoverflow.com/questions/1559808/paypal-api-send-money-to-any-paypal-account) is a question similar to yours. – unNamed Sep 19 '11 at 08:24
  • Maybe [this link](https://cms.paypal.com/us/cgi-bin/?cmd=_render-content&content_ID=developer/e_howto_api_APIntro) helps you out. There are different types explained: Simple Payments, Parallel Payments and Chained Payments. There are some good pictures at the end of the site about fee configuration. Maybe that helps. – unNamed Sep 20 '11 at 06:24