Class: AdvancedBilling::CreateInvoicePaymentApplication

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/advanced_billing/models/create_invoice_payment_application.rb

Overview

CreateInvoicePaymentApplication Model.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#to_hash, #to_json

Constructor Details

#initialize(invoice_uid = nil, amount = nil) ⇒ CreateInvoicePaymentApplication

Returns a new instance of CreateInvoicePaymentApplication.



39
40
41
42
43
# File 'lib/advanced_billing/models/create_invoice_payment_application.rb', line 39

def initialize(invoice_uid = nil,
               amount = nil)
  @invoice_uid = invoice_uid
  @amount = amount
end

Instance Attribute Details

#amountString

Dollar amount of the invoice payment (eg. “10.50” => $10.50).

Returns:

  • (String)


19
20
21
# File 'lib/advanced_billing/models/create_invoice_payment_application.rb', line 19

def amount
  @amount
end

#invoice_uidString

Unique identifier for the invoice. It has the prefix “inv_” followed by alphanumeric characters.

Returns:

  • (String)


15
16
17
# File 'lib/advanced_billing/models/create_invoice_payment_application.rb', line 15

def invoice_uid
  @invoice_uid
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



46
47
48
49
50
51
52
53
54
55
56
# File 'lib/advanced_billing/models/create_invoice_payment_application.rb', line 46

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.

  invoice_uid = hash.key?('invoice_uid') ? hash['invoice_uid'] : nil
  amount = hash.key?('amount') ? hash['amount'] : nil

  # Create object from extracted values.

  CreateInvoicePaymentApplication.new(invoice_uid,
                                      amount)
end

.namesObject

A mapping from model property names to API property names.



22
23
24
25
26
27
# File 'lib/advanced_billing/models/create_invoice_payment_application.rb', line 22

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['invoice_uid'] = 'invoice_uid'
  @_hash['amount'] = 'amount'
  @_hash
end

.nullablesObject

An array for nullable fields



35
36
37
# File 'lib/advanced_billing/models/create_invoice_payment_application.rb', line 35

def self.nullables
  []
end

.optionalsObject

An array for optional fields



30
31
32
# File 'lib/advanced_billing/models/create_invoice_payment_application.rb', line 30

def self.optionals
  []
end