class Ingenico::Direct::SDK::Webhooks::WebhooksEvent

@attr [String] api_version @attr [String] id @attr [String] created @attr [String] merchant_id @attr [String] type @attr [Ingenico::Direct::SDK::Domain::PaymentResponse] payment @attr [Ingenico::Direct::SDK::Domain::PayoutResponse] refund @attr [Ingenico::Direct::SDK::Domain::RefundResponse] payout @attr [Ingenico::Direct::SDK::Domain::TokenResponse] token @attr [Ingenico::Direct::SDK::Domain::DisputeResponse] dispute

Attributes

api_version[RW]
created[RW]
dispute[RW]
id[RW]
merchant_id[RW]
payment[RW]
payout[RW]
refund[RW]
token[RW]
type[RW]

Public Instance Methods

from_hash(hash) click to toggle source
# File lib/ingenico/direct/sdk/webhooks/webhooks_event.rb, line 44
def from_hash(hash)
  super
  @api_version = hash['apiVersion'] if hash.key? 'apiVersion'
  @id = hash['id'] if hash.key? 'id'
  @created = hash['created'] if hash.key? 'created'
  @merchant_id = hash['merchantId'] if hash.key? 'merchantId'
  @type = hash['type'] if hash.key? 'type'
  @payment = Ingenico::Direct::SDK::Domain::PaymentResponse.new_from_hash(hash['payment']) if hash.key? 'payment'
  @refund = Ingenico::Direct::SDK::Domain::RefundResponse.new_from_hash(hash['refund']) if hash.key? 'refund'
  @payout = Ingenico::Direct::SDK::Domain::PayoutResponse.new_from_hash(hash['payout']) if hash.key? 'payout'
  @token = Ingenico::Direct::SDK::Domain::TokenResponse.new_from_hash(hash['token']) if hash.key? 'token'
end
to_h() click to toggle source

@return [Hash]

Calls superclass method Ingenico::Direct::SDK::DataObject#to_h
# File lib/ingenico/direct/sdk/webhooks/webhooks_event.rb, line 29
def to_h
  hash = super
  hash['apiVersion'] = @api_version if @api_version
  hash['id'] = @id if @id
  hash['created'] = @created if @created
  hash['merchantId'] = @merchant_id if @merchant_id
  hash['type'] = @type if @type
  hash['payment'] = @payment.to_h if @payment
  hash['refund'] = @refund.to_h if @refund
  hash['payout'] = @payout.to_h if @payout
  hash['token'] = @token.to_h if @token
  hash['dispute'] = @dispute.to_h if @dispute
  hash
end