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:, card:, authentication_method:, message_id: SKIP, message_expiration: SKIP, cryptogram: SKIP, eci_indicator: SKIP) ⇒ GooglePayDecryptedTokenData

Returns a new instance of GooglePayDecryptedTokenData.



76
77
78
79
80
81
82
83
84
85
86
# File 'lib/paypal_server_sdk/models/google_pay_decrypted_token_data.rb', line 76

def initialize(payment_method:, card:, 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
  @card = card
  @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.



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

def authentication_method
  @authentication_method
end

#cardGooglePayCard

The payment card used to fund a Google Pay payment. Can be a credit or debit card.

Returns:



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

def card
  @card
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)


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

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)


46
47
48
# File 'lib/paypal_server_sdk/models/google_pay_decrypted_token_data.rb', line 46

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.



89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
# File 'lib/paypal_server_sdk/models/google_pay_decrypted_token_data.rb', line 89

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  payment_method =
    hash.key?('payment_method') ? hash['payment_method'] : nil
  card = GooglePayCard.from_hash(hash['card']) if hash['card']
  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,
                                  card: card,
                                  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.



49
50
51
52
53
54
55
56
57
58
59
# File 'lib/paypal_server_sdk/models/google_pay_decrypted_token_data.rb', line 49

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

.nullablesObject

An array for nullable fields



72
73
74
# File 'lib/paypal_server_sdk/models/google_pay_decrypted_token_data.rb', line 72

def self.nullables
  []
end

.optionalsObject

An array for optional fields



62
63
64
65
66
67
68
69
# File 'lib/paypal_server_sdk/models/google_pay_decrypted_token_data.rb', line 62

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