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.
-
#edit_paypal_vault_id ⇒ Object
readonly
Returns the value of attribute edit_paypal_vault_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.
18 19 20 21 22 |
# File 'lib/braintree/paypal_account.rb', line 18 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 |
#edit_paypal_vault_id ⇒ Object (readonly)
Returns the value of attribute edit_paypal_vault_id.
8 9 10 |
# File 'lib/braintree/paypal_account.rb', line 8 def edit_paypal_vault_id @edit_paypal_vault_id end |
#email ⇒ Object (readonly)
Returns the value of attribute email.
9 10 11 |
# File 'lib/braintree/paypal_account.rb', line 9 def email @email end |
#funding_source_description ⇒ Object (readonly)
Returns the value of attribute funding_source_description.
10 11 12 |
# File 'lib/braintree/paypal_account.rb', line 10 def funding_source_description @funding_source_description end |
#image_url ⇒ Object (readonly)
Returns the value of attribute image_url.
11 12 13 |
# File 'lib/braintree/paypal_account.rb', line 11 def image_url @image_url end |
#payer_id ⇒ Object (readonly)
Returns the value of attribute payer_id.
12 13 14 |
# File 'lib/braintree/paypal_account.rb', line 12 def payer_id @payer_id end |
#revoked_at ⇒ Object (readonly)
Returns the value of attribute revoked_at.
13 14 15 |
# File 'lib/braintree/paypal_account.rb', line 13 def revoked_at @revoked_at end |
#subscriptions ⇒ Object (readonly)
Returns the value of attribute subscriptions.
14 15 16 |
# File 'lib/braintree/paypal_account.rb', line 14 def subscriptions @subscriptions end |
#token ⇒ Object (readonly)
Returns the value of attribute token.
15 16 17 |
# File 'lib/braintree/paypal_account.rb', line 15 def token @token end |
#updated_at ⇒ Object (readonly)
Returns the value of attribute updated_at.
16 17 18 |
# File 'lib/braintree/paypal_account.rb', line 16 def updated_at @updated_at end |
Class Method Details
._new(*args) ⇒ Object
28 29 30 |
# File 'lib/braintree/paypal_account.rb', line 28 def self._new(*args) self.new(*args) end |
.create(attributes) ⇒ Object
32 33 34 |
# File 'lib/braintree/paypal_account.rb', line 32 def self.create(attributes) Configuration.gateway.paypal_account.create(attributes) end |
.delete(token) ⇒ Object
44 45 46 |
# File 'lib/braintree/paypal_account.rb', line 44 def self.delete(token) Configuration.gateway.paypal_account.delete(token) end |
.find(token) ⇒ Object
36 37 38 |
# File 'lib/braintree/paypal_account.rb', line 36 def self.find(token) Configuration.gateway.paypal_account.find(token) end |
.sale(token, transaction_attributes) ⇒ Object
48 49 50 |
# File 'lib/braintree/paypal_account.rb', line 48 def self.sale(token, transaction_attributes) Configuration.gateway.transaction.sale(transaction_attributes.merge(:payment_method_token => token)) end |
.sale!(token, transaction_attributes) ⇒ Object
52 53 54 |
# File 'lib/braintree/paypal_account.rb', line 52 def self.sale!(token, transaction_attributes) return_object_or_raise(:transaction) { sale(token, transaction_attributes) } end |
.update(token, attributes) ⇒ Object
40 41 42 |
# File 'lib/braintree/paypal_account.rb', line 40 def self.update(token, attributes) Configuration.gateway.paypal_account.update(token, attributes) end |
Instance Method Details
#default? ⇒ Boolean
56 57 58 |
# File 'lib/braintree/paypal_account.rb', line 56 def default? @default end |