Class: Io::Flow::V0::Models::PaymentCaptureStatus

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 = {}) ⇒ PaymentCaptureStatus

Returns a new instance of PaymentCaptureStatus.



56582
56583
56584
56585
56586
56587
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 56582

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

Instance Attribute Details

#reasonObject (readonly)

Returns the value of attribute reason.



56580
56581
56582
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 56580

def reason
  @reason
end

#statusObject (readonly)

Returns the value of attribute status.



56580
56581
56582
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 56580

def status
  @status
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



56593
56594
56595
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 56593

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

#to_hashObject



56597
56598
56599
56600
56601
56602
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 56597

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

#to_jsonObject



56589
56590
56591
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 56589

def to_json
  JSON.dump(to_hash)
end