Guest User

Untitled

a guest
Mar 4th, 2018
293
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.20 KB | None | 0 0
  1. class PaypalPayment
  2.  
  3.  
  4. def payments(users)
  5. #Hacer lotes de usuarios, paypal permite 250 max
  6. page=200
  7. length=users.length
  8. index=0
  9.  
  10.  
  11. until !(user_list = users[index,page])
  12. mass_payments(user_list)
  13. index = index + page
  14. end
  15.  
  16. end
  17.  
  18. # gateway.transfer 1000, 'bob@example.com',
  19. # :subject => "The money I owe you", :note => "Sorry it's so late"
  20. #
  21. # gateway.transfer [1000, 'fred@example.com'],
  22. # [2450, 'wilma@example.com', :note => 'You will receive another payment on 3/24'],
  23. # [2000, 'barney@example.com'],
  24. # :subject => "Your Earnings", :note => "Thanks for your business."
  25. def mass_payment (users)
  26. # users.each { |user_id|
  27. # user = User.find(user_id)
  28. # if user
  29. #
  30. # end
  31. # }
  32.  
  33.  
  34. gateway = ActiveMerchant::Billing::Base.gateway(:paypal).new(
  35. :login => 'admin_api1.aspgems.com',
  36. :password => 'HF3A35LB78RBH66H',
  37. :test => true
  38. )
  39.  
  40. gateway.transfer [100,'ailopez@aspgems.com'],[150,'cliente@clientes.com'],
  41. :subject => "Your Earnings", :note => "Thanks for your business."
  42. end
  43.  
  44. end
Add Comment
Please, Sign In to add comment