Class: Io::Flow::V0::Models::PaypalAuthorizationForm
- Inherits:
-
AuthorizationForm
- Object
- AuthorizationForm
- Io::Flow::V0::Models::PaypalAuthorizationForm
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Overview
Executes the PayPal payment
Instance Attribute Summary collapse
-
#attributes ⇒ Object
readonly
Returns the value of attribute attributes.
-
#ip ⇒ Object
readonly
Returns the value of attribute ip.
-
#key ⇒ Object
readonly
Returns the value of attribute key.
-
#paypal_payer_id ⇒ Object
readonly
Returns the value of attribute paypal_payer_id.
-
#paypal_payment_id ⇒ Object
readonly
Returns the value of attribute paypal_payment_id.
Attributes inherited from AuthorizationForm
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ PaypalAuthorizationForm
constructor
A new instance of PaypalAuthorizationForm.
- #subtype_to_hash ⇒ Object
- #to_json ⇒ Object
Methods inherited from AuthorizationForm
Constructor Details
#initialize(incoming = {}) ⇒ PaypalAuthorizationForm
Returns a new instance of PaypalAuthorizationForm.
54807 54808 54809 54810 54811 54812 54813 54814 54815 54816 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 54807 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 |
Instance Attribute Details
#attributes ⇒ Object (readonly)
Returns the value of attribute attributes.
54805 54806 54807 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 54805 def attributes @attributes end |
#ip ⇒ Object (readonly)
Returns the value of attribute ip.
54805 54806 54807 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 54805 def ip @ip end |
#key ⇒ Object (readonly)
Returns the value of attribute key.
54805 54806 54807 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 54805 def key @key end |
#paypal_payer_id ⇒ Object (readonly)
Returns the value of attribute paypal_payer_id.
54805 54806 54807 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 54805 def paypal_payer_id @paypal_payer_id end |
#paypal_payment_id ⇒ Object (readonly)
Returns the value of attribute paypal_payment_id.
54805 54806 54807 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 54805 def paypal_payment_id @paypal_payment_id end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
54822 54823 54824 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 54822 def copy(incoming={}) PaypalAuthorizationForm.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#subtype_to_hash ⇒ Object
54826 54827 54828 54829 54830 54831 54832 54833 54834 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 54826 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 ⇒ Object
54818 54819 54820 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 54818 def to_json JSON.dump(to_hash) end |