Class: PaypalServerSdk::GooglePayDecryptedTokenData

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/paypal_server_sdk/models/google_pay_decrypted_token_data.rb

Overview

Details shared by Google for the merchant to be shared with PayPal. This is required to process the transaction using the Google Pay payment method.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#to_hash, #to_json

Constructor Details

#initialize(payment_method:, authentication_method:, message_id: SKIP, message_expiration: SKIP, cryptogram: SKIP, eci_indicator: SKIP) ⇒ GooglePayDecryptedTokenData

Returns a new instance of GooglePayDecryptedTokenData.



70
71
72
73
74
75
76
77
78
79
# File 'lib/paypal_server_sdk/models/google_pay_decrypted_token_data.rb', line 70

def initialize(payment_method:, authentication_method:, message_id: SKIP,
               message_expiration: SKIP, cryptogram: SKIP,
               eci_indicator: SKIP)
  @message_id = message_id unless message_id == SKIP
  @message_expiration = message_expiration unless message_expiration == SKIP
  @payment_method = payment_method
  @authentication_method = authentication_method
  @cryptogram = cryptogram unless cryptogram == SKIP
  @eci_indicator = eci_indicator unless eci_indicator == SKIP
end

Instance Attribute Details

#authentication_methodGooglePayAuthenticationMethod

Authentication Method which is used for the card transaction.



29
30
31
# File 'lib/paypal_server_sdk/models/google_pay_decrypted_token_data.rb', line 29

def authentication_method
  @authentication_method
end

#cryptogramString

Base-64 cryptographic identifier used by card schemes to validate the token verification result. This is a conditionally required field if authentication_method is CRYPTOGRAM_3DS.

Returns:

  • (String)


35
36
37
# File 'lib/paypal_server_sdk/models/google_pay_decrypted_token_data.rb', line 35

def cryptogram
  @cryptogram
end

#eci_indicatorString

Electronic Commerce Indicator may not always be present. It is only returned for tokens on the Visa card network. This value is passed through in the payment authorization request.

Returns:

  • (String)


41
42
43
# File 'lib/paypal_server_sdk/models/google_pay_decrypted_token_data.rb', line 41

def eci_indicator
  @eci_indicator
end

#message_expirationString

Date and time at which the message expires as UTC milliseconds since epoch. Integrators should reject any message that’s expired.

Returns:

  • (String)


21
22
23
# File 'lib/paypal_server_sdk/models/google_pay_decrypted_token_data.rb', line 21

def message_expiration
  @message_expiration
end

#message_idString

A unique ID that identifies the message in case it needs to be revoked or located at a later time.

Returns:

  • (String)


16
17
18
# File 'lib/paypal_server_sdk/models/google_pay_decrypted_token_data.rb', line 16

def message_id
  @message_id
end

#payment_methodGooglePayPaymentMethod

The type of the payment credential. Currently, only CARD is supported.



25
26
27
# File 'lib/paypal_server_sdk/models/google_pay_decrypted_token_data.rb', line 25

def payment_method
  @payment_method
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
# File 'lib/paypal_server_sdk/models/google_pay_decrypted_token_data.rb', line 82

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  payment_method =
    hash.key?('payment_method') ? hash['payment_method'] : nil
  authentication_method =
    hash.key?('authentication_method') ? hash['authentication_method'] : nil
  message_id = hash.key?('message_id') ? hash['message_id'] : SKIP
  message_expiration =
    hash.key?('message_expiration') ? hash['message_expiration'] : SKIP
  cryptogram = hash.key?('cryptogram') ? hash['cryptogram'] : SKIP
  eci_indicator = hash.key?('eci_indicator') ? hash['eci_indicator'] : SKIP

  # Create object from extracted values.
  GooglePayDecryptedTokenData.new(payment_method: payment_method,
                                  authentication_method: authentication_method,
                                  message_id: message_id,
                                  message_expiration: message_expiration,
                                  cryptogram: cryptogram,
                                  eci_indicator: eci_indicator)
end

.namesObject

A mapping from model property names to API property names.



44
45
46
47
48
49
50
51
52
53
# File 'lib/paypal_server_sdk/models/google_pay_decrypted_token_data.rb', line 44

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['message_id'] = 'message_id'
  @_hash['message_expiration'] = 'message_expiration'
  @_hash['payment_method'] = 'payment_method'
  @_hash['authentication_method'] = 'authentication_method'
  @_hash['cryptogram'] = 'cryptogram'
  @_hash['eci_indicator'] = 'eci_indicator'
  @_hash
end

.nullablesObject

An array for nullable fields



66
67
68
# File 'lib/paypal_server_sdk/models/google_pay_decrypted_token_data.rb', line 66

def self.nullables
  []
end

.optionalsObject

An array for optional fields



56
57
58
59
60
61
62
63
# File 'lib/paypal_server_sdk/models/google_pay_decrypted_token_data.rb', line 56

def self.optionals
  %w[
    message_id
    message_expiration
    cryptogram
    eci_indicator
  ]
end