Class: OnlinePayments::SDK::Domain::Feedbacks

Inherits:
DataObject
  • Object
show all
Defined in:
lib/onlinepayments/sdk/domain/feedbacks.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from DataObject

new_from_hash

Instance Attribute Details

#webhook_urlObject

Deprecated.

The URL where the webhook will be dispatched for all status change events related to this payment.



11
12
13
# File 'lib/onlinepayments/sdk/domain/feedbacks.rb', line 11

def webhook_url
  @webhook_url
end

#webhooks_urlsArray<String>

Returns the current value of webhooks_urls.

Returns:

  • (Array<String>)

    the current value of webhooks_urls



11
12
13
# File 'lib/onlinepayments/sdk/domain/feedbacks.rb', line 11

def webhooks_urls
  @webhooks_urls
end

Instance Method Details

#from_hash(hash) ⇒ Object



26
27
28
29
30
31
32
33
34
35
36
37
38
# File 'lib/onlinepayments/sdk/domain/feedbacks.rb', line 26

def from_hash(hash)
  super
  if hash.has_key? 'webhookUrl'
    @webhook_url = hash['webhookUrl']
  end
  if hash.has_key? 'webhooksUrls'
    raise TypeError, "value '%s' is not an Array" % [hash['webhooksUrls']] unless hash['webhooksUrls'].is_a? Array
    @webhooks_urls = []
    hash['webhooksUrls'].each do |e|
      @webhooks_urls << e
    end
  end
end

#to_hHash

Returns:

  • (Hash)


19
20
21
22
23
24
# File 'lib/onlinepayments/sdk/domain/feedbacks.rb', line 19

def to_h
  hash = super
  hash['webhookUrl'] = @webhook_url unless @webhook_url.nil?
  hash['webhooksUrls'] = @webhooks_urls unless @webhooks_urls.nil?
  hash
end