Class: Io::Flow::V0::Models::PaymentAuthorizationStatus

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

Returns a new instance of PaymentAuthorizationStatus.



52197
52198
52199
52200
52201
52202
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 52197

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

Instance Attribute Details

#reasonObject (readonly)

Returns the value of attribute reason.



52195
52196
52197
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 52195

def reason
  @reason
end

#statusObject (readonly)

Returns the value of attribute status.



52195
52196
52197
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 52195

def status
  @status
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



52208
52209
52210
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 52208

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

#to_hashObject



52212
52213
52214
52215
52216
52217
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 52212

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

#to_jsonObject



52204
52205
52206
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 52204

def to_json
  JSON.dump(to_hash)
end