Class: Io::Flow::V0::Models::AuthorizationPayload

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

Overview

Used to complete an inline authorization like Google Pay or Apple Pay.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(incoming = {}) ⇒ AuthorizationPayload

Returns a new instance of AuthorizationPayload.



31187
31188
31189
31190
31191
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 31187

def initialize(incoming={})
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:parameters], 'AuthorizationPayload')
  @parameters = (x = opts.delete(:parameters); x.is_a?(::Io::Flow::V0::Models::AuthorizationPayloadParameters) ? x : ::Io::Flow::V0::Models::AuthorizationPayloadParameters.from_json(x))
end

Instance Attribute Details

#parametersObject (readonly)

Returns the value of attribute parameters.



31185
31186
31187
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 31185

def parameters
  @parameters
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



31197
31198
31199
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 31197

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

#to_hashObject



31201
31202
31203
31204
31205
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 31201

def to_hash
  {
    :parameters => parameters.to_hash
  }
end

#to_jsonObject



31193
31194
31195
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 31193

def to_json
  JSON.dump(to_hash)
end