Method: ProcessOut::Token#prefill

Defined in:
lib/processout/token.rb

#prefill(data) ⇒ Object

Prefills the object with the data passed as parameters Params:

data

Hash of data



327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
# File 'lib/processout/token.rb', line 327

def prefill(data)
  if data.nil?
    return self
  end
  self.id = data.fetch(:id, self.id)
  self.customer = data.fetch(:customer, self.customer)
  self.customer_id = data.fetch(:customer_id, self.customer_id)
  self.gateway_configuration = data.fetch(:gateway_configuration, self.gateway_configuration)
  self.gateway_configuration_id = data.fetch(:gateway_configuration_id, self.gateway_configuration_id)
  self.card = data.fetch(:card, self.card)
  self.card_id = data.fetch(:card_id, self.card_id)
  self.type = data.fetch(:type, self.type)
  self. = data.fetch(:metadata, self.)
  self.is_subscription_only = data.fetch(:is_subscription_only, self.is_subscription_only)
  self.is_default = data.fetch(:is_default, self.is_default)
  self.return_url = data.fetch(:return_url, self.return_url)
  self.cancel_url = data.fetch(:cancel_url, self.cancel_url)
  self.summary = data.fetch(:summary, self.summary)
  self.is_chargeable = data.fetch(:is_chargeable, self.is_chargeable)
  self.created_at = data.fetch(:created_at, self.created_at)
  self.description = data.fetch(:description, self.description)
  self.invoice = data.fetch(:invoice, self.invoice)
  self.invoice_id = data.fetch(:invoice_id, self.invoice_id)
  self.manual_invoice_cancellation = data.fetch(:manual_invoice_cancellation, self.manual_invoice_cancellation)
  self.verification_status = data.fetch(:verification_status, self.verification_status)
  self.can_get_balance = data.fetch(:can_get_balance, self.can_get_balance)
  self.webhook_url = data.fetch(:webhook_url, self.webhook_url)
  
  self
end