Module: GenesisRuby::Api::Mixins::Requests::Financial::Mobile::GooglePayTokenAttributes

Included in:
Requests::Financial::Mobile::GooglePay
Defined in:
lib/genesis_ruby/api/mixins/requests/financial/mobile/google_pay_token_attributes.rb

Overview

Google Pay Token Attributes

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#token_protocol_versionObject

Returns the value of attribute token_protocol_version.



14
15
16
# File 'lib/genesis_ruby/api/mixins/requests/financial/mobile/google_pay_token_attributes.rb', line 14

def token_protocol_version
  @token_protocol_version
end

#token_signatureObject

Returns the value of attribute token_signature.



14
15
16
# File 'lib/genesis_ruby/api/mixins/requests/financial/mobile/google_pay_token_attributes.rb', line 14

def token_signature
  @token_signature
end

#token_signed_keyObject

Returns the value of attribute token_signed_key.



14
15
16
# File 'lib/genesis_ruby/api/mixins/requests/financial/mobile/google_pay_token_attributes.rb', line 14

def token_signed_key
  @token_signed_key
end

#token_signed_messageObject

Returns the value of attribute token_signed_message.



14
15
16
# File 'lib/genesis_ruby/api/mixins/requests/financial/mobile/google_pay_token_attributes.rb', line 14

def token_signed_message
  @token_signed_message
end

Instance Method Details

#google_pay_token_structureObject

rubocop:disable Metrics/MethodLength



30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# File 'lib/genesis_ruby/api/mixins/requests/financial/mobile/google_pay_token_attributes.rb', line 30

def google_pay_token_structure # rubocop:disable Metrics/MethodLength
  structure = {
    signature:              token_signature,
    protocolVersion:        token_protocol_version,
    signedMessage:          token_signed_message,
    intermediateSigningKey: {
      signedKey:  token_signed_key,
      signatures: token_signatures
    }
  }

  GenesisRuby::Utils::Common.deep_compact!(structure)

  structure.to_json
end

#token_signaturesObject

Google Pay Token Signatures accessor



17
18
19
# File 'lib/genesis_ruby/api/mixins/requests/financial/mobile/google_pay_token_attributes.rb', line 17

def token_signatures
  @token_signatures ||= []
end

#token_signatures=(value) ⇒ Object

Google Pay Token Signatures accessor



22
23
24
25
26
27
28
# File 'lib/genesis_ruby/api/mixins/requests/financial/mobile/google_pay_token_attributes.rb', line 22

def token_signatures=(value)
  if !value.is_a?(Array) && !value.nil?
    raise InvalidArgumentError, 'Invalid value given for Token Signatures. Accept array'
  end

  @token_signatures = value
end