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

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

Overview

Apple Pay Token Attributes mixin

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#token_application_dataObject

Returns the value of attribute token_application_data.



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

def token_application_data
  @token_application_data
end

#token_dataObject

Returns the value of attribute token_data.



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

def token_data
  @token_data
end

#token_display_nameObject

Returns the value of attribute token_display_name.



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

def token_display_name
  @token_display_name
end

#token_ephemeral_public_keyObject

Returns the value of attribute token_ephemeral_public_key.



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

def token_ephemeral_public_key
  @token_ephemeral_public_key
end

#token_networkObject

Returns the value of attribute token_network.



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

def token_network
  @token_network
end

#token_public_key_hashObject

Returns the value of attribute token_public_key_hash.



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

def token_public_key_hash
  @token_public_key_hash
end

#token_signatureObject

Returns the value of attribute token_signature.



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

def token_signature
  @token_signature
end

#token_transaction_idObject

Returns the value of attribute token_transaction_id.



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

def token_transaction_id
  @token_transaction_id
end

#token_transaction_identifierObject

Returns the value of attribute token_transaction_identifier.



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

def token_transaction_identifier
  @token_transaction_identifier
end

#token_typeObject

Returns the value of attribute token_type.



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

def token_type
  @token_type
end

#token_versionObject

Returns the value of attribute token_version.



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

def token_version
  @token_version
end

#token_wrapped_keyObject

Returns the value of attribute token_wrapped_key.



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

def token_wrapped_key
  @token_wrapped_key
end

Instance Method Details

#payment_token_structureObject

Apple Pay token structure



20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# File 'lib/genesis_ruby/api/mixins/requests/financial/mobile/apple_pay_token_attributes.rb', line 20

def payment_token_structure # rubocop:disable Metrics/MethodLength
  structure = {
    paymentData:           {
      version:   token_version,
      data:      token_data,
      signature: token_signature,
      header:    {
        applicationData:    token_application_data,
        ephemeralPublicKey: token_ephemeral_public_key,
        wrappedKey:         token_wrapped_key,
        publicKeyHash:      token_public_key_hash,
        transactionId:      token_transaction_id
      }
    },
    paymentMethod:         {
      displayName: token_display_name,
      network:     token_network,
      type:        token_type
    },
    transactionIdentifier: token_transaction_identifier
  }

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

  structure.to_json
end