Class: OnlinePayments::SDK::Webhooks::WebhooksEvent

Inherits:
DataObject
  • Object
show all
Defined in:
lib/onlinepayments/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/onlinepayments/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/onlinepayments/sdk/webhooks/webhooks_event.rb', line 14

def created
  @created
end

#disputeOnlinePayments::SDK::Domain::DisputeResponse

Returns the current value of dispute.

Returns:

  • (OnlinePayments::SDK::Domain::DisputeResponse)

    the current value of dispute



14
15
16
# File 'lib/onlinepayments/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/onlinepayments/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/onlinepayments/sdk/webhooks/webhooks_event.rb', line 14

def merchant_id
  @merchant_id
end

#paymentOnlinePayments::SDK::Domain::PaymentResponse

Returns the current value of payment.

Returns:



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

def payment
  @payment
end

#payoutOnlinePayments::SDK::Domain::RefundResponse

Returns the current value of payout.

Returns:



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

def payout
  @payout
end

#refundOnlinePayments::SDK::Domain::PayoutResponse

Returns the current value of refund.

Returns:



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

def refund
  @refund
end

#tokenOnlinePayments::SDK::Domain::TokenResponse

Returns the current value of token.

Returns:



14
15
16
# File 'lib/onlinepayments/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/onlinepayments/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
# File 'lib/onlinepayments/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 = OnlinePayments::SDK::Domain::PaymentResponse.new_from_hash(hash['payment']) if hash.key? 'payment'
  @refund = OnlinePayments::SDK::Domain::RefundResponse.new_from_hash(hash['refund']) if hash.key? 'refund'
  @payout = OnlinePayments::SDK::Domain::PayoutResponse.new_from_hash(hash['payout']) if hash.key? 'payout'
  @token = OnlinePayments::SDK::Domain::TokenResponse.new_from_hash(hash['token']) if hash.key? 'token'
end

#to_hHash

Returns:

  • (Hash)


29
30
31
32
33
34
35
36
37
38
39
40
41
42
# File 'lib/onlinepayments/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