Class: PaysonAPI::V2::Models::Checkout

Inherits:
Object
  • Object
show all
Defined in:
lib/payson_api/v2/models/checkout.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#customerObject

Returns the value of attribute customer.



7
8
9
# File 'lib/payson_api/v2/models/checkout.rb', line 7

def customer
  @customer
end

#descriptionObject

Returns the value of attribute description.



7
8
9
# File 'lib/payson_api/v2/models/checkout.rb', line 7

def description
  @description
end

#expiration_timeObject

Returns the value of attribute expiration_time.



7
8
9
# File 'lib/payson_api/v2/models/checkout.rb', line 7

def expiration_time
  @expiration_time
end

#idObject

Returns the value of attribute id.



7
8
9
# File 'lib/payson_api/v2/models/checkout.rb', line 7

def id
  @id
end

#merchantObject

Returns the value of attribute merchant.



7
8
9
# File 'lib/payson_api/v2/models/checkout.rb', line 7

def merchant
  @merchant
end

#orderObject

Returns the value of attribute order.



7
8
9
# File 'lib/payson_api/v2/models/checkout.rb', line 7

def order
  @order
end

#snippetObject

Returns the value of attribute snippet.



7
8
9
# File 'lib/payson_api/v2/models/checkout.rb', line 7

def snippet
  @snippet
end

#statusObject

Returns the value of attribute status.



7
8
9
# File 'lib/payson_api/v2/models/checkout.rb', line 7

def status
  @status
end

Class Method Details

.from_hash(hash) ⇒ Object



10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/payson_api/v2/models/checkout.rb', line 10

def self.from_hash(hash)
  new.tap do |checkout|
    checkout.id = hash['id']
    checkout.status = hash['status']
    checkout.expiration_time = hash['expirationTime']
    checkout.description = hash['description']
    checkout.snippet = hash['snippet']

    checkout.customer = PaysonAPI::V2::Models::Customer.from_hash(hash['customer']) if hash['customer']

    checkout.merchant = PaysonAPI::V2::Models::Merchant.from_hash(hash['merchant']) if hash['merchant']

    checkout.order = PaysonAPI::V2::Models::Order.from_hash(hash['order'])
  end
end