Class: Io::Flow::V0::Models::PaymentRequestBundleForm

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(incoming = {}) ⇒ PaymentRequestBundleForm

Returns a new instance of PaymentRequestBundleForm.



58745
58746
58747
58748
58749
58750
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 58745

def initialize(incoming={})
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:payment_request, :billing], 'PaymentRequestBundleForm')
  @payment_request = (x = opts.delete(:payment_request); x.is_a?(::Io::Flow::V0::Models::PaymentRequestForm) ? x : ::Io::Flow::V0::Models::PaymentRequestForm.new(x))
  @billing = (x = opts.delete(:billing); x.is_a?(::Io::Flow::V0::Models::PaymentRequestBilling) ? x : ::Io::Flow::V0::Models::PaymentRequestBilling.new(x))
end

Instance Attribute Details

#billingObject (readonly)

Returns the value of attribute billing.



58743
58744
58745
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 58743

def billing
  @billing
end

#payment_requestObject (readonly)

Returns the value of attribute payment_request.



58743
58744
58745
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 58743

def payment_request
  @payment_request
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



58756
58757
58758
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 58756

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

#to_hashObject



58760
58761
58762
58763
58764
58765
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 58760

def to_hash
  {
    :payment_request => payment_request.to_hash,
    :billing => billing.to_hash
  }
end

#to_jsonObject



58752
58753
58754
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 58752

def to_json
  JSON.dump(to_hash)
end