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.



30628
30629
30630
30631
30632
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30628

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.



30626
30627
30628
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30626

def payment_id
  @payment_id
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



30638
30639
30640
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30638

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

#to_hashObject



30642
30643
30644
30645
30646
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30642

def to_hash
  {
    :payment_id => payment_id
  }
end

#to_jsonObject



30634
30635
30636
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30634

def to_json
  JSON.dump(to_hash)
end