Class: Io::Flow::V0::Models::PaymentMethodDataAuthorizePaypal

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

Instance Attribute Summary collapse

Attributes inherited from PaymentMethodData

#type

Instance Method Summary collapse

Methods inherited from PaymentMethodData

from_json, #to_hash

Constructor Details

#initialize(incoming = {}) ⇒ PaymentMethodDataAuthorizePaypal

Returns a new instance of PaymentMethodDataAuthorizePaypal.



57339
57340
57341
57342
57343
57344
57345
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 57339

def initialize(incoming={})
  super(:type => PaymentMethodData::Types::PAYMENT_METHOD_DATA_AUTHORIZE_PAYPAL)
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:payment_id, :payer_id], 'PaymentMethodDataAuthorizePaypal')
  @payment_id = HttpClient::Preconditions.assert_class('payment_id', opts.delete(:payment_id), String)
  @payer_id = HttpClient::Preconditions.assert_class('payer_id', opts.delete(:payer_id), String)
end

Instance Attribute Details

#payer_idObject (readonly)

Returns the value of attribute payer_id.



57337
57338
57339
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 57337

def payer_id
  @payer_id
end

#payment_idObject (readonly)

Returns the value of attribute payment_id.



57337
57338
57339
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 57337

def payment_id
  @payment_id
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



57351
57352
57353
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 57351

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

#subtype_to_hashObject



57355
57356
57357
57358
57359
57360
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 57355

def subtype_to_hash
  {
    :payment_id => payment_id,
    :payer_id => payer_id
  }
end

#to_jsonObject



57347
57348
57349
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 57347

def to_json
  JSON.dump(to_hash)
end