Class: Ingenico::Connect::SDK::Webhooks::WebhooksEvent

Inherits:
DataObject
  • Object
show all
Defined in:
lib/ingenico/connect/sdk/webhooks/webhooks_event.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from DataObject

new_from_hash

Instance Attribute Details

#api_versionString

Returns the current value of api_version.

Returns:

  • (String)

    the current value of api_version



14
15
16
# File 'lib/ingenico/connect/sdk/webhooks/webhooks_event.rb', line 14

def api_version
  @api_version
end

#createdString

Returns the current value of created.

Returns:

  • (String)

    the current value of created



14
15
16
# File 'lib/ingenico/connect/sdk/webhooks/webhooks_event.rb', line 14

def created
  @created
end

#disputeIngenico::Connect::SDK::Domain::Dispute::DisputeResponse

Returns the current value of dispute.

Returns:



14
15
16
# File 'lib/ingenico/connect/sdk/webhooks/webhooks_event.rb', line 14

def dispute
  @dispute
end

#idString

Returns the current value of id.

Returns:

  • (String)

    the current value of id



14
15
16
# File 'lib/ingenico/connect/sdk/webhooks/webhooks_event.rb', line 14

def id
  @id
end

#merchant_idString

Returns the current value of merchant_id.

Returns:

  • (String)

    the current value of merchant_id



14
15
16
# File 'lib/ingenico/connect/sdk/webhooks/webhooks_event.rb', line 14

def merchant_id
  @merchant_id
end

#paymentIngenico::Connect::SDK::Domain::Payment::PaymentResponse

Returns the current value of payment.

Returns:



14
15
16
# File 'lib/ingenico/connect/sdk/webhooks/webhooks_event.rb', line 14

def payment
  @payment
end

#payoutIngenico::Connect::SDK::Domain::Refund::RefundResponse

Returns the current value of payout.

Returns:



14
15
16
# File 'lib/ingenico/connect/sdk/webhooks/webhooks_event.rb', line 14

def payout
  @payout
end

#refundIngenico::Connect::SDK::Domain::Payout::PayoutResponse

Returns the current value of refund.

Returns:



14
15
16
# File 'lib/ingenico/connect/sdk/webhooks/webhooks_event.rb', line 14

def refund
  @refund
end

#tokenIngenico::Connect::SDK::Domain::Token::TokenResponse

Returns the current value of token.

Returns:



14
15
16
# File 'lib/ingenico/connect/sdk/webhooks/webhooks_event.rb', line 14

def token
  @token
end

#typeString

Returns the current value of type.

Returns:

  • (String)

    the current value of type



14
15
16
# File 'lib/ingenico/connect/sdk/webhooks/webhooks_event.rb', line 14

def type
  @type
end

Instance Method Details

#from_hash(hash) ⇒ Object



44
45
46
47
48
49
50
51
52
53
54
55
56
# File 'lib/ingenico/connect/sdk/webhooks/webhooks_event.rb', line 44

def from_hash(hash)
  super
  @api_version = hash['apiVersion'] if hash.has_key? 'apiVersion'
  @id = hash['id'] if hash.has_key? 'id'
  @created = hash['created'] if hash.has_key? 'created'
  @merchant_id = hash['merchantId'] if hash.has_key? 'merchantId'
  @type = hash['type'] if hash.has_key? 'type'
  @payment = Ingenico::Connect::SDK::Domain::Payment::PaymentResponse.new_from_hash(hash['payment']) if hash.has_key? 'payment'
  @refund = Ingenico::Connect::SDK::Domain::Refund::RefundResponse.new_from_hash(hash['refund']) if hash.has_key? 'refund'
  @payout = Ingenico::Connect::SDK::Domain::Payout::PayoutResponse.new_from_hash(hash['payout']) if hash.has_key? 'payout'
  @token = Ingenico::Connect::SDK::Domain::Token::TokenResponse.new_from_hash(hash['token']) if hash.has_key? 'token'
  @dispute = Ingenico::Connect::SDK::Domain::Dispute::DisputeResponse.new_from_hash(hash['dispute']) if hash.has_key? 'dispute'
end

#to_hHash

Returns:

  • (Hash)


29
30
31
32
33
34
35
36
37
38
39
40
41
42
# File 'lib/ingenico/connect/sdk/webhooks/webhooks_event.rb', line 29

def to_h
  hash = super
  hash['apiVersion'] = @api_version unless @api_version.nil?
  hash['id'] = @id unless @id.nil?
  hash['created'] = @created unless @created.nil?
  hash['merchantId'] = @merchant_id unless @merchant_id.nil?
  hash['type'] = @type unless @type.nil?
  hash['payment'] = @payment.to_h unless @payment.nil?
  hash['refund'] = @refund.to_h unless @refund.nil?
  hash['payout'] = @payout.to_h unless @payout.nil?
  hash['token'] = @token.to_h unless @token.nil?
  hash['dispute'] = @dispute.to_h unless @dispute.nil?
  hash
end