Class: Braintree::PayPalAccount
- Inherits:
-
Object
- Object
- Braintree::PayPalAccount
- Includes:
- BaseModule
- Defined in:
- lib/braintree/paypal_account.rb
Instance Attribute Summary collapse
-
#billing_agreement_id ⇒ Object
readonly
Returns the value of attribute billing_agreement_id.
-
#created_at ⇒ Object
readonly
Returns the value of attribute created_at.
-
#customer_id ⇒ Object
readonly
Returns the value of attribute customer_id.
-
#email ⇒ Object
readonly
Returns the value of attribute email.
-
#funding_source_description ⇒ Object
readonly
Returns the value of attribute funding_source_description.
-
#image_url ⇒ Object
readonly
Returns the value of attribute image_url.
-
#payer_id ⇒ Object
readonly
Returns the value of attribute payer_id.
-
#revoked_at ⇒ Object
readonly
Returns the value of attribute revoked_at.
-
#subscriptions ⇒ Object
readonly
Returns the value of attribute subscriptions.
-
#token ⇒ Object
readonly
Returns the value of attribute token.
-
#updated_at ⇒ Object
readonly
Returns the value of attribute updated_at.
Class Method Summary collapse
- ._new(*args) ⇒ Object
- .create(attributes) ⇒ Object
- .delete(token) ⇒ Object
- .find(token) ⇒ Object
- .sale(token, transaction_attributes) ⇒ Object
- .sale!(token, transaction_attributes) ⇒ Object
- .update(token, attributes) ⇒ Object
Instance Method Summary collapse
- #default? ⇒ Boolean
-
#initialize(gateway, attributes) ⇒ PayPalAccount
constructor
A new instance of PayPalAccount.
Methods included from BaseModule
Methods included from BaseModule::Methods
#copy_instance_variables_from_object, #return_object_or_raise, #set_instance_variables_from_hash, #singleton_class
Constructor Details
#initialize(gateway, attributes) ⇒ PayPalAccount
Returns a new instance of PayPalAccount.
17 18 19 20 21 |
# File 'lib/braintree/paypal_account.rb', line 17 def initialize(gateway, attributes) @gateway = gateway set_instance_variables_from_hash(attributes) @subscriptions = (@subscriptions || []).map { |subscription_hash| Subscription._new(@gateway, subscription_hash) } end |
Instance Attribute Details
#billing_agreement_id ⇒ Object (readonly)
Returns the value of attribute billing_agreement_id.
5 6 7 |
# File 'lib/braintree/paypal_account.rb', line 5 def billing_agreement_id @billing_agreement_id end |
#created_at ⇒ Object (readonly)
Returns the value of attribute created_at.
6 7 8 |
# File 'lib/braintree/paypal_account.rb', line 6 def created_at @created_at end |
#customer_id ⇒ Object (readonly)
Returns the value of attribute customer_id.
7 8 9 |
# File 'lib/braintree/paypal_account.rb', line 7 def customer_id @customer_id end |
#email ⇒ Object (readonly)
Returns the value of attribute email.
8 9 10 |
# File 'lib/braintree/paypal_account.rb', line 8 def email @email end |
#funding_source_description ⇒ Object (readonly)
Returns the value of attribute funding_source_description.
9 10 11 |
# File 'lib/braintree/paypal_account.rb', line 9 def funding_source_description @funding_source_description end |
#image_url ⇒ Object (readonly)
Returns the value of attribute image_url.
10 11 12 |
# File 'lib/braintree/paypal_account.rb', line 10 def image_url @image_url end |
#payer_id ⇒ Object (readonly)
Returns the value of attribute payer_id.
11 12 13 |
# File 'lib/braintree/paypal_account.rb', line 11 def payer_id @payer_id end |
#revoked_at ⇒ Object (readonly)
Returns the value of attribute revoked_at.
12 13 14 |
# File 'lib/braintree/paypal_account.rb', line 12 def revoked_at @revoked_at end |
#subscriptions ⇒ Object (readonly)
Returns the value of attribute subscriptions.
13 14 15 |
# File 'lib/braintree/paypal_account.rb', line 13 def subscriptions @subscriptions end |
#token ⇒ Object (readonly)
Returns the value of attribute token.
14 15 16 |
# File 'lib/braintree/paypal_account.rb', line 14 def token @token end |
#updated_at ⇒ Object (readonly)
Returns the value of attribute updated_at.
15 16 17 |
# File 'lib/braintree/paypal_account.rb', line 15 def updated_at @updated_at end |
Class Method Details
._new(*args) ⇒ Object
27 28 29 |
# File 'lib/braintree/paypal_account.rb', line 27 def self._new(*args) self.new(*args) end |
.create(attributes) ⇒ Object
31 32 33 |
# File 'lib/braintree/paypal_account.rb', line 31 def self.create(attributes) Configuration.gateway.paypal_account.create(attributes) end |
.delete(token) ⇒ Object
43 44 45 |
# File 'lib/braintree/paypal_account.rb', line 43 def self.delete(token) Configuration.gateway.paypal_account.delete(token) end |
.find(token) ⇒ Object
35 36 37 |
# File 'lib/braintree/paypal_account.rb', line 35 def self.find(token) Configuration.gateway.paypal_account.find(token) end |
.sale(token, transaction_attributes) ⇒ Object
47 48 49 |
# File 'lib/braintree/paypal_account.rb', line 47 def self.sale(token, transaction_attributes) Configuration.gateway.transaction.sale(transaction_attributes.merge(:payment_method_token => token)) end |
.sale!(token, transaction_attributes) ⇒ Object
51 52 53 |
# File 'lib/braintree/paypal_account.rb', line 51 def self.sale!(token, transaction_attributes) return_object_or_raise(:transaction) { sale(token, transaction_attributes) } end |
.update(token, attributes) ⇒ Object
39 40 41 |
# File 'lib/braintree/paypal_account.rb', line 39 def self.update(token, attributes) Configuration.gateway.paypal_account.update(token, attributes) end |
Instance Method Details
#default? ⇒ Boolean
55 56 57 |
# File 'lib/braintree/paypal_account.rb', line 55 def default? @default end |