Method: ProcessOut::Token#fill_with_data

Defined in:
lib/processout/token.rb

#fill_with_data(data) ⇒ Object

Fills the object with data coming from the API Params:

data

Hash of data coming from the API



247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
# File 'lib/processout/token.rb', line 247

def fill_with_data(data)
  if data.nil?
    return self
  end
  if data.include? "id"
    self.id = data["id"]
  end
  if data.include? "customer"
    self.customer = data["customer"]
  end
  if data.include? "customer_id"
    self.customer_id = data["customer_id"]
  end
  if data.include? "gateway_configuration"
    self.gateway_configuration = data["gateway_configuration"]
  end
  if data.include? "gateway_configuration_id"
    self.gateway_configuration_id = data["gateway_configuration_id"]
  end
  if data.include? "card"
    self.card = data["card"]
  end
  if data.include? "card_id"
    self.card_id = data["card_id"]
  end
  if data.include? "type"
    self.type = data["type"]
  end
  if data.include? "metadata"
    self. = data["metadata"]
  end
  if data.include? "is_subscription_only"
    self.is_subscription_only = data["is_subscription_only"]
  end
  if data.include? "is_default"
    self.is_default = data["is_default"]
  end
  if data.include? "return_url"
    self.return_url = data["return_url"]
  end
  if data.include? "cancel_url"
    self.cancel_url = data["cancel_url"]
  end
  if data.include? "summary"
    self.summary = data["summary"]
  end
  if data.include? "is_chargeable"
    self.is_chargeable = data["is_chargeable"]
  end
  if data.include? "created_at"
    self.created_at = data["created_at"]
  end
  if data.include? "description"
    self.description = data["description"]
  end
  if data.include? "invoice"
    self.invoice = data["invoice"]
  end
  if data.include? "invoice_id"
    self.invoice_id = data["invoice_id"]
  end
  if data.include? "manual_invoice_cancellation"
    self.manual_invoice_cancellation = data["manual_invoice_cancellation"]
  end
  if data.include? "verification_status"
    self.verification_status = data["verification_status"]
  end
  if data.include? "can_get_balance"
    self.can_get_balance = data["can_get_balance"]
  end
  if data.include? "webhook_url"
    self.webhook_url = data["webhook_url"]
  end
  
  self
end