Class: PayPal::Transfer
- Inherits:
-
Object
- Object
- PayPal::Transfer
- Includes:
- Merchant::MassPay
- Defined in:
- lib/paypal/transfer.rb
Instance Attribute Summary collapse
-
#amount ⇒ Object
Returns the value of attribute amount.
-
#email ⇒ Object
Returns the value of attribute email.
-
#response ⇒ Object
Returns the value of attribute response.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(params = {}) ⇒ Transfer
constructor
A new instance of Transfer.
- #success? ⇒ Boolean
Constructor Details
#initialize(params = {}) ⇒ Transfer
Returns a new instance of Transfer.
14 15 16 17 18 19 20 21 |
# File 'lib/paypal/transfer.rb', line 14 def initialize(params = {}) @amount, @email = params[:amount], params[:email] if @amount && @email @response = self.transfer(@amount, @email, params) else raise "You must provide an amount and a recipient email address." end end |
Instance Attribute Details
#amount ⇒ Object
Returns the value of attribute amount.
5 6 7 |
# File 'lib/paypal/transfer.rb', line 5 def amount @amount end |
#email ⇒ Object
Returns the value of attribute email.
5 6 7 |
# File 'lib/paypal/transfer.rb', line 5 def email @email end |
#response ⇒ Object
Returns the value of attribute response.
5 6 7 |
# File 'lib/paypal/transfer.rb', line 5 def response @response end |
Class Method Details
.create(params = {}) ⇒ Object
8 9 10 |
# File 'lib/paypal/transfer.rb', line 8 def create(params = {}) new(params) end |
Instance Method Details
#success? ⇒ Boolean
24 25 26 |
# File 'lib/paypal/transfer.rb', line 24 def success? @response && @response.try(:success?) end |