Class: AdvancedBilling::SubscriptionBankAccount
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- AdvancedBilling::SubscriptionBankAccount
- Defined in:
- lib/advanced_billing/models/subscription_bank_account.rb
Overview
SubscriptionBankAccount Model.
Instance Attribute Summary collapse
-
#bank_account_holder_type ⇒ String
Defaults to personal.
-
#bank_account_type ⇒ String
Defaults to checking.
-
#bank_name ⇒ String
The bank where the account resides.
-
#billing_address ⇒ String
The current billing street address for the bank account.
-
#billing_address_2 ⇒ String
The current billing street address, second line, for the bank account.
-
#billing_city ⇒ String
The current billing address city for the bank account.
-
#billing_country ⇒ String
The current billing address country for the bank account.
-
#billing_state ⇒ String
The current billing address state for the bank account.
-
#billing_zip ⇒ String
The current billing address zip code for the bank account.
-
#chargify_token ⇒ String
Token received after sending billing informations using chargify.js.
-
#current_vault ⇒ BankAccountVault
The vault that stores the payment profile with the provided vault_token.
-
#customer_id ⇒ Integer
The Chargify-assigned id for the customer record to which the bank account belongs.
-
#customer_vault_token ⇒ String
(only for Authorize.Net CIM storage): the customerProfileId for the owner of the customerPaymentProfileId provided as the vault_token.
-
#first_name ⇒ String
The first name of the bank account holder.
-
#gateway_handle ⇒ String
Token received after sending billing informations using chargify.js.
-
#id ⇒ Integer
The Chargify-assigned ID of the stored bank account.
-
#last_name ⇒ String
The last name of the bank account holder.
-
#masked_bank_account_number ⇒ String
A string representation of the stored bank account number with all but the last 4 digits marked with X’s (i.e. ‘XXXXXXX1111’).
-
#masked_bank_routing_number ⇒ String
A string representation of the stored bank routing number with all but the last 4 digits marked with X’s (i.e. ‘XXXXXXX1111’).
-
#site_gateway_setting_id ⇒ Integer
Token received after sending billing informations using chargify.js.
-
#vault_token ⇒ String
The “token” provided by your vault storage for an already stored payment profile.
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
Methods inherited from BaseModel
Constructor Details
#initialize(bank_account_holder_type = SKIP, bank_account_type = SKIP, bank_name = SKIP, billing_address = SKIP, billing_address_2 = SKIP, billing_city = SKIP, billing_state = SKIP, billing_zip = SKIP, billing_country = SKIP, current_vault = SKIP, customer_id = SKIP, customer_vault_token = SKIP, first_name = SKIP, last_name = SKIP, id = SKIP, masked_bank_account_number = SKIP, masked_bank_routing_number = SKIP, vault_token = SKIP, chargify_token = SKIP, site_gateway_setting_id = SKIP, gateway_handle = SKIP) ⇒ SubscriptionBankAccount
Returns a new instance of SubscriptionBankAccount.
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 |
# File 'lib/advanced_billing/models/subscription_bank_account.rb', line 169 def initialize(bank_account_holder_type = SKIP, bank_account_type = SKIP, bank_name = SKIP, billing_address = SKIP, billing_address_2 = SKIP, billing_city = SKIP, billing_state = SKIP, billing_zip = SKIP, billing_country = SKIP, current_vault = SKIP, customer_id = SKIP, customer_vault_token = SKIP, first_name = SKIP, last_name = SKIP, id = SKIP, masked_bank_account_number = SKIP, masked_bank_routing_number = SKIP, vault_token = SKIP, chargify_token = SKIP, site_gateway_setting_id = SKIP, gateway_handle = SKIP) @bank_account_holder_type = bank_account_holder_type unless bank_account_holder_type == SKIP @bank_account_type = bank_account_type unless bank_account_type == SKIP @bank_name = bank_name unless bank_name == SKIP @billing_address = billing_address unless billing_address == SKIP @billing_address_2 = billing_address_2 unless billing_address_2 == 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 @current_vault = current_vault unless current_vault == SKIP @customer_id = customer_id unless customer_id == SKIP @customer_vault_token = customer_vault_token unless customer_vault_token == SKIP @first_name = first_name unless first_name == SKIP @last_name = last_name unless last_name == SKIP @id = id unless id == SKIP unless masked_bank_account_number == SKIP @masked_bank_account_number = masked_bank_account_number end unless masked_bank_routing_number == SKIP @masked_bank_routing_number = masked_bank_routing_number end @vault_token = vault_token unless vault_token == SKIP @chargify_token = chargify_token unless chargify_token == SKIP @site_gateway_setting_id = site_gateway_setting_id unless site_gateway_setting_id == SKIP @gateway_handle = gateway_handle unless gateway_handle == SKIP end |
Instance Attribute Details
#bank_account_holder_type ⇒ String
Defaults to personal
14 15 16 |
# File 'lib/advanced_billing/models/subscription_bank_account.rb', line 14 def bank_account_holder_type @bank_account_holder_type end |
#bank_account_type ⇒ String
Defaults to checking
18 19 20 |
# File 'lib/advanced_billing/models/subscription_bank_account.rb', line 18 def bank_account_type @bank_account_type end |
#bank_name ⇒ String
The bank where the account resides
22 23 24 |
# File 'lib/advanced_billing/models/subscription_bank_account.rb', line 22 def bank_name @bank_name end |
#billing_address ⇒ String
The current billing street address for the bank account
26 27 28 |
# File 'lib/advanced_billing/models/subscription_bank_account.rb', line 26 def billing_address @billing_address end |
#billing_address_2 ⇒ String
The current billing street address, second line, for the bank account
30 31 32 |
# File 'lib/advanced_billing/models/subscription_bank_account.rb', line 30 def billing_address_2 @billing_address_2 end |
#billing_city ⇒ String
The current billing address city for the bank account
34 35 36 |
# File 'lib/advanced_billing/models/subscription_bank_account.rb', line 34 def billing_city @billing_city end |
#billing_country ⇒ String
The current billing address country for the bank account
46 47 48 |
# File 'lib/advanced_billing/models/subscription_bank_account.rb', line 46 def billing_country @billing_country end |
#billing_state ⇒ String
The current billing address state for the bank account
38 39 40 |
# File 'lib/advanced_billing/models/subscription_bank_account.rb', line 38 def billing_state @billing_state end |
#billing_zip ⇒ String
The current billing address zip code for the bank account
42 43 44 |
# File 'lib/advanced_billing/models/subscription_bank_account.rb', line 42 def billing_zip @billing_zip end |
#chargify_token ⇒ String
Token received after sending billing informations using chargify.js. This token will only be received if passed as a sole attribute of credit_card_attributes (i.e. tok_9g6hw85pnpt6knmskpwp4ttt)
96 97 98 |
# File 'lib/advanced_billing/models/subscription_bank_account.rb', line 96 def chargify_token @chargify_token end |
#current_vault ⇒ BankAccountVault
The vault that stores the payment profile with the provided vault_token.
50 51 52 |
# File 'lib/advanced_billing/models/subscription_bank_account.rb', line 50 def current_vault @current_vault end |
#customer_id ⇒ Integer
The Chargify-assigned id for the customer record to which the bank account belongs
55 56 57 |
# File 'lib/advanced_billing/models/subscription_bank_account.rb', line 55 def customer_id @customer_id end |
#customer_vault_token ⇒ String
(only for Authorize.Net CIM storage): the customerProfileId for the owner of the customerPaymentProfileId provided as the vault_token
60 61 62 |
# File 'lib/advanced_billing/models/subscription_bank_account.rb', line 60 def customer_vault_token @customer_vault_token end |
#first_name ⇒ String
The first name of the bank account holder
64 65 66 |
# File 'lib/advanced_billing/models/subscription_bank_account.rb', line 64 def first_name @first_name end |
#gateway_handle ⇒ String
Token received after sending billing informations using chargify.js. This token will only be received if passed as a sole attribute of credit_card_attributes (i.e. tok_9g6hw85pnpt6knmskpwp4ttt)
108 109 110 |
# File 'lib/advanced_billing/models/subscription_bank_account.rb', line 108 def gateway_handle @gateway_handle end |
#id ⇒ Integer
The Chargify-assigned ID of the stored bank account. This value can be used as an input to payment_profile_id when creating a subscription, in order to re-use a stored payment profile for the same customer
74 75 76 |
# File 'lib/advanced_billing/models/subscription_bank_account.rb', line 74 def id @id end |
#last_name ⇒ String
The last name of the bank account holder
68 69 70 |
# File 'lib/advanced_billing/models/subscription_bank_account.rb', line 68 def last_name @last_name end |
#masked_bank_account_number ⇒ String
A string representation of the stored bank account number with all but the last 4 digits marked with X’s (i.e. ‘XXXXXXX1111’)
79 80 81 |
# File 'lib/advanced_billing/models/subscription_bank_account.rb', line 79 def masked_bank_account_number @masked_bank_account_number end |
#masked_bank_routing_number ⇒ String
A string representation of the stored bank routing number with all but the last 4 digits marked with X’s (i.e. ‘XXXXXXX1111’). payment_type will be bank_account
85 86 87 |
# File 'lib/advanced_billing/models/subscription_bank_account.rb', line 85 def masked_bank_routing_number @masked_bank_routing_number end |
#site_gateway_setting_id ⇒ Integer
Token received after sending billing informations using chargify.js. This token will only be received if passed as a sole attribute of credit_card_attributes (i.e. tok_9g6hw85pnpt6knmskpwp4ttt)
102 103 104 |
# File 'lib/advanced_billing/models/subscription_bank_account.rb', line 102 def site_gateway_setting_id @site_gateway_setting_id end |
#vault_token ⇒ String
The “token” provided by your vault storage for an already stored payment profile
90 91 92 |
# File 'lib/advanced_billing/models/subscription_bank_account.rb', line 90 def vault_token @vault_token end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 |
# File 'lib/advanced_billing/models/subscription_bank_account.rb', line 210 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. bank_account_holder_type = hash.key?('bank_account_holder_type') ? hash['bank_account_holder_type'] : SKIP bank_account_type = hash.key?('bank_account_type') ? hash['bank_account_type'] : SKIP bank_name = hash.key?('bank_name') ? hash['bank_name'] : SKIP billing_address = hash.key?('billing_address') ? hash['billing_address'] : SKIP billing_address_2 = hash.key?('billing_address_2') ? hash['billing_address_2'] : 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 current_vault = hash.key?('current_vault') ? hash['current_vault'] : SKIP customer_id = hash.key?('customer_id') ? hash['customer_id'] : SKIP customer_vault_token = hash.key?('customer_vault_token') ? hash['customer_vault_token'] : SKIP first_name = hash.key?('first_name') ? hash['first_name'] : SKIP last_name = hash.key?('last_name') ? hash['last_name'] : SKIP id = hash.key?('id') ? hash['id'] : SKIP masked_bank_account_number = hash.key?('masked_bank_account_number') ? hash['masked_bank_account_number'] : SKIP masked_bank_routing_number = hash.key?('masked_bank_routing_number') ? hash['masked_bank_routing_number'] : SKIP vault_token = hash.key?('vault_token') ? hash['vault_token'] : SKIP chargify_token = hash.key?('chargify_token') ? hash['chargify_token'] : SKIP site_gateway_setting_id = hash.key?('site_gateway_setting_id') ? hash['site_gateway_setting_id'] : SKIP gateway_handle = hash.key?('gateway_handle') ? hash['gateway_handle'] : SKIP # Create object from extracted values. SubscriptionBankAccount.new(bank_account_holder_type, bank_account_type, bank_name, billing_address, billing_address_2, billing_city, billing_state, billing_zip, billing_country, current_vault, customer_id, customer_vault_token, first_name, last_name, id, masked_bank_account_number, masked_bank_routing_number, vault_token, chargify_token, site_gateway_setting_id, gateway_handle) end |
.names ⇒ Object
A mapping from model property names to API property names.
111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 |
# File 'lib/advanced_billing/models/subscription_bank_account.rb', line 111 def self.names @_hash = {} if @_hash.nil? @_hash['bank_account_holder_type'] = 'bank_account_holder_type' @_hash['bank_account_type'] = 'bank_account_type' @_hash['bank_name'] = 'bank_name' @_hash['billing_address'] = 'billing_address' @_hash['billing_address_2'] = 'billing_address_2' @_hash['billing_city'] = 'billing_city' @_hash['billing_state'] = 'billing_state' @_hash['billing_zip'] = 'billing_zip' @_hash['billing_country'] = 'billing_country' @_hash['current_vault'] = 'current_vault' @_hash['customer_id'] = 'customer_id' @_hash['customer_vault_token'] = 'customer_vault_token' @_hash['first_name'] = 'first_name' @_hash['last_name'] = 'last_name' @_hash['id'] = 'id' @_hash['masked_bank_account_number'] = 'masked_bank_account_number' @_hash['masked_bank_routing_number'] = 'masked_bank_routing_number' @_hash['vault_token'] = 'vault_token' @_hash['chargify_token'] = 'chargify_token' @_hash['site_gateway_setting_id'] = 'site_gateway_setting_id' @_hash['gateway_handle'] = 'gateway_handle' @_hash end |
.nullables ⇒ Object
An array for nullable fields
165 166 167 |
# File 'lib/advanced_billing/models/subscription_bank_account.rb', line 165 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 |
# File 'lib/advanced_billing/models/subscription_bank_account.rb', line 138 def self.optionals %w[ bank_account_holder_type bank_account_type bank_name billing_address billing_address_2 billing_city billing_state billing_zip billing_country current_vault customer_id customer_vault_token first_name last_name id masked_bank_account_number masked_bank_routing_number vault_token chargify_token site_gateway_setting_id gateway_handle ] end |
.validate(value) ⇒ Object
Validates an instance of the object from a given value.
273 274 275 276 277 278 279 |
# File 'lib/advanced_billing/models/subscription_bank_account.rb', line 273 def self.validate(value) return true if value.instance_of? self return false unless value.instance_of? Hash true end |