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.
-
#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.
16 17 18 19 20 |
# File 'lib/braintree/paypal_account.rb', line 16 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 |
#image_url ⇒ Object (readonly)
Returns the value of attribute image_url.
9 10 11 |
# File 'lib/braintree/paypal_account.rb', line 9 def image_url @image_url end |
#payer_id ⇒ Object (readonly)
Returns the value of attribute payer_id.
10 11 12 |
# File 'lib/braintree/paypal_account.rb', line 10 def payer_id @payer_id end |
#revoked_at ⇒ Object (readonly)
Returns the value of attribute revoked_at.
11 12 13 |
# File 'lib/braintree/paypal_account.rb', line 11 def revoked_at @revoked_at end |
#subscriptions ⇒ Object (readonly)
Returns the value of attribute subscriptions.
12 13 14 |
# File 'lib/braintree/paypal_account.rb', line 12 def subscriptions @subscriptions end |
#token ⇒ Object (readonly)
Returns the value of attribute token.
13 14 15 |
# File 'lib/braintree/paypal_account.rb', line 13 def token @token end |
#updated_at ⇒ Object (readonly)
Returns the value of attribute updated_at.
14 15 16 |
# File 'lib/braintree/paypal_account.rb', line 14 def updated_at @updated_at end |
Class Method Details
._new(*args) ⇒ Object
26 27 28 |
# File 'lib/braintree/paypal_account.rb', line 26 def self._new(*args) self.new(*args) end |
.create(attributes) ⇒ Object
30 31 32 |
# File 'lib/braintree/paypal_account.rb', line 30 def self.create(attributes) Configuration.gateway.paypal_account.create(attributes) end |
.delete(token) ⇒ Object
42 43 44 |
# File 'lib/braintree/paypal_account.rb', line 42 def self.delete(token) Configuration.gateway.paypal_account.delete(token) end |
.find(token) ⇒ Object
34 35 36 |
# File 'lib/braintree/paypal_account.rb', line 34 def self.find(token) Configuration.gateway.paypal_account.find(token) end |
.sale(token, transaction_attributes) ⇒ Object
46 47 48 |
# File 'lib/braintree/paypal_account.rb', line 46 def self.sale(token, transaction_attributes) Configuration.gateway.transaction.sale(transaction_attributes.merge(:payment_method_token => token)) end |
.sale!(token, transaction_attributes) ⇒ Object
50 51 52 |
# File 'lib/braintree/paypal_account.rb', line 50 def self.sale!(token, transaction_attributes) return_object_or_raise(:transaction) { sale(token, transaction_attributes) } end |
.update(token, attributes) ⇒ Object
38 39 40 |
# File 'lib/braintree/paypal_account.rb', line 38 def self.update(token, attributes) Configuration.gateway.paypal_account.update(token, attributes) end |
Instance Method Details
#default? ⇒ Boolean
54 55 56 |
# File 'lib/braintree/paypal_account.rb', line 54 def default? @default end |