Class: Io::Flow::V0::Models::PaymentPaypalData

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

Overview

Represents on line payment

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(incoming = {}) ⇒ PaymentPaypalData

Returns a new instance of PaymentPaypalData.



23475
23476
23477
23478
23479
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 23475

def initialize(incoming={})
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:payment_id], 'PaymentPaypalData')
  @payment_id = HttpClient::Preconditions.assert_class('payment_id', opts.delete(:payment_id), String)
end

Instance Attribute Details

#payment_idObject (readonly)

Returns the value of attribute payment_id.



23473
23474
23475
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 23473

def payment_id
  @payment_id
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



23485
23486
23487
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 23485

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

#to_hashObject



23489
23490
23491
23492
23493
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 23489

def to_hash
  {
    :payment_id => payment_id
  }
end

#to_jsonObject



23481
23482
23483
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 23481

def to_json
  JSON.dump(to_hash)
end