Class: AdvancedBilling::SubscriptionGroupBankAccount
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- AdvancedBilling::SubscriptionGroupBankAccount
- Defined in:
- lib/advanced_billing/models/subscription_group_bank_account.rb
Overview
SubscriptionGroupBankAccount Model.
Instance Attribute Summary collapse
-
#bank_account_holder_type ⇒ HolderType
(Optional when creating a subscription with GoCardless) Branch code.
-
#bank_account_number ⇒ String
(Required when creating a subscription with ACH. Required when creating a subscription with GoCardless and bank_iban is blank) The customerʼs bank account number.
-
#bank_account_type ⇒ BankAccountType
(Optional when creating a subscription with GoCardless) Branch code.
-
#bank_branch_code ⇒ String
(Optional when creating a subscription with GoCardless) Branch code.
-
#bank_iban ⇒ String
(Optional when creating a subscription with GoCardless).
-
#bank_name ⇒ String
(Required when creating a subscription with ACH or GoCardless) The name of the bank where the customer’s account resides.
-
#bank_routing_number ⇒ String
(Required when creating a subscription with ACH. Optional when creating a subscription with GoCardless).
-
#billing_address ⇒ String
(Optional when creating a subscription with GoCardless) Branch code.
-
#billing_city ⇒ String
(Optional when creating a subscription with GoCardless) Branch code.
-
#billing_country ⇒ String
(Optional when creating a subscription with GoCardless) Branch code.
-
#billing_state ⇒ String
(Optional when creating a subscription with GoCardless) Branch code.
-
#billing_zip ⇒ String
(Optional when creating a subscription with GoCardless) Branch code.
-
#chargify_token ⇒ String
(Optional when creating a subscription with GoCardless) Branch code.
-
#current_vault ⇒ BankAccountVault
The vault that stores the payment profile with the provided vault_token.
-
#gateway_handle ⇒ String
The vault that stores the payment profile with the provided vault_token.
-
#payment_type ⇒ String
(Optional when creating a subscription with GoCardless) Branch code.
Class Method Summary collapse
-
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
-
.names ⇒ Object
A mapping from model property names to API property names.
-
.nullables ⇒ Object
An array for nullable fields.
-
.optionals ⇒ Object
An array for optional fields.
-
.validate(value) ⇒ Object
Validates an instance of the object from a given value.
Instance Method Summary collapse
-
#initialize(bank_name = SKIP, bank_account_number = SKIP, bank_routing_number = SKIP, bank_iban = SKIP, bank_branch_code = SKIP, bank_account_type = BankAccountType::CHECKING, bank_account_holder_type = SKIP, payment_type = SKIP, billing_address = SKIP, billing_city = SKIP, billing_state = SKIP, billing_zip = SKIP, billing_country = SKIP, chargify_token = SKIP, current_vault = SKIP, gateway_handle = SKIP) ⇒ SubscriptionGroupBankAccount
constructor
A new instance of SubscriptionGroupBankAccount.
Methods inherited from BaseModel
Constructor Details
#initialize(bank_name = SKIP, bank_account_number = SKIP, bank_routing_number = SKIP, bank_iban = SKIP, bank_branch_code = SKIP, bank_account_type = BankAccountType::CHECKING, bank_account_holder_type = SKIP, payment_type = SKIP, billing_address = SKIP, billing_city = SKIP, billing_state = SKIP, billing_zip = SKIP, billing_country = SKIP, chargify_token = SKIP, current_vault = SKIP, gateway_handle = SKIP) ⇒ SubscriptionGroupBankAccount
Returns a new instance of SubscriptionGroupBankAccount.
141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 |
# File 'lib/advanced_billing/models/subscription_group_bank_account.rb', line 141 def initialize(bank_name = SKIP, bank_account_number = SKIP, bank_routing_number = SKIP, bank_iban = SKIP, bank_branch_code = SKIP, bank_account_type = BankAccountType::CHECKING, bank_account_holder_type = SKIP, payment_type = SKIP, billing_address = SKIP, billing_city = SKIP, billing_state = SKIP, billing_zip = SKIP, billing_country = SKIP, chargify_token = SKIP, current_vault = SKIP, gateway_handle = SKIP) @bank_name = bank_name unless bank_name == SKIP @bank_account_number = bank_account_number unless bank_account_number == SKIP @bank_routing_number = bank_routing_number unless bank_routing_number == SKIP @bank_iban = bank_iban unless bank_iban == SKIP @bank_branch_code = bank_branch_code unless bank_branch_code == SKIP @bank_account_type = bank_account_type unless bank_account_type == SKIP @bank_account_holder_type = bank_account_holder_type unless bank_account_holder_type == SKIP @payment_type = payment_type unless payment_type == SKIP @billing_address = billing_address unless billing_address == SKIP @billing_city = billing_city unless billing_city == SKIP @billing_state = billing_state unless billing_state == SKIP @billing_zip = billing_zip unless billing_zip == SKIP @billing_country = billing_country unless billing_country == SKIP @chargify_token = chargify_token unless chargify_token == SKIP @current_vault = current_vault unless current_vault == SKIP @gateway_handle = gateway_handle unless gateway_handle == SKIP end |
Instance Attribute Details
#bank_account_holder_type ⇒ HolderType
(Optional when creating a subscription with GoCardless) Branch code. Alternatively, an IBAN can be provided
47 48 49 |
# File 'lib/advanced_billing/models/subscription_group_bank_account.rb', line 47 def bank_account_holder_type @bank_account_holder_type end |
#bank_account_number ⇒ String
(Required when creating a subscription with ACH. Required when creating a subscription with GoCardless and bank_iban is blank) The customerʼs bank account number
21 22 23 |
# File 'lib/advanced_billing/models/subscription_group_bank_account.rb', line 21 def bank_account_number @bank_account_number end |
#bank_account_type ⇒ BankAccountType
(Optional when creating a subscription with GoCardless) Branch code. Alternatively, an IBAN can be provided
42 43 44 |
# File 'lib/advanced_billing/models/subscription_group_bank_account.rb', line 42 def bank_account_type @bank_account_type end |
#bank_branch_code ⇒ String
(Optional when creating a subscription with GoCardless) Branch code. Alternatively, an IBAN can be provided
37 38 39 |
# File 'lib/advanced_billing/models/subscription_group_bank_account.rb', line 37 def bank_branch_code @bank_branch_code end |
#bank_iban ⇒ String
(Optional when creating a subscription with GoCardless). International Bank Account Number. Alternatively, local bank details can be provided
32 33 34 |
# File 'lib/advanced_billing/models/subscription_group_bank_account.rb', line 32 def bank_iban @bank_iban end |
#bank_name ⇒ String
(Required when creating a subscription with ACH or GoCardless) The name of the bank where the customer’s account resides
15 16 17 |
# File 'lib/advanced_billing/models/subscription_group_bank_account.rb', line 15 def bank_name @bank_name end |
#bank_routing_number ⇒ String
(Required when creating a subscription with ACH. Optional when creating a subscription with GoCardless). The routing number of the bank. It becomes bank_code while passing via GoCardless API
27 28 29 |
# File 'lib/advanced_billing/models/subscription_group_bank_account.rb', line 27 def bank_routing_number @bank_routing_number end |
#billing_address ⇒ String
(Optional when creating a subscription with GoCardless) Branch code. Alternatively, an IBAN can be provided
57 58 59 |
# File 'lib/advanced_billing/models/subscription_group_bank_account.rb', line 57 def billing_address @billing_address end |
#billing_city ⇒ String
(Optional when creating a subscription with GoCardless) Branch code. Alternatively, an IBAN can be provided
62 63 64 |
# File 'lib/advanced_billing/models/subscription_group_bank_account.rb', line 62 def billing_city @billing_city end |
#billing_country ⇒ String
(Optional when creating a subscription with GoCardless) Branch code. Alternatively, an IBAN can be provided
77 78 79 |
# File 'lib/advanced_billing/models/subscription_group_bank_account.rb', line 77 def billing_country @billing_country end |
#billing_state ⇒ String
(Optional when creating a subscription with GoCardless) Branch code. Alternatively, an IBAN can be provided
67 68 69 |
# File 'lib/advanced_billing/models/subscription_group_bank_account.rb', line 67 def billing_state @billing_state end |
#billing_zip ⇒ String
(Optional when creating a subscription with GoCardless) Branch code. Alternatively, an IBAN can be provided
72 73 74 |
# File 'lib/advanced_billing/models/subscription_group_bank_account.rb', line 72 def billing_zip @billing_zip end |
#chargify_token ⇒ String
(Optional when creating a subscription with GoCardless) Branch code. Alternatively, an IBAN can be provided
82 83 84 |
# File 'lib/advanced_billing/models/subscription_group_bank_account.rb', line 82 def chargify_token @chargify_token end |
#current_vault ⇒ BankAccountVault
The vault that stores the payment profile with the provided vault_token.
86 87 88 |
# File 'lib/advanced_billing/models/subscription_group_bank_account.rb', line 86 def current_vault @current_vault end |
#gateway_handle ⇒ String
The vault that stores the payment profile with the provided vault_token.
90 91 92 |
# File 'lib/advanced_billing/models/subscription_group_bank_account.rb', line 90 def gateway_handle @gateway_handle end |
#payment_type ⇒ String
(Optional when creating a subscription with GoCardless) Branch code. Alternatively, an IBAN can be provided
52 53 54 |
# File 'lib/advanced_billing/models/subscription_group_bank_account.rb', line 52 def payment_type @payment_type end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 |
# File 'lib/advanced_billing/models/subscription_group_bank_account.rb', line 169 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. bank_name = hash.key?('bank_name') ? hash['bank_name'] : SKIP bank_account_number = hash.key?('bank_account_number') ? hash['bank_account_number'] : SKIP bank_routing_number = hash.key?('bank_routing_number') ? hash['bank_routing_number'] : SKIP bank_iban = hash.key?('bank_iban') ? hash['bank_iban'] : SKIP bank_branch_code = hash.key?('bank_branch_code') ? hash['bank_branch_code'] : SKIP bank_account_type = hash['bank_account_type'] ||= BankAccountType::CHECKING bank_account_holder_type = hash.key?('bank_account_holder_type') ? hash['bank_account_holder_type'] : SKIP payment_type = hash.key?('payment_type') ? hash['payment_type'] : SKIP billing_address = hash.key?('billing_address') ? hash['billing_address'] : SKIP billing_city = hash.key?('billing_city') ? hash['billing_city'] : SKIP billing_state = hash.key?('billing_state') ? hash['billing_state'] : SKIP billing_zip = hash.key?('billing_zip') ? hash['billing_zip'] : SKIP billing_country = hash.key?('billing_country') ? hash['billing_country'] : SKIP chargify_token = hash.key?('chargify_token') ? hash['chargify_token'] : SKIP current_vault = hash.key?('current_vault') ? hash['current_vault'] : SKIP gateway_handle = hash.key?('gateway_handle') ? hash['gateway_handle'] : SKIP # Create object from extracted values. SubscriptionGroupBankAccount.new(bank_name, bank_account_number, bank_routing_number, bank_iban, bank_branch_code, bank_account_type, bank_account_holder_type, payment_type, billing_address, billing_city, billing_state, billing_zip, billing_country, chargify_token, current_vault, gateway_handle) end |
.names ⇒ Object
A mapping from model property names to API property names.
93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 |
# File 'lib/advanced_billing/models/subscription_group_bank_account.rb', line 93 def self.names @_hash = {} if @_hash.nil? @_hash['bank_name'] = 'bank_name' @_hash['bank_account_number'] = 'bank_account_number' @_hash['bank_routing_number'] = 'bank_routing_number' @_hash['bank_iban'] = 'bank_iban' @_hash['bank_branch_code'] = 'bank_branch_code' @_hash['bank_account_type'] = 'bank_account_type' @_hash['bank_account_holder_type'] = 'bank_account_holder_type' @_hash['payment_type'] = 'payment_type' @_hash['billing_address'] = 'billing_address' @_hash['billing_city'] = 'billing_city' @_hash['billing_state'] = 'billing_state' @_hash['billing_zip'] = 'billing_zip' @_hash['billing_country'] = 'billing_country' @_hash['chargify_token'] = 'chargify_token' @_hash['current_vault'] = 'current_vault' @_hash['gateway_handle'] = 'gateway_handle' @_hash end |
.nullables ⇒ Object
An array for nullable fields
137 138 139 |
# File 'lib/advanced_billing/models/subscription_group_bank_account.rb', line 137 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 |
# File 'lib/advanced_billing/models/subscription_group_bank_account.rb', line 115 def self.optionals %w[ bank_name bank_account_number bank_routing_number bank_iban bank_branch_code bank_account_type bank_account_holder_type payment_type billing_address billing_city billing_state billing_zip billing_country chargify_token current_vault gateway_handle ] end |
.validate(value) ⇒ Object
Validates an instance of the object from a given value.
220 221 222 223 224 225 226 |
# File 'lib/advanced_billing/models/subscription_group_bank_account.rb', line 220 def self.validate(value) return true if value.instance_of? self return false unless value.instance_of? Hash true end |