class Io::Flow::V0::Models::PaypalAuthorizationForm

Executes the PayPal payment

Attributes

attributes[R]
ip[R]
key[R]
paypal_payer_id[R]
paypal_payment_id[R]

Public Class Methods

new(incoming={}) click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 59395
def initialize(incoming={})
  super(:discriminator => AuthorizationForm::Types::PAYPAL_AUTHORIZATION_FORM)
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:paypal_payment_id, :paypal_payer_id], 'PaypalAuthorizationForm')
  @paypal_payment_id = HttpClient::Preconditions.assert_class('paypal_payment_id', opts.delete(:paypal_payment_id), String)
  @paypal_payer_id = HttpClient::Preconditions.assert_class('paypal_payer_id', opts.delete(:paypal_payer_id), String)
  @key = (x = opts.delete(:key); x.nil? ? nil : HttpClient::Preconditions.assert_class('key', x, String))
  @attributes = (x = opts.delete(:attributes); x.nil? ? nil : HttpClient::Preconditions.assert_class('attributes', x, Hash).inject({}) { |h, d| h[d[0]] = HttpClient::Preconditions.assert_class('attributes', d[1], String); h })
  @ip = (x = opts.delete(:ip); x.nil? ? nil : HttpClient::Preconditions.assert_class('ip', x, String))
end

Public Instance Methods

copy(incoming={}) click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 59410
def copy(incoming={})
  PaypalAuthorizationForm.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
end
subtype_to_hash() click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 59414
def subtype_to_hash
  {
    :paypal_payment_id => paypal_payment_id,
    :paypal_payer_id => paypal_payer_id,
    :key => key,
    :attributes => attributes.nil? ? nil : attributes,
    :ip => ip
  }
end
to_json() click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 59406
def to_json
  JSON.dump(to_hash)
end