Class: Braintree::SepaDirectDebitAccount

Inherits:
Object
  • Object
show all
Includes:
BaseModule
Defined in:
lib/braintree/sepa_direct_debit_account.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from BaseModule

included

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) ⇒ SepaDirectDebitAccount

Returns a new instance of SepaDirectDebitAccount.



20
21
22
23
24
# File 'lib/braintree/sepa_direct_debit_account.rb', line 20

def initialize(gateway, attributes)
  @gateway = gateway
  @subscriptions = (@subscriptions || []).map { |subscription_hash| Subscription._new(@gateway, subscription_hash) }
  set_instance_variables_from_hash(attributes)
end

Instance Attribute Details

#bank_reference_tokenObject (readonly)

Returns the value of attribute bank_reference_token.



5
6
7
# File 'lib/braintree/sepa_direct_debit_account.rb', line 5

def bank_reference_token
  @bank_reference_token
end

#created_atObject (readonly)

Returns the value of attribute created_at.



6
7
8
# File 'lib/braintree/sepa_direct_debit_account.rb', line 6

def created_at
  @created_at
end

#customer_global_idObject (readonly)

Returns the value of attribute customer_global_id.



8
9
10
# File 'lib/braintree/sepa_direct_debit_account.rb', line 8

def customer_global_id
  @customer_global_id
end

#customer_idObject (readonly)

Returns the value of attribute customer_id.



7
8
9
# File 'lib/braintree/sepa_direct_debit_account.rb', line 7

def customer_id
  @customer_id
end

#defaultObject (readonly)

Returns the value of attribute default.



9
10
11
# File 'lib/braintree/sepa_direct_debit_account.rb', line 9

def default
  @default
end

#global_idObject (readonly)

Returns the value of attribute global_id.



10
11
12
# File 'lib/braintree/sepa_direct_debit_account.rb', line 10

def global_id
  @global_id
end

#image_urlObject (readonly)

Returns the value of attribute image_url.



11
12
13
# File 'lib/braintree/sepa_direct_debit_account.rb', line 11

def image_url
  @image_url
end

#last_4Object (readonly)

Returns the value of attribute last_4.



12
13
14
# File 'lib/braintree/sepa_direct_debit_account.rb', line 12

def last_4
  @last_4
end

#mandate_typeObject (readonly)

Returns the value of attribute mandate_type.



13
14
15
# File 'lib/braintree/sepa_direct_debit_account.rb', line 13

def mandate_type
  @mandate_type
end

#merchant_or_partner_customer_idObject (readonly)

Returns the value of attribute merchant_or_partner_customer_id.



14
15
16
# File 'lib/braintree/sepa_direct_debit_account.rb', line 14

def merchant_or_partner_customer_id
  @merchant_or_partner_customer_id
end

#subscriptionsObject (readonly)

Returns the value of attribute subscriptions.



15
16
17
# File 'lib/braintree/sepa_direct_debit_account.rb', line 15

def subscriptions
  @subscriptions
end

#tokenObject (readonly)

Returns the value of attribute token.



16
17
18
# File 'lib/braintree/sepa_direct_debit_account.rb', line 16

def token
  @token
end

#updated_atObject (readonly)

Returns the value of attribute updated_at.



17
18
19
# File 'lib/braintree/sepa_direct_debit_account.rb', line 17

def updated_at
  @updated_at
end

#view_mandate_urlObject (readonly)

Returns the value of attribute view_mandate_url.



18
19
20
# File 'lib/braintree/sepa_direct_debit_account.rb', line 18

def view_mandate_url
  @view_mandate_url
end

Class Method Details

._new(*args) ⇒ Object



34
35
36
# File 'lib/braintree/sepa_direct_debit_account.rb', line 34

def self._new(*args)
  self.new(*args)
end

.delete(*args) ⇒ Object



42
43
44
# File 'lib/braintree/sepa_direct_debit_account.rb', line 42

def self.delete(*args)
  Configuration.gateway..delete(*args)
end

.find(*args) ⇒ Object



38
39
40
# File 'lib/braintree/sepa_direct_debit_account.rb', line 38

def self.find(*args)
  Configuration.gateway..find(*args)
end

.sale(token, transaction_attributes) ⇒ Object



46
47
48
49
50
51
52
53
54
# File 'lib/braintree/sepa_direct_debit_account.rb', line 46

def self.sale(token, transaction_attributes)
  options = transaction_attributes[:options] || {}
  Configuration.gateway.transaction.sale(
    transaction_attributes.merge(
      :payment_method_token => token,
      :options => options.merge(:submit_for_settlement => true),
    ),
  )
end

.sale!(token, transaction_attributes) ⇒ Object



56
57
58
# File 'lib/braintree/sepa_direct_debit_account.rb', line 56

def self.sale!(token, transaction_attributes)
  return_object_or_raise(:transaction) { sale(token, transaction_attributes) }
end

Instance Method Details

#default?Boolean

Returns:

  • (Boolean)


26
27
28
# File 'lib/braintree/sepa_direct_debit_account.rb', line 26

def default?
  @default
end