Class: Io::Flow::V0::Models::CardAuthorizationUpsertedV2
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Overview
Represents an authorization for a card payment method
Instance Attribute Summary collapse
-
#authorization ⇒ Object
readonly
Returns the value of attribute authorization.
-
#event_id ⇒ Object
readonly
Returns the value of attribute event_id.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#organization ⇒ Object
readonly
Returns the value of attribute organization.
-
#timestamp ⇒ Object
readonly
Returns the value of attribute timestamp.
Attributes inherited from Event
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ CardAuthorizationUpsertedV2
constructor
A new instance of CardAuthorizationUpsertedV2.
- #subtype_to_hash ⇒ Object
- #to_json ⇒ Object
Methods inherited from Event
Constructor Details
#initialize(incoming = {}) ⇒ CardAuthorizationUpsertedV2
Returns a new instance of CardAuthorizationUpsertedV2.
13749 13750 13751 13752 13753 13754 13755 13756 13757 13758 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13749 def initialize(incoming={}) super(:discriminator => Event::Types::CARD_AUTHORIZATION_UPSERTED_V2) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:event_id, :timestamp, :organization, :id, :authorization], 'CardAuthorizationUpsertedV2') @event_id = HttpClient::Preconditions.assert_class('event_id', opts.delete(:event_id), String) = HttpClient::Preconditions.assert_class('timestamp', HttpClient::Helper.to_date_time_iso8601(opts.delete(:timestamp)), DateTime) @organization = HttpClient::Preconditions.assert_class('organization', opts.delete(:organization), String) @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String) = (x = opts.delete(:authorization); x.is_a?(::Io::Flow::V0::Models::CardAuthorization) ? x : ::Io::Flow::V0::Models::CardAuthorization.new(x)) end |
Instance Attribute Details
#authorization ⇒ Object (readonly)
Returns the value of attribute authorization.
13747 13748 13749 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13747 def end |
#event_id ⇒ Object (readonly)
Returns the value of attribute event_id.
13747 13748 13749 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13747 def event_id @event_id end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
13747 13748 13749 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13747 def id @id end |
#organization ⇒ Object (readonly)
Returns the value of attribute organization.
13747 13748 13749 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13747 def organization @organization end |
#timestamp ⇒ Object (readonly)
Returns the value of attribute timestamp.
13747 13748 13749 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13747 def end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
13764 13765 13766 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13764 def copy(incoming={}) CardAuthorizationUpsertedV2.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#subtype_to_hash ⇒ Object
13768 13769 13770 13771 13772 13773 13774 13775 13776 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13768 def subtype_to_hash { :event_id => event_id, :timestamp => , :organization => organization, :id => id, :authorization => .to_hash } end |
#to_json ⇒ Object
13760 13761 13762 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13760 def to_json JSON.dump(to_hash) end |