Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class PaypalPayment
- def payments(users)
- #Hacer lotes de usuarios, paypal permite 250 max
- page=200
- length=users.length
- index=0
- until !(user_list = users[index,page])
- mass_payments(user_list)
- index = index + page
- end
- end
- # gateway.transfer 1000, 'bob@example.com',
- # :subject => "The money I owe you", :note => "Sorry it's so late"
- #
- # gateway.transfer [1000, 'fred@example.com'],
- # [2450, 'wilma@example.com', :note => 'You will receive another payment on 3/24'],
- # [2000, 'barney@example.com'],
- # :subject => "Your Earnings", :note => "Thanks for your business."
- def mass_payment (users)
- # users.each { |user_id|
- # user = User.find(user_id)
- # if user
- #
- # end
- # }
- gateway = ActiveMerchant::Billing::Base.gateway(:paypal).new(
- :login => 'admin_api1.aspgems.com',
- :password => 'HF3A35LB78RBH66H',
- :test => true
- )
- gateway.transfer [100,'ailopez@aspgems.com'],[150,'cliente@clientes.com'],
- :subject => "Your Earnings", :note => "Thanks for your business."
- end
- end
Add Comment
Please, Sign In to add comment