0

I want to pay my users(share profit) automatically every month using PayPal.

I read a lot about PayPal and all features. I need to configure sending payments depends on some statistics from my database.

I'm using Rails and will appreciate all any help !

Can I rewrite or change something in recurrung bills gem to pay my users ?

Denys Medynskyi
  • 2,353
  • 8
  • 39
  • 70

3 Answers3

3

There are several scheduling gems for this purpose:

https://www.ruby-toolbox.com/categories/scheduling

Stefan
  • 109,145
  • 14
  • 143
  • 218
1

If you are using a payment gateway such as paypal, they have support for reccuring billing. Most payment services support this. I don't know if it is possible to set up a timer like you describe in the question, but I would definitely not rely on it. What about performance and what if your app goes down?

Take a look at activemerchant and this railscasts episode. Maybe this paypal documentation is helpful too.

Godisemo
  • 1,813
  • 2
  • 18
  • 26
  • Thanks, but to make recurring payments to users I should have their Profile ID ? – Denys Medynskyi Jul 13 '12 at 14:46
  • I'm not sure if that is necessary, but you will need some kind of token. – Godisemo Jul 13 '12 at 14:47
  • Just to clarifie, do you want to make recurring payments or recurring billing? Maybe I've misinterpreted the question. – Godisemo Jul 13 '12 at 14:54
  • I just lost in that amount of PayPal documentation. I need to make money(changable amount) to users and send reports about it. – Denys Medynskyi Jul 13 '12 at 14:58
  • I think it is recurring billing, but in this gem - USER pay every month, or I should overwrite this ? – Denys Medynskyi Jul 13 '12 at 15:07
  • Paypal is probably the most developer unfriendly tool I've ever used. You could take a look at alternate payment gateways. There is probably some that supports what you ask for. I would guess it is possible with paypal. Anyway, I still think you should rely on a payment gateway rather than your own application. If you want more help with this you should probably rename the question, retag it and try to describe your problem in more detail. – Godisemo Jul 13 '12 at 15:07
  • If you want to send money to users, it is not billing. – Godisemo Jul 13 '12 at 15:08
1

On the PayPal product family, take a look at Adaptive Payments. One of the features is the ability to do what's called Implicit Payments. Essentially this feature givves you the ability to programmatically send money out of your own account, to pay somebody else.

You simply need to write the script to determine the receiver's email address, the amount you want to send them, and make the API call with that information.

Check out page 25: https://cms.paypal.com/cms_content/US/en_US/files/developer/PP_AdaptivePayments.pdf

Although it's probably easier to write your own API call (It's basically and HTTP POST request, with some additional headers), you could probably tweak the ActiveMerchant library to do it for you.

Lenny Markus
  • 3,398
  • 2
  • 24
  • 30
  • Thanks, but can I do automatically payments with Adaptive Payments ? – Denys Medynskyi Jul 14 '12 at 16:19
  • No. PayPal doesn't have any automatic products for outgoing payments. Still, it's very straightforward if you have a server. It's just a matter of writing a script that runs as often as you need it. Only for incoming. (ie. you bill somebody) – Lenny Markus Jul 15 '12 at 00:20