Class: Io::Flow::V0::Models::PaymentRefundStatus

Inherits:
Object
  • Object
show all
Defined in:
lib/flow_commerce/flow_api_v0_client.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(incoming = {}) ⇒ PaymentRefundStatus

Returns a new instance of PaymentRefundStatus.



51809
51810
51811
51812
51813
51814
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 51809

def initialize(incoming={})
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:status], 'PaymentRefundStatus')
  @status = (x = opts.delete(:status); x.is_a?(::Io::Flow::V0::Models::RefundStatus) ? x : ::Io::Flow::V0::Models::RefundStatus.apply(x))
  @reason = (x = opts.delete(:reason); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::RefundDeclineCode) ? x : ::Io::Flow::V0::Models::RefundDeclineCode.apply(x)))
end

Instance Attribute Details

#reasonObject (readonly)

Returns the value of attribute reason.



51807
51808
51809
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 51807

def reason
  @reason
end

#statusObject (readonly)

Returns the value of attribute status.



51807
51808
51809
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 51807

def status
  @status
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



51820
51821
51822
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 51820

def copy(incoming={})
  PaymentRefundStatus.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
end

#to_hashObject



51824
51825
51826
51827
51828
51829
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 51824

def to_hash
  {
    :status => status.value,
    :reason => reason.nil? ? nil : reason.value
  }
end

#to_jsonObject



51816
51817
51818
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 51816

def to_json
  JSON.dump(to_hash)
end