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.



21053
21054
21055
21056
21057
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21053

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.



21051
21052
21053
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21051

def payment_id
  @payment_id
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



21063
21064
21065
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21063

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

#to_hashObject



21067
21068
21069
21070
21071
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21067

def to_hash
  {
    :payment_id => payment_id
  }
end

#to_jsonObject



21059
21060
21061
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21059

def to_json
  JSON.dump(to_hash)
end