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

Inherits:
Domain::DataObject show all
Defined in:
lib/onlinepayments/sdk/webhooks/webhooks_event.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Domain::DataObject

new_from_hash

Instance Attribute Details

#api_versionString

Returns the current value of api_version.

Returns:

  • (String)

    the current value of api_version



21
22
23
# File 'lib/onlinepayments/sdk/webhooks/webhooks_event.rb', line 21

def api_version
  @api_version
end

#createdString

Returns the current value of created.

Returns:

  • (String)

    the current value of created



21
22
23
# File 'lib/onlinepayments/sdk/webhooks/webhooks_event.rb', line 21

def created
  @created
end

#disputeObject

Returns the value of attribute dispute.



27
28
29
# File 'lib/onlinepayments/sdk/webhooks/webhooks_event.rb', line 27

def dispute
  @dispute
end

#idString

Returns the current value of id.

Returns:

  • (String)

    the current value of id



21
22
23
# File 'lib/onlinepayments/sdk/webhooks/webhooks_event.rb', line 21

def id
  @id
end

#merchant_idString

Returns the current value of merchant_id.

Returns:

  • (String)

    the current value of merchant_id



21
22
23
# File 'lib/onlinepayments/sdk/webhooks/webhooks_event.rb', line 21

def merchant_id
  @merchant_id
end

#paymentOnlinePayments::SDK::V2::Domain::PaymentResponse

Returns the current value of payment.

Returns:

  • (OnlinePayments::SDK::V2::Domain::PaymentResponse)

    the current value of payment



21
22
23
# File 'lib/onlinepayments/sdk/webhooks/webhooks_event.rb', line 21

def payment
  @payment
end

Returns the current value of payment_link.

Returns:

  • (OnlinePayments::SDK::V2::Domain::PaymentLinkResponse)

    the current value of payment_link



21
22
23
# File 'lib/onlinepayments/sdk/webhooks/webhooks_event.rb', line 21

def payment_link
  @payment_link
end

#payoutOnlinePayments::SDK::V2::Domain::PayoutResponse

Returns the current value of payout.

Returns:

  • (OnlinePayments::SDK::V2::Domain::PayoutResponse)

    the current value of payout



21
22
23
# File 'lib/onlinepayments/sdk/webhooks/webhooks_event.rb', line 21

def payout
  @payout
end

#refundOnlinePayments::SDK::V2::Domain::RefundResponse

Returns the current value of refund.

Returns:

  • (OnlinePayments::SDK::V2::Domain::RefundResponse)

    the current value of refund



21
22
23
# File 'lib/onlinepayments/sdk/webhooks/webhooks_event.rb', line 21

def refund
  @refund
end

#tokenOnlinePayments::SDK::V2::Domain::TokenResponse

Returns the current value of token.

Returns:

  • (OnlinePayments::SDK::V2::Domain::TokenResponse)

    the current value of token



21
22
23
# File 'lib/onlinepayments/sdk/webhooks/webhooks_event.rb', line 21

def token
  @token
end

#typeString

Returns the current value of type.

Returns:

  • (String)

    the current value of type



21
22
23
# File 'lib/onlinepayments/sdk/webhooks/webhooks_event.rb', line 21

def type
  @type
end

Instance Method Details

#from_hash(hash) ⇒ Object



61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
# File 'lib/onlinepayments/sdk/webhooks/webhooks_event.rb', line 61

def from_hash(hash)
  super
  if hash.has_key? 'apiVersion'
    @api_version = hash['apiVersion']
  end
  if hash.has_key? 'created'
    @created = hash['created']
  end
  if hash.has_key? 'id'
    @id = hash['id']
  end
  if hash.has_key? 'merchantId'
    @merchant_id = hash['merchantId']
  end
  if hash.has_key? 'type'
    @type = hash['type']
  end
  if hash.has_key? 'paymentLink'
    @payment_link = OnlinePayments::SDK::Domain::PaymentLinkResponse.new_from_hash(hash['paymentLink'])
  end
  if hash.has_key? 'payment'
    @payment = OnlinePayments::SDK::Domain::PaymentResponse.new_from_hash(hash['payment'])
  end
  if hash.has_key? 'payout'
    @payout = OnlinePayments::SDK::Domain::PayoutResponse.new_from_hash(hash['payout'])
  end
  if hash.has_key? 'refund'
    @refund = OnlinePayments::SDK::Domain::RefundResponse.new_from_hash(hash['refund'])
  end
  if hash.has_key? 'token'
    @token = OnlinePayments::SDK::Domain::TokenResponse.new_from_hash(hash['token'])
  end
end

#to_hHash

Returns:

  • (Hash)


46
47
48
49
50
51
52
53
54
55
56
57
58
59
# File 'lib/onlinepayments/sdk/webhooks/webhooks_event.rb', line 46

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