Class: PaypalServerSdk::GooglePayAuthenticationMethod

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

Overview

Authentication Method which is used for the card transaction.

Constant Summary collapse

GOOGLE_PAY_AUTHENTICATION_METHOD =
[
  # This authentication method is associated with payment cards stored on

  # file with the user's Google Account. Returned payment data includes

  # primary account number (PAN) with the expiration month and the

  # expiration year.

  PAN_ONLY = 'PAN_ONLY'.freeze,

  # Returned payment data includes a 3-D Secure (3DS) cryptogram generated

  # on the device. -> If authentication_method=CRYPTOGRAM, it is required

  # that 'cryptogram' parameter in the request has a valid 3-D Secure (3DS)

  # cryptogram generated on the device.

  CRYPTOGRAM_3DS = 'CRYPTOGRAM_3DS'.freeze
].freeze

Class Method Summary collapse

Class Method Details

.from_value(value, default_value = PAN_ONLY) ⇒ Object



29
30
31
32
33
34
35
36
37
38
39
40
# File 'lib/paypal_server_sdk/models/google_pay_authentication_method.rb', line 29

def self.from_value(value, default_value = PAN_ONLY)
  return default_value if value.nil?

  str = value.to_s.strip

  case str.downcase
  when 'pan_only' then PAN_ONLY
  when 'cryptogram_3ds' then CRYPTOGRAM_3DS
  else
    default_value
  end
end

.validate(value) ⇒ Object



23
24
25
26
27
# File 'lib/paypal_server_sdk/models/google_pay_authentication_method.rb', line 23

def self.validate(value)
  return false if value.nil?

  true
end