Class: Io::Flow::V0::Models::MerchantRejected

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

Overview

The merchant is rejected for onboarding by the compliance team

Instance Attribute Summary collapse

Attributes inherited from OnboardingState

#discriminator

Instance Method Summary collapse

Methods inherited from OnboardingState

from_json, #to_hash

Constructor Details

#initialize(incoming = {}) ⇒ MerchantRejected

Returns a new instance of MerchantRejected.



50402
50403
50404
50405
50406
50407
50408
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 50402

def initialize(incoming={})
  super(:discriminator => OnboardingState::Types::MERCHANT_REJECTED)
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:reason], 'MerchantRejected')
  @reason = (x = opts.delete(:reason); x.is_a?(::Io::Flow::V0::Models::MerchantRejectedReason) ? x : ::Io::Flow::V0::Models::MerchantRejectedReason.apply(x))
  @description = (x = opts.delete(:description); x.nil? ? nil : HttpClient::Preconditions.assert_class('description', x, String))
end

Instance Attribute Details

#descriptionObject (readonly)

Returns the value of attribute description.



50400
50401
50402
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 50400

def description
  @description
end

#reasonObject (readonly)

Returns the value of attribute reason.



50400
50401
50402
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 50400

def reason
  @reason
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



50414
50415
50416
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 50414

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

#subtype_to_hashObject



50418
50419
50420
50421
50422
50423
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 50418

def subtype_to_hash
  {
    :reason => reason.value,
    :description => description
  }
end

#to_jsonObject



50410
50411
50412
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 50410

def to_json
  JSON.dump(to_hash)
end